StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMtdQAMaker.cxx
1 #include <iostream>
2 #include <bitset>
3 #include <math.h>
4 #include <vector>
5 #include <stdlib.h>
6 #include <iterator>
7 
8 #include "TTree.h"
9 #include "TH1F.h"
10 #include "TH2F.h"
11 #include "TProfile.h"
12 #include "TLorentzVector.h"
13 
14 #include "StEventTypes.h"
15 #include "StThreeVectorF.hh"
16 #include "PhysicalConstants.h"
17 #include "StMemoryInfo.hh"
18 #include "StMessMgr.h"
19 #include "StTimer.hh"
20 #include "StEnumerations.h"
21 
22 #include "StEvent.h"
23 #include "StVertex.h"
24 #include "StTriggerData.h"
25 #include "StTrack.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"
37 #include "StMtdHit.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"
43 
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"
54 
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"
63 
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"
69 
70 ClassImp(StMtdQAMaker)
71 
72 //_____________________________________________________________________________
73 StMtdQAMaker::StMtdQAMaker(const Char_t *name) :
74  StMaker(name),
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)
83 {
84  // default constructor
85  mhEventStat = NULL;
86  mhEventCuts = NULL;
87  mhRunId = NULL;
88  mhZdcRate = NULL;
89  mhBbcRate = NULL;
90 
91  mhVtxZvsVpdVzDefault = NULL;
92  mhVtxZDiffDefault = NULL;
93  mhVtxZvsVpdVzClosest = NULL;
94  mhVtxZDiffClosest = NULL;
95  mhVtxClosestIndex = NULL;
96  mhVertexXY = NULL;
97  mhVertexXZ = NULL;
98  mhVertexYZ = NULL;
99  mhVertexZ = NULL;
100  mhVtxZDiffVsTpcVz = NULL;
101  mhVpdVz = NULL;
102 
103  mhRefMult = NULL;
104  mhgRefMult = NULL;
105  mhgRefMultVsRefMult = NULL;
106  mhTpcVzVsRefMult = NULL;
107  mhDiffVzVsRefMult = NULL;
108  mhZdcRateVsRefMult = NULL;
109  mhBbcRateVsRefMult = NULL;
110  mhTofMultVsRefMult = NULL;
111 
112  mhNTrk = NULL;
113  mhTrkPt = NULL;
114  mhTrkDcaVsPt = NULL;
115  mhTrkPhiVsPt = NULL;
116  mhTrkEtaVsPt = NULL;
117  mhTrkPhiEta = NULL;
118  mhTrkNHitsFitVsPt = NULL;
119  mhTrkNHitsPossVsPt = NULL;
120  mhTrkNHitsDedxVsPt = NULL;
121  mhTrkDedxVsMom = NULL;
122  mhTrkDedxVsPhi = NULL;
123  mhTrkNsigmaPiVsMom = NULL;
124 
125  mhTrkBetaVsMom = NULL;
126  mhTrkM2VsMom = NULL;
127  mhTofMthTrkLocaly = NULL;
128  mhTofMthTrkLocalz = NULL;
129 
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;
140  mhNQtSignal = NULL;
141  mhNMT101Signal = NULL;
142  mhNTF201Signal = NULL;
143  for(int i=0; i<kNQTboard; i++)
144  {
145  for(int j=0; j<2; j++)
146  mhMixMtdTacSumvsMxqMtdTacSum[i][j] = NULL;
147  }
148  for(int j=0; j<2; j++)
149  mhMtdTriggerTime[j] = NULL;
150 
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;
161 
162  mhMtdNHits = NULL;
163  mhMtdHitMap = 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;
173 
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;
191 
192  mhNMuonPos = NULL;
193  mhNMuonNeg = NULL;
194  mhMuonPt = NULL;
195  mhMuonPhiVsEta = NULL;
196  mhMuonMap = NULL;
197  mhNULpair = NULL;
198  mhNLSpairPos = NULL;
199  mhNLSpairNeg = NULL;
200  mhInvMvsPtUL = NULL;
201  mhInvMvsPtLSpos = NULL;
202  mhInvMvsPtLSneg = NULL;
203 
204  mhBBCrateVsRun = NULL;
205  mhZDCrateVsRun = NULL;
206  mhRefMultVsRun = NULL;
207  mhgRefMultVsRun = NULL;
208  mhTpcVxVsRun = NULL;
209  mhTpcVyVsRun = NULL;
210  mhTpcVzVsRun = NULL;
211  mhVpdVzVsRun = 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;
220  mhDedxVsRun = NULL;
221  mhNsigmaPiVsRun = NULL;
222  mhNsigmaEVsRun = NULL;
223  mhNsigmaKVsRun = NULL;
224  mhNsigmaPVsRun = NULL;
225  mhBetaVsRun = 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;
234 }
235 
236 //_____________________________________________________________________________
237 StMtdQAMaker::~StMtdQAMaker()
238 {
239  // default destructor
240 }
241 
242 //_____________________________________________________________________________
243 Int_t StMtdQAMaker::Init()
244 {
245  if(mPrintConfig) printConfig();
246  bookHistos();
247  return kStOK;
248 }
249 
250 //_____________________________________________________________________________
252 {
253  StTimer timer;
254  if (mPrintMemory) StMemoryInfo::instance()->snapshot();
255  if (mPrintCpu) timer.start();
256 
257  // Check the availability of input data
258  Int_t iret = -1;
259  if(GetInputDS("StEvent"))
260  {
261  mStEvent = (StEvent*) GetInputDS("StEvent");
262  if(mStEvent)
263  {
264  iret = processStEvent();
265  }
266  else
267  {
268  LOG_ERROR << "No StEvent is available ..." << endm;
269  return kStErr;
270  }
271  }
272  else if(GetMaker("MuDst"))
273  {
274  StMuDstMaker *muDstMaker = (StMuDstMaker*) GetMaker("MuDst");
275  mMuDst = muDstMaker->muDst();
276  if(mMuDst)
277  {
278  iret = processMuDst();
279  }
280  else
281  {
282  LOG_ERROR << "No muDST is available ... "<< endm;
283  iret = kStErr;
284  }
285  }
286  else if(GetMaker("picoDst"))
287  {
288  StPicoDstMaker *picoDstMaker = (StPicoDstMaker*) GetMaker("picoDst");
289  mPicoDst = picoDstMaker->picoDst();
290  if(mPicoDst)
291  {
292  iret = processPicoDst();
293  }
294  else
295  {
296  LOG_ERROR << "No picoDst is available ..." << endm;
297  iret = kStErr;
298  }
299  }
300  else
301  {
302  LOG_WARN << "No input data available ..." << endm;
303  iret = kStWarn;
304  }
305 
306  if (mPrintMemory)
307  {
308  StMemoryInfo::instance()->snapshot();
309  StMemoryInfo::instance()->print();
310  }
311  if (mPrintCpu)
312  {
313  timer.stop();
314  LOG_INFO << "CPU time for StMtdQAMaker::Make(): "
315  << timer.elapsedTime() << "sec " << endm;
316  }
317 
318  return iret;
319 }
320 
321 //_____________________________________________________________________________
322 Int_t StMtdQAMaker::processStEvent()
323 {
324  // Event statistics
325  mhEventStat->Fill(0.5);
326  return kStOK;
327 }
328 
329 
330 //_____________________________________________________________________________
331 Int_t StMtdQAMaker::processMuDst()
332 {
333  mRunId = mMuDst->event()->runId();
334  mRunYear = mRunId/1000000 + 1999;
335  int runIdFill = mRunId%1000000;
336 
337  int mass_east = mMuDst->event()->runInfo().beamMassNumber(east);
338  int mass_west = mMuDst->event()->runInfo().beamMassNumber(west);
339  if(mass_east == mass_west)
340  {
341  if(mass_east == 1) mCollisionSystem = "pp";
342  else mCollisionSystem = "AA";
343  }
344  else
345  {
346  mCollisionSystem = "pA";
347  }
348 
349  // Event statistics
350  mhEventStat->Fill(0.5);
351  mhRunId->Fill(runIdFill);
352 
353  //========== select valid triggers ==========
354  Bool_t isGoodTrigger = kFALSE;
355  Int_t nTrig = mTriggerIDs.size();
356  if(nTrig==0)
357  {
358  isGoodTrigger = kTRUE;
359  }
360  else
361  {
362  for(Int_t i=0; i<nTrig; i++)
363  {
364  if(mMuDst->event()->triggerIdCollection().nominal().isTrigger(mTriggerIDs[i]))
365  {
366  isGoodTrigger = kTRUE;
367  break;
368  }
369  }
370  }
371  if(!isGoodTrigger) return kStOK;
372  mhEventStat->Fill(1.5);
373 
374  //========== Select vertex ==========
375  int vtxIndex = -1;
376  Int_t nPrim = mMuDst->numberOfPrimaryVertices();
377  if(nPrim == 0)
378  {
379  LOG_WARN << "No reconstructed vertex in MuDst... " << endm;
380  return kStWarn;
381  }
382 
383  // start time & VPD vz
384  StBTofHeader *tofHeader = mMuDst->btofHeader();
385  Double_t vpdvz = -999;
386  if(tofHeader)
387  {
388  vpdvz = tofHeader->vpdVz();
389  mhEventStat->Fill(2.5);
390  }
391 
392  int index = -1;
393  if(tofHeader)
394  {
395  // constrain vertex with VPD
396  Double_t min_dz = 999;
397  for(Int_t i=0; i<nPrim; i++)
398  {
399  StMuPrimaryVertex *vertex = mMuDst->primaryVertex(i);
400  double ranking = vertex->ranking();
401  if(mCollisionSystem=="pp" && ranking<0) continue;
402  Double_t dz = fabs(vertex->position().z()-vpdvz);
403  if(dz<min_dz)
404  {
405  min_dz = dz;
406  index = i;
407  }
408  }
409  mhVtxClosestIndex->Fill(index);
410 
411  double default_z = mMuDst->primaryVertex(0)->position().z();
412  mhVtxZvsVpdVzDefault->Fill(default_z, vpdvz);
413  mhVtxZDiffDefault->Fill(default_z - vpdvz);
414  if(index>-1)
415  {
416  double cloest_z = mMuDst->primaryVertex(index)->position().z();
417  mhVtxZvsVpdVzClosest->Fill(cloest_z, vpdvz);
418  mhVtxZDiffClosest->Fill(cloest_z - vpdvz);
419  }
420  }
421 
422  if(mVertexMode==0) vtxIndex = 0;
423  else if(mVertexMode==1) vtxIndex = index;
424  else
425  {
426  LOG_WARN << "No vertex mode is set. Use default vertex!" << endm;
427  vtxIndex = 0;
428  }
429 
430  if(vtxIndex<0) return kStWarn;
431  mMuDst->setVertexIndex(vtxIndex);
432  StMuPrimaryVertex* priVertex = mMuDst->primaryVertex();
433  if(!priVertex) return kStWarn;
434  StThreeVectorF verPos = priVertex->position();
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++)
448  {
449  if(mMuDst->event()->triggerIdCollection().nominal().isTrigger(mTriggerIDs[i]))
450  {
451  mhEventStat->Fill(4.5+i);
452  }
453  }
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);
459 
460  //================= reference multiplicity ===================
461  StMuEvent *muEvent = mMuDst->event();
462  StRunInfo runInfo = muEvent->runInfo();
463  Int_t refMult = muEvent->refMult();
464  Int_t gRefMult = muEvent->grefmult();
465  Double_t bbcRate = runInfo.bbcCoincidenceRate() * 1e-3; // kHz
466  Double_t zdcRate = runInfo.zdcCoincidenceRate() * 1e-3; // kHz
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);
482 
483  //================= primary tracks ===================
484  Int_t nGoodTrack = 0;
485  vector<int> muonId;
486  muonId.clear();
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++)
491  {
492  StMuTrack* pTrack = mMuDst->primaryTracks(i);
493  if(!pTrack) continue;
494  if(!isValidTrack(pTrack)) continue;
495  trackIndex[pTrack->id()] = i;
496  nGoodTrack++;
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);
505  Int_t nHitsDedx = pTrack->nHitsDedx();
506  Double_t dedx = pTrack->dEdx() * 1e6;
507  Double_t nSigmaE = pTrack->nSigmaElectron();
508  Double_t nSigmaPi = pTrack->nSigmaPion();
509  Double_t nSigmaK = pTrack->nSigmaKaon();
510  Double_t nSigmaP = pTrack->nSigmaProton();
511  mhTrkPt ->Fill(pt);
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);
522 
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);
535 
536  // TOF matching
537  const StMuBTofHit *tofHit = pTrack->tofHit();
538  if(tofHit)
539  {
540  const StMuBTofPidTraits &tofPid = pTrack->btofPidTraits();
541  double beta = tofPid.beta();
542  if(beta!=0)
543  {
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);
548  }
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());
554  }
555 
556  // MTD matching
557  Int_t iMtd = pTrack->index2MtdHit();
558  if(iMtd>-1)
559  {
560  StMuMtdHit *hit = mMuDst->mtdHit(iMtd);
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;
565  const StMuMtdPidTraits mtdPid = pTrack->mtdPidTraits();
566  Double_t dy = mtdPid.deltaY();
567  Double_t dz = mtdPid.deltaZ();
568  Double_t localy = mtdPid.yLocal();
569  Double_t localz = mtdPid.zLocal();
570  Double_t mtdtof = mtdPid.timeOfFlight();
571  Double_t exptof = mtdPid.expTimeOfFlight();
572  Double_t dtof = mtdtof - exptof;
573 
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);
589 
590  Int_t tacDiffQT = 0, tacDiffMT101 = 0;
591  Int_t qt = 0, pos = 0, bin = 0;
592  if(mTrigUtil)
593  {
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))
603  {
604  mhMtdVpdTacDiffMT001Muon->Fill(bin, tacDiffQT);
605  mhMtdVpdTacDiffMT101Muon->Fill(bin, tacDiffMT101);
606  }
607  }
608 
609  if(isMuonCandidate(pTrack))
610  {
611  if(charge>0) nPosMuon++;
612  else nNegMuon++;
613  mhMuonPt->Fill(pt);
614  mhMuonPhiVsEta->Fill(eta, phi);
615  mhMuonMap->Fill(backleg, (module-1)*12+cell+1);
616  muonId.push_back(i);
617  }
618  }
619  }
620  mhNTrk->Fill(nGoodTrack);
621  mhNMuonPos->Fill(nPosMuon);
622  mhNMuonNeg->Fill(nNegMuon);
623  mhNMuonPosVsRun->Fill(runIdFill, nPosMuon);
624  mhNMuonNegVsRun->Fill(runIdFill, nNegMuon);
625 
626  //================= MTD trigger time ===================
627  StMuMtdHeader *muMtdHeader = mMuDst->mtdHeader();
628  int mtdTrigTime[2] = {0, 0};
629  if(muMtdHeader)
630  {
631  for(Int_t i=0; i<2; i++)
632  {
633  mtdTrigTime[i] = 25.*(muMtdHeader->triggerTime(i+1)&0xfff);
634  mhMtdTriggerTime[i]->Fill(mtdTrigTime[i]);
635  }
636  }
637 
638  //================= Trigger performance ===========
639  StTriggerData* trigData = const_cast<StTriggerData*>(muEvent->triggerData());
640  Int_t mtdQTtac[kNQTboard][16];
641  Int_t mtdQTadc[kNQTboard][16];
642  for(Int_t i=0; i<32; i++)
643  {
644  Int_t type = (i/4)%2;
645  if(mRunYear<=2015)
646  {
647  if(type==1)
648  {
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);
653  }
654  else
655  {
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);
660  }
661  }
662  else
663  {
664  for(int im=0; im<kNQTboard; im++)
665  {
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);
668  }
669  }
670  }
671 
672  if(mTrigUtil)
673  {
674  Int_t nQTsignal = 0;
675  Int_t vpdTacSum = mTrigUtil->getVpdTacSum();
676  for(Int_t im=0; im<kNQTboard; im++)
677  {
678  for(Int_t i=0; i<8; i++)
679  {
680  Int_t mtdTacSum = mTrigUtil->getQtTacSum(im+1, i+1);
681  if(mtdTacSum<=10) continue;
682  nQTsignal++;
683 
684  for(Int_t k=0; k<2; k++)
685  {
686  int index = 0;
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]);
692  }
693 
694  int bin = 0;
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);
699  }
700  }
701  mhNQtSignal->Fill(nQTsignal);
702 
703  Int_t nMT101signal = 0;
704  for(Int_t im=0; im<kNQTboard; im++)
705  {
706  for(Int_t j=0; j<2; j++)
707  {
708  Int_t mix_tacSum = mTrigUtil->getMT101Tac(im+1, j);
709  if(mix_tacSum>0)
710  {
711  nMT101signal++;
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);
715  int bin = 0;
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);
719  }
720  }
721  }
722  mhNMT101Signal->Fill(nMT101signal);
723 
724  Int_t nTF201signal = 0;
725  Int_t decision = mTrigUtil->getTF201TriggerBit();
726  for(Int_t i=0; i<4; i++)
727  {
728  for(Int_t j=0; j<2; j++)
729  {
730  if((decision>>(i*2+j))&0x1)
731  nTF201signal++;
732  }
733  }
734  mhNTF201Signal->Fill(nTF201signal);
735  }
736 
737 
738  //================= MTD raw hits ===================
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++)
744  {
745  StMuMtdRawHit *rawHit = (StMuMtdRawHit*)mMuDst->mtdRawHit(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;
756 
757  mhMtdRawHitMap->Fill(backleg, channel);
758  if(flag>0) mhMtdRawHitLeTime->Fill(gChan, tdc);
759  else mhMtdRawHitTrTime->Fill(gChan, tdc);
760  if(localChan <= 12)
761  {
762  if(flag>0) { mhMtdRawHitLeNWest->Fill(gCell); nDiffLe[gCell-1]++; }
763  else { mhMtdRawHitTrNWest->Fill(gCell); nDiffTr[gCell-1]++; }
764  }
765  else if (localChan > 12 && localChan <= 24)
766  {
767  gCell -= 12;
768  if(flag>0) { mhMtdRawHitLeNEast->Fill(gCell); nDiffLe[gCell-1]--; }
769  else { mhMtdRawHitTrNEast->Fill(gCell); nDiffTr[gCell-1]--; }
770  }
771  else
772  {
773  LOG_WARN << "Weird local channel number: " << localChan << " from global channel " << channel << " and module " << module << endm;
774  }
775  }
776  for(Int_t i=0; i<gMtdNBacklegs * gMtdNModules * gMtdNCells; i++)
777  {
778  mhMtdRawHitLeNDiff->Fill(i+1,nDiffLe[i]);
779  mhMtdRawHitTrNDiff->Fill(i+1,nDiffTr[i]);
780  }
781 
782  //================= MTD hits ===================
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++)
787  {
788  StMuMtdHit *hit = mMuDst->mtdHit(i);
789  if(!hit) continue;
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();
800  if(trackId>0)
801  {
802  Int_t index = (trackIndex.find(trackId)!=trackIndex.end()) ? trackIndex.find(trackId)->second : -1;
803  if(index>-1)
804  {
805  StMuTrack *pTrack = mMuDst->primaryTracks(index);
806  if(pTrack && isValidTrack(pTrack)) isMth = kTRUE;
807  }
808  }
809  Bool_t isTrig = mTrigUtil ? mTrigUtil->isHitFireTrigger(hit->backleg(), hit->module()) : kFALSE;
810 
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);
816 
817  if(isMth)
818  {
819  mMthMtdHit++;
820  mhMtdHitTrigTimeTrkMth->Fill(gChan,tDiff);
821  mhMtdMatchHitMap->Fill(backleg,lChan);
822  }
823  if(isTrig)
824  {
825  nTrigMtdHit ++;
826  mhMtdTrigHitMap->Fill(backleg,lChan);
827  if(isMth)
828  {
829  nTrigMtdHitMth++;
830  mhMtdTrigMthHitMap->Fill(backleg,lChan);
831  }
832  }
833  }
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);
840 
841  //================= muon analysis ===================
842  int nULpair = 0, nLSpairPos = 0, nLSpairNeg = 0;
843  UInt_t nMuon = muonId.size();
844  for(UInt_t i=0; i<nMuon; i++)
845  {
846  StMuTrack *ipTrack = mMuDst->primaryTracks(muonId[i]);
847  int iq = ipTrack->charge();
848  const StThreeVectorF imom = ipTrack->momentum();
849  TLorentzVector imuon;
850  imuon.SetXYZM(imom.x(),imom.y(),imom.z(),0.10566);
851  for(UInt_t j=i+1; j<nMuon; j++)
852  {
853  StMuTrack *jpTrack = mMuDst->primaryTracks(muonId[j]);
854  int jq = jpTrack->charge();
855  const StThreeVectorF jmom = jpTrack->momentum();
856  TLorentzVector jmuon;
857  jmuon.SetXYZM(jmom.x(),jmom.y(),jmom.z(),0.10566);
858 
859  float pt1 = imom.perp(), pt2 = jmom.perp();
860  if(pt1<pt2)
861  {
862  pt1 = jmom.perp();
863  pt2 = imom.perp();
864  }
865 
866  if(pt1<1.5) continue;
867  TLorentzVector jpsi = imuon + jmuon;
868  Double_t invmass = jpsi.M();
869  if(iq*jq<0)
870  {
871  nULpair++;
872  mhInvMvsPtUL->Fill(invmass, jpsi.Pt());
873  mhInvMUL->Fill(invmass);
874  }
875  else
876  {
877  if(iq>0)
878  {
879  nLSpairPos++;
880  mhInvMvsPtLSpos->Fill(invmass, jpsi.Pt());
881  mhInvMLSpos->Fill(invmass);
882  }
883  else
884  {
885  nLSpairNeg++;
886  mhInvMvsPtLSneg->Fill(invmass, jpsi.Pt());
887  mhInvMLSneg->Fill(invmass);
888  }
889  }
890  }
891  }
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);
898 
899  return kStOK;
900 }
901 
902 
903 //_____________________________________________________________________________
904 Int_t StMtdQAMaker::processPicoDst()
905 {
906  StPicoEvent *picoEvent = mPicoDst->event();
907  mRunId = picoEvent->runId();
908  mRunYear = mRunId/1000000 + 1999;
909  int runIdFill = mRunId%1000000;
910 
911  // Event statistics
912  mhEventStat->Fill(0.5);
913  mhRunId->Fill(runIdFill);
914 
915  //========== select valid triggers ==========
916  Bool_t isGoodTrigger = kFALSE;
917  Int_t nTrig = mTriggerIDs.size();
918  if(nTrig==0)
919  {
920  isGoodTrigger = kTRUE;
921  }
922  else
923  {
924  for(Int_t i=0; i<nTrig; i++)
925  {
926  if(picoEvent->isTrigger(mTriggerIDs[i]))
927  {
928  isGoodTrigger = kTRUE;
929  break;
930  }
931  }
932  }
933  if(!isGoodTrigger) return kStOK;
934  mhEventStat->Fill(1.5);
935 
936  //========== Select vertex ==========
937  Double_t vpdvz = picoEvent->vzVpd();
938  if(fabs(vpdvz)>300)
939  {
940  return kStOK;
941  }
942  mhEventStat->Fill(2.5);
943  TVector3 verPos = picoEvent->primaryVertex();
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++)
957  {
958  if(picoEvent->isTrigger(mTriggerIDs[i]))
959  {
960  mhEventStat->Fill(4.5+i);
961  }
962  }
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);
968 
969  //================= reference multiplicity ===================
970  Int_t refMult = picoEvent->refMult();
971  Int_t gRefMult = picoEvent->grefMult();
972  Double_t bbcRate = picoEvent->BBCx() * 1e-3; // kHz
973  Double_t zdcRate = picoEvent->ZDCx() * 1e-3; // kHz
974  Int_t tofMult = mPicoDst->numberOfBTofHits();
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);
989 
990  //================= primary tracks ===================
991  Int_t nGoodTrack = 0;
992  vector<int> muonId;
993  muonId.clear();
994  Int_t nPosMuon = 0, nNegMuon = 0;
995  Int_t nTrks = mPicoDst->numberOfTracks();
996  for(Int_t i=0; i<nTrks; i++)
997  {
998  StPicoTrack* pTrack = mPicoDst->track(i);
999  if(!pTrack) continue;
1000  TVector3 mom = pTrack->pMom();
1001  if(mom.Mag()<=0) continue;
1002  if(!isValidTrack(pTrack)) continue;
1003  nGoodTrack++;
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());
1009  Double_t dca = pTrack->gDCA(picoEvent->primaryVertex()).Mag();
1010  Int_t nHitsFit = pTrack->nHitsFit();
1011  Int_t nHitsPoss = pTrack->nHitsMax();
1012  Int_t nHitsDedx = pTrack->nHitsDedx();
1013  Double_t dedx = pTrack->dEdx();
1014  Double_t nSigmaE = pTrack->nSigmaElectron();
1015  Double_t nSigmaPi = pTrack->nSigmaPion();
1016  Double_t nSigmaK = pTrack->nSigmaKaon();
1017  Double_t nSigmaP = pTrack->nSigmaProton();
1018  mhTrkPt ->Fill(pt);
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);
1029 
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);
1042 
1043  // TOF matching
1044  if(pTrack->bTofPidTraitsIndex()>-1)
1045  {
1046  StPicoBTofPidTraits *tofPid = mPicoDst->btofPidTraits(pTrack->bTofPidTraitsIndex());
1047  double beta = tofPid->btofBeta();
1048  if(beta!=0)
1049  {
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);
1054  }
1055  Int_t tofTray = tofPid->btofCellId()/192+1;
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());
1060  }
1061 
1062  // MTD matching
1063  int iMtd = pTrack->mtdPidTraitsIndex();
1064  if(iMtd>-1)
1065  {
1066  StPicoMtdPidTraits *mtdPid = mPicoDst->mtdPidTraits(iMtd);
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();
1073  Double_t dtof = mtdPid->deltaTimeOfFlight();
1074 
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);
1086 
1087  Int_t tacDiffQT = 0, tacDiffMT101 = 0;
1088  Int_t qt = 0, pos = 0, bin = 0;
1089  if(mTrigUtil)
1090  {
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))
1100  {
1101  mhMtdVpdTacDiffMT001Muon->Fill(bin, tacDiffQT);
1102  mhMtdVpdTacDiffMT101Muon->Fill(bin, tacDiffMT101);
1103  }
1104  }
1105 
1106  if(isMuonCandidate(pTrack))
1107  {
1108  if(charge>0) nPosMuon++;
1109  else nNegMuon++;
1110  mhMuonPt->Fill(pt);
1111  mhMuonPhiVsEta->Fill(eta, phi);
1112  mhMuonMap->Fill(backleg, (module-1)*12+cell+1);
1113  muonId.push_back(i);
1114  }
1115  }
1116  }
1117  mhNTrk->Fill(nGoodTrack);
1118  mhNMuonPos->Fill(nPosMuon);
1119  mhNMuonNeg->Fill(nNegMuon);
1120  mhNMuonPosVsRun->Fill(runIdFill, nPosMuon);
1121  mhNMuonNegVsRun->Fill(runIdFill, nNegMuon);
1122 
1123  //================= MTD trigger time ===================
1124  StPicoMtdTrigger *mtdTrig = mPicoDst->mtdTrigger(0);
1125  int mtdTrigTime[2] = {0, 0};
1126  for(Int_t i=0; i<2; i++)
1127  {
1128  mtdTrigTime[i] = mtdTrig ? mtdTrig->getTHUBtime(i+1) : 0;
1129  mhMtdTriggerTime[i]->Fill(mtdTrigTime[i]);
1130  }
1131 
1132  //================= Trigger performance ===========
1133  if(mTrigUtil)
1134  {
1135  Int_t nQTsignal = 0;
1136  Int_t vpdTacSum = mTrigUtil->getVpdTacSum();
1137  for(Int_t im=0; im<kNQTboard; im++)
1138  {
1139  for(Int_t i=0; i<8; i++)
1140  {
1141  Int_t mtdTacSum = mTrigUtil->getQtTacSum(im+1, i+1);
1142  if(mtdTacSum<=10) continue;
1143  nQTsignal++;
1144  int bin = 0;
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);
1148  }
1149  }
1150  mhNQtSignal->Fill(nQTsignal);
1151 
1152  Int_t nMT101signal = 0;
1153  for(Int_t im=0; im<kNQTboard; im++)
1154  {
1155  if(mRunYear!=2016 && im>3) continue;
1156  for(Int_t j=0; j<2; j++)
1157  {
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);
1161  if(mix_tacSum>0)
1162  {
1163  nMT101signal++;
1164  mhMixMtdTacSumvsMxqMtdTacSum[im][j]->Fill(mxq_tacSum/8,mix_tacSum);
1165  int bin = 0;
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);
1169  }
1170  }
1171  }
1172  mhNMT101Signal->Fill(nMT101signal);
1173 
1174  Int_t nTF201signal = 0;
1175  Int_t decision = mTrigUtil->getTF201TriggerBit();
1176  for(Int_t i=0; i<4; i++)
1177  {
1178  for(Int_t j=0; j<2; j++)
1179  {
1180  if((decision>>(i*2+j))&0x1)
1181  nTF201signal++;
1182  }
1183  }
1184  mhNTF201Signal->Fill(nTF201signal);
1185  }
1186 
1187  //================= MTD hits ===================
1188  int nMtdHits = mPicoDst->numberOfMtdHits();
1189  int mMthMtdHit = 0, nTrigMtdHit = 0, nTrigMtdHitMth = 0;
1190  mhMtdNHits->Fill(nMtdHits);
1191  for(Int_t i=0; i<nMtdHits; i++)
1192  {
1193  StPicoMtdHit *hit = mPicoDst->mtdHit(i);
1194  if(!hit) continue;
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);
1201  Double_t tDiff = (hit->leadingEdgeTime().first+hit->leadingEdgeTime().second)/2 - mtdTrigTime[tHub-1];
1202  while(tDiff<0) tDiff += 51200;
1203  Bool_t isMth = kFALSE;
1204  Int_t pidIndex = getMtdPidTraitsIndex(hit);
1205  if(pidIndex>-1)
1206  {
1207  StPicoMtdPidTraits *mtdPid = mPicoDst->mtdPidTraits(pidIndex);
1208  StPicoTrack* pTrack = mPicoDst->track(mtdPid->trackIndex());
1209  if(pTrack && pTrack->pMom().Mag()>0 && isValidTrack(pTrack)) isMth = kTRUE;
1210  }
1211  Bool_t isTrig = mTrigUtil ? mTrigUtil->isHitFireTrigger(hit->backleg(), hit->module()) : kFALSE;
1212  mhMtdHitMap ->Fill(backleg,lChan);
1213  mhMtdHitLeTimeDiff->Fill(gChan, hit->leadingEdgeTime().first-hit->leadingEdgeTime().second);
1214  mhMtdHitTotWest ->Fill(gChan, hit->tot().first);
1215  mhMtdHitTotEast ->Fill(gChan, hit->tot().second);
1216  mhMtdHitTrigTime ->Fill(gChan, tDiff);
1217 
1218  if(isMth)
1219  {
1220  mMthMtdHit++;
1221  mhMtdHitTrigTimeTrkMth->Fill(gChan,tDiff);
1222  mhMtdMatchHitMap->Fill(backleg,lChan);
1223  }
1224  if(isTrig)
1225  {
1226  nTrigMtdHit ++;
1227  mhMtdTrigHitMap->Fill(backleg,lChan);
1228  if(isMth)
1229  {
1230  nTrigMtdHitMth++;
1231  mhMtdTrigMthHitMap->Fill(backleg,lChan);
1232  }
1233  }
1234  }
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);
1241 
1242  //================= muon analysis ===================
1243  int nULpair = 0, nLSpairPos = 0, nLSpairNeg = 0;
1244  UInt_t nMuon = muonId.size();
1245  for(UInt_t i=0; i<nMuon; i++)
1246  {
1247  StPicoTrack* ipTrack = mPicoDst->track(muonId[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++)
1253  {
1254  StPicoTrack* jpTrack = mPicoDst->track(muonId[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);
1259 
1260  float pt1 = imom.Perp(), pt2 = jmom.Perp();
1261  if(pt1<pt2)
1262  {
1263  pt1 = jmom.Perp();
1264  pt2 = imom.Perp();
1265  }
1266 
1267  if(pt1<1.5) continue;
1268  TLorentzVector jpsi = imuon + jmuon;
1269  Double_t invmass = jpsi.M();
1270  if(iq*jq<0)
1271  {
1272  nULpair++;
1273  mhInvMvsPtUL->Fill(invmass, jpsi.Pt());
1274  mhInvMUL->Fill(invmass);
1275  }
1276  else
1277  {
1278  if(iq>0)
1279  {
1280  nLSpairPos++;
1281  mhInvMvsPtLSpos->Fill(invmass, jpsi.Pt());
1282  mhInvMLSpos->Fill(invmass);
1283  }
1284  else
1285  {
1286  nLSpairNeg++;
1287  mhInvMvsPtLSneg->Fill(invmass, jpsi.Pt());
1288  mhInvMLSneg->Fill(invmass);
1289  }
1290  }
1291  }
1292  }
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);
1299 
1300  return kStOK;
1301 }
1302 
1303 
1304 //_____________________________________________________________________________
1305 void StMtdQAMaker::addCutToHisto(TH1 *h, const Int_t bin, const char *label, const Float_t value)
1306 {
1307  if(!h) return;
1308  h->GetXaxis()->SetBinLabel(bin,label);
1309  if(value!=-9999999)
1310  h->SetBinContent(bin,value);
1311 }
1312 
1313 //_____________________________________________________________________________
1315 {
1316  // event histograms
1317 
1318 
1319 //this array describe the Channel input from which backleg & position & direction
1320 
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"};
1322 
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"};
1324 
1325  const Int_t nSpecMBins = 56;//PRL mass bin
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};
1332 
1333  const int startRun = 0;
1334  const int endRun = 200000;
1335 
1336  const int nPtBins = 40;
1337  const double lowPtBin = 0, hiPtBin = 20;
1338 
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);
1361 
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++)
1369  {
1370  mhEventStat->GetXaxis()->SetBinLabel(i+5,Form("%d",mTriggerIDs[i]));
1371  }
1372  AddHist(mhEventStat);
1373 
1374  mhRunId = new TH1F("hRunId","Number of events per run",endRun-startRun+1,startRun-0.5,endRun+0.5);
1375  AddHist(mhRunId);
1376 
1377  mhZdcRate = new TH1F("hZdcRate","ZDC coincidence distribution;ZDC (kHz)",500,0,500);
1378  AddHist(mhZdcRate);
1379 
1380  mhBbcRate = new TH1F("hBbcRate","BBC coincidence distribution;BBC (kHz)",500,0,5000);
1381  AddHist(mhBbcRate);
1382 
1383  // vertex
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);
1386 
1387  mhVtxZDiffDefault = new TH1F("hVtxZDiffDefault","TPC vz - VPD vz (default); #Deltavz (cm)",200,-20,20);
1388  AddHist(mhVtxZDiffDefault);
1389 
1390  mhVtxClosestIndex = new TH1F("hVtxClosestIndex","TPC vertex index closest to VPD (ranking>0)",50,0,50);
1391  AddHist(mhVtxClosestIndex);
1392 
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);
1395 
1396  mhVtxZDiffClosest = new TH1F("hVtxZDiffClosest","TPC vz - VPD vz (closest); #Deltavz (cm)",200,-20,20);
1397  AddHist(mhVtxZDiffClosest);
1398 
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);
1401 
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);
1404 
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);
1407 
1408  mhVertexZ = new TH1F("hVertexZ","Primary vertex z (TPC); vz_{TPC} (cm)",201,-201,201);
1409  AddHist(mhVertexZ);
1410 
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);
1413 
1414  mhVpdVz = new TH1F("hVpdVz","VPD z distribution; vz_{VPD} (cm)",201,-201,201);
1415  AddHist(mhVpdVz);
1416 
1417  mhVtxZDiff = new TH1F("hVtxZDiff","TPC vz - VPD vz distribution; #Deltavz (cm)",200,-20,20);
1418  AddHist(mhVtxZDiff);
1419 
1421  mhRefMult = new TH1F("hRefMult","RefMult distribution;RefMult",500,0,1000);
1422  AddHist(mhRefMult);
1423 
1424  mhgRefMult = new TH1F("hgRefMult","gRefMult distribution;gRefMult",500,0,1000);
1425  AddHist(mhgRefMult);
1426 
1427  mhgRefMultVsRefMult = new TH2F("hgRefMultVsRefMult","gRefMult vs. RefMult;RefMult;gRefMult",500,0,1000,500,0,1000);
1428  AddHist(mhgRefMultVsRefMult);
1429 
1430  mhTpcVzVsRefMult = new TH2F("hTpcVzVsRefMult","TPC v_{z} vs. RefMult;RefMult;vz_{TPC} (cm)",500,0,1000,201,-201,201);
1431  AddHist(mhTpcVzVsRefMult);
1432 
1433  mhDiffVzVsRefMult = new TH2F("hDiffVzVsRefMult","TPC-VPD v_{z} vs. RefMult;RefMult;#Deltavz (cm)",500,0,1000,200,-20,20);
1434  AddHist(mhDiffVzVsRefMult);
1435 
1436  mhZdcRateVsRefMult = new TH2F("hZdcRateVsRefMult","ZDC rate vs. RefMult;RefMult;ZDC (kHz)",500,0,1000,500,0,5000);
1437  AddHist(mhZdcRateVsRefMult);
1438 
1439  mhBbcRateVsRefMult = new TH2F("hBbcRateVsRefMult","BBC rate vs. RefMult;RefMult;BBC (kHz)",500,0,1000,500,0,5000);
1440  AddHist(mhBbcRateVsRefMult);
1441 
1442  mhTofMultVsRefMult = new TH2F("hTofMultVsRefMult","TofMult vs. RefMult;RefMult;TofMult",500,0,1000,500,0,5000);
1443  AddHist(mhTofMultVsRefMult);
1444 
1445  // Primary tracks
1446  mhNTrk = new TH1F("hNTrk","Number of good primary tracks per event;N",1000,0,1000);
1447  AddHist(mhNTrk);
1448 
1449  mhTrkPt = new TH1F("hTrkPt","p_{T} of primary tracks;p_{T} (GeV/c)",nPtBins,lowPtBin,hiPtBin);
1450  AddHist(mhTrkPt);
1451 
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);
1454 
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);
1457 
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);
1460 
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);
1463 
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);
1466 
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);
1469 
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);
1472 
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);
1475 
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);
1478 
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);
1481 
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);
1484 
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);
1487 
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);
1490 
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);
1493 
1494  // MTD trigger electronics
1495  mhMtdQTAdcAll = new TH2F("hMtdQTAdcAll","MTD QT: ADC vs channel (All);;ADC",64,0.5,64.5,350,0,3500);
1496  AddHist(mhMtdQTAdcAll);
1497 
1498  mhMtdQTTacAll = new TH2F("hMtdQTTacAll","MTD QT: TAC vs channel (All);;TAC",64,0.5,64.5,300,0,3000);
1499  AddHist(mhMtdQTTacAll);
1500 
1501  mhMtdQTAdcVsTacAll = new TH2F("hMtdQTAdcVsTacAll","MTD QT: ADC vs. TAC (All);TAC;ADC",350,0,3500,350,0,3500);
1502  AddHist(mhMtdQTAdcVsTacAll);
1503 
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);
1506 
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);
1509 
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);
1512 
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);
1515 
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);
1518 
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);
1521 
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);
1524 
1525  for(Int_t i=0; i<64; i++)
1526  {
1527  mhMtdQTAdcAll->GetXaxis()->SetBinLabel(i+1,qtlabel[i]);
1528  mhMtdQTTacAll->GetXaxis()->SetBinLabel(i+1,qtlabel[i]);
1529  }
1530  for(Int_t i=0; i<32; i++)
1531  {
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]);
1539  }
1540 
1541  for(Int_t i=0; i<kNQTboard; i++)
1542  {
1543  for(Int_t j=0; j<2; j++)
1544  {
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]);
1547  }
1548  }
1549 
1550  mhNQtSignal = new TH1F("hNQtSignal","Number of good QT signals;N",10,0,10);
1551  AddHist(mhNQtSignal);
1552 
1553  mhNMT101Signal = new TH1F("hNMT101Signal","Number of good MT101 signals;N",10,0,10);
1554  AddHist(mhNMT101Signal);
1555 
1556  mhNTF201Signal = new TH1F("hNTF201Signal","Number of good TF201 signals;N",10,0,10);
1557  AddHist(mhNTF201Signal);
1558 
1559 
1560  // MTD hits
1561  mhMtdTriggerTime[0] = new TH1F("hMtdTriggerTime0","MTD: trigger time for backleg 16-30;t",120,0,1.2e5);
1562  AddHist(mhMtdTriggerTime[0]);
1563 
1564  mhMtdTriggerTime[1] = new TH1F("hMtdTriggerTime1","MTD: trigger time for backleg 1-15;t",120,0,1.2e5);
1565  AddHist(mhMtdTriggerTime[1]);
1566 
1567  // ===== raw hits
1568  mhMtdNRawHits = new TH1F("hMtdNRawHits","Number of raw MTD hits per event;N",100,0,100);
1569  AddHist(mhMtdNRawHits);
1570 
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);
1573 
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);
1576 
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);
1579 
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);
1582 
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);
1585 
1586  mhMtdRawHitLeNEast = new TH1F("hMtdRawHitLeNEast","MTD: number of leading raw hit (east);channel;N_{leading,east}",1801,-0.5,1800.5);
1587  AddHist(mhMtdRawHitLeNEast);
1588 
1589  mhMtdRawHitLeNWest = new TH1F("hMtdRawHitLeNWest","MTD: number of leading raw hit (west);channel;N_{leading,west}",1801,-0.5,1800.5);
1590  AddHist(mhMtdRawHitLeNWest);
1591 
1592  mhMtdRawHitTrNEast = new TH1F("hMtdRawHitTrNEast","MTD: number of trailing raw hit (east);channel;N_{trailing,east}",1801,-0.5,1800.5);
1593  AddHist(mhMtdRawHitTrNEast);
1594 
1595  mhMtdRawHitTrNWest = new TH1F("hMtdRawHitTrNWest","MTD: number of trailing raw hit (west);channel;N_{trailing,west}",1801,-0.5,1800.5);
1596  AddHist(mhMtdRawHitTrNWest);
1597 
1598  // ===== hits
1599  mhMtdNHits = new TH1F("hMtdNHits","Number of MTD hits per event;N",50,0,50);
1600  AddHist(mhMtdNHits);
1601 
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);
1604 
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);
1607 
1608  mhMtdHitTotWest = new TH2F("hMtdHitTotWest","MTD: west TOT of hits;channel;tot (ns)",1801,-0.5,1800.5,50,0,50);
1609  AddHist(mhMtdHitTotWest);
1610 
1611  mhMtdHitTotEast = new TH2F("hMtdHitTotEast","MTD: east TOT of hits;channel;tot (ns)",1801,-0.5,1800.5,50,0,50);
1612  AddHist(mhMtdHitTotEast);
1613 
1614  const int nBinsTrigTime = 750;
1615  const double minTrigTime = 2000, maxTrigTime = 3500;
1616 
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);
1619 
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);
1622 
1623  mhMtdTrigNHits = new TH1F("hMtdTrigNHits","Number of triggering MTD hits per event;N",50,0,50);
1624  AddHist(mhMtdTrigNHits);
1625 
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);
1628 
1629  mhMtdTrigMthNHits = new TH1F("hMtdTrigMthNHits","Number of triggering MTD hits matched to tracks;N",50,0,50);
1630  AddHist(mhMtdTrigMthNHits);
1631 
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);
1634 
1635  // ===== matched hits
1636  mhMtdNMatchHits = new TH1F("mhMtdNMatchHits","Number of matched MTD hits per event;N",50,0,50);
1637  AddHist(mhMtdNMatchHits);
1638 
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);
1641 
1642  mhMtdMatchTrkPt = new TH1F("hMtdMatchTrkPt","MTD: p_{T} of matched primary tracks;p_{T} (GeV/c)",nPtBins,lowPtBin,hiPtBin);
1643  AddHist(mhMtdMatchTrkPt);
1644 
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);
1647 
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);
1650 
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);
1653 
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);
1656 
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);
1659 
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);
1662 
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);
1665 
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);
1668 
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);
1671 
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);
1674 
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);
1677 
1678  mhMtdMatchDtofVsChan = new TH2F("hMtdMatchDtofVsChan","MTD: #Deltatof distribution;channel;#Deltatof (ns)",1801,-0.5,1800.5,100,-5,5);
1679  AddHist(mhMtdMatchDtofVsChan);
1680 
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);
1683 
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);
1686 
1688  mhNMuonPos = new TH1F("hNMuonPos","Number of positive muon candidates per event;N",5,-0.5,4.5);
1689  AddHist(mhNMuonPos);
1690 
1691  mhNMuonNeg = new TH1F("hNMuonNeg","Number of negative muon candidates per event;N",5,-0.5,4.5);
1692  AddHist(mhNMuonNeg);
1693 
1694  mhMuonPt = new TH1F("hMuonPt","p_{T} distribution of muon candidates;p_{T} (GeV/c)",nPtBins,lowPtBin,hiPtBin);
1695  AddHist(mhMuonPt);
1696 
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);
1699 
1700  mhMuonMap = new TH2F("hMuonMap","Channel vs backleg of muon candidates;backleg;channel",30,0.5,30.5,60,0.5,60.5);
1701  AddHist(mhMuonMap);
1702 
1703  mhNULpair = new TH1F("hNULpair","Number of unlike-sign pairs per event;N",5,-0.5,4.5);
1704  AddHist(mhNULpair);
1705 
1706  mhNLSpairPos = new TH1F("hNLSpairPos","Number of positive like-sign pairs per event;N",5,-0.5,4.5);
1707  AddHist(mhNLSpairPos);
1708 
1709  mhNLSpairNeg = new TH1F("hNLSpairNeg","Number of negative like-sign pairs per event;N",5,-0.5,4.5);
1710  AddHist(mhNLSpairNeg);
1711 
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);
1714 
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);
1717 
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);
1720 
1721  mhInvMUL = new TH1F("hInvMUL","M_{#mu#mu} for unlike-sign pairs;M_{#mu#mu} (GeV/c^2)",nSpecMBins,specM);
1722  AddHist(mhInvMUL);
1723 
1724  mhInvMLSpos = new TH1F("hInvMLSpos","M_{#mu#mu} for positive like-sign pairs;M_{#mu#mu} (GeV/c^2)",nSpecMBins,specM);
1725  AddHist(mhInvMLSpos);
1726 
1727  mhInvMLSneg = new TH1F("hInvMLSneg","M_{#mu#mu} for negative like-sign pairs;M_{#mu#mu} (GeV/c^2)",nSpecMBins,specM);
1728  AddHist(mhInvMLSneg);
1729 
1730  int nRun = endRun-startRun+1;
1731  double run_lowBin = startRun - 0.5;
1732  double run_highBin = endRun + 0.5;
1733 
1734  mhBBCrateVsRun = new TProfile("mhBBCrateVsRun","BBC rate vs run; run index; BBC rate (kHz)",nRun, run_lowBin, run_highBin);
1735  AddHist((TH1*)mhBBCrateVsRun);
1736 
1737  mhZDCrateVsRun = new TProfile("mhZDCrateVsRun","ZDC rate vs run; run index; ZDC rate (kHz)",nRun, run_lowBin, run_highBin);
1738  AddHist((TH1*)mhZDCrateVsRun);
1739 
1740  mhRefMultVsRun = new TProfile("mhRefMultVsRun","Reference multiplicity vs run; run index; RefMult",nRun, run_lowBin, run_highBin);
1741  AddHist((TH1*)mhRefMultVsRun);
1742 
1743  mhgRefMultVsRun = new TProfile("mhgRefMultVsRun","Global reference multiplicity vs run; run index; gRefMult",nRun, run_lowBin, run_highBin);
1744  AddHist((TH1*)mhgRefMultVsRun);
1745 
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);
1748 
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);
1751 
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);
1754 
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);
1757 
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);
1760 
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);
1763 
1764  mhpTrkEtaVsRun = new TProfile("mhpTrkEtaVsRun","Primary track #eta vs run; run index; #eta_{trk}",nRun, run_lowBin, run_highBin);
1765  AddHist((TH1*)mhpTrkEtaVsRun);
1766 
1767  mhpTrkPhiVsRun = new TProfile("mhpTrkPhiVsRun","Primary track #varphi vs run; run index; #varphi_{trk}",nRun, run_lowBin, run_highBin);
1768  AddHist((TH1*)mhpTrkPhiVsRun);
1769 
1770  mhpTrkDcaVsRun = new TProfile("mhpTrkDcaVsRun","Primary track DCA vs run; run index; DCA (cm)",nRun, run_lowBin, run_highBin);
1771  AddHist((TH1*)mhpTrkDcaVsRun);
1772 
1773  mhNHitsFitVsRun = new TProfile("mhNHitsFitVsRun","Primary track NHitsFit vs run; run index; NhitsFit",nRun, run_lowBin, run_highBin);
1774  AddHist((TH1*)mhNHitsFitVsRun);
1775 
1776  mhNHitsPossVsRun = new TProfile("mhNHitsPossVsRun","Primary track NHitsPoss vs run; run index; NHitsPoss",nRun, run_lowBin, run_highBin);
1777  AddHist((TH1*)mhNHitsPossVsRun);
1778 
1779  mhNHitsDedxVsRun = new TProfile("mhNHitsDedxVsRun","Primary track NHitsDedx vs run; run index; NhitsDedx",nRun, run_lowBin, run_highBin);
1780  AddHist((TH1*)mhNHitsDedxVsRun);
1781 
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);
1784 
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);
1787 
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);
1790 
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);
1793 
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);
1796 
1797  mhBetaVsRun = new TProfile("mhBetaVsRun","Primary track 1/#beta vs run; run index; 1/#beta",nRun, run_lowBin, run_highBin);
1798  AddHist((TH1*)mhBetaVsRun);
1799 
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);
1802 
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);
1805 
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);
1808 
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);
1811 
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);
1814 
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);
1817 
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);
1820 
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);
1823 }
1824 
1825 
1826 //_____________________________________________________________________________
1827 void StMtdQAMaker::printConfig()
1828 {
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");
1851 }
1852 
1853 //_____________________________________________________________________________
1854 Int_t StMtdQAMaker::getMtdHitTHUB(const Int_t backleg) const
1855 {
1856  if(backleg>=1 && backleg<=15) return 2;
1857  else if (backleg>=16 && backleg<=30) return 1;
1858  else return -1;
1859 }
1860 
1861 //_____________________________________________________________________________
1862 Bool_t StMtdQAMaker::isValidTrack(StTrack *track, StVertex *vtx) const
1863 {
1864  StThreeVectorF mom = track->geometry()->momentum();
1865  Float_t pt = mom.perp();
1866  Float_t eta = mom.pseudoRapidity();
1867  Float_t phi = rotatePhi(mom.phi());
1868 
1869  if(pt < mMinTrkPt || pt > mMaxTrkPt) return kFALSE;
1870  if(eta < mMinTrkEta || eta > mMaxTrkEta) return kFALSE;
1871  if(phi < mMinTrkPhi || phi > mMaxTrkPhi) return kFALSE;
1872 
1873  Int_t nHitsFit = track->fitTraits().numberOfFitPoints(kTpcId);
1874  if(nHitsFit<mMinNHitsFit) return kFALSE;
1875 
1876  Int_t nHitsPoss = track->numberOfPossiblePoints(kTpcId);
1877  if(nHitsFit/(1.0*nHitsPoss)<mMinFitHitsFraction) return kFALSE;
1878 
1879  StTpcDedxPidAlgorithm pidAlgorithm;
1880  const StParticleDefinition *pd = track->pidTraits(pidAlgorithm);
1881  if(!pd || !pidAlgorithm.traits()) return kFALSE;
1882  if(pidAlgorithm.traits()->numberOfPoints()<mMinNHitsDedx) return kFALSE;
1883 
1884  StGlobalTrack *globalTrack = dynamic_cast<StGlobalTrack*>(track);
1885  if(!globalTrack) return kFALSE;
1886  THelixTrack thelix = globalTrack->dcaGeometry()->thelix();
1887  const Double_t *pos = thelix.Pos();
1888  StThreeVectorF dcaGlobal = StThreeVectorF(pos[0],pos[1],pos[2]) - vtx->position();
1889  if(dcaGlobal.mag()>mMaxDca) return kFALSE;
1890 
1891  return kTRUE;
1892 }
1893 
1894 
1895 //_____________________________________________________________________________
1896 Bool_t StMtdQAMaker::isValidTrack(const StMuTrack *track) const
1897 {
1898  if(!track) return kFALSE;
1899  const StThreeVectorF mom = track->momentum();
1900  Double_t pt = mom.perp();
1901  Double_t eta = mom.pseudoRapidity();
1902  Double_t phi = rotatePhi(mom.phi());
1903 
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;
1911  return kTRUE;
1912 }
1913 
1914 //_____________________________________________________________________________
1915 Bool_t StMtdQAMaker::isValidTrack(const StPicoTrack *track) const
1916 {
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());
1922 
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;
1929  double dca = track->gDCA(mPicoDst->event()->primaryVertex()).Mag();
1930  if(dca>mMaxDca) return kFALSE;
1931  return kTRUE;
1932 }
1933 
1934 //_____________________________________________________________________________
1935 Bool_t StMtdQAMaker::isMuonCandidate(const StMuTrack *track)
1936 {
1937  if(!track) return kFALSE;
1938  Double_t pt = track->momentum().perp();
1939  Double_t nSigmaPi = track->nSigmaPion();
1940 
1941  Double_t dz = -999., dy = -999, dtof = -999.;
1942  Bool_t isMtdTrig = kFALSE;
1943  Int_t iMtd = track->index2MtdHit();
1944  if(iMtd>=0)
1945  {
1946  const StMuMtdPidTraits mtdPid = track->mtdPidTraits();
1947  dy = mtdPid.deltaY();
1948  dz = mtdPid.deltaZ();
1949  dtof = mtdPid.timeOfFlight() - mtdPid.expTimeOfFlight();
1950 
1951  StMuMtdHit *hit = mMuDst->mtdHit(iMtd);
1952  isMtdTrig = mTrigUtil ? mTrigUtil->isHitFireTrigger(hit->backleg(), hit->module()) : kFALSE;
1953  }
1954 
1955  return isMuonCandidate(pt, nSigmaPi, dz, dy, dtof, isMtdTrig);
1956 }
1957 
1958 //_____________________________________________________________________________
1959 Bool_t StMtdQAMaker::isMuonCandidate(const StPicoTrack *track)
1960 {
1961  if(!track) return kFALSE;
1962  Double_t pt = track->pMom().Perp();
1963  Double_t nSigmaPi = track->nSigmaPion();
1964 
1965  double dz = -999., dy = -999, dtof = -999.;
1966  bool isMtdTrig = kFALSE;
1967  int iMtd = track->mtdPidTraitsIndex();
1968  if(iMtd>=0)
1969  {
1970  StPicoMtdPidTraits *mtdPid = mPicoDst->mtdPidTraits(iMtd);
1971  dy = mtdPid->deltaY();
1972  dz = mtdPid->deltaZ();
1973  dtof = mtdPid->deltaTimeOfFlight();
1974 
1975  int hitIndex = getMtdHitIndex(track);
1976  StPicoMtdHit *hit = mPicoDst->mtdHit(hitIndex);
1977  isMtdTrig = hit->triggerFlag();
1978  }
1979 
1980  return isMuonCandidate(pt, nSigmaPi, dz, dy, dtof, isMtdTrig);
1981 }
1982 
1983 
1984 //_____________________________________________________________________________
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)
1986 {
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;
1993 
1994  return kTRUE;
1995 }
1996 
1997 
1998 //_____________________________________________________________________________
1999 Int_t StMtdQAMaker::getMtdHitIndex(const StPicoTrack *track)
2000 {
2001  Int_t index = -1;
2002  if(track->mtdPidTraitsIndex()>=0)
2003  {
2004  StPicoMtdPidTraits *mtdPid = mPicoDst->mtdPidTraits(track->mtdPidTraitsIndex());
2005  Int_t nMtdHits = mPicoDst->numberOfMtdHits();
2006  for(Int_t i=0; i<nMtdHits; i++)
2007  {
2008  StPicoMtdHit *hit = mPicoDst->mtdHit(i);
2009  if(!hit) continue;
2010  if(mtdPid->backleg()==hit->backleg() &&
2011  mtdPid->module()==hit->module() &&
2012  mtdPid->cell()==hit->cell())
2013  {
2014  index = i;
2015  break;
2016  }
2017  }
2018  }
2019  return index;
2020 }
2021 
2022 //_____________________________________________________________________________
2023 Int_t StMtdQAMaker::getMtdPidTraitsIndex(const StPicoMtdHit *hit)
2024 {
2025  Int_t index = -1;
2026  Int_t nPidTraits = mPicoDst->numberOfMtdPidTraits();
2027  for(Int_t i=0; i<nPidTraits; i++)
2028  {
2029  StPicoMtdPidTraits *mtdPid = mPicoDst->mtdPidTraits(i);
2030  if(!mtdPid) continue;
2031  if(mtdPid->backleg()==hit->backleg() &&
2032  mtdPid->module()==hit->module() &&
2033  mtdPid->cell()==hit->cell())
2034  {
2035  index = i;
2036  break;
2037  }
2038  }
2039  return index;
2040 }
2041 
2042 //_____________________________________________________________________________
2043 Double_t StMtdQAMaker::rotatePhi(Double_t phi) const
2044 {
2045  Double_t outPhi = phi;
2046  while(outPhi<0) outPhi += 2*pi;
2047  while(outPhi>2*pi) outPhi -= 2*pi;
2048  return outPhi;
2049 }
2050 
2051 //
Float_t btofZLocal() const
Return zLocal (compression = zLocal * 1000)
static StMuPrimaryVertex * primaryVertex()
return pointer to current primary vertex
Definition: StMuDst.h:322
std::pair< Float_t, Float_t > leadingEdgeTime() const
Return leading edge time.
Definition: StPicoMtdHit.h:49
static StPicoMtdHit * mtdHit(Int_t i)
Return pointer to i-th mtd hit.
Definition: StPicoDst.h:75
Holds information about MTD-matched track.
Int_t runId() const
Return run ID.
Definition: StPicoEvent.h:41
Class that converts MuDst into PicoDst.
Float_t nSigmaKaon() const
Return nSigma(kaon)
Definition: StPicoTrack.h:138
static UInt_t numberOfMtdHits()
Return number of MTD hits.
Definition: StPicoDst.h:114
Float_t nSigmaPion() const
Return nSigma(pion)
Definition: StPicoTrack.h:136
StMuDst * muDst()
Definition: StMuDstMaker.h:425
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.
Definition: StPicoEvent.h:191
Double_t pt() const
Returns pT at point of dca to primary vertex.
Definition: StMuTrack.h:256
short id() const
Returns the track id(or key), is unique for a track node, i.e. global and primary tracks have the sam...
Definition: StMuTrack.h:228
UShort_t nHitsDedx() const
Return number of hits used for dEdx.
Definition: StMuTrack.h:238
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)
Definition: StPicoDst.h:63
Holds information about track parameters.
Definition: StPicoTrack.h:35
Float_t deltaZ() const
Return delta Z.
Int_t backleg() const
Return backleg number (1-30) of the MTD hit.
Definition: StPicoMtdHit.h:39
UShort_t nHitsFit() const
Return total number of hits used in fit.
Definition: StMuTrack.h:239
static StPicoMtdPidTraits * mtdPidTraits(Int_t i)
Return pointer to i-th mtd pidTraits.
Definition: StPicoDst.h:87
static UInt_t numberOfTracks()
Return number of tracks.
Definition: StPicoDst.h:104
Int_t module() const
Return module number (1-5) of the MTD hit.
Definition: StPicoMtdHit.h:41
Float_t nSigmaElectron() const
Return nSigma(electron)
Definition: StPicoTrack.h:142
Short_t charge() const
Returns charge.
Definition: StMuTrack.h:255
Float_t BBCx() const
Return BBC coincidence rate.
Definition: StPicoEvent.h:193
Int_t trackIndex() const
Return assiciated track index.
const StThreeVectorF & p() const
Returns 3-momentum at dca to primary vertex.
Definition: StMuTrack.h:259
Double_t nSigmaPion() const
Returns Craig&#39;s distance to the calculated dE/dx band for pions in units of sigma.
Definition: StMuTrack.h:245
Double_t eta() const
Returns pseudo rapidity at point of dca to primary vertex.
Definition: StMuTrack.h:257
Float_t vzVpd() const
Return z position of the primary vertex estimated by VPD.
Definition: StPicoEvent.h:164
Int_t nHitsDedx() const
Return number of hits used for dE/dx measurement.
Definition: StPicoTrack.h:112
StPicoDst * picoDst()
Returns null pointer if no StPicoDst.
static TObjArray * primaryTracks()
returns pointer to a list of tracks belonging to the selected primary vertex
Definition: StMuDst.h:301
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)
Definition: StMuEvent.cxx:195
static StPicoMtdTrigger * mtdTrigger(Int_t i)
Return pointer to i-th MTD trigger data.
Definition: StPicoDst.h:69
Double_t nSigmaElectron() const
Returns Craig&#39;s distance to the calculated dE/dx band for electrons in units of sigma.
Definition: StMuTrack.h:244
static UInt_t numberOfMtdPidTraits()
Return number of MTD traits.
Definition: StPicoDst.h:126
UShort_t nHitsPoss() const
Return number of possible hits on track.
Definition: StMuTrack.cxx:242
TVector3 pMom() const
Return momentum (GeV/c) of the primary track. Return (0,0,0) if not primary track.
Definition: StPicoTrack.h:62
Float_t dEdx() const
Return dE/dx (in keV/cm) of the track.
Definition: StPicoTrack.h:116
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:320
Int_t refMult() const
Return RefMult (-0.5&lt;eta&lt;0.5)
Definition: StPicoEvent.h:83
float timeOfFlight() const
timing for PID
std::pair< Float_t, Float_t > tot() const
Return time-over-threshold of the MTD hit.
Definition: StPicoMtdHit.h:53
const StThreeVectorF & momentum() const
Returns 3-momentum at dca to primary vertex.
Definition: StMuTrack.h:260
static StPicoTrack * track(Int_t i)
Return pointer to i-th track.
Definition: StPicoDst.h:65
Holds information about the hit from MTD.
Definition: StPicoMtdHit.h:18
Definition: Stypes.h:42
Definition: Stypes.h:40
Float_t nSigmaProton() const
Return nSigma(proton)
Definition: StPicoTrack.h:140
Double_t dEdx() const
Returns measured dE/dx value.
Definition: StMuTrack.h:248
Int_t nHitsFit() const
Return number of hits fit.
Definition: StPicoTrack.h:106
Int_t grefMult() const
Return gRefMult (RefMult by global tracks in |gRefMult|&lt;0.5)
Definition: StPicoEvent.h:127
Int_t triggerFlag() const
Definition: StPicoMtdHit.h:47
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.
Definition: StPicoEvent.h:24
Int_t cell() const
Return cell number (0-11) of the MTD hit.
Definition: StPicoMtdHit.h:43
static StBTofHeader * btofHeader()
returns pointer to the btofHeader - dongx
Definition: StMuDst.h:423
Double_t phi() const
Returns phi at point of dca to primary vertex.
Definition: StMuTrack.h:258
Int_t nHitsMax() const
Return number of hits possible.
Definition: StPicoTrack.h:108
Double_t nSigmaProton() const
Returns Craig&#39;s distance to the calculated dE/dx band for protons in units of sigma.
Definition: StMuTrack.h:247
Int_t module() const
Return module number.
Int_t mtdPidTraitsIndex() const
Return index to the corresponding MTD PID trait.
Definition: StPicoTrack.h:185
Int_t bTofPidTraitsIndex() const
Return index to the corresponding BTOF PID trait.
Definition: StPicoTrack.h:183
static UInt_t numberOfBTofHits()
Return number of BTof hits.
Definition: StPicoDst.h:112
StThreeVectorF dcaGlobal(Int_t vtx_id=-1) const
Returns 3D distance of closest approach to primary vertex of associated global track.
Definition: StMuTrack.cxx:371
Double_t nSigmaKaon() const
Returns Craig&#39;s distance to the calculated dE/dx band for kaons in units of sigma.
Definition: StMuTrack.h:246
Definition: Stypes.h:44
static void setVertexIndex(Int_t vtx_id)
Set the index number of the current primary vertex (used by both primaryTracks() functions and for St...
Definition: StMuDst.cxx:273
TVector3 primaryVertex() const
Return primary vertex position.
Definition: StPicoEvent.h:52
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.
Definition: StPicoDst.h:85
Short_t charge() const
Return charge of the track (encoded in nHitsFit as: nHitsFit * charge)
Definition: StPicoTrack.h:102