12 #include "TLorentzVector.h"
14 #include "StEventTypes.h"
15 #include "StThreeVectorF.hh"
16 #include "PhysicalConstants.h"
17 #include "StMemoryInfo.hh"
18 #include "StMessMgr.h"
24 #include "StTriggerData.h"
26 #include "StDcaGeometry.h"
27 #include "StDedxPidTraits.h"
28 #include "StTrackPidTraits.h"
29 #include "StBTofPidTraits.h"
30 #include "StBTofCollection.h"
31 #include "StBTofHit.h"
32 #include "StBTofRawHit.h"
33 #include "StBTofHeader.h"
34 #include "StMtdCollection.h"
35 #include "StMtdHeader.h"
36 #include "StMtdRawHit.h"
38 #include "StMtdPidTraits.h"
39 #include "StTpcDedxPidAlgorithm.h"
40 #include "StMuDSTMaker/COMMON/StMuBTofPidTraits.h"
41 #include "StMuDSTMaker/COMMON/StMuBTofHit.h"
42 #include "StarClassLibrary/StParticleDefinition.hh"
44 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
45 #include "StMuDSTMaker/COMMON/StMuDst.h"
46 #include "StMuDSTMaker/COMMON/StMuEvent.h"
47 #include "StMuDSTMaker/COMMON/StMuPrimaryVertex.h"
48 #include "StMuDSTMaker/COMMON/StMuTrack.h"
49 #include "StMuDSTMaker/COMMON/StMuMtdCollection.h"
50 #include "StMuDSTMaker/COMMON/StMuMtdHeader.h"
51 #include "StMuDSTMaker/COMMON/StMuMtdRawHit.h"
52 #include "StMuDSTMaker/COMMON/StMuMtdHit.h"
53 #include "StMuDSTMaker/COMMON/StMuMtdPidTraits.h"
55 #include "StPicoDstMaker/StPicoDstMaker.h"
56 #include "StPicoEvent/StPicoDst.h"
57 #include "StPicoEvent/StPicoEvent.h"
58 #include "StPicoEvent/StPicoTrack.h"
59 #include "StPicoEvent/StPicoMtdHit.h"
60 #include "StPicoEvent/StPicoMtdTrigger.h"
61 #include "StPicoEvent/StPicoMtdPidTraits.h"
62 #include "StPicoEvent/StPicoBTofPidTraits.h"
64 #include "StMtdQAMaker/StMtdTrigUtil.h"
65 #include "StMtdQAMaker.h"
66 #include "tables/St_mtdModuleToQTmap_Table.h"
67 #include "tables/St_mtdQTSlewingCorr_Table.h"
68 #include "tables/St_mtdQTSlewingCorrPart2_Table.h"
75 mStEvent(NULL), mMuDst(NULL), mPicoDst(NULL), mTrigUtil(NULL),
76 mRunId(-1), mRunYear(-1), mCollisionSystem("pp"), mVertexMode(1),
77 mPrintMemory(kFALSE), mPrintCpu(kFALSE), mPrintConfig(kFALSE), mTriggerIDs(0),
78 mMaxVtxZ(100.), mMaxVtxR(2.), mApplyVtxDzCut(kTRUE), mMaxVtxDz(3.),
79 mMinTrkPt(1.0), mMaxTrkPt(100), mMinTrkPhi(0.), mMaxTrkPhi(2*pi), mMinTrkEta(-1), mMaxTrkEta(1),
80 mMinNHitsFit(15), mMinNHitsDedx(10), mMinFitHitsFraction(0.52), mMaxDca(3.),
81 mMinMuonPt(1.3), mMinNsigmaPi(-2), mMaxNsigmaPi(3), mMinMuonDeltaZ(-20.), mMaxMuonDeltaZ(20.),
82 mMinMuonDeltaY(-20), mMaxMuonDeltaY(20), mMinMuonDeltaTof(-2), mMaxMuonDeltaTof(1), mMtdHitTrigger(kTRUE)
91 mhVtxZvsVpdVzDefault = NULL;
92 mhVtxZDiffDefault = NULL;
93 mhVtxZvsVpdVzClosest = NULL;
94 mhVtxZDiffClosest = NULL;
95 mhVtxClosestIndex = NULL;
100 mhVtxZDiffVsTpcVz = NULL;
105 mhgRefMultVsRefMult = NULL;
106 mhTpcVzVsRefMult = NULL;
107 mhDiffVzVsRefMult = NULL;
108 mhZdcRateVsRefMult = NULL;
109 mhBbcRateVsRefMult = NULL;
110 mhTofMultVsRefMult = NULL;
118 mhTrkNHitsFitVsPt = NULL;
119 mhTrkNHitsPossVsPt = NULL;
120 mhTrkNHitsDedxVsPt = NULL;
121 mhTrkDedxVsMom = NULL;
122 mhTrkDedxVsPhi = NULL;
123 mhTrkNsigmaPiVsMom = NULL;
125 mhTrkBetaVsMom = NULL;
127 mhTofMthTrkLocaly = NULL;
128 mhTofMthTrkLocalz = NULL;
130 mhMtdQTAdcAll = NULL;
131 mhMtdQTTacAll = NULL;
132 mhMtdQTAdcVsTacAll = NULL;
133 mhMtdQTJ2J3Diff = NULL;
134 mhMtdVpdTacDiffMT001 = NULL;
135 mhMtdVpdTacDiffMT001Mth = NULL;
136 mhMtdVpdTacDiffMT001Muon = NULL;
137 mhMtdVpdTacDiffMT101 = NULL;
138 mhMtdVpdTacDiffMT101Mth = NULL;
139 mhMtdVpdTacDiffMT101Muon = NULL;
141 mhNMT101Signal = NULL;
142 mhNTF201Signal = NULL;
143 for(
int i=0; i<kNQTboard; i++)
145 for(
int j=0; j<2; j++)
146 mhMixMtdTacSumvsMxqMtdTacSum[i][j] = NULL;
148 for(
int j=0; j<2; j++)
149 mhMtdTriggerTime[j] = NULL;
151 mhMtdNRawHits = NULL;
152 mhMtdRawHitMap = NULL;
153 mhMtdRawHitLeTime = NULL;
154 mhMtdRawHitTrTime = NULL;
155 mhMtdRawHitLeNEast = NULL;
156 mhMtdRawHitLeNWest = NULL;
157 mhMtdRawHitTrNEast = NULL;
158 mhMtdRawHitTrNWest = NULL;
159 mhMtdRawHitLeNDiff = NULL;
160 mhMtdRawHitTrNDiff = NULL;
164 mhMtdHitLeTimeDiff = NULL;
165 mhMtdHitTotWest = NULL;
166 mhMtdHitTotEast = NULL;
167 mhMtdHitTrigTime = NULL;
168 mhMtdHitTrigTimeTrkMth = NULL;
169 mhMtdTrigNHits = NULL;
170 mhMtdTrigHitMap = NULL;
171 mhMtdTrigMthNHits = NULL;
172 mhMtdTrigMthHitMap = NULL;
174 mhMtdNMatchHits = NULL;
175 mhMtdMatchHitMap = NULL;
176 mhMtdMatchTrkPt = NULL;
177 mhMtdMatchTrkPhiEta = NULL;
178 mhMtdMatchTrkPhiPt = NULL;
179 mhMtdMatchDzVsChan = NULL;
180 mhMtdMatchDzVsPtPos = NULL;
181 mhMtdMatchDzVsPtNeg = NULL;
182 mhMtdMatchDyVsChan = NULL;
183 mhMtdMatchDyVsPtPos = NULL;
184 mhMtdMatchDyVsPtNeg = NULL;
185 mhMtdMatchDtofVsPt = NULL;
186 mhMtdMatchMtdTofVsChan = NULL;
187 mhMtdMatchExpTofVsChan = NULL;
188 mhMtdMatchDtofVsChan = NULL;
189 mhMtdMatchLocalyVsChan = NULL;
190 mhMtdMatchLocalzVsChan = NULL;
195 mhMuonPhiVsEta = NULL;
201 mhInvMvsPtLSpos = NULL;
202 mhInvMvsPtLSneg = NULL;
204 mhBBCrateVsRun = NULL;
205 mhZDCrateVsRun = NULL;
206 mhRefMultVsRun = NULL;
207 mhgRefMultVsRun = NULL;
212 mhDiffVzVsRun = NULL;
213 mhpTrkPtVsRun = NULL;
214 mhpTrkEtaVsRun = NULL;
215 mhpTrkPhiVsRun = NULL;
216 mhpTrkDcaVsRun = NULL;
217 mhNHitsFitVsRun = NULL;
218 mhNHitsPossVsRun = NULL;
219 mhNHitsDedxVsRun = NULL;
221 mhNsigmaPiVsRun = NULL;
222 mhNsigmaEVsRun = NULL;
223 mhNsigmaKVsRun = NULL;
224 mhNsigmaPVsRun = NULL;
226 mhNMtdHitsVsRun = NULL;
227 mhNMtdTrigHitsVsRun = NULL;
228 mhNMtdMthHitsVsRun = NULL;
229 mhNMuonPosVsRun = NULL;
230 mhNMuonNegVsRun = NULL;
231 mhNMuonPairULVsRun = NULL;
232 mhNMuonPairLSPosVsRun = NULL;
233 mhNMuonPairLSNegVsRun = NULL;
237 StMtdQAMaker::~StMtdQAMaker()
243 Int_t StMtdQAMaker::Init()
245 if(mPrintConfig) printConfig();
254 if (mPrintMemory) StMemoryInfo::instance()->snapshot();
255 if (mPrintCpu) timer.start();
259 if(GetInputDS(
"StEvent"))
261 mStEvent = (
StEvent*) GetInputDS(
"StEvent");
264 iret = processStEvent();
268 LOG_ERROR <<
"No StEvent is available ..." << endm;
272 else if(GetMaker(
"MuDst"))
275 mMuDst = muDstMaker->
muDst();
278 iret = processMuDst();
282 LOG_ERROR <<
"No muDST is available ... "<< endm;
286 else if(GetMaker(
"picoDst"))
289 mPicoDst = picoDstMaker->
picoDst();
292 iret = processPicoDst();
296 LOG_ERROR <<
"No picoDst is available ..." << endm;
302 LOG_WARN <<
"No input data available ..." << endm;
308 StMemoryInfo::instance()->snapshot();
309 StMemoryInfo::instance()->print();
314 LOG_INFO <<
"CPU time for StMtdQAMaker::Make(): "
315 << timer.elapsedTime() <<
"sec " << endm;
322 Int_t StMtdQAMaker::processStEvent()
325 mhEventStat->Fill(0.5);
331 Int_t StMtdQAMaker::processMuDst()
333 mRunId = mMuDst->
event()->runId();
334 mRunYear = mRunId/1000000 + 1999;
335 int runIdFill = mRunId%1000000;
337 int mass_east = mMuDst->
event()->runInfo().beamMassNumber(east);
338 int mass_west = mMuDst->
event()->runInfo().beamMassNumber(west);
339 if(mass_east == mass_west)
341 if(mass_east == 1) mCollisionSystem =
"pp";
342 else mCollisionSystem =
"AA";
346 mCollisionSystem =
"pA";
350 mhEventStat->Fill(0.5);
351 mhRunId->Fill(runIdFill);
354 Bool_t isGoodTrigger = kFALSE;
355 Int_t nTrig = mTriggerIDs.size();
358 isGoodTrigger = kTRUE;
362 for(Int_t i=0; i<nTrig; i++)
364 if(mMuDst->
event()->triggerIdCollection().nominal().isTrigger(mTriggerIDs[i]))
366 isGoodTrigger = kTRUE;
371 if(!isGoodTrigger)
return kStOK;
372 mhEventStat->Fill(1.5);
376 Int_t nPrim = mMuDst->numberOfPrimaryVertices();
379 LOG_WARN <<
"No reconstructed vertex in MuDst... " << endm;
385 Double_t vpdvz = -999;
388 vpdvz = tofHeader->vpdVz();
389 mhEventStat->Fill(2.5);
396 Double_t min_dz = 999;
397 for(Int_t i=0; i<nPrim; i++)
400 double ranking = vertex->ranking();
401 if(mCollisionSystem==
"pp" && ranking<0)
continue;
402 Double_t dz = fabs(vertex->position().z()-vpdvz);
409 mhVtxClosestIndex->Fill(index);
412 mhVtxZvsVpdVzDefault->Fill(default_z, vpdvz);
413 mhVtxZDiffDefault->Fill(default_z - vpdvz);
416 double cloest_z = mMuDst->
primaryVertex(index)->position().z();
417 mhVtxZvsVpdVzClosest->Fill(cloest_z, vpdvz);
418 mhVtxZDiffClosest->Fill(cloest_z - vpdvz);
422 if(mVertexMode==0) vtxIndex = 0;
423 else if(mVertexMode==1) vtxIndex = index;
426 LOG_WARN <<
"No vertex mode is set. Use default vertex!" << endm;
435 double tpcvz = verPos.z();
436 mhVertexXY->Fill(verPos.y(), verPos.x());
437 mhVertexXZ->Fill(verPos.z(), verPos.x());
438 mhVertexYZ->Fill(verPos.z(), verPos.y());
439 mhVertexZ->Fill(tpcvz);
440 mhVpdVz->Fill(vpdvz);
441 mhVtxZDiff->Fill(tpcvz-vpdvz);
442 mhVtxZDiffVsTpcVz->Fill(tpcvz, tpcvz-vpdvz);
443 if(fabs(tpcvz)>mMaxVtxZ)
return kStOK;
444 if(sqrt(verPos.x()*verPos.x()+verPos.y()*verPos.y())>mMaxVtxR)
return kStOK;
445 if(mApplyVtxDzCut && fabs(tpcvz-vpdvz)>mMaxVtxDz)
return kStOK;
446 mhEventStat->Fill(3.5);
447 for(UInt_t i=0; i<mTriggerIDs.size(); i++)
449 if(mMuDst->
event()->triggerIdCollection().nominal().isTrigger(mTriggerIDs[i]))
451 mhEventStat->Fill(4.5+i);
454 mhTpcVxVsRun->Fill(runIdFill, verPos.x());
455 mhTpcVyVsRun->Fill(runIdFill, verPos.y());
456 mhTpcVzVsRun->Fill(runIdFill, tpcvz);
457 mhVpdVzVsRun->Fill(runIdFill, vpdvz);
458 mhDiffVzVsRun->Fill(runIdFill, tpcvz-vpdvz);
463 Int_t refMult = muEvent->
refMult();
464 Int_t gRefMult = muEvent->grefmult();
465 Double_t bbcRate = runInfo.bbcCoincidenceRate() * 1e-3;
466 Double_t zdcRate = runInfo.zdcCoincidenceRate() * 1e-3;
467 Int_t tofMult = mMuDst->numberOfBTofHit();
468 mhZdcRate->Fill(zdcRate);
469 mhBbcRate->Fill(bbcRate);
470 mhRefMult->Fill(refMult);
471 mhgRefMult->Fill(gRefMult);
472 mhgRefMultVsRefMult->Fill(refMult, gRefMult);
473 mhTpcVzVsRefMult ->Fill(refMult, verPos.z());
474 mhDiffVzVsRefMult ->Fill(refMult, verPos.z()-vpdvz);
475 mhZdcRateVsRefMult ->Fill(refMult, zdcRate);
476 mhBbcRateVsRefMult ->Fill(refMult, bbcRate);
477 mhTofMultVsRefMult ->Fill(refMult, tofMult);
478 mhBBCrateVsRun->Fill(runIdFill, bbcRate);
479 mhZDCrateVsRun->Fill(runIdFill, zdcRate);
480 mhRefMultVsRun->Fill(runIdFill, refMult);
481 mhgRefMultVsRun->Fill(runIdFill, gRefMult);
484 Int_t nGoodTrack = 0;
487 Int_t nPosMuon = 0, nNegMuon = 0;
488 Int_t nTrks = mMuDst->numberOfPrimaryTracks();
489 map<Short_t, UShort_t> trackIndex;
490 for(Int_t i=0; i<nTrks; i++)
493 if(!pTrack)
continue;
494 if(!isValidTrack(pTrack))
continue;
495 trackIndex[pTrack->
id()] = i;
497 Int_t charge = pTrack->
charge();
498 Double_t p = pTrack->
p().mag();
499 Double_t pt = pTrack->
pt();
500 Double_t eta = pTrack->
eta();
501 Double_t phi = rotatePhi(pTrack->
phi());
502 Double_t dca = pTrack->
dcaGlobal().mag();
503 Int_t nHitsFit = pTrack->
nHitsFit(kTpcId);
504 Int_t nHitsPoss = pTrack->
nHitsPoss(kTpcId);
506 Double_t dedx = pTrack->
dEdx() * 1e6;
512 mhTrkDcaVsPt ->Fill(pt, dca);
513 mhTrkPhiVsPt ->Fill(pt, phi);
514 mhTrkEtaVsPt ->Fill(pt, eta);
515 mhTrkPhiEta ->Fill(eta, phi);
516 mhTrkNHitsFitVsPt ->Fill(pt, nHitsFit);
517 mhTrkNHitsPossVsPt ->Fill(pt, nHitsPoss);
518 mhTrkNHitsDedxVsPt ->Fill(pt, nHitsDedx);
519 mhTrkDedxVsMom ->Fill(p, dedx);
520 mhTrkDedxVsPhi ->Fill(phi, dedx);
521 mhTrkNsigmaPiVsMom ->Fill(p, nSigmaPi);
523 mhpTrkPtVsRun ->Fill(runIdFill, pt);
524 mhpTrkEtaVsRun ->Fill(runIdFill, eta);
525 mhpTrkPhiVsRun ->Fill(runIdFill, phi);
526 mhpTrkDcaVsRun ->Fill(runIdFill, dca);
527 mhNHitsFitVsRun ->Fill(runIdFill, nHitsFit);
528 mhNHitsPossVsRun ->Fill(runIdFill, nHitsPoss);
529 mhNHitsDedxVsRun ->Fill(runIdFill, nHitsDedx);
530 mhDedxVsRun ->Fill(runIdFill, dedx);
531 mhNsigmaPiVsRun ->Fill(runIdFill, nSigmaPi);
532 mhNsigmaEVsRun ->Fill(runIdFill, nSigmaE);
533 mhNsigmaKVsRun ->Fill(runIdFill, nSigmaK);
534 mhNsigmaPVsRun ->Fill(runIdFill, nSigmaP);
541 double beta = tofPid.beta();
544 Double_t m2 = pow(p,2) * (1/pow(beta,2)-1);
545 mhTrkBetaVsMom->Fill(p, 1./beta);
546 mhTrkM2VsMom->Fill(p, m2);
547 mhBetaVsRun->Fill(runIdFill, 1./beta);
549 Int_t tofTray = tofHit->tray();
550 Int_t tofModule = tofHit->module();
551 if(tofTray>60 && tofTray<=120) tofModule += 32;
552 mhTofMthTrkLocaly->Fill(tofTray,tofPid.yLocal());
553 mhTofMthTrkLocalz->Fill(tofModule,tofPid.zLocal());
557 Int_t iMtd = pTrack->index2MtdHit();
561 Int_t backleg = hit->backleg();
562 Int_t module = hit->module();
563 Int_t cell = hit->cell();
564 Double_t gChan = (backleg-1)*60 + (module-1)*12 + cell;
566 Double_t dy = mtdPid.deltaY();
567 Double_t dz = mtdPid.deltaZ();
568 Double_t localy = mtdPid.yLocal();
569 Double_t localz = mtdPid.zLocal();
571 Double_t exptof = mtdPid.expTimeOfFlight();
572 Double_t dtof = mtdtof - exptof;
574 mhMtdMatchTrkPt ->Fill(pt);
575 mhMtdMatchTrkPhiEta ->Fill(eta, phi);
576 mhMtdMatchTrkPhiPt ->Fill(pt, phi);
577 mhMtdMatchDzVsChan ->Fill(gChan, dz);
578 if(charge>0) mhMtdMatchDzVsPtPos->Fill(pt, dz);
579 if(charge<0) mhMtdMatchDzVsPtNeg->Fill(pt, dz);
580 mhMtdMatchDyVsChan ->Fill(gChan, dy);
581 if(charge>0) mhMtdMatchDyVsPtPos->Fill(pt, dy);
582 if(charge<0) mhMtdMatchDyVsPtNeg->Fill(pt, dy);
583 mhMtdMatchDtofVsPt ->Fill(pt, dtof);
584 mhMtdMatchMtdTofVsChan ->Fill(gChan, mtdtof);
585 mhMtdMatchExpTofVsChan ->Fill(gChan, exptof);
586 mhMtdMatchDtofVsChan ->Fill(gChan, dtof);
587 mhMtdMatchLocalyVsChan ->Fill(gChan, localy);
588 mhMtdMatchLocalzVsChan ->Fill(gChan, localz);
590 Int_t tacDiffQT = 0, tacDiffMT101 = 0;
591 Int_t qt = 0, pos = 0, bin = 0;
594 tacDiffQT = mTrigUtil->getHitTimeDiffToVPDInQT(backleg, module);
595 tacDiffMT101 = mTrigUtil->getHitTimeDiffToVPDInMT101(backleg, module);
596 qt = mTrigUtil->getQt(backleg, module);
597 pos = mTrigUtil->getQtPos(backleg, module);
598 if(mRunYear!=2016) bin = (qt-1)*8+pos;
599 else bin = (qt-1)*4+(pos-1)/2+1;
600 mhMtdVpdTacDiffMT001Mth->Fill(bin, tacDiffQT);
601 mhMtdVpdTacDiffMT101Mth->Fill(bin, tacDiffMT101);
602 if(isMuonCandidate(pt, nSigmaPi, dz, dy, dtof, kTRUE))
604 mhMtdVpdTacDiffMT001Muon->Fill(bin, tacDiffQT);
605 mhMtdVpdTacDiffMT101Muon->Fill(bin, tacDiffMT101);
609 if(isMuonCandidate(pTrack))
611 if(charge>0) nPosMuon++;
614 mhMuonPhiVsEta->Fill(eta, phi);
615 mhMuonMap->Fill(backleg, (module-1)*12+cell+1);
620 mhNTrk->Fill(nGoodTrack);
621 mhNMuonPos->Fill(nPosMuon);
622 mhNMuonNeg->Fill(nNegMuon);
623 mhNMuonPosVsRun->Fill(runIdFill, nPosMuon);
624 mhNMuonNegVsRun->Fill(runIdFill, nNegMuon);
628 int mtdTrigTime[2] = {0, 0};
631 for(Int_t i=0; i<2; i++)
633 mtdTrigTime[i] = 25.*(muMtdHeader->triggerTime(i+1)&0xfff);
634 mhMtdTriggerTime[i]->Fill(mtdTrigTime[i]);
640 Int_t mtdQTtac[kNQTboard][16];
641 Int_t mtdQTadc[kNQTboard][16];
642 for(Int_t i=0; i<32; i++)
644 Int_t type = (i/4)%2;
649 mtdQTtac[0][i-i/4*2-2] = trigData->mtdAtAddress(i,0);
650 mtdQTtac[1][i-i/4*2-2] = trigData->mtdgemAtAddress(i,0);
651 mtdQTtac[2][i-i/4*2-2] = trigData->mtd3AtAddress(i,0);
652 mtdQTtac[3][i-i/4*2-2] = trigData->mtd4AtAddress(i,0);
656 mtdQTadc[0][i-i/4*2] = trigData->mtdAtAddress(i,0);
657 mtdQTadc[1][i-i/4*2] = trigData->mtdgemAtAddress(i,0);
658 mtdQTadc[2][i-i/4*2] = trigData->mtd3AtAddress(i,0);
659 mtdQTadc[3][i-i/4*2] = trigData->mtd4AtAddress(i,0);
664 for(
int im=0; im<kNQTboard; im++)
666 if(type==0) mtdQTadc[im][i-i/4*2] = trigData->mtdQtAtCh(im+1,i,0);
667 else mtdQTtac[im][i-i/4*2-2] = trigData->mtdQtAtCh(im+1,i,0);
675 Int_t vpdTacSum = mTrigUtil->getVpdTacSum();
676 for(Int_t im=0; im<kNQTboard; im++)
678 for(Int_t i=0; i<8; i++)
680 Int_t mtdTacSum = mTrigUtil->getQtTacSum(im+1, i+1);
681 if(mtdTacSum<=10)
continue;
684 for(Int_t k=0; k<2; k++)
687 if(mRunYear!=2016) index = im*16 + i*2 + k + 1;
688 else index = im*8 + (i/2)*2 + k + 1;
689 mhMtdQTAdcAll->Fill(index, mtdQTadc[im][i*2+k]);
690 mhMtdQTTacAll->Fill(index, mtdQTtac[im][i*2+k]);
691 mhMtdQTAdcVsTacAll->Fill(mtdQTtac[im][i*2+k], mtdQTadc[im][i*2+k]);
695 if(mRunYear!=2016) bin = im*8+i+1;
696 else bin = im*4+i/2+1;
697 mhMtdQTJ2J3Diff->Fill(bin,mtdQTtac[im][i*2]-mtdQTtac[im][i*2+1]);
698 mhMtdVpdTacDiffMT001->Fill(bin, mtdTacSum/8 - vpdTacSum/8 + 1024);
701 mhNQtSignal->Fill(nQTsignal);
703 Int_t nMT101signal = 0;
704 for(Int_t im=0; im<kNQTboard; im++)
706 for(Int_t j=0; j<2; j++)
708 Int_t mix_tacSum = mTrigUtil->getMT101Tac(im+1, j);
712 Int_t mxq_tacSum = mTrigUtil->getQtTacSumHighestTwo(im+1, j);
713 Int_t mxq_tacPos = mTrigUtil->getQtPosHighestTwo(im+1, j);
714 mhMixMtdTacSumvsMxqMtdTacSum[im][j]->Fill(mxq_tacSum/8,mix_tacSum);
716 if(mRunYear!=2016) bin = im*8+mxq_tacPos;
717 else bin = im*4+mxq_tacPos/2;
718 mhMtdVpdTacDiffMT101->Fill(bin,mix_tacSum-vpdTacSum/8+1024);
722 mhNMT101Signal->Fill(nMT101signal);
724 Int_t nTF201signal = 0;
725 Int_t decision = mTrigUtil->getTF201TriggerBit();
726 for(Int_t i=0; i<4; i++)
728 for(Int_t j=0; j<2; j++)
730 if((decision>>(i*2+j))&0x1)
734 mhNTF201Signal->Fill(nTF201signal);
739 Int_t nMtdRawHits = mMuDst->numberOfBMTDRawHit();
740 mhMtdNRawHits->Fill(nMtdRawHits);
741 Int_t nDiffLe[gMtdNBacklegs * gMtdNModules * gMtdNCells] = {0};
742 Int_t nDiffTr[gMtdNBacklegs * gMtdNModules * gMtdNCells] = {0};
743 for(Int_t i=0; i<nMtdRawHits; i++)
746 if(!rawHit)
continue;
747 Int_t backleg = rawHit->backleg();
748 Int_t channel = rawHit->channel();
749 Int_t module = (channel-1)/gMtdNChannels+1;
750 if(backleg<1 || backleg>30)
continue;
751 Int_t gChan = (backleg-1)*120 + channel;
752 Int_t localChan = channel - (module-1) * 24;
753 Int_t gCell = (backleg-1)*60 + (module-1)*12 + localChan;
754 Int_t flag = rawHit->flag();
755 Double_t tdc = rawHit->tdc()*gMtdConvertTdcToNs;
757 mhMtdRawHitMap->Fill(backleg, channel);
758 if(flag>0) mhMtdRawHitLeTime->Fill(gChan, tdc);
759 else mhMtdRawHitTrTime->Fill(gChan, tdc);
762 if(flag>0) { mhMtdRawHitLeNWest->Fill(gCell); nDiffLe[gCell-1]++; }
763 else { mhMtdRawHitTrNWest->Fill(gCell); nDiffTr[gCell-1]++; }
765 else if (localChan > 12 && localChan <= 24)
768 if(flag>0) { mhMtdRawHitLeNEast->Fill(gCell); nDiffLe[gCell-1]--; }
769 else { mhMtdRawHitTrNEast->Fill(gCell); nDiffTr[gCell-1]--; }
773 LOG_WARN <<
"Weird local channel number: " << localChan <<
" from global channel " << channel <<
" and module " << module << endm;
776 for(Int_t i=0; i<gMtdNBacklegs * gMtdNModules * gMtdNCells; i++)
778 mhMtdRawHitLeNDiff->Fill(i+1,nDiffLe[i]);
779 mhMtdRawHitTrNDiff->Fill(i+1,nDiffTr[i]);
783 int nMtdHits = mMuDst->numberOfMTDHit();
784 int mMthMtdHit = 0, nTrigMtdHit = 0, nTrigMtdHitMth = 0;
785 mhMtdNHits->Fill(nMtdHits);
786 for(Int_t i=0; i<nMtdHits; i++)
790 Int_t backleg = hit->backleg();
791 Int_t module = hit->module();
792 Int_t cell = hit->cell();
793 Int_t lChan = (module-1)*12+cell;
794 Int_t gChan = (backleg-1)*60 + lChan;
795 Int_t tHub = getMtdHitTHUB(backleg);
796 Double_t tDiff = (hit->leadingEdgeTime().first+hit->leadingEdgeTime().second)/2 - mtdTrigTime[tHub-1];
797 while(tDiff<0) tDiff += 51200;
798 Bool_t isMth = kFALSE;
799 Short_t trackId = hit->associatedTrackKey();
802 Int_t index = (trackIndex.find(trackId)!=trackIndex.end()) ? trackIndex.find(trackId)->second : -1;
806 if(pTrack && isValidTrack(pTrack)) isMth = kTRUE;
809 Bool_t isTrig = mTrigUtil ? mTrigUtil->isHitFireTrigger(hit->backleg(), hit->module()) : kFALSE;
811 mhMtdHitMap ->Fill(backleg,lChan);
812 mhMtdHitLeTimeDiff->Fill(gChan, hit->leadingEdgeTime().first-hit->leadingEdgeTime().second);
813 mhMtdHitTotWest ->Fill(gChan, hit->tot().first);
814 mhMtdHitTotEast ->Fill(gChan, hit->tot().second);
815 mhMtdHitTrigTime ->Fill(gChan, tDiff);
820 mhMtdHitTrigTimeTrkMth->Fill(gChan,tDiff);
821 mhMtdMatchHitMap->Fill(backleg,lChan);
826 mhMtdTrigHitMap->Fill(backleg,lChan);
830 mhMtdTrigMthHitMap->Fill(backleg,lChan);
834 mhMtdNMatchHits ->Fill(mMthMtdHit);
835 mhMtdTrigNHits ->Fill(nTrigMtdHit);
836 mhMtdTrigMthNHits ->Fill(nTrigMtdHitMth);
837 mhNMtdHitsVsRun ->Fill(runIdFill, nMtdHits);
838 mhNMtdTrigHitsVsRun ->Fill(runIdFill, nTrigMtdHit);
839 mhNMtdMthHitsVsRun ->Fill(runIdFill, mMthMtdHit);
842 int nULpair = 0, nLSpairPos = 0, nLSpairNeg = 0;
843 UInt_t nMuon = muonId.size();
844 for(UInt_t i=0; i<nMuon; i++)
847 int iq = ipTrack->
charge();
849 TLorentzVector imuon;
850 imuon.SetXYZM(imom.x(),imom.y(),imom.z(),0.10566);
851 for(UInt_t j=i+1; j<nMuon; j++)
854 int jq = jpTrack->
charge();
856 TLorentzVector jmuon;
857 jmuon.SetXYZM(jmom.x(),jmom.y(),jmom.z(),0.10566);
859 float pt1 = imom.perp(), pt2 = jmom.perp();
866 if(pt1<1.5)
continue;
867 TLorentzVector jpsi = imuon + jmuon;
868 Double_t invmass = jpsi.M();
872 mhInvMvsPtUL->Fill(invmass, jpsi.Pt());
873 mhInvMUL->Fill(invmass);
880 mhInvMvsPtLSpos->Fill(invmass, jpsi.Pt());
881 mhInvMLSpos->Fill(invmass);
886 mhInvMvsPtLSneg->Fill(invmass, jpsi.Pt());
887 mhInvMLSneg->Fill(invmass);
892 mhNULpair ->Fill(nULpair);
893 mhNLSpairPos ->Fill(nLSpairPos);
894 mhNLSpairNeg ->Fill(nLSpairNeg);
895 mhNMuonPairULVsRun ->Fill(runIdFill, nULpair);
896 mhNMuonPairLSPosVsRun->Fill(runIdFill, nLSpairPos);
897 mhNMuonPairLSNegVsRun->Fill(runIdFill, nLSpairNeg);
904 Int_t StMtdQAMaker::processPicoDst()
907 mRunId = picoEvent->
runId();
908 mRunYear = mRunId/1000000 + 1999;
909 int runIdFill = mRunId%1000000;
912 mhEventStat->Fill(0.5);
913 mhRunId->Fill(runIdFill);
916 Bool_t isGoodTrigger = kFALSE;
917 Int_t nTrig = mTriggerIDs.size();
920 isGoodTrigger = kTRUE;
924 for(Int_t i=0; i<nTrig; i++)
928 isGoodTrigger = kTRUE;
933 if(!isGoodTrigger)
return kStOK;
934 mhEventStat->Fill(1.5);
937 Double_t vpdvz = picoEvent->
vzVpd();
942 mhEventStat->Fill(2.5);
944 double tpcvz = verPos.z();
945 mhVertexXY->Fill(verPos.y(), verPos.x());
946 mhVertexXZ->Fill(verPos.z(), verPos.x());
947 mhVertexYZ->Fill(verPos.z(), verPos.y());
948 mhVertexZ->Fill(tpcvz);
949 mhVpdVz->Fill(vpdvz);
950 mhVtxZDiff->Fill(tpcvz-vpdvz);
951 mhVtxZDiffVsTpcVz->Fill(tpcvz, tpcvz-vpdvz);
952 if(fabs(tpcvz)>mMaxVtxZ)
return kStOK;
953 if(sqrt(verPos.x()*verPos.x()+verPos.y()*verPos.y())>mMaxVtxR)
return kStOK;
954 if(mApplyVtxDzCut && fabs(tpcvz-vpdvz)>mMaxVtxDz)
return kStOK;
955 mhEventStat->Fill(3.5);
956 for(UInt_t i=0; i<mTriggerIDs.size(); i++)
960 mhEventStat->Fill(4.5+i);
963 mhTpcVxVsRun->Fill(runIdFill, verPos.x());
964 mhTpcVyVsRun->Fill(runIdFill, verPos.y());
965 mhTpcVzVsRun->Fill(runIdFill, tpcvz);
966 mhVpdVzVsRun->Fill(runIdFill, vpdvz);
967 mhDiffVzVsRun->Fill(runIdFill, tpcvz-vpdvz);
970 Int_t refMult = picoEvent->
refMult();
971 Int_t gRefMult = picoEvent->
grefMult();
972 Double_t bbcRate = picoEvent->
BBCx() * 1e-3;
973 Double_t zdcRate = picoEvent->
ZDCx() * 1e-3;
975 mhZdcRate->Fill(zdcRate);
976 mhBbcRate->Fill(bbcRate);
977 mhRefMult->Fill(refMult);
978 mhgRefMult->Fill(gRefMult);
979 mhgRefMultVsRefMult->Fill(refMult, gRefMult);
980 mhTpcVzVsRefMult ->Fill(refMult, verPos.z());
981 mhDiffVzVsRefMult ->Fill(refMult, verPos.z()-vpdvz);
982 mhZdcRateVsRefMult ->Fill(refMult, zdcRate);
983 mhBbcRateVsRefMult ->Fill(refMult, bbcRate);
984 mhTofMultVsRefMult ->Fill(refMult, tofMult);
985 mhBBCrateVsRun->Fill(runIdFill, bbcRate);
986 mhZDCrateVsRun->Fill(runIdFill, zdcRate);
987 mhRefMultVsRun->Fill(runIdFill, refMult);
988 mhgRefMultVsRun->Fill(runIdFill, gRefMult);
991 Int_t nGoodTrack = 0;
994 Int_t nPosMuon = 0, nNegMuon = 0;
996 for(Int_t i=0; i<nTrks; i++)
999 if(!pTrack)
continue;
1000 TVector3 mom = pTrack->
pMom();
1001 if(mom.Mag()<=0)
continue;
1002 if(!isValidTrack(pTrack))
continue;
1004 Int_t charge = pTrack->
charge();
1005 Double_t p = mom.Mag();
1006 Double_t pt = mom.Perp();
1007 Double_t eta = mom.Eta();
1008 Double_t phi = rotatePhi(mom.Phi());
1010 Int_t nHitsFit = pTrack->
nHitsFit();
1011 Int_t nHitsPoss = pTrack->
nHitsMax();
1013 Double_t dedx = pTrack->
dEdx();
1019 mhTrkDcaVsPt ->Fill(pt, dca);
1020 mhTrkPhiVsPt ->Fill(pt, phi);
1021 mhTrkEtaVsPt ->Fill(pt, eta);
1022 mhTrkPhiEta ->Fill(eta, phi);
1023 mhTrkNHitsFitVsPt ->Fill(pt, nHitsFit);
1024 mhTrkNHitsPossVsPt ->Fill(pt, nHitsPoss);
1025 mhTrkNHitsDedxVsPt ->Fill(pt, nHitsDedx);
1026 mhTrkDedxVsMom ->Fill(p, dedx);
1027 mhTrkDedxVsPhi ->Fill(phi, dedx);
1028 mhTrkNsigmaPiVsMom ->Fill(p, nSigmaPi);
1030 mhpTrkPtVsRun ->Fill(runIdFill, pt);
1031 mhpTrkEtaVsRun ->Fill(runIdFill, eta);
1032 mhpTrkPhiVsRun ->Fill(runIdFill, phi);
1033 mhpTrkDcaVsRun ->Fill(runIdFill, dca);
1034 mhNHitsFitVsRun ->Fill(runIdFill, nHitsFit);
1035 mhNHitsPossVsRun ->Fill(runIdFill, nHitsPoss);
1036 mhNHitsDedxVsRun ->Fill(runIdFill, nHitsDedx);
1037 mhDedxVsRun ->Fill(runIdFill, dedx);
1038 mhNsigmaPiVsRun ->Fill(runIdFill, nSigmaPi);
1039 mhNsigmaEVsRun ->Fill(runIdFill, nSigmaE);
1040 mhNsigmaKVsRun ->Fill(runIdFill, nSigmaK);
1041 mhNsigmaPVsRun ->Fill(runIdFill, nSigmaP);
1050 Double_t m2 = pow(p,2) * (1/pow(beta,2)-1);
1051 mhTrkBetaVsMom->Fill(p, 1./beta);
1052 mhTrkM2VsMom->Fill(p, m2);
1053 mhBetaVsRun->Fill(runIdFill, 1./beta);
1056 Int_t tofModule = tofPid->
btofCellId()%192/6+1;
1057 if(tofTray>60 && tofTray<=120) tofModule += 32;
1058 mhTofMthTrkLocaly->Fill(tofTray,tofPid->
btofYLocal());
1059 mhTofMthTrkLocalz->Fill(tofModule,tofPid->
btofZLocal());
1067 Int_t backleg = mtdPid->
backleg();
1068 Int_t module = mtdPid->
module();
1069 Int_t cell = mtdPid->
cell();
1070 Double_t gChan = (backleg-1)*60 + (module-1)*12 + cell;
1071 Double_t dy = mtdPid->
deltaY();
1072 Double_t dz = mtdPid->
deltaZ();
1075 mhMtdMatchTrkPt ->Fill(pt);
1076 mhMtdMatchTrkPhiEta ->Fill(eta, phi);
1077 mhMtdMatchTrkPhiPt ->Fill(pt, phi);
1078 mhMtdMatchDzVsChan ->Fill(gChan, dz);
1079 if(charge>0) mhMtdMatchDzVsPtPos->Fill(pt, dz);
1080 if(charge<0) mhMtdMatchDzVsPtNeg->Fill(pt, dz);
1081 mhMtdMatchDyVsChan ->Fill(gChan, dy);
1082 if(charge>0) mhMtdMatchDyVsPtPos->Fill(pt, dy);
1083 if(charge<0) mhMtdMatchDyVsPtNeg->Fill(pt, dy);
1084 mhMtdMatchDtofVsPt ->Fill(pt, dtof);
1085 mhMtdMatchDtofVsChan ->Fill(gChan, dtof);
1087 Int_t tacDiffQT = 0, tacDiffMT101 = 0;
1088 Int_t qt = 0, pos = 0, bin = 0;
1091 tacDiffQT = mTrigUtil->getHitTimeDiffToVPDInQT(backleg, module);
1092 tacDiffMT101 = mTrigUtil->getHitTimeDiffToVPDInMT101(backleg, module);
1093 qt = mTrigUtil->getQt(backleg, module);
1094 pos = mTrigUtil->getQtPos(backleg, module);
1095 if(mRunYear!=2016) bin = (qt-1)*8+pos;
1096 else bin = (qt-1)*4+(pos-1)/2+1;
1097 mhMtdVpdTacDiffMT001Mth->Fill(bin, tacDiffQT);
1098 mhMtdVpdTacDiffMT101Mth->Fill(bin, tacDiffMT101);
1099 if(isMuonCandidate(pt, nSigmaPi, dz, dy, dtof, kTRUE))
1101 mhMtdVpdTacDiffMT001Muon->Fill(bin, tacDiffQT);
1102 mhMtdVpdTacDiffMT101Muon->Fill(bin, tacDiffMT101);
1106 if(isMuonCandidate(pTrack))
1108 if(charge>0) nPosMuon++;
1111 mhMuonPhiVsEta->Fill(eta, phi);
1112 mhMuonMap->Fill(backleg, (module-1)*12+cell+1);
1113 muonId.push_back(i);
1117 mhNTrk->Fill(nGoodTrack);
1118 mhNMuonPos->Fill(nPosMuon);
1119 mhNMuonNeg->Fill(nNegMuon);
1120 mhNMuonPosVsRun->Fill(runIdFill, nPosMuon);
1121 mhNMuonNegVsRun->Fill(runIdFill, nNegMuon);
1125 int mtdTrigTime[2] = {0, 0};
1126 for(Int_t i=0; i<2; i++)
1128 mtdTrigTime[i] = mtdTrig ? mtdTrig->
getTHUBtime(i+1) : 0;
1129 mhMtdTriggerTime[i]->Fill(mtdTrigTime[i]);
1135 Int_t nQTsignal = 0;
1136 Int_t vpdTacSum = mTrigUtil->getVpdTacSum();
1137 for(Int_t im=0; im<kNQTboard; im++)
1139 for(Int_t i=0; i<8; i++)
1141 Int_t mtdTacSum = mTrigUtil->getQtTacSum(im+1, i+1);
1142 if(mtdTacSum<=10)
continue;
1145 if(mRunYear!=2016) bin = im*8+i+1;
1146 else bin = im*4+i/2+1;
1147 mhMtdVpdTacDiffMT001->Fill(bin, mtdTacSum/8 - vpdTacSum/8 + 1024);
1150 mhNQtSignal->Fill(nQTsignal);
1152 Int_t nMT101signal = 0;
1153 for(Int_t im=0; im<kNQTboard; im++)
1155 if(mRunYear!=2016 && im>3)
continue;
1156 for(Int_t j=0; j<2; j++)
1158 Int_t mix_tacSum = mTrigUtil->getMT101Tac(im+1, j);
1159 Int_t mxq_tacSum = mTrigUtil->getQtTacSumHighestTwo(im+1, j);
1160 Int_t mxq_tacPos = mTrigUtil->getQtPosHighestTwo(im+1, j);
1164 mhMixMtdTacSumvsMxqMtdTacSum[im][j]->Fill(mxq_tacSum/8,mix_tacSum);
1166 if(mRunYear!=2016) bin = im*8+mxq_tacPos;
1167 else bin = im*4+mxq_tacPos/2;
1168 mhMtdVpdTacDiffMT101->Fill(bin,mix_tacSum-vpdTacSum/8+1024);
1172 mhNMT101Signal->Fill(nMT101signal);
1174 Int_t nTF201signal = 0;
1175 Int_t decision = mTrigUtil->getTF201TriggerBit();
1176 for(Int_t i=0; i<4; i++)
1178 for(Int_t j=0; j<2; j++)
1180 if((decision>>(i*2+j))&0x1)
1184 mhNTF201Signal->Fill(nTF201signal);
1189 int mMthMtdHit = 0, nTrigMtdHit = 0, nTrigMtdHitMth = 0;
1190 mhMtdNHits->Fill(nMtdHits);
1191 for(Int_t i=0; i<nMtdHits; i++)
1195 Int_t backleg = hit->
backleg();
1196 Int_t module = hit->
module();
1197 Int_t cell = hit->
cell();
1198 Int_t lChan = (module-1)*12+cell;
1199 Int_t gChan = (backleg-1)*60 + lChan;
1200 Int_t tHub = getMtdHitTHUB(backleg);
1202 while(tDiff<0) tDiff += 51200;
1203 Bool_t isMth = kFALSE;
1204 Int_t pidIndex = getMtdPidTraitsIndex(hit);
1209 if(pTrack && pTrack->
pMom().Mag()>0 && isValidTrack(pTrack)) isMth = kTRUE;
1211 Bool_t isTrig = mTrigUtil ? mTrigUtil->isHitFireTrigger(hit->
backleg(), hit->
module()) : kFALSE;
1212 mhMtdHitMap ->Fill(backleg,lChan);
1214 mhMtdHitTotWest ->Fill(gChan, hit->
tot().first);
1215 mhMtdHitTotEast ->Fill(gChan, hit->
tot().second);
1216 mhMtdHitTrigTime ->Fill(gChan, tDiff);
1221 mhMtdHitTrigTimeTrkMth->Fill(gChan,tDiff);
1222 mhMtdMatchHitMap->Fill(backleg,lChan);
1227 mhMtdTrigHitMap->Fill(backleg,lChan);
1231 mhMtdTrigMthHitMap->Fill(backleg,lChan);
1235 mhMtdNMatchHits ->Fill(mMthMtdHit);
1236 mhMtdTrigNHits ->Fill(nTrigMtdHit);
1237 mhMtdTrigMthNHits ->Fill(nTrigMtdHitMth);
1238 mhNMtdHitsVsRun ->Fill(runIdFill, nMtdHits);
1239 mhNMtdTrigHitsVsRun ->Fill(runIdFill, nTrigMtdHit);
1240 mhNMtdMthHitsVsRun ->Fill(runIdFill, mMthMtdHit);
1243 int nULpair = 0, nLSpairPos = 0, nLSpairNeg = 0;
1244 UInt_t nMuon = muonId.size();
1245 for(UInt_t i=0; i<nMuon; i++)
1248 int iq = ipTrack->
charge();
1249 TVector3 imom = ipTrack->
pMom();
1250 TLorentzVector imuon;
1251 imuon.SetXYZM(imom.x(),imom.y(),imom.z(),0.10566);
1252 for(UInt_t j=i+1; j<nMuon; j++)
1255 int jq = jpTrack->
charge();
1256 TVector3 jmom = jpTrack->
pMom();
1257 TLorentzVector jmuon;
1258 jmuon.SetXYZM(jmom.x(),jmom.y(),jmom.z(),0.10566);
1260 float pt1 = imom.Perp(), pt2 = jmom.Perp();
1267 if(pt1<1.5)
continue;
1268 TLorentzVector jpsi = imuon + jmuon;
1269 Double_t invmass = jpsi.M();
1273 mhInvMvsPtUL->Fill(invmass, jpsi.Pt());
1274 mhInvMUL->Fill(invmass);
1281 mhInvMvsPtLSpos->Fill(invmass, jpsi.Pt());
1282 mhInvMLSpos->Fill(invmass);
1287 mhInvMvsPtLSneg->Fill(invmass, jpsi.Pt());
1288 mhInvMLSneg->Fill(invmass);
1293 mhNULpair ->Fill(nULpair);
1294 mhNLSpairPos ->Fill(nLSpairPos);
1295 mhNLSpairNeg ->Fill(nLSpairNeg);
1296 mhNMuonPairULVsRun ->Fill(runIdFill, nULpair);
1297 mhNMuonPairLSPosVsRun->Fill(runIdFill, nLSpairPos);
1298 mhNMuonPairLSNegVsRun->Fill(runIdFill, nLSpairNeg);
1305 void StMtdQAMaker::addCutToHisto(TH1 *h,
const Int_t bin,
const char *label,
const Float_t value)
1308 h->GetXaxis()->SetBinLabel(bin,label);
1310 h->SetBinContent(bin,value);
1321 const char qtlabel[64][100] = {
"QT1-1 25-1-J2",
"QT1-1 25-1-J3",
"QT1-2 25-5-J2",
"QT1-2 25-5-J3",
"QT1-3 25-2-J2",
"QT1-3 25-2-J3",
"QT1-4 25-4-J2",
"QT1-4 25-4-J3",
"QT1-5 25-3-J2",
"QT1-5 25-3-J3",
"QT1-6 30-3-J2",
"QT1-6 30-3-J3",
"QT1-7 30-1-J2",
"QT1-7 30-1-J3",
"QT1-8 30-5-J2",
"QT1-8 30-5-J3",
"QT2-1 05-1-J2",
"QT2-1 05-1-J3",
"QT2-2 05-5-J2",
"QT2-2 05-5-J3",
"QT2-3 05-2-J2",
"QT2-3 05-2-J3",
"QT2-4 05-4-J2",
"QT2-4 05-4-J3",
"QT2-5 05-3-J2",
"QT2-5 05-3-J3",
"QT2-6 ",
"QT2-6 ",
"QT2-7 30-2-J2",
"QT2-7 30-2-J3",
"QT2-8 30-4-J2",
"QT2-8 30-4-J3",
"QT3-1 10-1-J2",
"QT3-1 10-1-J3",
"QT3-2 10-5-J2",
"QT3-2 10-5-J3",
"QT3-3 10-2-J2",
"QT3-3 10-2-J3",
"QT3-4 10-4-J2",
"QT3-4 10-4-J3",
"QT3-5 10-3-J2",
"QT3-5 10-3-J3",
"QT3-6 15-3-J2",
"QT3-6 15-3-J3",
"QT3-7 ",
"QT3-7 ",
"QT3-8 ",
"QT3-8 ",
"QT4-1 21-1-J2",
"QT4-1 21-1-J3",
"QT4-2 21-5-J2",
"QT4-2 21-5-J3",
"QT4-3 20-2-J2",
"QT4-3 20-2-J3",
"QT4-4 20-4-J2",
"QT4-4 20-4-J3",
"QT4-5 20-3-J2",
"QT4-5 20-3-J3",
"QT4-6 ",
"QT4-6 ",
"QT4-7 15-2-J2",
"QT4-7 15-2-J3",
"QT4-8 15-4-J2",
"QT4-8 15-4-J3"};
1323 const char qtlabel2[32][100] = {
"QT1-1 25-1",
"QT1-2 25-5",
"QT1-3 25-2",
"QT1-4 25-4",
"QT1-5 25-3",
"QT1-6 30-3",
"QT1-7 30-1",
"QT1-8 30-5",
"QT2-1 05-1",
"QT2-2 05-5",
"QT2-3 05-2",
"QT2-4 05-4",
"QT2-5 05-3",
"QT2-6 ",
"QT2-7 30-2",
"QT2-8 30-4",
"QT3-1 10-1",
"QT3-2 10-5",
"QT3-3 10-2",
"QT3-4 10-4",
"QT3-5 10-3",
"QT3-6 15-3",
"QT3-7 ",
"QT3-8 ",
"QT4-1 21-1",
"QT4-2 21-5",
"QT4-3 20-2",
"QT4-4 20-4",
"QT4-5 20-3",
"QT4-6 ",
"QT4-7 15-2",
"QT4-8 15-4"};
1325 const Int_t nSpecMBins = 56;
1326 Double_t specM[nSpecMBins+1] = {0, 0.01, 0.02, 0.03, 0.04, 0.05,
1327 0.06, 0.07, 0.08, 0.09, 0.1, 0.11, 0.125, 0.175, 0.2, 0.31, 0.4, 0.51,
1328 0.63, 0.75, 0.78, 0.785, 0.79, 0.8, 0.89, 0.965, 1, 1.01, 1.015, 1.02,
1329 1.035, 1.13, 1.25, 1.45, 1.65, 1.875, 2.075, 2.25, 2.475, 2.665, 2.85,
1330 2.99, 3.02, 3.035, 3.055, 3.07, 3.075, 3.09, 3.095, 3.1, 3.115, 3.13,
1331 3.225, 3.4, 3.85, 4.4, 5.5};
1333 const int startRun = 0;
1334 const int endRun = 200000;
1336 const int nPtBins = 40;
1337 const double lowPtBin = 0, hiPtBin = 20;
1339 mhEventCuts =
new TH1F(
"hEventCuts",
"Cuts used for analysis",20,0,20);
1340 addCutToHisto(mhEventCuts, 1,
"mVertexMode", mVertexMode);
1341 addCutToHisto(mhEventCuts, 2,
"|vtx_z|", mMaxVtxZ);
1342 addCutToHisto(mhEventCuts, 3,
"dz", mMaxVtxDz);
1343 addCutToHisto(mhEventCuts, 4,
"trk_pt_min", mMinTrkPt);
1344 addCutToHisto(mhEventCuts, 5,
"trk_pt_max", mMaxTrkPt);
1345 addCutToHisto(mhEventCuts, 6,
"trk_eta", mMaxTrkEta);
1346 addCutToHisto(mhEventCuts, 7,
"MinNHitsFit", mMinNHitsFit);
1347 addCutToHisto(mhEventCuts, 8,
"MinNHitsDedx", mMinNHitsDedx);
1348 addCutToHisto(mhEventCuts, 9,
"MinNHitsFrac", mMinFitHitsFraction);
1349 addCutToHisto(mhEventCuts, 10,
"mMaxDca", mMaxDca);
1350 addCutToHisto(mhEventCuts, 11,
"mMinNsigmaPi", mMinNsigmaPi);
1351 addCutToHisto(mhEventCuts, 12,
"mMaxNsigmaPi", mMaxNsigmaPi);
1352 addCutToHisto(mhEventCuts, 13,
"mMinMuonDeltaZ", mMinMuonDeltaZ);
1353 addCutToHisto(mhEventCuts, 14,
"mMaxMuonDeltaZ", mMaxMuonDeltaZ);
1354 addCutToHisto(mhEventCuts, 15,
"mMinMuonDeltaY", mMinMuonDeltaY);
1355 addCutToHisto(mhEventCuts, 16,
"mMaxMuonDeltaY", mMaxMuonDeltaY);
1356 addCutToHisto(mhEventCuts, 17,
"mMinMuonDeltaTof", mMinMuonDeltaTof);
1357 addCutToHisto(mhEventCuts, 18,
"mMaxMuonDeltaTof", mMaxMuonDeltaTof);
1358 addCutToHisto(mhEventCuts, 19,
"mMinMuonPt", mMinMuonPt);
1359 addCutToHisto(mhEventCuts, 20,
"mMtdHitTrigger", mMtdHitTrigger);
1360 AddHist(mhEventCuts);
1362 const Int_t nbins = 4 + mTriggerIDs.size();
1363 mhEventStat =
new TH1F(
"hEventStat",
"Event statistics",nbins,0.,(Float_t)nbins);
1364 mhEventStat->GetXaxis()->SetBinLabel(1,
"All events");
1365 mhEventStat->GetXaxis()->SetBinLabel(2,
"Good trigger");
1366 mhEventStat->GetXaxis()->SetBinLabel(3,
"VPD");
1367 mhEventStat->GetXaxis()->SetBinLabel(4,
"Vtx Cuts");
1368 for(UInt_t i=0; i<mTriggerIDs.size(); i++)
1370 mhEventStat->GetXaxis()->SetBinLabel(i+5,Form(
"%d",mTriggerIDs[i]));
1372 AddHist(mhEventStat);
1374 mhRunId =
new TH1F(
"hRunId",
"Number of events per run",endRun-startRun+1,startRun-0.5,endRun+0.5);
1377 mhZdcRate =
new TH1F(
"hZdcRate",
"ZDC coincidence distribution;ZDC (kHz)",500,0,500);
1380 mhBbcRate =
new TH1F(
"hBbcRate",
"BBC coincidence distribution;BBC (kHz)",500,0,5000);
1384 mhVtxZvsVpdVzDefault =
new TH2F(
"hVtxZvsVpdVzDefault",
"Primary vertex z: VPD vs TPC (default);vz_{TPC} (cm);vz_{VPD} (cm)",201,-201,201,201,-201,201);
1385 AddHist(mhVtxZvsVpdVzDefault);
1387 mhVtxZDiffDefault =
new TH1F(
"hVtxZDiffDefault",
"TPC vz - VPD vz (default); #Deltavz (cm)",200,-20,20);
1388 AddHist(mhVtxZDiffDefault);
1390 mhVtxClosestIndex =
new TH1F(
"hVtxClosestIndex",
"TPC vertex index closest to VPD (ranking>0)",50,0,50);
1391 AddHist(mhVtxClosestIndex);
1393 mhVtxZvsVpdVzClosest =
new TH2F(
"hVtxZvsVpdVzClosest",
"Primary vertex z: VPD vs TPC (closest);vz_{TPC} (cm);vz_{VPD} (cm)",201,-201,201,201,-201,201);
1394 AddHist(mhVtxZvsVpdVzClosest);
1396 mhVtxZDiffClosest =
new TH1F(
"hVtxZDiffClosest",
"TPC vz - VPD vz (closest); #Deltavz (cm)",200,-20,20);
1397 AddHist(mhVtxZDiffClosest);
1399 mhVertexXY =
new TH2F(
"hVertexXY",
"Primary vertex y vs x (TPC);vx_{TPC} (cm);vy_{TPC} (cm)",100,-5,5,100,-5,5);
1400 AddHist(mhVertexXY);
1402 mhVertexXZ =
new TH2F(
"hVertexXZ",
"Primary vertex x vs z (TPC);vz_{TPC} (cm);vx_{TPC} (cm)",201,-201,201,100,-5,5);
1403 AddHist(mhVertexXZ);
1405 mhVertexYZ =
new TH2F(
"hVertexYZ",
"Primary vertex y vs z (TPC);vz_{TPC} (cm);vy_{TPC} (cm)",201,-201,201,100,-5,5);
1406 AddHist(mhVertexYZ);
1408 mhVertexZ =
new TH1F(
"hVertexZ",
"Primary vertex z (TPC); vz_{TPC} (cm)",201,-201,201);
1411 mhVtxZDiffVsTpcVz =
new TH2F(
"hVtxZDiffVsTpcVz",
"Vertex z difference vs vz_{TPC};vz_{TPC} (cm);#Deltavz (cm)",201,-201,201,200,-20,20);
1412 AddHist(mhVtxZDiffVsTpcVz);
1414 mhVpdVz =
new TH1F(
"hVpdVz",
"VPD z distribution; vz_{VPD} (cm)",201,-201,201);
1417 mhVtxZDiff =
new TH1F(
"hVtxZDiff",
"TPC vz - VPD vz distribution; #Deltavz (cm)",200,-20,20);
1418 AddHist(mhVtxZDiff);
1421 mhRefMult =
new TH1F(
"hRefMult",
"RefMult distribution;RefMult",500,0,1000);
1424 mhgRefMult =
new TH1F(
"hgRefMult",
"gRefMult distribution;gRefMult",500,0,1000);
1425 AddHist(mhgRefMult);
1427 mhgRefMultVsRefMult =
new TH2F(
"hgRefMultVsRefMult",
"gRefMult vs. RefMult;RefMult;gRefMult",500,0,1000,500,0,1000);
1428 AddHist(mhgRefMultVsRefMult);
1430 mhTpcVzVsRefMult =
new TH2F(
"hTpcVzVsRefMult",
"TPC v_{z} vs. RefMult;RefMult;vz_{TPC} (cm)",500,0,1000,201,-201,201);
1431 AddHist(mhTpcVzVsRefMult);
1433 mhDiffVzVsRefMult =
new TH2F(
"hDiffVzVsRefMult",
"TPC-VPD v_{z} vs. RefMult;RefMult;#Deltavz (cm)",500,0,1000,200,-20,20);
1434 AddHist(mhDiffVzVsRefMult);
1436 mhZdcRateVsRefMult =
new TH2F(
"hZdcRateVsRefMult",
"ZDC rate vs. RefMult;RefMult;ZDC (kHz)",500,0,1000,500,0,5000);
1437 AddHist(mhZdcRateVsRefMult);
1439 mhBbcRateVsRefMult =
new TH2F(
"hBbcRateVsRefMult",
"BBC rate vs. RefMult;RefMult;BBC (kHz)",500,0,1000,500,0,5000);
1440 AddHist(mhBbcRateVsRefMult);
1442 mhTofMultVsRefMult =
new TH2F(
"hTofMultVsRefMult",
"TofMult vs. RefMult;RefMult;TofMult",500,0,1000,500,0,5000);
1443 AddHist(mhTofMultVsRefMult);
1446 mhNTrk =
new TH1F(
"hNTrk",
"Number of good primary tracks per event;N",1000,0,1000);
1449 mhTrkPt =
new TH1F(
"hTrkPt",
"p_{T} of primary tracks;p_{T} (GeV/c)",nPtBins,lowPtBin,hiPtBin);
1452 mhTrkDcaVsPt =
new TH2F(
"hTrkDcaVsPt",
"Primary tracks: DCA vs p_{T};p_{T} (GeV/c);dca (cm)",nPtBins,lowPtBin,hiPtBin,35,0,3.5);
1453 AddHist(mhTrkDcaVsPt);
1455 mhTrkPhiVsPt =
new TH2F(
"hTrkPhiVsPt",
"Primary tracks: #varphi vs p_{T};p_{T} (GeV/c);#varphi",nPtBins,lowPtBin,hiPtBin,120,0,2*pi);
1456 AddHist(mhTrkPhiVsPt);
1458 mhTrkEtaVsPt =
new TH2F(
"hTrkEtaVsPt",
"Primary tracks: #eta vs p_{T};p_{T} (GeV/c);#eta",nPtBins,lowPtBin,hiPtBin,60,-1.2,1.2);
1459 AddHist(mhTrkEtaVsPt);
1461 mhTrkPhiEta =
new TH2F(
"hTrkPhiEta",
"Primary tracks: #varphi vs #eta (p_{T} > 1 GeV/c);#eta;#varphi",60,-1.2,1.2,120,0,2*pi);
1462 AddHist(mhTrkPhiEta);
1464 mhTrkNHitsFitVsPt =
new TH2F(
"hTrkNHitsFitVsPt",
"Primary tracks: NHitsFit vs p_{T};p_{T} (GeV/c);NHitsFit",nPtBins,lowPtBin,hiPtBin,45,0,45);
1465 AddHist(mhTrkNHitsFitVsPt);
1467 mhTrkNHitsPossVsPt =
new TH2F(
"hTrkNHitsPossVsPt",
"Primary tracks: NHitsPoss vs p_{T};p_{T} (GeV/c);NHitsPoss",nPtBins,lowPtBin,hiPtBin,45,0,45);
1468 AddHist(mhTrkNHitsPossVsPt);
1470 mhTrkNHitsDedxVsPt =
new TH2F(
"hTrkNHitsDedxVsPt",
"Primary tracks: NHitsDedx vs p_{T};p_{T} (GeV/c);NHitsDedx",nPtBins,lowPtBin,hiPtBin,45,0,45);
1471 AddHist(mhTrkNHitsDedxVsPt);
1473 mhTrkDedxVsMom =
new TH2F(
"hTrkDedxVsMom",
"Primary tracks: dE/dx vs momentum;p (GeV/c);dE/dx (keV/cm)",nPtBins,lowPtBin,hiPtBin,100,0,10);
1474 AddHist(mhTrkDedxVsMom);
1476 mhTrkDedxVsPhi =
new TH2F(
"hTrkDedxVsPhi",
"Primary tracks: dE/dx vs #varphi (p > 1 GeV/c);#varphi;dE/dx (keV/cm)",120,0,2*pi,100,0,10);
1477 AddHist(mhTrkDedxVsPhi);
1479 mhTrkNsigmaPiVsMom =
new TH2F(
"hTrkNsigmaPiVsMom",
"Primary tracks: n#sigma_{#pi} vs momentum;p (GeV/c);n#sigma_{#pi}",nPtBins,lowPtBin,hiPtBin,100,-5,5);
1480 AddHist(mhTrkNsigmaPiVsMom);
1482 mhTrkM2VsMom =
new TH2F(
"hTrkM2VsMom",
"Primary tracks: m^{2} vs momentum;p (GeV/c);m^{2} (GeV/c^{2})^{2}",nPtBins,lowPtBin,hiPtBin,100,0,2);
1483 AddHist(mhTrkM2VsMom);
1485 mhTrkBetaVsMom =
new TH2F(
"hTrkBetaVsMom",
"Primary tracks: 1/#beta vs momentum;p (GeV/c);1/#beta",nPtBins,lowPtBin,hiPtBin,100,0,5);
1486 AddHist(mhTrkBetaVsMom);
1488 mhTofMthTrkLocaly =
new TH2F(
"hTofMthTrkLocaly",
"TOF match: local y vs tray;tray;local y (cm)",120,0.5,120.5,100,-5,5);
1489 AddHist(mhTofMthTrkLocaly);
1491 mhTofMthTrkLocalz =
new TH2F(
"hTofMthTrkLocalz",
"TOF match: local z vs module;module;local z (cm)",64,0.5,64.5,100,-5,5);
1492 AddHist(mhTofMthTrkLocalz);
1495 mhMtdQTAdcAll =
new TH2F(
"hMtdQTAdcAll",
"MTD QT: ADC vs channel (All);;ADC",64,0.5,64.5,350,0,3500);
1496 AddHist(mhMtdQTAdcAll);
1498 mhMtdQTTacAll =
new TH2F(
"hMtdQTTacAll",
"MTD QT: TAC vs channel (All);;TAC",64,0.5,64.5,300,0,3000);
1499 AddHist(mhMtdQTTacAll);
1501 mhMtdQTAdcVsTacAll =
new TH2F(
"hMtdQTAdcVsTacAll",
"MTD QT: ADC vs. TAC (All);TAC;ADC",350,0,3500,350,0,3500);
1502 AddHist(mhMtdQTAdcVsTacAll);
1504 mhMtdQTJ2J3Diff =
new TH2F(
"hMtdQTJ2J3Diff",
"MTD QT: J3-J2 TAC vs channel;;TAC (J3-J2)",32,0.5,32.5,160,-800,800);
1505 AddHist(mhMtdQTJ2J3Diff);
1507 mhMtdVpdTacDiffMT001 =
new TH2F(
"hMtdVpdTacDiffMT001",
"QT: MTD-VPD tac difference (All);;tac_{MTD}-tac_{VPD}",32,0.5,32.5,1000,500,1500);
1508 AddHist(mhMtdVpdTacDiffMT001);
1510 mhMtdVpdTacDiffMT001Mth =
new TH2F(
"hMtdVpdTacDiffMT001Mth",
"QT: MTD-VPD tac difference (Track matched);;tac_{MTD}-tac_{VPD}",32,0.5,32.5,1000,500,1500);
1511 AddHist(mhMtdVpdTacDiffMT001Mth);
1513 mhMtdVpdTacDiffMT001Muon =
new TH2F(
"hMtdVpdTacDiffMT001Muon",
"QT: MTD-VPD tac difference (Muon PID);;tac_{MTD}-tac_{VPD}",32,0.5,32.5,1000,500,1500);
1514 AddHist(mhMtdVpdTacDiffMT001Muon);
1516 mhMtdVpdTacDiffMT101 =
new TH2F(
"hMtdVpdTacDiffMT101",
"MT101: MTD-VPD tac difference;;tac_{MTD}-tac_{VPD}+1024",32,0.5,32.5,1000,500,1500);
1517 AddHist(mhMtdVpdTacDiffMT101);
1519 mhMtdVpdTacDiffMT101Mth =
new TH2F(
"hMtdVpdTacDiffMT101Mth",
"MT101: MTD-VPD tac difference (Track matched);;tac_{MTD}-tac_{VPD}+1024",32,0.5,32.5,1000,500,1500);
1520 AddHist(mhMtdVpdTacDiffMT101Mth);
1522 mhMtdVpdTacDiffMT101Muon =
new TH2F(
"hMtdVpdTacDiffMT101Muon",
"MT101: MTD-VPD tac difference (Muon PID);;tac_{MTD}-tac_{VPD}+1024",32,0.5,32.5,1000,500,1500);
1523 AddHist(mhMtdVpdTacDiffMT101Muon);
1525 for(Int_t i=0; i<64; i++)
1527 mhMtdQTAdcAll->GetXaxis()->SetBinLabel(i+1,qtlabel[i]);
1528 mhMtdQTTacAll->GetXaxis()->SetBinLabel(i+1,qtlabel[i]);
1530 for(Int_t i=0; i<32; i++)
1532 mhMtdVpdTacDiffMT001->GetXaxis()->SetBinLabel(i+1,qtlabel2[i]);
1533 mhMtdVpdTacDiffMT001Mth->GetXaxis()->SetBinLabel(i+1,qtlabel2[i]);
1534 mhMtdVpdTacDiffMT001Muon->GetXaxis()->SetBinLabel(i+1,qtlabel2[i]);
1535 mhMtdVpdTacDiffMT101->GetXaxis()->SetBinLabel(i+1,qtlabel2[i]);
1536 mhMtdVpdTacDiffMT101Mth->GetXaxis()->SetBinLabel(i+1,qtlabel2[i]);
1537 mhMtdVpdTacDiffMT101Muon->GetXaxis()->SetBinLabel(i+1,qtlabel2[i]);
1538 mhMtdQTJ2J3Diff->GetXaxis()->SetBinLabel(i+1,qtlabel2[i]);
1541 for(Int_t i=0; i<kNQTboard; i++)
1543 for(Int_t j=0; j<2; j++)
1545 mhMixMtdTacSumvsMxqMtdTacSum[i][j] =
new TH2F(Form(
"hMixMtdTacSumvsMxqMtdTacSum_QT%d_%d",i+1,j),Form(
"MTD QT%d: MIX vs MXQ at %d;mxq_mtdtacsum;mix_mtdtacsum",i+1,j),1024,0,1024,1024,0,1024);
1546 AddHist(mhMixMtdTacSumvsMxqMtdTacSum[i][j]);
1550 mhNQtSignal =
new TH1F(
"hNQtSignal",
"Number of good QT signals;N",10,0,10);
1551 AddHist(mhNQtSignal);
1553 mhNMT101Signal =
new TH1F(
"hNMT101Signal",
"Number of good MT101 signals;N",10,0,10);
1554 AddHist(mhNMT101Signal);
1556 mhNTF201Signal =
new TH1F(
"hNTF201Signal",
"Number of good TF201 signals;N",10,0,10);
1557 AddHist(mhNTF201Signal);
1561 mhMtdTriggerTime[0] =
new TH1F(
"hMtdTriggerTime0",
"MTD: trigger time for backleg 16-30;t",120,0,1.2e5);
1562 AddHist(mhMtdTriggerTime[0]);
1564 mhMtdTriggerTime[1] =
new TH1F(
"hMtdTriggerTime1",
"MTD: trigger time for backleg 1-15;t",120,0,1.2e5);
1565 AddHist(mhMtdTriggerTime[1]);
1568 mhMtdNRawHits =
new TH1F(
"hMtdNRawHits",
"Number of raw MTD hits per event;N",100,0,100);
1569 AddHist(mhMtdNRawHits);
1571 mhMtdRawHitMap =
new TH2F(
"hMtdRawHitMap",
"MTD: channel vs backleg of raw hits;backleg;channel",30,0.5,30.5,120,0.5,120.5);
1572 AddHist(mhMtdRawHitMap);
1574 mhMtdRawHitLeTime =
new TH2F(
"hMtdRawHitLeTime",
"MTD: leading time of raw hit;channel;t_{leading} (ns)",3601,-0.5,3600.5,128,0,51200);
1575 AddHist(mhMtdRawHitLeTime);
1577 mhMtdRawHitTrTime =
new TH2F(
"hMtdRawHitTrTime",
"MTD: trailing time of raw hit;channel;t_{trailing} (ns)",3601,-0.5,3600.5,128,0,51200);
1578 AddHist(mhMtdRawHitTrTime);
1580 mhMtdRawHitLeNDiff =
new TH2F(
"hMtdRawHitLeNDiff",
"MTD: difference in leading raw hit rates (west-east);channel;nLeRawHit: West - East",1801,-0.5,1800.5,11,-5.5,5.5);
1581 AddHist(mhMtdRawHitLeNDiff);
1583 mhMtdRawHitTrNDiff =
new TH2F(
"hMtdRawHitTrNDiff",
"MTD: difference in trailing raw hit rates (west-east);channel;nTrRawHit: West - East",1801,-0.5,1800.5,11,-5.5,5.5);
1584 AddHist(mhMtdRawHitTrNDiff);
1586 mhMtdRawHitLeNEast =
new TH1F(
"hMtdRawHitLeNEast",
"MTD: number of leading raw hit (east);channel;N_{leading,east}",1801,-0.5,1800.5);
1587 AddHist(mhMtdRawHitLeNEast);
1589 mhMtdRawHitLeNWest =
new TH1F(
"hMtdRawHitLeNWest",
"MTD: number of leading raw hit (west);channel;N_{leading,west}",1801,-0.5,1800.5);
1590 AddHist(mhMtdRawHitLeNWest);
1592 mhMtdRawHitTrNEast =
new TH1F(
"hMtdRawHitTrNEast",
"MTD: number of trailing raw hit (east);channel;N_{trailing,east}",1801,-0.5,1800.5);
1593 AddHist(mhMtdRawHitTrNEast);
1595 mhMtdRawHitTrNWest =
new TH1F(
"hMtdRawHitTrNWest",
"MTD: number of trailing raw hit (west);channel;N_{trailing,west}",1801,-0.5,1800.5);
1596 AddHist(mhMtdRawHitTrNWest);
1599 mhMtdNHits =
new TH1F(
"hMtdNHits",
"Number of MTD hits per event;N",50,0,50);
1600 AddHist(mhMtdNHits);
1602 mhMtdHitMap =
new TH2F(
"hMtdHitMap",
"MTD: channel vs backleg of hits;backleg;channel",30,0.5,30.5,60,-0.5,59.5);
1603 AddHist(mhMtdHitMap);
1605 mhMtdHitLeTimeDiff =
new TH2F(
"hMtdHitLeTimeDiff",
"MTD: (east-west) leading time of hits;channel;#Deltat_{leading} (ns)",1801,-0.5,1800.5,41,-20.5,20.5);
1606 AddHist(mhMtdHitLeTimeDiff);
1608 mhMtdHitTotWest =
new TH2F(
"hMtdHitTotWest",
"MTD: west TOT of hits;channel;tot (ns)",1801,-0.5,1800.5,50,0,50);
1609 AddHist(mhMtdHitTotWest);
1611 mhMtdHitTotEast =
new TH2F(
"hMtdHitTotEast",
"MTD: east TOT of hits;channel;tot (ns)",1801,-0.5,1800.5,50,0,50);
1612 AddHist(mhMtdHitTotEast);
1614 const int nBinsTrigTime = 750;
1615 const double minTrigTime = 2000, maxTrigTime = 3500;
1617 mhMtdHitTrigTime =
new TH2F(
"hMtdHitTrigTime",
"MTD: trigger time of hit (west+east)/2;channel;tdc-t_{trigger} (ns)",1801,-0.5,1800.5,nBinsTrigTime,minTrigTime,maxTrigTime);
1618 AddHist(mhMtdHitTrigTime);
1620 mhMtdHitTrigTimeTrkMth =
new TH2F(
"hMtdHitTrigTimeTrkMth",
"MTD: trigger time of hits (Track matched);channel;tdc-t_{trigger} (ns)",1801,-0.5,1800.5,nBinsTrigTime,minTrigTime,maxTrigTime);
1621 AddHist(mhMtdHitTrigTimeTrkMth);
1623 mhMtdTrigNHits =
new TH1F(
"hMtdTrigNHits",
"Number of triggering MTD hits per event;N",50,0,50);
1624 AddHist(mhMtdTrigNHits);
1626 mhMtdTrigHitMap =
new TH2F(
"hMtdTrigHitMap",
"MTD: channel vs backleg of triggering hits;backleg;channel",30,0.5,30.5,60,-0.5,59.5);
1627 AddHist(mhMtdTrigHitMap);
1629 mhMtdTrigMthNHits =
new TH1F(
"hMtdTrigMthNHits",
"Number of triggering MTD hits matched to tracks;N",50,0,50);
1630 AddHist(mhMtdTrigMthNHits);
1632 mhMtdTrigMthHitMap =
new TH2F(
"hMtdTrigMthHitMap",
"MTD: channel vs backleg of triggering hits matched to tracks;backleg;channel",30,0.5,30.5,60,-0.5,59.5);
1633 AddHist(mhMtdTrigMthHitMap);
1636 mhMtdNMatchHits =
new TH1F(
"mhMtdNMatchHits",
"Number of matched MTD hits per event;N",50,0,50);
1637 AddHist(mhMtdNMatchHits);
1639 mhMtdMatchHitMap =
new TH2F(
"hMtdMatchHitMap",
"MTD: channel vs backleg of matched hits;backleg;channel",30,0.5,30.5,60,-0.5,59.5);
1640 AddHist(mhMtdMatchHitMap);
1642 mhMtdMatchTrkPt =
new TH1F(
"hMtdMatchTrkPt",
"MTD: p_{T} of matched primary tracks;p_{T} (GeV/c)",nPtBins,lowPtBin,hiPtBin);
1643 AddHist(mhMtdMatchTrkPt);
1645 mhMtdMatchTrkPhiEta =
new TH2F(
"hMtdMatchTrkPhiEta",
"MTD: #varphi vs #eta of matched primary tracks;#eta;#varphi",60,-1.2,1.2,120,0,2*pi);
1646 AddHist(mhMtdMatchTrkPhiEta);
1648 mhMtdMatchTrkPhiPt =
new TH2F(
"hMtdMatchTrkPhiPt",
"MTD: #varphi vs p_{T} of matched primary tracks;p_{T} (GeV/c);#varphi",nPtBins,lowPtBin,hiPtBin,120,0,2*pi);
1649 AddHist(mhMtdMatchTrkPhiPt);
1651 mhMtdMatchDzVsChan =
new TH2F(
"hMtdMatchDzVsChan",
"MTD: #Deltaz distribution;channel;#Deltaz = z_{proj}-z_{hit} (cm)",1801,-0.5,1800.5,200,-100,100);
1652 AddHist(mhMtdMatchDzVsChan);
1654 mhMtdMatchDzVsPtPos =
new TH2F(
"hMtdMatchDzVsPtPos",
"MTD: #Deltaz vs p_{T} for positive tracks;p_{T} (GeV/c);#Deltaz (cm)",nPtBins,lowPtBin,hiPtBin,200,-100,100);
1655 AddHist(mhMtdMatchDzVsPtPos);
1657 mhMtdMatchDzVsPtNeg =
new TH2F(
"hMtdMatchDzVsPtNeg",
"MTD: #Deltaz vs p_{T} for negative tracks;p_{T} (GeV/c);#Deltaz (cm)",nPtBins,lowPtBin,hiPtBin,200,-100,100);
1658 AddHist(mhMtdMatchDzVsPtNeg);
1660 mhMtdMatchDyVsChan =
new TH2F(
"hMtdMatchDyVsChan",
"MTD: #Deltay distribution;channel;#Deltay = y_{proj}-y_{hit} (cm)",1801,-0.5,1800.5,200,-100,100);
1661 AddHist(mhMtdMatchDyVsChan);
1663 mhMtdMatchDyVsPtPos =
new TH2F(
"hMtdMatchDyVsPtPos",
"MTD: #Deltay vs p_{T} for positive tracks;p_{T} (GeV/c);#Deltay (cm)",nPtBins,lowPtBin,hiPtBin,200,-100,100);
1664 AddHist(mhMtdMatchDyVsPtPos);
1666 mhMtdMatchDyVsPtNeg =
new TH2F(
"hMtdMatchDyVsPtNeg",
"MTD: #Deltay vs p_{T} for negative tracks;p_{T} (GeV/c);#Deltay (cm)",nPtBins,lowPtBin,hiPtBin,200,-100,100);
1667 AddHist(mhMtdMatchDyVsPtNeg);
1669 mhMtdMatchDtofVsPt =
new TH2F(
"hMtdMatchDtofVsPt",
"MTD: #Deltatof vs p_{T} distribution;p_{T} (GeV/c);#Deltatof (ns)",nPtBins,lowPtBin,hiPtBin,100,-5,5);
1670 AddHist(mhMtdMatchDtofVsPt);
1672 mhMtdMatchMtdTofVsChan =
new TH2F(
"hMtdMatchMtdTofVsChan",
"MTD: MTD time vs channel of primary tracks;channel;tof_{MTD} (ns)",1800,-0.5,1799.5,300,0,30);
1673 AddHist(mhMtdMatchMtdTofVsChan);
1675 mhMtdMatchExpTofVsChan =
new TH2F(
"hMtdMatchExpTofVsChan",
"MTD: TPC time vs channel of primary tracks;channel;tof_{expected} (ns)",1800,-0.5,1799.5,300,0,30);
1676 AddHist(mhMtdMatchExpTofVsChan);
1678 mhMtdMatchDtofVsChan =
new TH2F(
"hMtdMatchDtofVsChan",
"MTD: #Deltatof distribution;channel;#Deltatof (ns)",1801,-0.5,1800.5,100,-5,5);
1679 AddHist(mhMtdMatchDtofVsChan);
1681 mhMtdMatchLocalyVsChan =
new TH2F(
"hMtdMatchLocalyVsChan",
"MTD: local y of matched tracks;channel;y (cm)",1801,-0.5,1800.5,100,-50.5,49.5);
1682 AddHist(mhMtdMatchLocalyVsChan);
1684 mhMtdMatchLocalzVsChan =
new TH2F(
"hMtdMatchLocalzVsChan",
"MTD: local z of matched tracks;channel;z (cm)",1801,-0.5,1800.5,100,-50.5,49.5);
1685 AddHist(mhMtdMatchLocalzVsChan);
1688 mhNMuonPos =
new TH1F(
"hNMuonPos",
"Number of positive muon candidates per event;N",5,-0.5,4.5);
1689 AddHist(mhNMuonPos);
1691 mhNMuonNeg =
new TH1F(
"hNMuonNeg",
"Number of negative muon candidates per event;N",5,-0.5,4.5);
1692 AddHist(mhNMuonNeg);
1694 mhMuonPt =
new TH1F(
"hMuonPt",
"p_{T} distribution of muon candidates;p_{T} (GeV/c)",nPtBins,lowPtBin,hiPtBin);
1697 mhMuonPhiVsEta =
new TH2F(
"hMuonPhiVsEta",
"#varphi vs #eta of muon candidates;#eta;#varphi",60,-1.2,1.2,120,0,2*pi);
1698 AddHist(mhMuonPhiVsEta);
1700 mhMuonMap =
new TH2F(
"hMuonMap",
"Channel vs backleg of muon candidates;backleg;channel",30,0.5,30.5,60,0.5,60.5);
1703 mhNULpair =
new TH1F(
"hNULpair",
"Number of unlike-sign pairs per event;N",5,-0.5,4.5);
1706 mhNLSpairPos =
new TH1F(
"hNLSpairPos",
"Number of positive like-sign pairs per event;N",5,-0.5,4.5);
1707 AddHist(mhNLSpairPos);
1709 mhNLSpairNeg =
new TH1F(
"hNLSpairNeg",
"Number of negative like-sign pairs per event;N",5,-0.5,4.5);
1710 AddHist(mhNLSpairNeg);
1712 mhInvMvsPtUL =
new TH2F(
"hInvMvsPtUL",
" p_{T} vs M_{#mu#mu} for unlike-sign pairs;M_{#mu#mu} (GeV/c^2);p_{T} (GeV/c)",300,0,15,10,0,10);
1713 AddHist(mhInvMvsPtUL);
1715 mhInvMvsPtLSpos =
new TH2F(
"hInvMvsPtLSpos",
" p_{T} vs M_{#mu#mu} for positive like-sign pairs;M_{#mu#mu} (GeV/c^2);p_{T} (GeV/c)",300,0,15,10,0,10);
1716 AddHist(mhInvMvsPtLSpos);
1718 mhInvMvsPtLSneg =
new TH2F(
"hInvMvsPtLSneg",
" p_{T} vs M_{#mu#mu} for negative like-sign pairs;M_{#mu#mu} (GeV/c^2);p_{T} (GeV/c)",300,0,15,10,0,10);
1719 AddHist(mhInvMvsPtLSneg);
1721 mhInvMUL =
new TH1F(
"hInvMUL",
"M_{#mu#mu} for unlike-sign pairs;M_{#mu#mu} (GeV/c^2)",nSpecMBins,specM);
1724 mhInvMLSpos =
new TH1F(
"hInvMLSpos",
"M_{#mu#mu} for positive like-sign pairs;M_{#mu#mu} (GeV/c^2)",nSpecMBins,specM);
1725 AddHist(mhInvMLSpos);
1727 mhInvMLSneg =
new TH1F(
"hInvMLSneg",
"M_{#mu#mu} for negative like-sign pairs;M_{#mu#mu} (GeV/c^2)",nSpecMBins,specM);
1728 AddHist(mhInvMLSneg);
1730 int nRun = endRun-startRun+1;
1731 double run_lowBin = startRun - 0.5;
1732 double run_highBin = endRun + 0.5;
1734 mhBBCrateVsRun =
new TProfile(
"mhBBCrateVsRun",
"BBC rate vs run; run index; BBC rate (kHz)",nRun, run_lowBin, run_highBin);
1735 AddHist((TH1*)mhBBCrateVsRun);
1737 mhZDCrateVsRun =
new TProfile(
"mhZDCrateVsRun",
"ZDC rate vs run; run index; ZDC rate (kHz)",nRun, run_lowBin, run_highBin);
1738 AddHist((TH1*)mhZDCrateVsRun);
1740 mhRefMultVsRun =
new TProfile(
"mhRefMultVsRun",
"Reference multiplicity vs run; run index; RefMult",nRun, run_lowBin, run_highBin);
1741 AddHist((TH1*)mhRefMultVsRun);
1743 mhgRefMultVsRun =
new TProfile(
"mhgRefMultVsRun",
"Global reference multiplicity vs run; run index; gRefMult",nRun, run_lowBin, run_highBin);
1744 AddHist((TH1*)mhgRefMultVsRun);
1746 mhTpcVxVsRun =
new TProfile(
"mhTpcVxVsRun",
"TPC v_{x} vs run; run index; TPC v_{x} (cm)",nRun, run_lowBin, run_highBin);
1747 AddHist((TH1*)mhTpcVxVsRun);
1749 mhTpcVyVsRun =
new TProfile(
"mhTpcVyVsRun",
"TPC v_{y} vs run; run index; TPC v_{y} (cm)",nRun, run_lowBin, run_highBin);
1750 AddHist((TH1*)mhTpcVyVsRun);
1752 mhTpcVzVsRun =
new TProfile(
"mhTpcVzVsRun",
"TPC v_{z} vs run; run index; TPC v_{z} (cm)",nRun, run_lowBin, run_highBin);
1753 AddHist((TH1*)mhTpcVzVsRun);
1755 mhVpdVzVsRun =
new TProfile(
"mhVpdVzVsRun",
"VPD v_{z} vs run; run index; VPD v_{z} (cm)",nRun, run_lowBin, run_highBin);
1756 AddHist((TH1*)mhVpdVzVsRun);
1758 mhDiffVzVsRun =
new TProfile(
"mhDiffVzVsRun",
"TPC-VPD v_{z} vs run; run index;#Deltav_{z} (cm)",nRun, run_lowBin, run_highBin);
1759 AddHist((TH1*)mhDiffVzVsRun);
1761 mhpTrkPtVsRun =
new TProfile(
"mhpTrkPtVsRun",
"Primary track p_{T} vs run; run index; p_{T,trk} (GeV/c)",nRun, run_lowBin, run_highBin);
1762 AddHist((TH1*)mhpTrkPtVsRun);
1764 mhpTrkEtaVsRun =
new TProfile(
"mhpTrkEtaVsRun",
"Primary track #eta vs run; run index; #eta_{trk}",nRun, run_lowBin, run_highBin);
1765 AddHist((TH1*)mhpTrkEtaVsRun);
1767 mhpTrkPhiVsRun =
new TProfile(
"mhpTrkPhiVsRun",
"Primary track #varphi vs run; run index; #varphi_{trk}",nRun, run_lowBin, run_highBin);
1768 AddHist((TH1*)mhpTrkPhiVsRun);
1770 mhpTrkDcaVsRun =
new TProfile(
"mhpTrkDcaVsRun",
"Primary track DCA vs run; run index; DCA (cm)",nRun, run_lowBin, run_highBin);
1771 AddHist((TH1*)mhpTrkDcaVsRun);
1773 mhNHitsFitVsRun =
new TProfile(
"mhNHitsFitVsRun",
"Primary track NHitsFit vs run; run index; NhitsFit",nRun, run_lowBin, run_highBin);
1774 AddHist((TH1*)mhNHitsFitVsRun);
1776 mhNHitsPossVsRun =
new TProfile(
"mhNHitsPossVsRun",
"Primary track NHitsPoss vs run; run index; NHitsPoss",nRun, run_lowBin, run_highBin);
1777 AddHist((TH1*)mhNHitsPossVsRun);
1779 mhNHitsDedxVsRun =
new TProfile(
"mhNHitsDedxVsRun",
"Primary track NHitsDedx vs run; run index; NhitsDedx",nRun, run_lowBin, run_highBin);
1780 AddHist((TH1*)mhNHitsDedxVsRun);
1782 mhDedxVsRun =
new TProfile(
"mhDedxVsRun",
"Primary track dE/dx vs run; run index; dE/dx (keV/cm)",nRun, run_lowBin, run_highBin);
1783 AddHist((TH1*)mhDedxVsRun);
1785 mhNsigmaPiVsRun =
new TProfile(
"mhNsigmaPiVsRun",
"Primary track n#sigma_{#pi} vs run; run index; n#sigma_{#pi}",nRun, run_lowBin, run_highBin);
1786 AddHist((TH1*)mhNsigmaPiVsRun);
1788 mhNsigmaEVsRun =
new TProfile(
"mhNsigmaEVsRun",
"Primary track n#sigma_{e} vs run; run index; n#sigma_{e}",nRun, run_lowBin, run_highBin);
1789 AddHist((TH1*)mhNsigmaEVsRun);
1791 mhNsigmaKVsRun =
new TProfile(
"mhNsigmaKVsRun",
"Primary track n#sigma_{K} vs run; run index; n#sigma_{K}",nRun, run_lowBin, run_highBin);
1792 AddHist((TH1*)mhNsigmaKVsRun);
1794 mhNsigmaPVsRun =
new TProfile(
"mhNsigmaPVsRun",
"Primary track n#sigma_{P} vs run; run index; n#sigma_{P}",nRun, run_lowBin, run_highBin);
1795 AddHist((TH1*)mhNsigmaPVsRun);
1797 mhBetaVsRun =
new TProfile(
"mhBetaVsRun",
"Primary track 1/#beta vs run; run index; 1/#beta",nRun, run_lowBin, run_highBin);
1798 AddHist((TH1*)mhBetaVsRun);
1800 mhNMtdHitsVsRun =
new TProfile(
"mhNMtdHitsVsRun",
"Number of MTD hits per event vs run; run index; N",nRun, run_lowBin, run_highBin);
1801 AddHist((TH1*)mhNMtdHitsVsRun);
1803 mhNMtdTrigHitsVsRun =
new TProfile(
"mhNMtdTrigHitsVsRun",
"Number of triggering MTD hits per event vs run; run index; N",nRun, run_lowBin, run_highBin);
1804 AddHist((TH1*)mhNMtdTrigHitsVsRun);
1806 mhNMtdMthHitsVsRun =
new TProfile(
"mhNMtdMthHitsVsRun",
"Number of matched MTD hits per event vs run; run index; N",nRun, run_lowBin, run_highBin);
1807 AddHist((TH1*)mhNMtdMthHitsVsRun);
1809 mhNMuonPosVsRun =
new TProfile(
"mhNMuonPosVsRun",
"Number of positive muon candidates per event vs run; run index; N",nRun, run_lowBin, run_highBin);
1810 AddHist((TH1*)mhNMuonPosVsRun);
1812 mhNMuonNegVsRun =
new TProfile(
"mhNMuonNegVsRun",
"Number of negative muon candidates per event vs run; run index; N",nRun, run_lowBin, run_highBin);
1813 AddHist((TH1*)mhNMuonNegVsRun);
1815 mhNMuonPairULVsRun =
new TProfile(
"mhNMuonPairULVsRun",
"Number of unlike-sign muon pairs per event vs run; run index; N",nRun, run_lowBin, run_highBin);
1816 AddHist((TH1*)mhNMuonPairULVsRun);
1818 mhNMuonPairLSPosVsRun =
new TProfile(
"mhNMuonPairLSPosVsRun",
"Number of positve like-sign muon pairs per event vs run; run index; N",nRun, run_lowBin, run_highBin);
1819 AddHist((TH1*)mhNMuonPairLSPosVsRun);
1821 mhNMuonPairLSNegVsRun =
new TProfile(
"mhNMuonPairLSNegVsRun",
"Number of negative like-sign muon pairs per event vs run; run index; N",nRun, run_lowBin, run_highBin);
1822 AddHist((TH1*)mhNMuonPairLSNegVsRun);
1827 void StMtdQAMaker::printConfig()
1829 const char *decision[2] = {
"no",
"yes"};
1830 const char *vtxmode[2] = {
"default",
"closest to VPD"};
1831 printf(
"=== Configuration for StMtdQAMaker ===\n");
1832 printf(
"Use vertex that is %s\n",vtxmode[mVertexMode]);
1833 printf(
"Maximum vertex z: %1.0f\n",mMaxVtxZ);
1834 printf(
"Maximum vertex r: %1.0f\n",mMaxVtxR);
1835 printf(
"Maximum vz diff: %1.0f\n",mMaxVtxDz);
1836 printf(
"Track pt range: [%1.2f, %1.2f]\n",mMinTrkPt,mMaxTrkPt);
1837 printf(
"Track phi range: [%1.2f, %1.2f]\n",mMinTrkPhi,mMaxTrkPhi);
1838 printf(
"Track eta range: [%1.2f, %1.2f]\n",mMinTrkEta,mMaxTrkEta);
1839 printf(
"Minimum number of fit hits: %d\n",mMinNHitsFit);
1840 printf(
"Minimum number of dedx hits: %d\n",mMinNHitsDedx);
1841 printf(
"Minimum fraction of fit hits: %4.2f\n",mMinFitHitsFraction);
1842 printf(
"Maximum dca: %1.2f\n",mMaxDca);
1843 printf(
"Muon PID cuts:\n");
1844 printf(
" pt > %1.1f GeV/c \n", mMinMuonPt);
1845 printf(
" %1.1f < NsigmaPi < %1.1f\n",mMinNsigmaPi,mMaxNsigmaPi);
1846 printf(
" MTD hit trigger: %s\n",decision[mMtdHitTrigger]);
1847 printf(
" %1.0f < dz < %1.0f cm\n",mMinMuonDeltaZ,mMaxMuonDeltaZ);
1848 printf(
" %1.0f < dy < %1.0f cm\n",mMinMuonDeltaY,mMaxMuonDeltaY);
1849 printf(
" %1.1f < dtof < %1.1f ns\n",mMinMuonDeltaTof,mMaxMuonDeltaTof);
1850 printf(
"=======================================\n");
1854 Int_t StMtdQAMaker::getMtdHitTHUB(
const Int_t backleg)
const
1856 if(backleg>=1 && backleg<=15)
return 2;
1857 else if (backleg>=16 && backleg<=30)
return 1;
1865 Float_t pt = mom.perp();
1866 Float_t eta = mom.pseudoRapidity();
1867 Float_t phi = rotatePhi(mom.phi());
1869 if(pt < mMinTrkPt || pt > mMaxTrkPt)
return kFALSE;
1870 if(eta < mMinTrkEta || eta > mMaxTrkEta)
return kFALSE;
1871 if(phi < mMinTrkPhi || phi > mMaxTrkPhi)
return kFALSE;
1873 Int_t nHitsFit = track->fitTraits().numberOfFitPoints(kTpcId);
1874 if(nHitsFit<mMinNHitsFit)
return kFALSE;
1876 Int_t nHitsPoss = track->numberOfPossiblePoints(kTpcId);
1877 if(nHitsFit/(1.0*nHitsPoss)<mMinFitHitsFraction)
return kFALSE;
1881 if(!pd || !pidAlgorithm.traits())
return kFALSE;
1882 if(pidAlgorithm.traits()->numberOfPoints()<mMinNHitsDedx)
return kFALSE;
1885 if(!globalTrack)
return kFALSE;
1886 THelixTrack thelix = globalTrack->dcaGeometry()->thelix();
1887 const Double_t *pos = thelix.Pos();
1889 if(dcaGlobal.mag()>mMaxDca)
return kFALSE;
1896 Bool_t StMtdQAMaker::isValidTrack(
const StMuTrack *track)
const
1898 if(!track)
return kFALSE;
1900 Double_t pt = mom.perp();
1901 Double_t eta = mom.pseudoRapidity();
1902 Double_t phi = rotatePhi(mom.phi());
1904 if(pt < mMinTrkPt || pt > mMaxTrkPt)
return kFALSE;
1905 if(eta < mMinTrkEta || eta > mMaxTrkEta)
return kFALSE;
1906 if(phi < mMinTrkPhi || phi > mMaxTrkPhi)
return kFALSE;
1907 if(track->
nHitsFit(kTpcId)<mMinNHitsFit)
return kFALSE;
1908 if(track->
nHitsFit(kTpcId)/(1.0*track->
nHitsPoss(kTpcId))<mMinFitHitsFraction)
return kFALSE;
1909 if(track->
nHitsDedx()<mMinNHitsDedx)
return kFALSE;
1910 if(track->
dcaGlobal().mag()>mMaxDca)
return kFALSE;
1915 Bool_t StMtdQAMaker::isValidTrack(
const StPicoTrack *track)
const
1917 if(!track)
return kFALSE;
1918 TVector3 mom = track->
pMom();
1919 Float_t pt = mom.Perp();
1920 Float_t eta = mom.Eta();
1921 Float_t phi = rotatePhi(mom.Phi());
1923 if(pt < mMinTrkPt || pt > mMaxTrkPt)
return kFALSE;
1924 if(eta < mMinTrkEta || eta > mMaxTrkEta)
return kFALSE;
1925 if(phi < mMinTrkPhi || phi > mMaxTrkPhi)
return kFALSE;
1926 if(track->
nHitsFit()<mMinNHitsFit)
return kFALSE;
1927 if(track->
nHitsFit()/(1.0*track->
nHitsMax())<mMinFitHitsFraction)
return kFALSE;
1928 if(track->
nHitsDedx()<mMinNHitsDedx)
return kFALSE;
1930 if(dca>mMaxDca)
return kFALSE;
1935 Bool_t StMtdQAMaker::isMuonCandidate(
const StMuTrack *track)
1937 if(!track)
return kFALSE;
1938 Double_t pt = track->
momentum().perp();
1941 Double_t dz = -999., dy = -999, dtof = -999.;
1942 Bool_t isMtdTrig = kFALSE;
1943 Int_t iMtd = track->index2MtdHit();
1947 dy = mtdPid.deltaY();
1948 dz = mtdPid.deltaZ();
1949 dtof = mtdPid.
timeOfFlight() - mtdPid.expTimeOfFlight();
1952 isMtdTrig = mTrigUtil ? mTrigUtil->isHitFireTrigger(hit->backleg(), hit->module()) : kFALSE;
1955 return isMuonCandidate(pt, nSigmaPi, dz, dy, dtof, isMtdTrig);
1959 Bool_t StMtdQAMaker::isMuonCandidate(
const StPicoTrack *track)
1961 if(!track)
return kFALSE;
1962 Double_t pt = track->
pMom().Perp();
1965 double dz = -999., dy = -999, dtof = -999.;
1966 bool isMtdTrig = kFALSE;
1975 int hitIndex = getMtdHitIndex(track);
1980 return isMuonCandidate(pt, nSigmaPi, dz, dy, dtof, isMtdTrig);
1985 Bool_t StMtdQAMaker::isMuonCandidate(
const Double_t pt,
const Double_t nSigmaPi,
const Double_t dz,
const Double_t dy,
const Double_t dtof,
const Bool_t isTrig)
1987 if(pt<mMinMuonPt)
return kFALSE;
1988 if(nSigmaPi<mMinNsigmaPi || nSigmaPi>mMaxNsigmaPi)
return kFALSE;
1989 if(dz<mMinMuonDeltaZ || dz>mMaxMuonDeltaZ)
return kFALSE;
1990 if(dy<mMinMuonDeltaY || dy>mMaxMuonDeltaY)
return kFALSE;
1991 if(dtof<mMinMuonDeltaTof || dtof>mMaxMuonDeltaTof)
return kFALSE;
1992 if(mMtdHitTrigger && !isTrig)
return kFALSE;
1999 Int_t StMtdQAMaker::getMtdHitIndex(
const StPicoTrack *track)
2006 for(Int_t i=0; i<nMtdHits; i++)
2023 Int_t StMtdQAMaker::getMtdPidTraitsIndex(
const StPicoMtdHit *hit)
2027 for(Int_t i=0; i<nPidTraits; i++)
2030 if(!mtdPid)
continue;
2043 Double_t StMtdQAMaker::rotatePhi(Double_t phi)
const
2045 Double_t outPhi = phi;
2046 while(outPhi<0) outPhi += 2*pi;
2047 while(outPhi>2*pi) outPhi -= 2*pi;
Float_t btofZLocal() const
Return zLocal (compression = zLocal * 1000)
static StMuPrimaryVertex * primaryVertex()
return pointer to current primary vertex
std::pair< Float_t, Float_t > leadingEdgeTime() const
Return leading edge time.
static StPicoMtdHit * mtdHit(Int_t i)
Return pointer to i-th mtd hit.
Holds information about MTD-matched track.
Int_t runId() const
Return run ID.
Class that converts MuDst into PicoDst.
Float_t nSigmaKaon() const
Return nSigma(kaon)
static UInt_t numberOfMtdHits()
Return number of MTD hits.
Float_t nSigmaPion() const
Return nSigma(pion)
Int_t btofCellId() const
Return BTOF cell ID (encoding = (tray-1)*192+(module-1)*6+(cell-1): -1 - no match ) ...
Float_t ZDCx() const
Return ZDC coincidence rate.
Double_t pt() const
Returns pT at point of dca to primary vertex.
short id() const
Returns the track id(or key), is unique for a track node, i.e. global and primary tracks have the sam...
UShort_t nHitsDedx() const
Return number of hits used for dEdx.
Int_t cell() const
Return cell number.
Int_t backleg() const
Return backleg number.
Float_t btofYLocal() const
Return yLocal (compression = yLocal * 1000)
Class storing MTD trigger information including VPD, QT, MT101, TF201.
Float_t deltaY() const
Return delta Y.
UInt_t getTHUBtime(const Int_t thub) const
bool isTrigger(unsigned int) const
Float_t btofBeta() const
Return beta (compression = beta * 20000)
static StPicoEvent * event()
Return pointer to current StPicoEvent (class holding the event wise information)
Holds information about track parameters.
Float_t deltaZ() const
Return delta Z.
Int_t backleg() const
Return backleg number (1-30) of the MTD hit.
UShort_t nHitsFit() const
Return total number of hits used in fit.
static StPicoMtdPidTraits * mtdPidTraits(Int_t i)
Return pointer to i-th mtd pidTraits.
static UInt_t numberOfTracks()
Return number of tracks.
Int_t module() const
Return module number (1-5) of the MTD hit.
Float_t nSigmaElectron() const
Return nSigma(electron)
Short_t charge() const
Returns charge.
Float_t BBCx() const
Return BBC coincidence rate.
Int_t trackIndex() const
Return assiciated track index.
const StThreeVectorF & p() const
Returns 3-momentum at dca to primary vertex.
Double_t nSigmaPion() const
Returns Craig's distance to the calculated dE/dx band for pions in units of sigma.
Double_t eta() const
Returns pseudo rapidity at point of dca to primary vertex.
Float_t vzVpd() const
Return z position of the primary vertex estimated by VPD.
Int_t nHitsDedx() const
Return number of hits used for dE/dx measurement.
StPicoDst * picoDst()
Returns null pointer if no StPicoDst.
static TObjArray * primaryTracks()
returns pointer to a list of tracks belonging to the selected primary vertex
unsigned short refMult(int vtx_id=-1)
Reference multiplicity of charged particles as defined in StEventUtilities/StuRefMult.hh for vertex vtx_id (-1 is default index from StMuDst)
static StPicoMtdTrigger * mtdTrigger(Int_t i)
Return pointer to i-th MTD trigger data.
Double_t nSigmaElectron() const
Returns Craig's distance to the calculated dE/dx band for electrons in units of sigma.
static UInt_t numberOfMtdPidTraits()
Return number of MTD traits.
UShort_t nHitsPoss() const
Return number of possible hits on track.
TVector3 pMom() const
Return momentum (GeV/c) of the primary track. Return (0,0,0) if not primary track.
Float_t dEdx() const
Return dE/dx (in keV/cm) of the track.
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Int_t refMult() const
Return RefMult (-0.5<eta<0.5)
float timeOfFlight() const
timing for PID
std::pair< Float_t, Float_t > tot() const
Return time-over-threshold of the MTD hit.
const StThreeVectorF & momentum() const
Returns 3-momentum at dca to primary vertex.
static StPicoTrack * track(Int_t i)
Return pointer to i-th track.
Holds information about the hit from MTD.
Float_t nSigmaProton() const
Return nSigma(proton)
Double_t dEdx() const
Returns measured dE/dx value.
Int_t nHitsFit() const
Return number of hits fit.
Int_t grefMult() const
Return gRefMult (RefMult by global tracks in |gRefMult|<0.5)
Int_t triggerFlag() const
Float_t gDCA(Float_t pVtxX, Float_t pVtxY, Float_t pVtxZ) const
Return distance in xyz direction (cm) between the (x,y,z) point and the DCA point to primary vertex...
Stores global information about the event.
Int_t cell() const
Return cell number (0-11) of the MTD hit.
static StBTofHeader * btofHeader()
returns pointer to the btofHeader - dongx
Double_t phi() const
Returns phi at point of dca to primary vertex.
Int_t nHitsMax() const
Return number of hits possible.
Double_t nSigmaProton() const
Returns Craig's distance to the calculated dE/dx band for protons in units of sigma.
Int_t module() const
Return module number.
Int_t mtdPidTraitsIndex() const
Return index to the corresponding MTD PID trait.
Int_t bTofPidTraitsIndex() const
Return index to the corresponding BTOF PID trait.
static UInt_t numberOfBTofHits()
Return number of BTof hits.
StThreeVectorF dcaGlobal(Int_t vtx_id=-1) const
Returns 3D distance of closest approach to primary vertex of associated global track.
Double_t nSigmaKaon() const
Returns Craig's distance to the calculated dE/dx band for kaons in units of sigma.
static void setVertexIndex(Int_t vtx_id)
Set the index number of the current primary vertex (used by both primaryTracks() functions and for St...
TVector3 primaryVertex() const
Return primary vertex position.
Float_t deltaTimeOfFlight() const
Return difference between measured and expected time of flight.
static StPicoBTofPidTraits * btofPidTraits(Int_t i)
Return pointer to i-th btof pidTraits.
Short_t charge() const
Return charge of the track (encoded in nHitsFit as: nHitsFit * charge)