StFemtoDstMaker.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  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 STFEMTODSTMAKER_HH
  7. #define STFEMTODSTMAKER_HH
  8. #include "StMaker.h"
  9. #include "StThreeVector.hh"
  10. #include "StThreeVectorF.hh"
  11. #include "StPhysicalHelixD.hh"
  12. #include "StRefMultCorr/StRefMultCorr.h"
  13. #include "QVMaker/QV.h"
  14. #include "QVMaker/QVMaker.h"
  15. #include "StFemtoEvent.h"
  16. #include "StFemtoTrack.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 <TString.h>
  25. #include <TFile.h>
  26. #include <TLorentzVector.h>
  27. #include <TTree.h>
  28. #include <TH1.h>
  29. #include <TH2.h>
  30. #include <TVectorT.h>
  31. #include <TMatrixTLazy.h>
  32. #include <TMatrixDSymEigen.h>
  33. #include <vector>
  34. #include <iostream>
  35. #ifndef St_NO_NAMESPACES
  36. using namespace std;
  37. #endif
  38. //
  39. // Predefinisions
  40. //
  41. class StFemtoEvent;
  42. class StFemtoTrack;
  43. class StMuDst;
  44. class StMuDstMaker;
  45. class StMuEvent;
  46. class StMuTrack;
  47. //_________________
  48. class StFemtoDstMaker : public StMaker {
  49. public:
  50. StFemtoDstMaker(StMuDstMaker *muMaker,
  51. const char *calibPath,
  52. const Char_t *oFileName);
  53. ~StFemtoDstMaker();
  54. void Clear(Option_t *option = "");
  55. Int_t Init();
  56. Int_t Make();
  57. Int_t Finish();
  58. void CleanVariables();
  59. void SetCompressionLevel(Int_t comp) { mCompression = comp; }
  60. //
  61. // Setters
  62. //
  63. // global parameters of the maker
  64. void SetCollisionType(const Bool_t& type) { mCollisionType = type; }
  65. void SetMuDstMaker(StMuDstMaker *maker) { mMuDstMaker = maker; }
  66. void SetRefmultCorrUtil(StRefMultCorr* rf) { mRefMultCorrUtil = rf; }
  67. void SetAuAuZdcCoincidenceEnergy(const Bool_t &correct) { mAuAuCorrectZdc = correct; }
  68. // event
  69. void SetTriggerId(const UInt_t& id);
  70. void SetVtxZCut(const Float_t& lo, const Float_t& hi) { mPrimVtxZ[0]=lo; mPrimVtxZ[1]=hi; }
  71. void SetVtxRCut(const Float_t& lo, const Float_t& hi) { mPrimVtxR[0]=lo; mPrimVtxR[1]=hi; }
  72. void SetVtxShift(const Float_t& xShift, const Float_t& yShift) { mPrimVtxXShift=xShift; mPrimVtxYShift=yShift; }
  73. void SetVtxVpdVzDiffCut(const Float_t& lo, const Float_t& hi) { mPrimVtxVpdVzDiff[0]=lo; mPrimVtxVpdVzDiff[1]=hi;}
  74. void SetSphericityCut(float ptCut) { mPtCut = ptCut; }
  75. // track
  76. void SetParticleMomentum(const Float_t& lo, const Float_t& hi) { mTrackMomentum[0]=lo; mTrackMomentum[1]=hi; }
  77. void SetTrackDca(const Float_t& lo, const Float_t& hi) { mTrackDca[0]=lo; mTrackDca[1]=hi; }
  78. void SetTrackDcaGlobal(const Float_t& lo, const Float_t& hi) { mTrackDcaGlobal[0]=lo; mTrackDcaGlobal[1]=hi; }
  79. void SetTrackNHits(const Int_t& lo, const Int_t& hi) { mTrackNHits[0]=lo; mTrackNHits[1]=hi; }
  80. void SetTrackNHitsFit(const Int_t& lo, const Int_t& hi) { mTrackNHitsFit[0]=lo; mTrackNHitsFit[1]=hi; }
  81. void SetTrackEta(const Float_t& lo, const Float_t& hi) { mTrackEta[0]=lo; mTrackEta[1]=hi; }
  82. void SetTrackFlag(const Short_t& lo, const Short_t& hi) { mTrackFlag[0]=lo; mTrackFlag[1]=hi;}
  83. //
  84. // Exclusion cuts
  85. //
  86. void SetRemovePions(Bool_t &remove) { mRemovePions = remove; }
  87. void SetRemoveKaons(Bool_t &remove) { mRemoveKaons = remove; }
  88. void SetRemoveProtons(Bool_t &remove) { mRemoveProtons = remove; }
  89. void SetRemoveMomThreshold(Float_t &t) { mPthresh = t; }
  90. void SetTpcPionNSigma(Float_t &lo, Float_t &hi) { mTpcPionNSigma[0] = lo; mTpcPionNSigma[1] = hi; }
  91. void SetTofPionMassSqr(Float_t &lo, Float_t &hi) { mTofPionMassSqr[0] = lo; mTofPionMassSqr[1] = hi; }
  92. void SetTpcKaonNSigma(Float_t &lo, Float_t &hi) { mTpcKaonNSigma[0] = lo; mTpcKaonNSigma[1] = hi; }
  93. void SetTofKaonMassSqr(Float_t &lo, Float_t &hi) { mTofKaonMassSqr[0] = lo; mTofKaonMassSqr[1] = hi; }
  94. void SetTpcProtonNSigma(Float_t &lo, Float_t &hi) { mTpcProtonNSigma[0] = lo; mTpcProtonNSigma[1] = hi; }
  95. void SetTofProtonMassSqr(Float_t &lo, Float_t &hi) { mTofProtonMassSqr[0] = lo; mTofProtonMassSqr[1] = hi; }
  96. private:
  97. const Char_t *mOutFileName;
  98. TFile *mOutFile;
  99. TTree *mTree;
  100. Int_t mCompression; // see ROOT documentation for more info
  101. Int_t mNBytes; // number of writed bytes to the mTree
  102. vector<UInt_t> mTriggerIdCollection;
  103. //
  104. // Reaction plane
  105. //
  106. QVMaker *mQVMaker;
  107. double mZDCSMDCenterex = 4.72466; //
  108. double mZDCSMDCenterey = 5.53629; // This variables
  109. double mZDCSMDCenterwx = 4.39604; // is from Takafumi codes
  110. double mZDCSMDCenterwy = 5.19968; //
  111. const char *mCalibPath; // path to the calibration ROOT files
  112. int LoadEPCalibParam(int runid); // load calibration
  113. int GetCentralityBin(float refMult, int fVz);
  114. void CalcQvSMD(StMuEvent *mEv, QV fQv[NsubSMD], int fCent, int fVz);
  115. Float_t ZDCSMD(StMuEvent *mEv, int eastwest, int verthori, int strip);
  116. Float_t ZDCSMD_GetPosition(int eastwest, int verthori, int strip);
  117. //
  118. // Transverse sphericity
  119. //
  120. TMatrixTSym<double> *matrix; // transverse sphericity matrix
  121. float mPtCut;
  122. //
  123. // Global counters
  124. //
  125. Bool_t mEventIsGood;
  126. Int_t mNEventsIn;
  127. Int_t mNEventsPassed;
  128. Bool_t mIsGoodTrack;
  129. Bool_t mAuAuCorrectZdc;
  130. //
  131. // Event cuts
  132. //
  133. Bool_t mCollisionType; //0-pp, 1-AuAu
  134. Float_t mPrimVtxZ[2];
  135. Float_t mPrimVtxR[2];
  136. Float_t mPrimVtxVpdVzDiff[2];
  137. Float_t mPrimVtxXShift;
  138. Float_t mPrimVtxYShift;
  139. //
  140. // Single-particle cuts
  141. //
  142. Float_t mTrackMomentum[2];
  143. Float_t mTrackDca[2];
  144. Float_t mTrackDcaGlobal[2];
  145. UShort_t mTrackNHits[2];
  146. UShort_t mTrackNHitsFit[2];
  147. Float_t mTrackEta[2];
  148. Short_t mTrackFlag[2];
  149. //
  150. //Cuts for exclusion
  151. //
  152. Bool_t mRemovePions;
  153. Bool_t mRemoveKaons;
  154. Bool_t mRemoveProtons;
  155. Float_t mPthresh;
  156. Float_t mTpcPionNSigma[2];
  157. Float_t mTofPionMassSqr[2];
  158. Float_t mTpcKaonNSigma[2];
  159. Float_t mTofKaonMassSqr[2];
  160. Float_t mTpcProtonNSigma[2];
  161. Float_t mTofProtonMassSqr[2];
  162. //
  163. // Pointers to classes
  164. //
  165. StMuPrimaryVertex *mPrimVertex;
  166. StMuTrack *mPrimTrack;
  167. StMuTrack *mGlobTrack;
  168. StMuDstMaker *mMuDstMaker;
  169. StMuEvent *mMuEvent;
  170. StMuDst *mMuDst;
  171. StRefMultCorr *mRefMultCorrUtil;
  172. //
  173. // Trigger
  174. //
  175. UInt_t mCurrentTrigger;
  176. //
  177. // Counter for the debug purposes
  178. //
  179. int mAcceptTriggerFail;
  180. int mRefMultFail;
  181. int mAntiPileupFail;
  182. int mRankingFail;
  183. int mVtxNullFail;
  184. int mNPrimVtxFail;
  185. int mAcceptPrimVtxFail;
  186. //
  187. // Femto event structure
  188. //
  189. StFemtoEvent *mFemtoEvent;
  190. //
  191. // Internal class methods
  192. //
  193. Bool_t AcceptTrigger(StMuEvent *muEvent);
  194. Bool_t AcceptPrimVtx(StThreeVectorF vtxPos, Float_t vpdVz);
  195. Bool_t AcceptRunId(Int_t runId); //For StRefMultCorr (isBadRun)
  196. Bool_t AcceptTrack(StMuTrack *primTrk, UShort_t vtxInd);
  197. Bool_t AcceptRefMult2(StMuTrack *trk);
  198. Bool_t AcceptDcaGlobal(Float_t dcaToPrimVtx);
  199. Bool_t IsTofTrack(StMuTrack *globTrack);
  200. //
  201. // Pion, Kaon and Proton selection
  202. //
  203. Bool_t IsTpcPion(StMuTrack *pTrk);
  204. Bool_t IsTofPion(StMuTrack *gTrk);
  205. Bool_t IsTpcKaon(StMuTrack *pTrk);
  206. Bool_t IsTofKaon(StMuTrack *gTrk);
  207. Bool_t IsTpcProton(StMuTrack *pTrk);
  208. Bool_t IsTofProton(StMuTrack *gTrk);
  209. ClassDef(StFemtoDstMaker, 4)
  210. };
  211. #endif