346 {
347
348 Double_t field = -f_Magnetic;
349 Double_t
kvC = 3.0e8;
350 Int_t charge = recTrack->
charge();
351 Double_t pt = recTrack->
pxy();
352 Double_t pz = recTrack->
pz();
353 Double_t
pi = TMath::Pi();
354
355
356 Double_t orgx = recTrack->
x()*10;
357 Double_t orgy = recTrack->
y()*10;
358 Double_t orgz = recTrack->
z()*10;
359
360
363
364 Double_t radius,zStep;
365 if (charge == 0) {
366 radius = 1e9 ;
367 zStep = 1e9;
368 }
369 else {
370 radius = (pt * 1.0e9 /
kvC * 1e3) / fabs(charge * field) ;
371 zStep = 2*
pi*radius * fabs(pz/pt);
372 }
373 Double_t curvature = 1.0/radius;
374 Double_t step = 10.0;
375 Double_t delt = step*(1.0e-3)/
kvC;
376
377 mdcTrack->
AddPoint(orgx, orgy, orgz, 0.0);
378 const Double_t *p;
379 Int_t nStep = 0;
380
383 y = orgy;
384 z = orgz;
385
386 if (charge == 0){
387 do {
388 x = recTrack->
helix(0)* 10 *
390 - nStep * step *
sin(recTrack->
helix(1));
391 y = recTrack->
helix(0)* 10 *
393 + nStep * step *
cos(recTrack->
helix(1));
394 z = recTrack->
helix(3)* 10 +
395 nStep * step * recTrack->
helix(4);
396
397 mdcTrack->
AddPoint(x, y, z, delt*nStep);
402 mdcTrack->PaintMarker(
mp);
403 mdcTrack->SetMarkerColor(kBlack);
404 mdcTrack->SetMarkerSize(10);
405 mdcTrack->SetLineColor(kBlack);
406
407 nStep++;
408 }
409 while ( (x*x + y*y) < mdcR*mdcR && fabs(z) < mdcZ );
410
411 nStep = 0;
412 do {
413 x = recTrack->
helix(0)* 10 *
415 - nStep * step *
sin(recTrack->
helix(1));
416 y = recTrack->
helix(0)* 10 *
418 + nStep * step *
cos(recTrack->
helix(1));
419 z = recTrack->
helix(3)* 10 +
420 nStep * step * recTrack->
helix(4);
421
422 mdcTrack->
AddPoint(x, y, z, delt*nStep);
427 mdcTrack->PaintMarker(
mp);
428 mdcTrack->SetMarkerColor(kBlack);
429 mdcTrack->SetMarkerSize(10);
430 mdcTrack->SetLineColor(kRed);
431
432 }
433 while ( (x*x + y*y) < mdcR*mdcR && fabs(z) < mdcZ );
434 }
435 else{
436 TGeoHelix helix(curvature, zStep, charge);
437 helix.InitPoint(orgx, orgy, orgz);
438
439 helix.InitDirection(recTrack->
px(), recTrack->
py(), recTrack->
pz(), kFALSE);
440
441 helix.SetField(0.0, 0.0, field, kFALSE);
442
443 do {
444
445 helix.Step(step);
446 p = helix.GetCurrentPoint();
447
448 mdcTrack->
AddPoint(p[0], p[1], p[2], delt*nStep);
453 mdcTrack->PaintMarker(
mp);
454 mdcTrack->SetMarkerColor(kBlack);
455 mdcTrack->SetMarkerSize(10);
456 nStep++;
457 }
458 while ( (p[0]*p[0] + p[1]*p[1]) < mdcR*mdcR && fabs(p[2]) < mdcZ );
459
460 }
461
462
463 vector<UInt_t> vecHits(0);
464 const TObjArray *recMdcHitCol = fRecEvent->getRecMdcHitCol();
465 for (Int_t i = 0; i < recMdcHitCol->GetEntriesFast(); i++){
467 Int_t recHitId = recMdcHit->
getTrkId();
468 Int_t recTrkId = recTrack->
trackId();
469 if (recHitId == recTrkId) vecHits.push_back(recMdcHit->
getMdcId());
470 }
471 for (Int_t i = 0; i < (Int_t)vecHits.size(); i++) {
475
478 }
479
481
482
484 TString info;
485
486 info = TString("MdcTrack ");
489
490 sprintf(
data,
"charge=%i, status=%i", recTrack->
charge(), recTrack->
stat());
492
493 sprintf(
data,
"P=%-.3f GeV, Pt=%-.3f GeV", recTrack->
p(), recTrack->
pxy());
495
496
497
498
499 sprintf(
data,
"Pxyz=(%-.3f,%-.3f,%-.3f) GeV", recTrack->
px(),recTrack->
py(),recTrack->
pz());
501
502 sprintf(
data,
"helix(%-.3f,%-.3f,%-.3f,%-.3f,%-.3f)", recTrack->
helix(0),recTrack->
helix(1),recTrack->
helix(2),recTrack->
helix(3), recTrack->
helix(4));
504
505 sprintf(
data,
"Origin (%-.3f, %-.3f, %-.3f) cm", orgx/10, orgy/10, orgz/10);
507
508 sprintf(
data,
"#phi=%-.3f #theta=%-.3f cos#theta=%-.3f", recTrack->
phi(),recTrack->
theta(),
cos(recTrack->
theta()));
510
511
512 sprintf(
data,
"nHit=%i, #chi^{2}= %-.3f",recTrack->
ndof()+5, recTrack->
chi2());
514
515
516
517
518
519
520
521
523
525}
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;.
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