362 {
363
364 Double_t field = -f_Magnetic;
365 Double_t
kvC = 3.0e8;
367 Double_t pt = recTrack->
pxy();
368 Double_t pz = recTrack->
pz();
369 Double_t
pi = TMath::Pi();
370
371
372 Double_t orgx = recTrack->
x()*10;
373 Double_t orgy = recTrack->
y()*10;
374 Double_t orgz = recTrack->
z()*10;
375
378
379 Double_t radius,zStep;
381 radius = 1e9 ;
382 zStep = 1e9;
383 }
384 else {
385 radius = (pt * 1.0e9 /
kvC * 1e3) / fabs(
charge * field) ;
386 zStep = 2*
pi*radius * fabs(pz/pt);
387 }
388 Double_t curvature = 1.0/radius;
389 Double_t step = 10.0;
390 Double_t delt = step*(1.0e-3)/
kvC;
391
392 mdcTrack->
AddPoint(orgx, orgy, orgz, 0.0);
393 const Double_t *p;
394 Int_t nStep = 0;
395
399 z = orgz;
400
402 do {
403 x = recTrack->
helix(0)* 10 *
405 - nStep * step *
sin(recTrack->
helix(1));
406 y = recTrack->
helix(0)* 10 *
408 + nStep * step *
cos(recTrack->
helix(1));
409 z = recTrack->
helix(3)* 10 +
410 nStep * step * recTrack->
helix(4);
411
417 mdcTrack->PaintMarker(
mp);
418 mdcTrack->SetMarkerColor(kBlack);
419 mdcTrack->SetMarkerSize(10);
420 mdcTrack->SetLineColor(kBlack);
421
422 nStep++;
423 }
424 while ( (x*x +
y*
y) < mdcR*mdcR && fabs(z) < mdcZ );
425
426 nStep = 0;
427 do {
428 x = recTrack->
helix(0)* 10 *
430 - nStep * step *
sin(recTrack->
helix(1));
431 y = recTrack->
helix(0)* 10 *
433 + nStep * step *
cos(recTrack->
helix(1));
434 z = recTrack->
helix(3)* 10 +
435 nStep * step * recTrack->
helix(4);
436
442 mdcTrack->PaintMarker(
mp);
443 mdcTrack->SetMarkerColor(kBlack);
444 mdcTrack->SetMarkerSize(10);
445 mdcTrack->SetLineColor(kRed);
446
447 }
448 while ( (x*x +
y*
y) < mdcR*mdcR && fabs(z) < mdcZ );
449 }
450 else{
451 TGeoHelix helix(curvature, zStep,
charge);
452 helix.InitPoint(orgx, orgy, orgz);
453
454 helix.InitDirection(recTrack->
px(), recTrack->
py(), recTrack->
pz(), kFALSE);
455
456 helix.SetField(0.0, 0.0, field, kFALSE);
457
458 do {
459
460 helix.Step(step);
461 p = helix.GetCurrentPoint();
462
463 mdcTrack->
AddPoint(p[0], p[1], p[2], delt*nStep);
468 mdcTrack->PaintMarker(
mp);
469 mdcTrack->SetMarkerColor(kBlack);
470 mdcTrack->SetMarkerSize(10);
471 nStep++;
472 }
473 while ( (p[0]*p[0] + p[1]*p[1]) < mdcR*mdcR && fabs(p[2]) < mdcZ );
474
475 }
476
477
478 vector<UInt_t> vecHits(0);
479 const TObjArray *recMdcHitCol = fRecEvent->getRecMdcHitCol();
480 for (Int_t i = 0; i < recMdcHitCol->GetEntriesFast(); i++){
482 Int_t recHitId = recMdcHit->
getTrkId();
483 Int_t recTrkId = recTrack->
trackId();
484 if (recHitId == recTrkId) vecHits.push_back(recMdcHit->
getMdcId());
485 }
486 for (Int_t i = 0; i < (Int_t)vecHits.size(); i++) {
490
493
496 }
497
499
500
501 char data[200];
502 TString info;
503
504 info = TString("MdcTrack ");
507
509 mdcTrack->
AddInfo( TString(data) );
510
511 sprintf(data,
"P=%-.3f GeV, Pt=%-.3f GeV", recTrack->
p(), recTrack->
pxy());
512 mdcTrack->
AddInfo( TString(data) );
513
514
515
516
517 sprintf(data,
"Pxyz=(%-.3f,%-.3f,%-.3f) GeV", recTrack->
px(),recTrack->
py(),recTrack->
pz());
518 mdcTrack->
AddInfo( TString(data) );
519
520 sprintf(data,
"helix(%-.3f,%-.3f,%-.3f,%-.3f,%-.3f)", recTrack->
helix(0),recTrack->
helix(1),recTrack->
helix(2),recTrack->
helix(3), recTrack->
helix(4));
521 mdcTrack->
AddInfo( TString(data) );
522
523 sprintf(data,
"Origin (%-.3f, %-.3f, %-.3f) cm", orgx/10, orgy/10, orgz/10);
524 mdcTrack->
AddInfo( TString(data) );
525
526 sprintf(data,
"#phi=%-.3f #theta=%-.3f cos#theta=%-.3f", recTrack->
phi(),recTrack->
theta(),
cos(recTrack->
theta()));
527 mdcTrack->
AddInfo( TString(data) );
528
529
530 sprintf(data,
"nHit=%i, #chi^{2}= %-.3f",recTrack->
ndof()+5, recTrack->
chi2());
531 mdcTrack->
AddInfo( TString(data) );
532
533
534
535
536
537
538
539
540
541
543}
double sin(const BesAngle a)
double cos(const BesAngle a)
virtual void AddPoint(Double_t x, Double_t y, Double_t z, Double_t t)
virtual void SetCharge(Int_t charge)
MdcROOTGeo * GetMdcROOTGeo()
static int layer(const Identifier &id)
Values of different levels (failure returns 0)
static int wire(const Identifier &id)
Mdc2DWire * Get2DWire(Int_t layer, Int_t replica)
Get Mdc2DWire;.
TGeoPhysicalNode * GetPhysicalReplica(int layer, int replica)
Get replica physical node;.
TGeoVolume * GetVolumeMdc()
Get Mdc volume;.
const UInt_t getMdcId() const
const Int_t getTrkId(void) const
const Double_t phi() const
const Double_t pz() const
const Double_t px() const
const Double_t chi2() const
const Int_t trackId() const
const Double_t pxy() const
const Double_t theta() const
const Int_t charge() const
const Double_t py() const
const Double_t helix(Int_t i) const