StMuDstQAMaker.h 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. /****************************************/
  2. /*** ***/
  3. /*** StMuDstQAMaker ***/
  4. /*** VERSION: 1.1 ***/
  5. /*** AUTHOR: Nikita Ermakov ***/
  6. /*** DATE: ***/
  7. /*** E-MAIL: coffe92@gmail.com ***/
  8. /*** ***/
  9. /****************************************/
  10. #ifndef STMUDSTQAMAKER_HH
  11. #define STMUDSTQAMAKER_HH
  12. #include "StMaker.h"
  13. #include "StThreeVector.hh"
  14. #include "StThreeVectorF.hh"
  15. #include "StPhysicalHelixD.hh"
  16. #include "StRefMultCorr/StRefMultCorr.h"
  17. #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
  18. #include "StMuDSTMaker/COMMON/StMuDst.h"
  19. #include "StMuDSTMaker/COMMON/StMuEvent.h"
  20. #include "StMuDSTMaker/COMMON/StMuTrack.h"
  21. #include "StMuDSTMaker/COMMON/StMuPrimaryVertex.h"
  22. #include "StMuDSTMaker/COMMON/StMuBTofPidTraits.h"
  23. #include "StMuDSTMaker/COMMON/StMuBTofHit.h"
  24. #include "StMuDstMinvMaker.h"
  25. #include <TString.h>
  26. #include <TFile.h>
  27. #include <TLorentzVector.h>
  28. #include <TTree.h>
  29. #include <TH1.h>
  30. #include <TH2.h>
  31. #include <TProfile.h>
  32. #include <vector>
  33. #include <iostream>
  34. #ifndef St_NO_NAMESPACES
  35. using namespace std;
  36. #endif
  37. class StMuDst;
  38. class StMuDstMaker;
  39. class StMuEvent;
  40. class StMuTrack;
  41. class StMuDstQAMaker : public StMaker
  42. {
  43. public:
  44. StMuDstQAMaker(StMuDstMaker *muMaker,
  45. const Char_t *oFileName);
  46. ~StMuDstQAMaker();
  47. //
  48. // Chain methods
  49. //
  50. void Clear(Option_t *option = "");
  51. Int_t Init();
  52. Int_t Make();
  53. Int_t Finish();
  54. void CleanVariables();
  55. void SetMuDstMaker(StMuDstMaker *maker);
  56. void SetTracksLoop(bool val);
  57. //
  58. // Setup event
  59. //
  60. void SetTriggerId(unsigned int id);
  61. void SetTriggerCut(bool val);
  62. void SetVtxZCut(float lo, float hi);
  63. void SetVtxRCut(float lo, float hi);
  64. void SetVtxShift(float xShift, float yShift);
  65. void SetVtxVpdVzDiffCut(float lo, float hi);
  66. //
  67. // Setup track
  68. //
  69. void SetP(float lo, float hi);
  70. void SetPt(float lo, float hi);
  71. void SetTrackNHits(int lo, int hi);
  72. void SetTrackNHitsFit(int lo, int hi);
  73. void SetTrackEta(float lo, float hi);
  74. void SetTrackFlag(short lo, short hi);
  75. void SetTrackDCA(float lo, float hi);
  76. //
  77. // TPC PID
  78. //
  79. // Pion
  80. void SetPionPionNSigma(float lo, float hi);
  81. void SetPionKaonNSigma(float lo, float hi);
  82. void SetPionProtonNSigma(float lo, float hi);
  83. // Kaon
  84. void SetKaonPionNSigma(float lo, float hi);
  85. void SetKaonKaonNSigma(float lo, float hi);
  86. void SetKaonProtonNSigma(float lo, float hi);
  87. // Proton
  88. void SetProtonPionNSigma(float lo, float hi);
  89. void SetProtonKaonNSigma(float lo, float hi);
  90. void SetProtonProtonNSigma(float lo, float hi);
  91. //
  92. // TOF PID
  93. //
  94. void SetPionMassSqr(float lo, float hi);
  95. void SetKaonMassSqr(float lo, float hi);
  96. void SetProtonMassSqr(float lo, float hi);
  97. //
  98. // TOF and TPC momentum threshold
  99. //
  100. void SetTTTPThreshold(float pThresh);
  101. //
  102. // Cut methods
  103. //
  104. Bool_t AcceptTrigger(StMuEvent *muEvent);
  105. Bool_t AcceptPrimVtx(StThreeVectorF vtxPos, Float_t vpdVz);
  106. Bool_t AcceptTrack(StMuTrack *trk, UShort_t vtxInd);
  107. Bool_t IsTofTrack(StMuTrack *trkGlob, StMuTrack *trkPrim);
  108. private:
  109. const char *mFileName;
  110. TFile *mOutFile;
  111. vector<UInt_t> mTriggerIdCollection;
  112. //
  113. // Global counters
  114. //
  115. bool mEventIsGood;
  116. int mNEventsIn;
  117. int mNEventsPassed;
  118. bool mIsGoodTrack;
  119. bool mTrackLoop;
  120. bool mTriggerCut;
  121. float mTTTPThreshold;
  122. //
  123. // Event cuts
  124. //
  125. float mPrimVtxZ[2];
  126. float mPrimVtxR[2];
  127. float mPrimVtxVpdVzDiff[2];
  128. float mPrimVtxXShift;
  129. float mPrimVtxYShift;
  130. //
  131. // Single-particle cuts
  132. //
  133. float mTrackP[2];
  134. float mTrackPt[2];
  135. float mTrackDca[2];
  136. float mTrackDcaGlobal[2];
  137. unsigned short mTrackNHits[2];
  138. unsigned short mTrackNHitsFit[2];
  139. float mTrackEta[2];
  140. short mTrackFlag[2];
  141. //
  142. // TPC NSigma
  143. //
  144. // Pion
  145. float mPionPionNSigma[2];
  146. float mPionKaonNSigma[2];
  147. float mPionProtonNSigma[2];
  148. // Kaon
  149. float mKaonPionNSigma[2];
  150. float mKaonKaonNSigma[2];
  151. float mKaonProtonNSigma[2];
  152. // Proton
  153. float mProtonPionNSigma[2];
  154. float mProtonKaonNSigma[2];
  155. float mProtonProtonNSigma[2];
  156. //
  157. // TOF Mass
  158. //
  159. float mPionMass[2];
  160. float mKaonMass[2];
  161. float mProtonMass[2];
  162. //
  163. // Counter for the debug purposes
  164. //
  165. int mAcceptTriggerFail;
  166. int mRefMultFail;
  167. int mAntiPileupFail;
  168. int mRankingFail;
  169. int mVtxNullFail;
  170. int mNPrimVtxFail;
  171. int mAcceptPrimVtxFail;
  172. //
  173. // Pointers to classes
  174. //
  175. StMuPrimaryVertex *mPrimVertex;
  176. StMuTrack *mPrimTrack;
  177. StMuTrack *mGlobTrack;
  178. StMuDstMaker *mMuDstMaker;
  179. StMuEvent *mMuEvent;
  180. StMuDst *mMuDst;
  181. //
  182. // Histograms
  183. //
  184. //
  185. // General event distributions (before event cuts)
  186. //
  187. TH1F *hR_BeforeCut;
  188. TH1F *hVx_BeforeCut;
  189. TH1F *hVy_BeforeCut;
  190. TH1F *hVz_BeforeCut;
  191. TH2F *hVxVsVy_BeforeCut;
  192. TH2F *hVxVsVz_BeforeCut;
  193. TH2F *hVyVsVz_BeforeCut;
  194. TH2F *hVpdVz2D_BeforeCut;
  195. TH1F *hNPrimTr_BeforeCut;
  196. TH1F *hNGlobTr_BeforeCut;
  197. TH1F *hTofRefMult_BeforeCut;
  198. TH2F *hTofRefMultVsRefMult_BeforeCut;
  199. TH1F *hRefMult_BeforeCut;
  200. TH1F *hRefMultAccept_BeforeCut;
  201. TH1F *hVpd_BeforeCut;
  202. TH1F *hVpdVz_BeforeCut;
  203. TH1F *hNPrimVtx_BeforeCut;
  204. TH1I *hTriggerId_BeforePileupCut;
  205. TH1I *hTriggerId_BeforeVertexCut;
  206. TH1I *hTriggerId_BeforeAllCut;
  207. //
  208. // General event distributions (after event cuts)
  209. //
  210. TH1F *hR_AfterCut;
  211. TH1F *hVx_AfterCut;
  212. TH1F *hVy_AfterCut;
  213. TH1F *hVz_AfterCut;
  214. TH2F *hVxVsVy_AfterCut;
  215. TH2F *hVxVsVz_AfterCut;
  216. TH2F *hVyVsVz_AfterCut;
  217. TH2F *hVpdVz2D_AfterCut;
  218. TH1F *hNPrimTr_AfterCut;
  219. TH1F *hNGlobTr_AfterCut;
  220. TH1F *hTofRefMult_AfterCut;
  221. TH2F *hTofRefMultVsRefMult_AfterCut;
  222. TH1F *hRefMult_AfterCut;
  223. TH1F *hRefMultAccept_AfterCut;
  224. TH1F *hVpd_AfterCut;
  225. TH1F *hVpdVz_AfterCut;
  226. TH1F *hNPrimVtx_AfterCut;
  227. TH1I *hTriggerId_AfterCut;
  228. //
  229. // General track distributions
  230. //
  231. TH1F *hP;
  232. TH1F *hPt;
  233. TH1F *hPx;
  234. TH1F *hPy;
  235. TH1F *hPz;
  236. TH1F *hEta;
  237. TH1F *hPAccept;
  238. TH1F *hPtAccept;
  239. TH1F *hPxAccept;
  240. TH1F *hPyAccept;
  241. TH1F *hPzAccept;
  242. TH1F *hEtaAccept;
  243. TH2F *hMassSqrVsPt;
  244. TH2F *hDedxVsPt;
  245. TH2F *hInvBetaExpVsPt;
  246. TH2F *hInvBetaThVsPt;
  247. TH1F *hDiffBeta; // For check difference between global and
  248. TH1F *hDiffTOF; // primary tracks
  249. TH1F *hTOF;
  250. TH2F *hNHitsVsMom;
  251. TProfile *pNHitsVsMom;
  252. // Pion PID
  253. TH1F *hNSigmaPionPion;
  254. TH1F *hNSigmaPionKaon;
  255. TH1F *hNSigmaPionProton;
  256. TH2F *hNSigmaPionPionVsPt;
  257. TH2F *hNSigmaPionKaonVsPt;
  258. TH2F *hNSigmaPionProtonVsPt;
  259. TH2F *hDMassSqrVsPtPionTPC;
  260. TH2F *hDMassSqrVsPtPionTOF;
  261. TH2F *hInvBetaExpThPionTNT;
  262. TH2F *hInvBetaExpThPionTPC;
  263. TH2F *hInvBetaExpThPionTOF;
  264. TH2F *hInvBetaExpThPionTTT;
  265. TH2F *hInvBetaExpThPionINT;
  266. // Kaon PID
  267. TH1F *hNSigmaKaonPion;
  268. TH1F *hNSigmaKaonKaon;
  269. TH1F *hNSigmaKaonProton;
  270. TH2F *hNSigmaKaonPionVsPt;
  271. TH2F *hNSigmaKaonKaonVsPt;
  272. TH2F *hNSigmaKaonProtonVsPt;
  273. TH2F *hDMassSqrVsPtKaonTPC;
  274. TH2F *hDMassSqrVsPtKaonTOF;
  275. TH2F *hInvBetaExpThKaonTNT;
  276. TH2F *hInvBetaExpThKaonTPC;
  277. TH2F *hInvBetaExpThKaonTOF;
  278. TH2F *hInvBetaExpThKaonTTT;
  279. TH2F *hInvBetaExpThKaonINT;
  280. // Proton PID
  281. TH1F *hNSigmaProtonPion;
  282. TH1F *hNSigmaProtonKaon;
  283. TH1F *hNSigmaProtonProton;
  284. TH2F *hNSigmaProtonPionVsPt;
  285. TH2F *hNSigmaProtonKaonVsPt;
  286. TH2F *hNSigmaProtonProtonVsPt;
  287. TH2F *hDMassSqrVsPtProtonTPC;
  288. TH2F *hDMassSqrVsPtProtonTOF;
  289. TH2F *hInvBetaExpThProtonTNT;
  290. TH2F *hInvBetaExpThProtonTPC;
  291. TH2F *hInvBetaExpThProtonTOF;
  292. TH2F *hInvBetaExpThProtonTTT;
  293. TH2F *hInvBetaExpThProtonINT;
  294. //
  295. // Trigger
  296. //
  297. unsigned int mCurrentTrigger;
  298. ClassDef(StMuDstQAMaker, 2)
  299. };
  300. #endif