StMuDstQAMaker.cxx 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086
  1. #include "StMuDstQAMaker.h"
  2. #include "StBTofHeader.h"
  3. #include "TBranch.h"
  4. ClassImp(StMuDstQAMaker)
  5. //
  6. // Set maximum file size to 1.9 GB (Root has a 2GB limit)
  7. //
  8. #define MAXFILESIZE 1900000000
  9. StMuDstQAMaker::StMuDstQAMaker(StMuDstMaker *muMaker,
  10. const Char_t *oFileName) {
  11. std::cout << "StMuDstQAMaker::StMuDstQAMaker - Creating an instance...";
  12. mMuDstMaker = muMaker;
  13. mAcceptTriggerFail = 0;
  14. mRefMultFail = 0;
  15. mAntiPileupFail = 0;
  16. mRankingFail = 0;
  17. mVtxNullFail = 0;
  18. mNPrimVtxFail = 0;
  19. mAcceptPrimVtxFail = 0;
  20. mEventIsGood = false;
  21. mNEventsIn = 0;
  22. mNEventsPassed = 0;
  23. mIsGoodTrack = false;
  24. mCurrentTrigger = 0;
  25. mTrackLoop = true;
  26. mTriggerCut = true;
  27. mFileName = oFileName;
  28. //
  29. // Initialize event cut variables
  30. //
  31. mPrimVtxZ[0] = -70.;
  32. mPrimVtxZ[1] = 70.;
  33. mPrimVtxR[0] = -1.;
  34. mPrimVtxR[1] = 10.;
  35. mPrimVtxVpdVzDiff[0] = -10.;
  36. mPrimVtxVpdVzDiff[1]= 10.;
  37. mPrimVtxXShift = 0.;
  38. mPrimVtxYShift = 0.;
  39. //
  40. // Initialize single-particle cut variables
  41. //
  42. mTrackP[0] = 0.1;
  43. mTrackP[1] = 2.;
  44. mTrackDca[0] = 0.;
  45. mTrackDca[1] = 5.;
  46. mTrackDcaGlobal[0] = 0.;
  47. mTrackDcaGlobal[1] = 5.;
  48. mTrackNHits[0] = 15;
  49. mTrackNHits[1] = 50;
  50. mTrackNHitsFit[0] = 15;
  51. mTrackNHitsFit[1] = 50;
  52. mTrackEta[0] = -1.1;
  53. mTrackEta[1] = 1.1;
  54. mTrackFlag[0] = 0;
  55. mTrackFlag[1] = 1000;
  56. /*
  57. //
  58. // Initialize TPC and TOF PID
  59. //
  60. mPionPionNSigma[0] = -3.; mPionPionNSigma[1] = 3.;
  61. mPionKaonNSigma[0] = 1.; mPionKaonNSigma[1] = -1.;
  62. */
  63. mTTTPThreshold = 0.7;
  64. std::cout << "\t[DONE]" << std::endl;
  65. }
  66. //_________________
  67. StMuDstQAMaker::~StMuDstQAMaker() {
  68. /* nothing to do */
  69. }
  70. //_________________
  71. Int_t StMuDstQAMaker::Init() {
  72. std::cout << "StMuDstQAMaker::Init - Initializing the maker"
  73. << std::endl;
  74. //
  75. // Create histograms and output file
  76. //
  77. mOutFile = new TFile(mFileName, "RECREATE");
  78. //
  79. // General event distributions (before event cuts)
  80. //
  81. hR_BeforeCut = new TH1F("hR_BeforeCut", "R=#sqrt{v_{x}^{2} + v_{y}^{2}};R (cm);#",
  82. 160, 0., 0.8);
  83. hVx_BeforeCut = new TH1F("hVx_BeforeCut", ";v_{x} (cm);#", 320, -0.8, 0.8);
  84. hVy_BeforeCut = new TH1F("hVy_BeforeCut", ";v_{y} (cm);#", 320, -0.8, 0.8);
  85. hVz_BeforeCut = new TH1F("hVz_BeforeCut", ";v_{z} (cm);#", 400, -200., 200.);
  86. hVxVsVy_BeforeCut = new TH2F("hVxVsVy_BeforeCut", ";v_{x} (cm); v_{y} (cm)",
  87. 320, -0.8, 0.8,
  88. 320, -0.8, 0.8);
  89. hVxVsVz_BeforeCut = new TH2F("hVxVsVz_BeforeCut", ";v_{x} (cm); v_{z} (cm)",
  90. 600, -0.8, 0.8,
  91. 400, -200., 200.);
  92. hVyVsVz_BeforeCut = new TH2F("hVyVsVz_BeforeCut", ";v_{y} (cm); v_{z} (cm)",
  93. 320, -0.8, 0.8,
  94. 400, -200., 200.);
  95. hVpdVz2D_BeforeCut = new TH2F("hVpdVz2D_BeforeCut", ";vpd_{z} (cm); v_{z} (cm)",
  96. 400, -200., 200.,
  97. 400, -200., 200.);
  98. hNPrimTr_BeforeCut = new TH1F("hNPrimTr_BeforeCut", ";N_{primary tracks};#", 150, 0, 150);
  99. hNGlobTr_BeforeCut = new TH1F("hNGlobTr_BeforeCut", ";N_{global tracks};#", 200, 0, 2000);
  100. hTofRefMult_BeforeCut = new TH1F("hTofRefMult_BeforeCut", ";TofRefMult;#", 100, 0, 1000);
  101. hTofRefMultVsRefMult_BeforeCut = new TH2F("hTofRefMultVsRefMult_BeforeCut", ";TofRefMult;RefMult",
  102. 500, 0., 1000,
  103. 500, 0., 1000);
  104. hVpd_BeforeCut = new TH1F("hVpd_BeforeCut", ";v_{z}^{vpd} (cm);#", 400, -200., 200.);
  105. hVpdVz_BeforeCut = new TH1F("hVpdVz_BeforeCut", ";v_{z}^{vpd}-v_{z}", 200, -20., 20.);
  106. hNPrimVtx_BeforeCut = new TH1F("hNPrimVtx_BeforeCut", ";N_{primary vertex};#", 15, 0, 15);
  107. hTriggerId_BeforePileupCut = new TH1I("hTriggerId_BeforePileupCut", ";trigger ID;#",
  108. 32, 0, 32);
  109. hTriggerId_BeforeAllCut = new TH1I("hTriggerId_BeforeAllCut", ";trigger ID;#",
  110. 32, 0, 32);
  111. hTriggerId_BeforeVertexCut = new TH1I("hTriggerId_BeforeVertexCut", ";trigger ID;#",
  112. 32, 0, 32);
  113. //
  114. // General event distributions (after event cuts)
  115. //
  116. hR_AfterCut = new TH1F("hR_AfterCut", "R=#sqrt{v_{x}^{2} + v_{y}^{2}};R (cm);#",
  117. 160, 0., 0.8);
  118. hVx_AfterCut = new TH1F("hVx_AfterCut", ";v_{x} (cm);#", 320, -0.8, 0.8);
  119. hVy_AfterCut = new TH1F("hVy_AfterCut", ";v_{y} (cm);#", 320, -0.8, 0.8);
  120. hVz_AfterCut = new TH1F("hVz_AfterCut", ";v_{z} (cm);#", 400, -200., 200.);
  121. hVxVsVy_AfterCut = new TH2F("hVxVsVy_AfterCut", ";v_{x} (cm); v_{y} (cm)",
  122. 320, -0.8, 0.8,
  123. 320, -0.8, 0.8);
  124. hVxVsVz_AfterCut = new TH2F("hVxVsVz_AfterCut", ";v_{x} (cm); v_{z} (cm)",
  125. 320, -0.8, 0.8,
  126. 400, -200., 200.);
  127. hVyVsVz_AfterCut = new TH2F("hVyVsVz_AfterCut", ";v_{y} (cm); v_{z} (cm)",
  128. 320, -0.8, 0.8,
  129. 400, -200., 200.);
  130. hVpdVz2D_AfterCut = new TH2F("hVpdVz2D_AfterCut", ";vpd_{z} (cm); v_{z} (cm)",
  131. 400, -200., 200.,
  132. 400, -200., 200.);
  133. hNPrimTr_AfterCut = new TH1F("hNPrimTr_AfterCut", ";N_{primary tracks};#", 150, 0, 150);
  134. hNGlobTr_AfterCut = new TH1F("hNGlobTr_AfterCut", ";N_{global tracks};#", 200, 0, 2000);
  135. hTofRefMult_AfterCut = new TH1F("hTofRefMult_AfterCut", ";TofRefMult;#", 100, 0, 1000);
  136. hTofRefMultVsRefMult_AfterCut = new TH2F("hTofRefMultVsRefMult_AfterCut", ";TofRefMult;RefMult",
  137. 500, 0., 1000,
  138. 500, 0., 1000);
  139. hVpd_AfterCut = new TH1F("hVpd_AfterCut", ";v_{z}^{vpd} (cm);#", 400, -200., 200.);
  140. hVpdVz_AfterCut = new TH1F("hVpdVz_AfterCut", ";v_{z}^{vpd}-v_{z}", 200, -20., 20.);
  141. hNPrimVtx_AfterCut = new TH1F("hNPrimVtx_AfterCut", ";N_{primary vertex};#", 15, 0, 15);
  142. hTriggerId_AfterCut = new TH1I("hTriggerId_AfterCut", ";trigger ID;#",
  143. 32, 0, 32);
  144. //
  145. // General track distributions
  146. //
  147. if (mTrackLoop)
  148. {
  149. hNHitsVsMom = new TH2F("hNHitsVsMom", ";p (GeV/c);NHits",
  150. 400, -2.0, 2.0,
  151. 50, 0., 50.);
  152. pNHitsVsMom = new TProfile("pNHitsVsMom", ";p (GeV/c);<NHits>",
  153. 400, -2.0, 2.0);
  154. hP = new TH1F("hP", ";p (GeV/c);#", 200, 0., 5.);
  155. hPt = new TH1F("hPt", ";p_{t} (GeV/c);#", 200, 0., 5.);
  156. hPx = new TH1F("hPx", ";p_{x} (GeV/c);#", 200, 0., 5.);
  157. hPy = new TH1F("hPy", ";p_{y} (GeV/c);#", 200, 0., 5.);
  158. hPz = new TH1F("hPz", ";p_{z} (GeV/c);#", 200, 0., 5.);
  159. hEta = new TH1F("hEta", ";#eta;#", 200, -2., 2.);
  160. hPAccept = new TH1F("hPAccept", "accepted tracks;p (GeV/c);#", 200, 0., 3.);
  161. hPtAccept = new TH1F("hPtAccept", "accepted tracks;p_{t} (GeV/c);#", 200, 0., 3.);
  162. hPxAccept = new TH1F("hPxAccept", "accepted tracks;p_{x} (GeV/c);#", 200, 0., 3.);
  163. hPyAccept = new TH1F("hPyAccept", "accepted tracks;p_{y} (GeV/c);#", 200, 0., 3.);
  164. hPzAccept = new TH1F("hPzAccept", "accepted tracks;p_{z} (GeV/c);#", 200, 0., 3.);
  165. hEtaAccept = new TH1F("hEtaAccept", "accepted tracks;#eta;#", 200, -2., 2.);
  166. hMassSqrVsPt = new TH2F("hMassSqrVsPt", ";p_{t}Q (GeV/c);m^{2} (GeV/c^{2})",
  167. 400, -2., 2.,
  168. 1000, -0.1, 1.5);
  169. hDedxVsPt = new TH2F("hDedxVsPt", ";p_{t}Q (GeV/c);dE/dx (keV/cm)",
  170. 400, -2., 2.,
  171. 400, 0., 20.);
  172. hInvBetaExpVsPt = new TH2F("hInvBetaExpVsPt", ";p_{t}Q (GeV/c);1/beta_{exp}",
  173. 400, -2., 2.,
  174. 200, 0., 2.);
  175. hInvBetaThVsPt = new TH2F("hInvBetaThVsPt", ";p_{t}Q (GeV/c);1/beta_{exp}",
  176. 400, -2., 2.,
  177. 200, 0., 2.);
  178. hTOF = new TH1F("hTOF", "time of flight;t ns;#", 100, 0., 50.);
  179. hDiffBeta = new TH1F("hDiffBeta",
  180. "difference in #beta between primary and global tracks;#beta_{primary} - #beta_{global};counts",
  181. 5000., -10., 10.);
  182. hDiffTOF = new TH1F("hDiffTOF",
  183. "difference in TOF between primary and global tracks;TOF_{primary} - TOF_{global};counts",
  184. 5000., -100., 100.);
  185. // Pion PID
  186. hNSigmaPionPion = new TH1F("hNSigmaPionPion", "#pi;n#sigma(#pi^{#pm});#",
  187. 100, -5., 5.);
  188. hNSigmaPionKaon = new TH1F("hNSigmaPionKaon", "#pi;n#sigma(#K^{#pm});#",
  189. 100, -5., 5.);
  190. hNSigmaPionProton = new TH1F("hNSigmaPionProton", "#pi;n#sigma(p);#",
  191. 100, -5., 5.);
  192. hNSigmaPionPionVsPt = new TH2F("hNSigmaPionPionVsPt",
  193. "#pi;p_{t}Q (GeV/c);n#sigma(#pi^{#pm})",
  194. 400, -2., 2.,
  195. 1000, -5., 5.);
  196. hNSigmaPionKaonVsPt = new TH2F("hNSigmaPionKaonVsPt",
  197. "#pi;p_{t}Q (GeV/c);n#sigma(K^{#pm})",
  198. 400, -2., 2.,
  199. 1000, -5., 5.);
  200. hNSigmaPionProtonVsPt = new TH2F("hNSigmaPionProtonVsPt",
  201. "#pi;p_{t}Q (GeV/c);n#sigma(p)",
  202. 400, -2., 2.,
  203. 1000, -5., 5.);
  204. hDMassSqrVsPtPionTPC = new TH2F("hDMassSqrVsPtPionTPC",
  205. "TPC PID;p_{t} (GeV/c);dM(#pi^{#pm}) (GeV/c^{2})",
  206. 400, -2., 2.,
  207. 500, -.5, .5);
  208. hDMassSqrVsPtPionTOF = new TH2F("hDMassSqrVsPtPionTOF",
  209. "TOF PID;p_{t} (GeV/c);dM(#pi^{#pm}) (GeV/c^{2})",
  210. 400, -2., 2.,
  211. 500, -.5, .5);
  212. hInvBetaExpThPionTNT = new TH2F("hInvBetaExpThPionTNT", "TPC and TOF #pi^{#pm} PID;p_{t}Q (GeV/c);1/beta_{exp} - 1/beta_{th}",
  213. 400, -2., 2.,
  214. 500, -0.5, 0.5);
  215. hInvBetaExpThPionTPC = new TH2F("hInvBetaExpThPionTPC", "only TPC #pi^{#pm} PID;p_{t}Q (GeV/c);1/beta_{exp} - 1/beta_{th}",
  216. 400, -2., 2.,
  217. 500, -0.5, 0.5);
  218. hInvBetaExpThPionTOF = new TH2F("hInvBetaExpThPionTOF", "only TOF #pi^{#pm} PID;p_{t}Q (GeV/c);1/beta_{exp} - 1/beta_{th}",
  219. 400, -2., 2.,
  220. 500, -0.5, 0.5);
  221. hInvBetaExpThPionTTT = new TH2F("hInvBetaExpThPionTTT",
  222. Form("if p #leq %.2f then TPC, else TOF #pi^{#pm} PID;p_{t}Q (GeV/c);1/beta_{exp} - 1/beta_{th}",
  223. mTTTPThreshold),
  224. 400, -2., 2.,
  225. 500, -0.5, 0.5);
  226. hInvBetaExpThPionINT = new TH2F("hInvBetaExpThPionINT",
  227. "#pi^{#pm};p_{t}Q (GeV/c);1/beta_{exp} - 1/beta_{th}",
  228. 400, -2., 2.,
  229. 500, -5., 5.);
  230. // Kaon PID
  231. hNSigmaKaonPion = new TH1F("hNSigmaKaonPion", "K;n#sigma(#pi^{#pm}};#",
  232. 100, -5., 5.);
  233. hNSigmaKaonKaon = new TH1F("hNSigmaKaonKaon", "K;n#sigma(#K^{#pm}};#",
  234. 100, -5., 5.);
  235. hNSigmaKaonProton = new TH1F("hNSigmaKaonProton", "K;n#sigma(p);#",
  236. 100, -5., 5.);
  237. hNSigmaKaonPionVsPt = new TH2F("hNSigmaKaonPionVsPt",
  238. "K;p_{t}Q (GeV/c);n#sigma(#pi^{#pm})",
  239. 400, -2., 2.,
  240. 1000, -5., 5.);
  241. hNSigmaKaonKaonVsPt = new TH2F("hNSigmaKaonKaonVsPt",
  242. "K;p_{t}Q (GeV/c);n#sigma(K^{#pm})",
  243. 400, -2., 2.,
  244. 1000, -5., 5.);
  245. hNSigmaKaonProtonVsPt = new TH2F("hNSigmaKaonProtonVsPt",
  246. "K;p_{t}Q (GeV/c);n#sigma(p)",
  247. 400, -2., 2.,
  248. 1000, -5., 5.);
  249. hDMassSqrVsPtKaonTPC = new TH2F("hDMassSqrVsPtKaonTPC",
  250. "TPC PID;p_{t} (GeV/c);dM(K^{#pm}) (GeV/c^{2})",
  251. 400, -2., 2.,
  252. 500, -.5, .5);
  253. hDMassSqrVsPtKaonTOF = new TH2F("hDMassSqrVsPtKaonTOF",
  254. "TOF PID;p_{t} (GeV/c);dM(K^{#pm}) (GeV/c^{2})",
  255. 400, -2., 2.,
  256. 500, -.5, .5);
  257. hInvBetaExpThKaonTNT = new TH2F("hInvBetaExpThKaonTNT", "TPC and TOF K^{#pm} PID;p_{t}Q (GeV/c);1/beta_{exp} - 1/beta_{th}",
  258. 400, -2., 2.,
  259. 500, -0.5, 0.5);
  260. hInvBetaExpThKaonTPC = new TH2F("hInvBetaExpThKaonTPC", "only TPC K^{#pm} PID;p_{t}Q (GeV/c);1/beta_{exp} - 1/beta_{th}",
  261. 400, -2., 2.,
  262. 500, -0.5, 0.5);
  263. hInvBetaExpThKaonTOF = new TH2F("hInvBetaExpThKaonTOF", "only TOF K^{#pm} PID;p_{t}Q (GeV/c);1/beta_{exp} - 1/beta_{th}",
  264. 400, -2., 2.,
  265. 500, -0.5, 0.5);
  266. hInvBetaExpThKaonTTT = new TH2F("hInvBetaExpThKaonTTT",
  267. Form("if p #leq %.2f then TPC, else TOF K^{#pm} PID;p_{t}Q (GeV/c);1/beta_{exp} - 1/beta_{th}",
  268. mTTTPThreshold),
  269. 400, -2., 2.,
  270. 500, -0.5, 0.5);
  271. hInvBetaExpThKaonINT = new TH2F("hInvBetaExpThKaonINT",
  272. "K^{#pm};p_{t}Q (GeV/c);1/beta_{exp} - 1/beta_{th}",
  273. 400, -2., 2.,
  274. 500, -5., 5.);
  275. // Proton PID
  276. hNSigmaProtonPion = new TH1F("hNSigmaProtonPion", "p;n#sigma(#pi^{#pm}};#",
  277. 100, -5., 5.);
  278. hNSigmaProtonKaon = new TH1F("hNSigmaProtonKaon", "p;n#sigma(#K^{#pm}};#",
  279. 100, -5., 5.);
  280. hNSigmaProtonProton = new TH1F("hNSigmaProtonProton", "p;n#sigma(p);#",
  281. 100, -5., 5.);
  282. hNSigmaProtonPionVsPt = new TH2F("hNSigmaProtonPionVsPt",
  283. "p;p_{t}Q (GeV/c);n#sigma(#pi^{#pm})",
  284. 400, -2., 2.,
  285. 1000, -5., 5.);
  286. hNSigmaProtonKaonVsPt = new TH2F("hNSigmaProtonKaonVsPt",
  287. "p;p_{t}Q (GeV/c);n#sigma(K^{#pm})",
  288. 400, -2., 2.,
  289. 1000, -5., 5.);
  290. hNSigmaProtonProtonVsPt = new TH2F("hNSigmaProtonProtonVsPt",
  291. "p;p_{t}Q (GeV/c);n#sigma(p)",
  292. 400, -2., 2.,
  293. 1000, -5., 5.);
  294. hDMassSqrVsPtProtonTPC = new TH2F("hDMassSqrVsPtProtonTPC",
  295. "TPC PID;p_{t} (GeV/c);dM(p) (GeV/c^{2})",
  296. 400, -2., 2.,
  297. 500, -.5, .5);
  298. hDMassSqrVsPtProtonTOF = new TH2F("hDMassSqrVsPtProtonTOF",
  299. "TOF PID;p_{t} (GeV/c);dM(p) (GeV/c^{2})",
  300. 400, -2., 2.,
  301. 500, -.5, .5);
  302. hInvBetaExpThProtonTNT = new TH2F("hInvBetaExpThProtonTNT", "TPC and TOF p PID;p_{t}Q (GeV/c);1/beta_{exp} - 1/beta_{th}",
  303. 400, -2., 2.,
  304. 500, -0.5, 0.5);
  305. hInvBetaExpThProtonTPC = new TH2F("hInvBetaExpThProtonTPC", "only TPC p PID;p_{t}Q (GeV/c);1/beta_{exp} - 1/beta_{th}",
  306. 400, -2., 2.,
  307. 500, -0.5, 0.5);
  308. hInvBetaExpThProtonTOF = new TH2F("hInvBetaExpThProtonTOF", "only TOF p PID;p_{t}Q (GeV/c);1/beta_{exp} - 1/beta_{th}",
  309. 400, -2., 2.,
  310. 500, -0.5, 0.5);
  311. hInvBetaExpThProtonTTT = new TH2F("hInvBetaExpThProtonTTT",
  312. Form("if p #leq %.2f then TPC, else TOF p PID;p_{t}Q (GeV/c);1/beta_{exp} - 1/beta_{th}",
  313. mTTTPThreshold),
  314. 400, -2., 2.,
  315. 500, -0.5, 0.5);
  316. hInvBetaExpThProtonINT = new TH2F("hInvBetaExpThProtonINT",
  317. "p;p_{t}Q (GeV/c);1/beta_{exp} - 1/beta_{th}",
  318. 400, -2., 2.,
  319. 500, -5., 5.);
  320. }
  321. //
  322. // Any charge
  323. //
  324. hRefMult_BeforeCut = new TH1F("hRefMult_BeforeCut", ";RefMult;#", 100, 0., 1000.);
  325. hRefMultAccept_BeforeCut = new TH1F("hRefMultAccept_BeforeCut", ";RefMultAccept;#", 100, 0., 1000.);
  326. hRefMult_AfterCut = new TH1F("hRefMult_AfterCut", ";RefMult;#", 100, 0., 1000.);
  327. hRefMultAccept_AfterCut = new TH1F("hRefMultAccept_AfterCut", ";RefMultAccept;#", 100, 0., 1000.);
  328. std::cout << "StMuDstQAMaker::Init - Initialization has been finished"
  329. << std::endl;
  330. return StMaker::Init();
  331. }
  332. //________________
  333. void StMuDstQAMaker::Clear(Option_t *option) {
  334. StMaker::Clear();
  335. }
  336. //________________
  337. Int_t StMuDstQAMaker::Make() {
  338. mNEventsIn++;
  339. mMuDst = NULL;
  340. mMuEvent = NULL;
  341. //MuDstMaker initialization
  342. if(!mMuDstMaker) {
  343. mMuDstMaker = (StMuDstMaker*)GetMaker("MuDst");
  344. if(!mMuDstMaker) {
  345. LOG_ERROR << "StMuDstQAMaker::Make [ERROR] - Cannot find StMuDstMaker"
  346. << std::endl;
  347. return kStOk;
  348. }
  349. }
  350. //Obtaining MuDst
  351. mMuDst = mMuDstMaker->muDst();
  352. if (!mMuDst) {
  353. mMuDst = (StMuDst*)GetInputDS("MuDst");
  354. if (!mMuDst) {
  355. gMessMgr->Warning() << "StFemtoDstMaker::Make [WARNING] - No MuDst has been found"
  356. << endm;
  357. return kStOk;
  358. }
  359. }
  360. //Obtaining MuEvent
  361. mMuEvent = (StMuEvent*)mMuDst->event();
  362. //Multiplicity cannot be negative
  363. unsigned short refMult = mMuEvent->refMult();
  364. unsigned short refMultPos = 0;
  365. unsigned short refMultNeg = 0;
  366. if(refMult < 0) {
  367. mRefMultFail++;
  368. std::cout << "[kStOk] RefMult less than zero!\n";
  369. return kStOk;
  370. }
  371. int mNVertices = mMuDst->numberOfPrimaryVertices();
  372. int mNPrimTracks = mMuDst->numberOfPrimaryTracks();
  373. int mNGlobTracks = mMuDst->numberOfGlobalTracks();
  374. if (mNVertices == 0)
  375. {
  376. return kStOk;
  377. }
  378. //Some initializations of local variables
  379. mPrimVertex = NULL;
  380. StThreeVectorF mVertPosition;
  381. Float_t mVpdVz = 0.;
  382. Int_t mPrimVertIndex = -999;
  383. Float_t mRanking = -999.;
  384. //Clean index vectors
  385. CleanVariables();
  386. //Vertex loop
  387. unsigned short refMultAccept = 0;
  388. unsigned short tofRefMult = 0;
  389. unsigned short refMultAcceptPos = 0;
  390. unsigned short refMultAcceptNeg = 0;
  391. // Not first primary vertex does not contain tracks with fast detectors (TOF)
  392. int iVert = 0;
  393. mEventIsGood = false;
  394. //
  395. // Fill histogram hTriggerId before all cuts
  396. //
  397. for(unsigned int iTrg=0; iTrg<mTriggerIdCollection.size(); iTrg++)
  398. {
  399. if(mMuEvent->triggerIdCollection().nominal().isTrigger(mTriggerIdCollection.at(iTrg)))
  400. {
  401. hTriggerId_BeforeAllCut->Fill(iTrg);
  402. }
  403. }
  404. mPrimVertex = mMuDst->primaryVertex(iVert);
  405. //Positive ranking only
  406. if(mPrimVertex->ranking() <= 0)
  407. {
  408. mRankingFail++;
  409. return kStOk;
  410. }
  411. //Not (0,0,0) position of the primary vertex
  412. if(mPrimVertex->position().x() == 0 &&
  413. mPrimVertex->position().y() == 0 &&
  414. mPrimVertex->position().z() == 0)
  415. {
  416. mVtxNullFail++;
  417. std::cout << "[kStOk] Vertex equals to zero!\n";
  418. return kStOk;
  419. }
  420. //Reasonable amount of tracks
  421. if(mNPrimTracks < 0 || mNPrimTracks > 10000)
  422. {
  423. mNPrimVtxFail++;
  424. std::cout << "[kStOk] N primary tracks cut failed!\n";
  425. return kStOk;
  426. }
  427. mPrimVertIndex = iVert;
  428. mRanking = mPrimVertex->ranking();
  429. mVertPosition = mPrimVertex->position();
  430. StBTofHeader *btofH = mMuDst->btofHeader();
  431. if (!btofH)
  432. {
  433. std::cout << "StBTofHeader - NULL pointer!\n";
  434. return kStOk;
  435. }
  436. mVpdVz = mMuDst->btofHeader()->vpdVz();
  437. hRefMult_BeforeCut->Fill(refMult);
  438. hNPrimVtx_BeforeCut->Fill(mNVertices);
  439. hNPrimTr_BeforeCut->Fill(mNPrimTracks);
  440. hNGlobTr_BeforeCut->Fill(mNGlobTracks);
  441. //
  442. // Fill histogram hTriggerId before pile-up cuts
  443. //
  444. for(unsigned int iTrg=0; iTrg<mTriggerIdCollection.size(); iTrg++)
  445. {
  446. if(mMuEvent->triggerIdCollection().nominal().isTrigger(mTriggerIdCollection.at(iTrg)))
  447. {
  448. hTriggerId_BeforePileupCut->Fill(iTrg);
  449. }
  450. }
  451. //
  452. // Calculate the amount of the pile-up vertices
  453. //
  454. int mNVtxInBunchCross = 0;
  455. for(unsigned int i = 0; i < mMuDst->numberOfPrimaryVertices(); i++)
  456. {
  457. StMuPrimaryVertex *primVtx = mMuDst->primaryVertex(i);
  458. if(!primVtx || primVtx->ranking() <= 0.) continue;
  459. if(TMath::Abs(primVtx->position().x()) < 1e-5 &&
  460. TMath::Abs(primVtx->position().y()) < 1e-5 &&
  461. TMath::Abs(primVtx->position().z()) < 1e-5) continue;
  462. if(TMath::Abs(primVtx->position().z() - btofH->vpdVz()) < 5.0) mNVtxInBunchCross++;
  463. }
  464. // There should be only one primary vertex that caused the trigger
  465. if(mNVtxInBunchCross > 1) {
  466. mAntiPileupFail++;
  467. return kStOk;
  468. }
  469. //
  470. // Fill histogram hTriggerId before cuts
  471. //
  472. for(unsigned int iTrg=0; iTrg < mTriggerIdCollection.size(); iTrg++)
  473. {
  474. if(mMuEvent->triggerIdCollection().nominal().isTrigger(mTriggerIdCollection.at(iTrg)))
  475. {
  476. hTriggerId_BeforeVertexCut->Fill(iTrg);
  477. }
  478. }
  479. //
  480. // Trigger cut
  481. //
  482. if (mTriggerCut)
  483. {
  484. if(!AcceptTrigger(mMuEvent)) //If trigger is not found
  485. {
  486. mAcceptTriggerFail++;
  487. return kStOk;
  488. }
  489. }
  490. if( !AcceptPrimVtx(mVertPosition, mVpdVz) ) {
  491. mAcceptPrimVtxFail++;
  492. return kStOk;
  493. }
  494. mEventIsGood = true;
  495. //
  496. // Fill histogram hTriggerId after cuts
  497. //
  498. for(unsigned int iTrg=0; iTrg<mTriggerIdCollection.size(); iTrg++)
  499. {
  500. if(mMuEvent->triggerIdCollection().nominal().isTrigger(mTriggerIdCollection.at(iTrg)))
  501. {
  502. hTriggerId_AfterCut->Fill(iTrg);
  503. }
  504. }
  505. //
  506. //Loop over primary tracks
  507. //
  508. if (mTrackLoop)
  509. {
  510. for(int iTrk = 0; iTrk < mNPrimTracks; iTrk++) {
  511. mPrimTrack = mMuDst->primaryTracks(iTrk);
  512. int idxGlob = mPrimTrack->index2Global();
  513. if (idxGlob < 0) continue;
  514. mGlobTrack = mMuDst->globalTracks(idxGlob);
  515. short charge = mPrimTrack->charge() > 0 ? 1 : -1;
  516. float eta = mPrimTrack->eta();
  517. float pt = mPrimTrack->pt();
  518. float p = mPrimTrack->p().mag();
  519. float p2 = mPrimTrack->p().mag2();
  520. float px = mPrimTrack->p().x();
  521. float py = mPrimTrack->p().y();
  522. float pz = mPrimTrack->p().z();
  523. charge > 0 ? refMultPos++ : refMultNeg++;
  524. hP->Fill(p);
  525. hPt->Fill(pt);
  526. hPx->Fill(px);
  527. hPy->Fill(py);
  528. hPz->Fill(pz);
  529. hEta->Fill(eta);
  530. if( !AcceptTrack(mPrimTrack, iVert) ) continue;
  531. hPAccept->Fill(p);
  532. hPtAccept->Fill(pt);
  533. hPxAccept->Fill(px);
  534. hPyAccept->Fill(py);
  535. hPzAccept->Fill(pz);
  536. hEtaAccept->Fill(eta);
  537. refMultAccept++;
  538. charge > 0 ? refMultAcceptPos++ : refMultAcceptNeg++;
  539. float nSigmaPion = mPrimTrack->nSigmaPion();
  540. float nSigmaKaon = mPrimTrack->nSigmaKaon();
  541. float nSigmaProton = mPrimTrack->nSigmaProton();
  542. float dedx = mPrimTrack->dEdx();
  543. bool tofTrack = IsTofTrack(mGlobTrack, mPrimTrack);
  544. float betaExp;
  545. float massSqr;
  546. bool pionTPC = ((nSigmaPion >= mPionPionNSigma[0] || nSigmaPion <= mPionPionNSigma[1]) &&
  547. (nSigmaKaon < mPionKaonNSigma[0] || nSigmaKaon > mPionKaonNSigma[1]) &&
  548. (nSigmaProton < mPionProtonNSigma[0] || nSigmaProton > mPionProtonNSigma[1]));
  549. bool kaonTPC = ((nSigmaPion < mKaonPionNSigma[0] || nSigmaPion > mKaonPionNSigma[1]) &&
  550. (nSigmaKaon >= mKaonKaonNSigma[0] || nSigmaKaon <= mKaonKaonNSigma[1]) &&
  551. (nSigmaProton < mKaonProtonNSigma[0] || nSigmaProton > mKaonProtonNSigma[1]));
  552. bool protonTPC = ((nSigmaPion < mProtonPionNSigma[0] || nSigmaPion > mProtonPionNSigma[1]) &&
  553. (nSigmaKaon < mProtonKaonNSigma[0] || nSigmaKaon > mProtonKaonNSigma[1]) &&
  554. (nSigmaProton >= mProtonProtonNSigma[0] || nSigmaProton <= mProtonProtonNSigma[1]));
  555. bool pionTOF = false;
  556. bool kaonTOF = false;
  557. bool protonTOF = false;
  558. //
  559. // Pion TPC
  560. //
  561. if (pionTPC) {
  562. hNSigmaPionPion->Fill(nSigmaPion);
  563. hNSigmaPionKaon->Fill(nSigmaKaon);
  564. hNSigmaPionProton->Fill(nSigmaProton);
  565. hNSigmaPionPionVsPt->Fill(pt*charge, nSigmaPion);
  566. hNSigmaPionKaonVsPt->Fill(pt*charge, nSigmaKaon);
  567. hNSigmaPionProtonVsPt->Fill(pt*charge, nSigmaProton);
  568. }
  569. //
  570. // Kaon TPC
  571. //
  572. if (kaonTPC) {
  573. hNSigmaKaonPion->Fill(nSigmaPion);
  574. hNSigmaKaonKaon->Fill(nSigmaKaon);
  575. hNSigmaKaonProton->Fill(nSigmaProton);
  576. hNSigmaKaonPionVsPt->Fill(pt*charge, nSigmaPion);
  577. hNSigmaKaonKaonVsPt->Fill(pt*charge, nSigmaKaon);
  578. hNSigmaKaonProtonVsPt->Fill(pt*charge, nSigmaProton);
  579. }
  580. //
  581. // Proton TPC
  582. //
  583. if (protonTPC) {
  584. hNSigmaProtonPion->Fill(nSigmaPion);
  585. hNSigmaProtonKaon->Fill(nSigmaKaon);
  586. hNSigmaProtonProton->Fill(nSigmaProton);
  587. hNSigmaProtonPionVsPt->Fill(pt*charge, nSigmaPion);
  588. hNSigmaProtonKaonVsPt->Fill(pt*charge, nSigmaKaon);
  589. hNSigmaProtonProtonVsPt->Fill(pt*charge, nSigmaProton);
  590. }
  591. hDedxVsPt->Fill(pt*charge, dedx*1e6);
  592. if (tofTrack) {
  593. hTOF->Fill(mGlobTrack->btofPidTraits().timeOfFlight());
  594. float betaThPion = sqrt(p2/(PION_MASS*PION_MASS + p2));
  595. float betaThKaon = sqrt(p2/(KAON_MASS*KAON_MASS + p2));
  596. float betaThProton = sqrt(p2/(PROTON_MASS*PROTON_MASS + p2));
  597. tofRefMult++;
  598. betaExp = mGlobTrack->btofPidTraits().beta();
  599. massSqr = p2*(1./(betaExp*betaExp) - 1.);
  600. hMassSqrVsPt->Fill(pt*charge, massSqr);
  601. pionTOF = massSqr >= mPionMass[0] && massSqr <= mPionMass[1];
  602. kaonTOF = massSqr >= mKaonMass[0] && massSqr <= mKaonMass[1];
  603. protonTOF = massSqr >= mProtonMass[0] && massSqr <= mProtonMass[1];
  604. float dMpion = massSqr - PION_MASS*PION_MASS;
  605. float dMkaon = massSqr - KAON_MASS*KAON_MASS;
  606. float dMproton = massSqr - PROTON_MASS*PROTON_MASS;
  607. hInvBetaExpVsPt->Fill(pt*charge, 1./betaExp);
  608. //
  609. // TPC PID
  610. //
  611. if (pionTPC) {
  612. hInvBetaExpThPionTPC->Fill(pt*charge, 1./betaExp - 1./betaThPion);
  613. hDMassSqrVsPtPionTPC->Fill(pt*charge, dMpion);
  614. }
  615. else if (kaonTPC) {
  616. hInvBetaExpThKaonTPC->Fill(pt*charge, 1./betaExp - 1./betaThKaon);
  617. hDMassSqrVsPtKaonTPC->Fill(pt, dMkaon);
  618. }
  619. else if (protonTPC) {
  620. hInvBetaExpThProtonTPC->Fill(pt*charge, 1./betaExp - 1./betaThProton);
  621. hDMassSqrVsPtProtonTPC->Fill(pt, dMproton);
  622. }
  623. //
  624. // TOF PID
  625. //
  626. if (pionTOF) {
  627. hInvBetaExpThPionTOF->Fill(pt*charge, 1./betaExp - 1./betaThPion);
  628. hDMassSqrVsPtPionTOF->Fill(pt, dMpion);
  629. hInvBetaThVsPt->Fill(pt*charge, 1./betaThPion);
  630. hInvBetaExpThPionINT->Fill(pt*charge, 1./betaExp - 1./betaThPion);
  631. hInvBetaExpThPionINT->Fill(pt*charge, 1./betaExp - 1./betaThKaon);
  632. hInvBetaExpThPionINT->Fill(pt*charge, 1./betaExp - 1./betaThProton);
  633. }
  634. else if (kaonTOF) {
  635. hInvBetaExpThKaonTOF->Fill(pt*charge, 1./betaExp - 1./betaThKaon);
  636. hDMassSqrVsPtKaonTOF->Fill(pt, dMkaon);
  637. hInvBetaThVsPt->Fill(pt*charge, 1./betaThKaon);
  638. hInvBetaExpThKaonINT->Fill(pt*charge, 1./betaExp - 1./betaThPion);
  639. hInvBetaExpThKaonINT->Fill(pt*charge, 1./betaExp - 1./betaThKaon);
  640. hInvBetaExpThKaonINT->Fill(pt*charge, 1./betaExp - 1./betaThProton);
  641. }
  642. else if (protonTOF) {
  643. hInvBetaExpThProtonTOF->Fill(pt*charge, 1./betaExp - 1./betaThProton);
  644. hDMassSqrVsPtProtonTOF->Fill(pt, dMproton);
  645. hInvBetaThVsPt->Fill(pt*charge, 1./betaThProton);
  646. hInvBetaExpThProtonINT->Fill(pt*charge, 1./betaExp - 1./betaThPion);
  647. hInvBetaExpThProtonINT->Fill(pt*charge, 1./betaExp - 1./betaThKaon);
  648. hInvBetaExpThProtonINT->Fill(pt*charge, 1./betaExp - 1./betaThProton);
  649. }
  650. //
  651. // TNT PID
  652. //
  653. if (pionTOF && pionTPC) {
  654. hInvBetaExpThPionTNT->Fill(pt*charge, 1./betaExp - 1./betaThPion);
  655. }
  656. else if (kaonTOF && kaonTPC) {
  657. hInvBetaExpThKaonTNT->Fill(pt*charge, 1./betaExp - 1./betaThKaon);
  658. }
  659. else if (protonTOF && protonTPC) {
  660. hInvBetaExpThProtonTNT->Fill(pt*charge, 1./betaExp - 1./betaThProton);
  661. }
  662. //
  663. // TTT PID
  664. //
  665. if (p >= mTTTPThreshold) {
  666. if (pionTOF) {
  667. hInvBetaExpThPionTTT->Fill(pt*charge, 1./betaExp - 1./betaThPion);
  668. }
  669. else if (kaonTOF) {
  670. hInvBetaExpThKaonTTT->Fill(pt*charge, 1./betaExp - 1./betaThKaon);
  671. }
  672. else if (protonTOF) {
  673. hInvBetaExpThProtonTTT->Fill(pt*charge, 1./betaExp - 1./betaThProton);
  674. }
  675. } else {
  676. if (pionTPC) {
  677. hInvBetaExpThPionTTT->Fill(pt*charge, 1./betaExp - 1./betaThPion);
  678. }
  679. else if (kaonTPC) {
  680. hInvBetaExpThKaonTTT->Fill(pt*charge, 1./betaExp - 1./betaThKaon);
  681. }
  682. else if (protonTPC) {
  683. hInvBetaExpThProtonTTT->Fill(pt*charge, 1./betaExp - 1./betaThProton);
  684. }
  685. }
  686. }
  687. } //for(Int_t iTrk=0; iTrk<mNPrimTracks; iTrk++)
  688. }
  689. if (mEventIsGood) {
  690. hRefMultAccept_AfterCut->Fill(refMultAccept);
  691. hTofRefMult_AfterCut->Fill(tofRefMult);
  692. hTofRefMultVsRefMult_AfterCut->Fill(tofRefMult, refMultAccept);
  693. }
  694. return kStOk;
  695. }
  696. //_________________
  697. Bool_t StMuDstQAMaker::AcceptTrigger(StMuEvent *muEvent) {
  698. Bool_t mIsGoodTrigger = false;
  699. if(mTriggerIdCollection.empty()) {
  700. mIsGoodTrigger = true;
  701. }
  702. else {
  703. for(UInt_t iTrg=0; iTrg<mTriggerIdCollection.size(); iTrg++) {
  704. if(muEvent->triggerIdCollection().nominal().isTrigger(mTriggerIdCollection.at(iTrg))) {
  705. mIsGoodTrigger = true;
  706. mCurrentTrigger = mTriggerIdCollection.at(iTrg);
  707. break;
  708. }
  709. } //for(UInt_t iTrg=0; iTrg<mTriggerIdCollection.size(); iTrg++)
  710. }
  711. return mIsGoodTrigger;
  712. }
  713. //_________________
  714. Bool_t StMuDstQAMaker::AcceptPrimVtx(StThreeVectorF vtxPos,
  715. Float_t vpdVz) {
  716. Float_t mVtxX = vtxPos.x() - mPrimVtxXShift;
  717. Float_t mVtxY = vtxPos.y() - mPrimVtxYShift;
  718. Float_t mVtxZ = vtxPos.z();
  719. Float_t vtxR = TMath::Sqrt(mVtxX*mVtxX + mVtxY*mVtxY);
  720. Float_t vpdDiff = mVtxZ - vpdVz;
  721. hR_BeforeCut->Fill(vtxR);
  722. hVx_BeforeCut->Fill(mVtxX);
  723. hVy_BeforeCut->Fill(mVtxY);
  724. hVz_BeforeCut->Fill(mVtxZ);
  725. hVxVsVy_BeforeCut->Fill(mVtxX, mVtxY);
  726. hVxVsVz_BeforeCut->Fill(mVtxX, mVtxZ);
  727. hVyVsVz_BeforeCut->Fill(mVtxY, mVtxZ);
  728. hVpd_BeforeCut->Fill(vpdVz);
  729. hVpdVz_BeforeCut->Fill(vpdDiff);
  730. hVpdVz2D_BeforeCut->Fill(vpdVz, mVtxZ);
  731. bool isGoodEvent = ( vtxPos.z() >= mPrimVtxZ[0] &&
  732. vtxPos.z() <= mPrimVtxZ[1] &&
  733. vtxR >= mPrimVtxR[0] &&
  734. vtxR <= mPrimVtxR[1] &&
  735. vpdDiff >= mPrimVtxVpdVzDiff[0] &&
  736. vpdDiff <= mPrimVtxVpdVzDiff[1] );
  737. if (isGoodEvent)
  738. {
  739. hR_AfterCut->Fill(vtxR);
  740. hVx_AfterCut->Fill(mVtxX);
  741. hVy_AfterCut->Fill(mVtxY);
  742. hVz_AfterCut->Fill(mVtxZ);
  743. hVxVsVy_AfterCut->Fill(mVtxX, mVtxY);
  744. hVxVsVz_AfterCut->Fill(mVtxX, mVtxZ);
  745. hVyVsVz_AfterCut->Fill(mVtxY, mVtxZ);
  746. hVpd_AfterCut->Fill(vpdVz);
  747. hVpdVz_AfterCut->Fill(vpdDiff);
  748. hVpdVz2D_AfterCut->Fill(vpdVz, mVtxZ);
  749. }
  750. return isGoodEvent;
  751. }
  752. //_________________
  753. Bool_t StMuDstQAMaker::AcceptTrack(StMuTrack *trk, UShort_t vtxInd) {
  754. float mom = trk->momentum().mag();
  755. float eta = trk->eta();
  756. unsigned short nHitsFit = trk->nHitsFit();
  757. float ratioH = (float)trk->nHitsFit()/(float)trk->nHitsPoss();
  758. short flag = trk->flag();
  759. float dca = trk->dcaGlobal(vtxInd).perp();
  760. short charge = trk->charge();
  761. bool isMomOk = ( mom >= mTrackP[0] &&
  762. mom <= mTrackP[1] );
  763. bool isEtaOk = ( eta >= mTrackEta[0] &&
  764. eta <= mTrackEta[1] );
  765. bool isNHitsFitOk = ( nHitsFit >= mTrackNHitsFit[0] &&
  766. nHitsFit <= mTrackNHitsFit[1] &&
  767. ratioH >= 0.51 );
  768. bool isFlagOk = ( flag >= mTrackFlag[0] &&
  769. flag <= mTrackFlag[1] );
  770. // bool isDcaOk = ( dca >= mTrackDcaGlobal[0] &&
  771. // dca <= mTrackDcaGlobal[1] );
  772. bool isGoodTrack = isMomOk && isEtaOk && isNHitsFitOk && isFlagOk;
  773. if (isGoodTrack)
  774. {
  775. hNHitsVsMom->Fill(mom*charge, nHitsFit);
  776. pNHitsVsMom->Fill(mom*charge, nHitsFit);
  777. }
  778. return isGoodTrack;
  779. }
  780. //_________________
  781. Int_t StMuDstQAMaker::Finish() {
  782. std::cout
  783. << "*************************************" << "\n"
  784. << "StMuDstQAMaker has been finished" << "\n"
  785. << "\t nEventsPassed : " << mNEventsPassed << "\n"
  786. << "\t nEventsProcessed: " << mNEventsIn << "\n"
  787. << "Accept trigger fail = " << mAcceptTriggerFail << "\n"
  788. << "RefMult fail = " << mRefMultFail << "\n"
  789. << "Anti-pileup fail = " << mAntiPileupFail << "\n"
  790. << "Ranking fail = " << mRankingFail << "\n"
  791. << "VtxNull fail = " << mVtxNullFail << "\n"
  792. << "NPrimVtx fail = " << mNPrimVtxFail << "\n"
  793. << "AcceptPrimVtx fail = " << mAcceptPrimVtxFail << "\n"
  794. << "*************************************" << "\n";
  795. mOutFile->cd();
  796. mOutFile->Write();
  797. mOutFile->Close();
  798. return kStOk;
  799. }
  800. //_________________
  801. void StMuDstQAMaker::CleanVariables() {
  802. mEventIsGood = false;
  803. }
  804. //_________________
  805. void StMuDstQAMaker::SetTriggerId(unsigned int id) {
  806. mTriggerIdCollection.push_back(id);
  807. }
  808. //_________________
  809. void StMuDstQAMaker::SetMuDstMaker(StMuDstMaker *maker) {
  810. mMuDstMaker = maker;
  811. }
  812. //_________________
  813. void StMuDstQAMaker::SetVtxZCut(float lo, float hi) {
  814. mPrimVtxZ[0] = lo;
  815. mPrimVtxZ[1] = hi;
  816. }
  817. //_________________
  818. void StMuDstQAMaker::SetVtxRCut(float lo, float hi) {
  819. mPrimVtxR[0] = lo;
  820. mPrimVtxR[1] = hi;
  821. }
  822. //_________________
  823. void StMuDstQAMaker::SetVtxShift(float xShift, float yShift) {
  824. mPrimVtxXShift = xShift;
  825. mPrimVtxYShift = yShift;
  826. }
  827. //_________________
  828. void StMuDstQAMaker::SetVtxVpdVzDiffCut(float lo, float hi) {
  829. mPrimVtxVpdVzDiff[0] = lo;
  830. mPrimVtxVpdVzDiff[1] = hi;
  831. }
  832. //_________________
  833. void StMuDstQAMaker::SetP(float lo, float hi) {
  834. mTrackP[0] = lo;
  835. mTrackP[1] = hi;
  836. }
  837. //_________________
  838. void StMuDstQAMaker::SetPt(float lo, float hi) {
  839. mTrackPt[0] = lo;
  840. mTrackPt[1] = hi;
  841. }
  842. //_________________
  843. void StMuDstQAMaker::SetTrackNHits(int lo, int hi) {
  844. mTrackNHits[0] = lo;
  845. mTrackNHits[1] = hi;
  846. }
  847. //_________________
  848. void StMuDstQAMaker::SetTrackNHitsFit(int lo, int hi) {
  849. mTrackNHitsFit[0] = lo;
  850. mTrackNHitsFit[1] = hi;
  851. }
  852. //_________________
  853. void StMuDstQAMaker::SetTrackEta(float lo, float hi) {
  854. mTrackEta[0] = lo;
  855. mTrackEta[1] = hi;
  856. }
  857. //_________________
  858. void StMuDstQAMaker::SetTrackFlag(short lo, short hi) {
  859. mTrackFlag[0] = lo;
  860. mTrackFlag[1] = hi;
  861. }
  862. //_________________
  863. void StMuDstQAMaker::SetTrackDCA(float lo, float hi) {
  864. mTrackDcaGlobal[0] = lo;
  865. mTrackDcaGlobal[1] = hi;
  866. }
  867. //_________________
  868. Bool_t StMuDstQAMaker::IsTofTrack(StMuTrack *trkGlob, StMuTrack *trkPrim) {
  869. Bool_t isTofHit = false;
  870. float betaGlobal = trkGlob->btofPidTraits().beta();
  871. float tofGlobal = trkGlob->btofPidTraits().timeOfFlight();
  872. float betaPrimary = trkPrim->btofPidTraits().beta();
  873. float tofPrimary = trkPrim->btofPidTraits().timeOfFlight();
  874. hDiffBeta->Fill(betaPrimary - betaGlobal);
  875. hDiffTOF->Fill(tofPrimary - tofGlobal);
  876. if(betaGlobal > 0 && tofGlobal > 0) isTofHit = true;
  877. return isTofHit;
  878. }
  879. //_________________
  880. void StMuDstQAMaker::SetPionPionNSigma(float lo, float hi) {
  881. mPionPionNSigma[0] = lo; mPionPionNSigma[1] = hi;
  882. }
  883. //_________________
  884. void StMuDstQAMaker::SetPionKaonNSigma(float lo, float hi) {
  885. mPionKaonNSigma[0] = lo; mPionKaonNSigma[1] = hi;
  886. }
  887. //_________________
  888. void StMuDstQAMaker::SetPionProtonNSigma(float lo, float hi) {
  889. mPionProtonNSigma[0] = lo; mPionProtonNSigma[1] = hi;
  890. }
  891. //_________________
  892. void StMuDstQAMaker::SetKaonPionNSigma(float lo, float hi) {
  893. mKaonPionNSigma[0] = lo; mKaonPionNSigma[1] = hi;
  894. }
  895. //_________________
  896. void StMuDstQAMaker::SetKaonKaonNSigma(float lo, float hi) {
  897. mKaonKaonNSigma[0] = lo; mKaonKaonNSigma[1] = hi;
  898. }
  899. //_________________
  900. void StMuDstQAMaker::SetKaonProtonNSigma(float lo, float hi) {
  901. mKaonProtonNSigma[0] = lo; mKaonProtonNSigma[1] = hi;
  902. }
  903. //_________________
  904. void StMuDstQAMaker::SetProtonPionNSigma(float lo, float hi) {
  905. mProtonPionNSigma[0] = lo; mProtonPionNSigma[1] = hi;
  906. }
  907. //_________________
  908. void StMuDstQAMaker::SetProtonKaonNSigma(float lo, float hi) {
  909. mProtonKaonNSigma[0] = lo; mProtonKaonNSigma[1] = hi;
  910. }
  911. //_________________
  912. void StMuDstQAMaker::SetProtonProtonNSigma(float lo, float hi) {
  913. mProtonProtonNSigma[0] = lo; mProtonProtonNSigma[1] = hi;
  914. }
  915. //_________________
  916. void StMuDstQAMaker::SetPionMassSqr(float lo, float hi) {
  917. mPionMass[0] = lo; mPionMass[1] = hi;
  918. }
  919. //_________________
  920. void StMuDstQAMaker::SetKaonMassSqr(float lo, float hi) {
  921. mKaonMass[0] = lo; mKaonMass[1] = hi;
  922. }
  923. //_________________
  924. void StMuDstQAMaker::SetProtonMassSqr(float lo, float hi) {
  925. mProtonMass[0] = lo; mProtonMass[1] = hi;
  926. }
  927. //_________________
  928. void StMuDstQAMaker::SetTTTPThreshold(float pThresh) {
  929. mTTTPThreshold = pThresh;
  930. }
  931. void StMuDstQAMaker::SetTracksLoop(bool val)
  932. {
  933. mTrackLoop = val;
  934. }
  935. void StMuDstQAMaker::SetTriggerCut(bool val)
  936. {
  937. mTriggerCut = val;
  938. }