StFemtoDstInclusiveSelector.h 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. //
  2. // The version of the class should be changed every time
  3. // when any changes in the codes are done
  4. // Grigory Nigmatkulov: 2016/12/15
  5. //
  6. #ifndef STFEMTODSTINCLUSIVESELECTOR_HH
  7. #define STFEMTODSTINCLUSIVESELECTOR_HH
  8. #include "StMaker.h"
  9. #include "StThreeVector.hh"
  10. #include "StThreeVectorF.hh"
  11. #include "StPhysicalHelixD.hh"
  12. #include "StRefMultCorr/StRefMultCorr.h"
  13. #include "StFemtoEvent.h"
  14. #include "StFemtoTrack.h"
  15. #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
  16. #include "StMuDSTMaker/COMMON/StMuDst.h"
  17. #include "StMuDSTMaker/COMMON/StMuEvent.h"
  18. #include "StMuDSTMaker/COMMON/StMuTrack.h"
  19. #include "StMuDSTMaker/COMMON/StMuPrimaryVertex.h"
  20. #include "StMuDSTMaker/COMMON/StMuBTofPidTraits.h"
  21. #include "StMuDSTMaker/COMMON/StMuBTofHit.h"
  22. #include <TString.h>
  23. #include <TFile.h>
  24. #include <TLorentzVector.h>
  25. #include <TTree.h>
  26. #include <TH1.h>
  27. #include <TH2.h>
  28. #include <vector>
  29. #include <iostream>
  30. #ifndef St_NO_NAMESPACES
  31. using namespace std;
  32. #endif
  33. //Predefinisions
  34. class StFemtoEvent;
  35. class StFemtoTrack;
  36. class StMuDst;
  37. class StMuDstMaker;
  38. class StMuEvent;
  39. class StMuTrack;
  40. //_________________
  41. class StFemtoDstInclusiveSelector : public StMaker {
  42. public:
  43. StFemtoDstInclusiveSelector(StMuDstMaker *muMaker,
  44. const Char_t *oFileName);
  45. ~StFemtoDstInclusiveSelector();
  46. void Clear(Option_t *option = "");
  47. Int_t Init();
  48. Int_t Make();
  49. Int_t Finish();
  50. void CleanVariables();
  51. void SetCompressionLevel(Int_t comp) { mCompression = comp; }
  52. //Setters
  53. //Global
  54. void SetCollisionTypeAuAu(const Bool_t& type) { mCollisionTypeAuAu = type; }
  55. void SetMuDstMaker(StMuDstMaker *maker) { mMuDstMaker = maker; }
  56. void SetRefmultCorrUtil(StRefMultCorr* rf) { mRefMultCorrUtil = rf; }
  57. void SetAuAuZdcCoincidenceEnergy(const Bool_t &correct) { mAuAuCorrectZdc = correct; }
  58. //Event
  59. void AddTriggerId(const UInt_t& id);
  60. void SetVtxZCut(const Float_t& lo, const Float_t& hi) { mPrimVtxZ[0]=lo; mPrimVtxZ[1]=hi; }
  61. void SetVtxRCut(const Float_t& lo, const Float_t& hi) { mPrimVtxR[0]=lo; mPrimVtxR[1]=hi; }
  62. void SetVtxShift(const Float_t& xShift, const Float_t& yShift) { mPrimVtxXShift=xShift; mPrimVtxYShift=yShift; }
  63. void SetVtxVpdVzDiffCut(const Float_t& lo, const Float_t& hi) { mPrimVtxVpdVzDiff[0]=lo; mPrimVtxVpdVzDiff[1]=hi;}
  64. //Track
  65. void SetParticleMomentum(const Float_t& lo, const Float_t& hi) { mTrackMomentum[0]=lo; mTrackMomentum[1]=hi; }
  66. void SetTrackDca(const Float_t& lo, const Float_t& hi) { mTrackDca[0]=lo; mTrackDca[1]=hi; }
  67. void SetTrackDcaGlobal(const Float_t& lo, const Float_t& hi) { mTrackDcaGlobal[0]=lo; mTrackDcaGlobal[1]=hi; }
  68. void SetTrackNHits(const Int_t& lo, const Int_t& hi) { mTrackNHits[0]=lo; mTrackNHits[1]=hi; }
  69. void SetTrackEta(const Float_t& lo, const Float_t& hi) { mTrackEta[0]=lo; mTrackEta[1]=hi; }
  70. void SetTrackFlag(const Short_t& lo, const Short_t& hi) { mTrackFlag[0]=lo; mTrackFlag[1]=hi;}
  71. //Inclusive cuts
  72. //Pions
  73. void SetSelectPions(Bool_t &sel) { mSelectPions = sel; }
  74. void SetSelectTpcPions(Bool_t &sel) { mSelectTpcPions = sel; }
  75. void SetPionTpcMom(Float_t &lo, Float_t &hi) { mPionTpcMomentum[0]=lo; mPionTpcMomentum[1]=hi; }
  76. void SetPionTpcNSigmaElectron(Float_t &lo, Float_t &hi) { mPionTpcNSigmaElectron[0]=lo; mPionTpcNSigmaElectron[1]=hi; }
  77. void SetPionTpcNSigmaPion(Float_t &lo, Float_t &hi) { mPionTpcNSigmaPion[0]=lo; mPionTpcNSigmaPion[1]=hi; }
  78. void SetPionTpcNSigmaKaon(Float_t &lo, Float_t &hi) { mPionTpcNSigmaKaon[0]=lo; mPionTpcNSigmaKaon[1]=hi; }
  79. void SetPionTpcNSigmaProton(Float_t &lo, Float_t &hi) { mPionTpcNSigmaProton[0]=lo; mPionTpcNSigmaProton[1]=hi; }
  80. void SetSelectTofPions(Bool_t &sel) {mSelectTofPions = sel; }
  81. void SetPionTofMom(Float_t &lo, Float_t &hi) { mPionTofMomentum[0]=lo; mPionTofMomentum[1]=hi; }
  82. void SetPionMassSqr(Float_t &lo, Float_t &hi) { mPionMassSqr[0]=lo; mPionMassSqr[1]=hi; }
  83. //Kaons
  84. void SetSelectKaons(Bool_t &sel) { mSelectKaons = sel; }
  85. void SetSelectTpcKaons(Bool_t &sel) { mSelectTpcKaons = sel; }
  86. void SetKaonTpcMom(Float_t &lo, Float_t &hi) { mKaonTpcMomentum[0]=lo; mKaonTpcMomentum[1]=hi; }
  87. void SetKaonTpcNSigmaElectron(Float_t &lo, Float_t &hi) { mKaonTpcNSigmaElectron[0]=lo; mKaonTpcNSigmaElectron[1]=hi; }
  88. void SetKaonTpcNSigmaPion(Float_t &lo, Float_t &hi) { mKaonTpcNSigmaPion[0]=lo; mKaonTpcNSigmaPion[1]=hi; }
  89. void SetKaonTpcNSigmaKaon(Float_t &lo, Float_t &hi) { mKaonTpcNSigmaKaon[0]=lo; mKaonTpcNSigmaKaon[1]=hi; }
  90. void SetKaonTpcNSigmaProton(Float_t &lo, Float_t &hi) { mKaonTpcNSigmaProton[0]=lo; mKaonTpcNSigmaProton[1]=hi; }
  91. void SetSelectTofKaons(Bool_t &sel) {mSelectTofKaons = sel; }
  92. void SetKaonTofMom(Float_t &lo, Float_t &hi) { mKaonTofMomentum[0]=lo; mKaonTofMomentum[1]=hi; }
  93. void SetKaonMassSqr(Float_t &lo, Float_t &hi) { mKaonMassSqr[0]=lo; mKaonMassSqr[1]=hi; }
  94. //Protons
  95. void SetSelectProtons(Bool_t &sel) { mSelectProtons = sel; }
  96. void SetSelectTpcProtons(Bool_t &sel) { mSelectTpcProtons = sel; }
  97. void SetProtonTpcMom(Float_t &lo, Float_t &hi) { mProtonTpcMomentum[0]=lo; mProtonTpcMomentum[1]=hi; }
  98. void SetProtonTpcNSigmaElectron(Float_t &lo, Float_t &hi) { mProtonTpcNSigmaElectron[0]=lo; mProtonTpcNSigmaElectron[1]=hi; }
  99. void SetProtonTpcNSigmaPion(Float_t &lo, Float_t &hi) { mProtonTpcNSigmaPion[0]=lo; mProtonTpcNSigmaPion[1]=hi; }
  100. void SetProtonTpcNSigmaKaon(Float_t &lo, Float_t &hi) { mProtonTpcNSigmaKaon[0]=lo; mProtonTpcNSigmaKaon[1]=hi; }
  101. void SetProtonTpcNSigmaProton(Float_t &lo, Float_t &hi) { mProtonTpcNSigmaProton[0]=lo; mProtonTpcNSigmaProton[1]=hi; }
  102. void SetSelectTofProtons(Bool_t &sel) {mSelectTofProtons = sel; }
  103. void SetProtonTofMom(Float_t &lo, Float_t &hi) { mProtonTofMomentum[0]=lo; mProtonTofMomentum[1]=hi; }
  104. void SetProtonMassSqr(Float_t &lo, Float_t &hi) { mProtonMassSqr[0]=lo; mProtonMassSqr[1]=hi; }
  105. private:
  106. const Char_t *mOutFileName;
  107. TFile *mOutFile;
  108. TTree *mTree;
  109. StMuDstMaker *mMuDstMaker;
  110. StMuDst *mMuDst;
  111. Int_t mCompression;
  112. StRefMultCorr *mRefMultCorrUtil;
  113. Int_t mNBytes;
  114. vector<UInt_t> mTriggerIdCollection;
  115. //Global counters
  116. Bool_t mEventIsGood;
  117. Int_t mNEventsIn;
  118. Int_t mNEventsPassed;
  119. Bool_t mIsGoodTrack;
  120. Bool_t mAuAuCorrectZdc;
  121. Bool_t mLoopAllVert;
  122. //Event cuts
  123. Bool_t mCollisionTypeAuAu; // pp: false; AuAu: true
  124. Float_t mPrimVtxZ[2];
  125. Float_t mPrimVtxR[2];
  126. Float_t mPrimVtxVpdVzDiff[2];
  127. Float_t mPrimVtxXShift;
  128. Float_t mPrimVtxYShift;
  129. //Single-particle cuts
  130. Float_t mTrackMomentum[2];
  131. Float_t mTrackDca[2];
  132. Float_t mTrackDcaGlobal[2];
  133. UShort_t mTrackNHits[2];
  134. Float_t mTrackEta[2];
  135. Short_t mTrackFlag[2];
  136. //Inclusive cuts
  137. //Pions
  138. Bool_t mSelectPions;
  139. Bool_t mSelectTpcPions;
  140. Float_t mPionTpcMomentum[2];
  141. Float_t mPionTpcNSigmaElectron[2];
  142. Float_t mPionTpcNSigmaPion[2];
  143. Float_t mPionTpcNSigmaKaon[2];
  144. Float_t mPionTpcNSigmaProton[2];
  145. Bool_t mSelectTofPions;
  146. Float_t mPionMassSqr[2];
  147. Float_t mPionTofMomentum[2];
  148. //Kaons
  149. Bool_t mSelectKaons;
  150. Bool_t mSelectTpcKaons;
  151. Float_t mKaonTpcMomentum[2];
  152. Float_t mKaonTpcNSigmaElectron[2];
  153. Float_t mKaonTpcNSigmaPion[2];
  154. Float_t mKaonTpcNSigmaKaon[2];
  155. Float_t mKaonTpcNSigmaProton[2];
  156. Bool_t mSelectTofKaons;
  157. Float_t mKaonTofMomentum[2];
  158. Float_t mKaonMassSqr[2];
  159. //Protons
  160. Bool_t mSelectProtons;
  161. Bool_t mSelectTpcProtons;
  162. Float_t mProtonTpcMomentum[2];
  163. Float_t mProtonTpcNSigmaElectron[2];
  164. Float_t mProtonTpcNSigmaPion[2];
  165. Float_t mProtonTpcNSigmaKaon[2];
  166. Float_t mProtonTpcNSigmaProton[2];
  167. Bool_t mSelectTofProtons;
  168. Float_t mProtonTofMomentum[2];
  169. Float_t mProtonMassSqr[2];
  170. //Trigger is a bit mask for the list of triggers that is set in macros
  171. UInt_t mCurrentTrigger;
  172. // Femto event structure
  173. StFemtoEvent *mFemtoEvent;
  174. // Femto track
  175. StFemtoTrack *mFTrack;
  176. //Internal class methods
  177. Bool_t AcceptTrigger(StMuEvent *muEvent);
  178. Bool_t AcceptRefMult2(StMuTrack *trk);
  179. Bool_t AcceptPrimVtx(StThreeVectorF vtxPos, Float_t vpdVz);
  180. Bool_t AcceptRunId(Int_t runId); //For StRefMultCorr (isBadRun)
  181. Bool_t AcceptTrack(StMuTrack *primTrk, UShort_t vtxInd);
  182. Bool_t AcceptDcaGlobal(Float_t dcaToPrimVtx);
  183. Bool_t IsTofTrack(StMuTrack *globTrack);
  184. //pion, kaon and proton selection
  185. Bool_t IsTpcPion(StMuTrack *pTrk);
  186. Bool_t IsTofPion(Float_t mSqr, Float_t p);
  187. Bool_t IsTpcKaon(StMuTrack *pTrk);
  188. Bool_t IsTofKaon(Float_t mSqr, Float_t p);
  189. Bool_t IsTpcProton(StMuTrack *pTrk);
  190. Bool_t IsTofProton(Float_t mSqr, Float_t p);
  191. ClassDef(StFemtoDstInclusiveSelector, 3)
  192. };
  193. #endif