StFemtoDstPicoRun11Maker.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. /***
  2. StFemtoDstPicoRun11Maker
  3. COMMENT: This class converts PicoDst for Run11 to FemtoDst
  4. VERSION: 1.0
  5. AUTHOR: Nikita Ermakov
  6. E-MAIL: coffe92@gmail.com
  7. CHANGE LOG:
  8. Version 1.0: First version
  9. ***/
  10. #ifndef STFEMTODSTPICORUN11MAKER_HH
  11. #define STFEMTODSTPICORUN11MAKER_HH
  12. #include "StMaker.h"
  13. #include "StThreeVector.hh"
  14. #include "StThreeVectorF.hh"
  15. #include "StPhysicalHelixD.hh"
  16. #include "StPicoDstMakerRun11/StPicoDst.h"
  17. #include "StPicoDstMakerRun11/StPicoDstMaker.h"
  18. #include "StPicoDstMakerRun11/StPicoEvent.h"
  19. #include "StPicoDstMakerRun11/StPicoTrack.h"
  20. #include "StPicoDstMakerRun11/StPicoBTofPidTraits.h"
  21. #include "StFemtoEvent.h"
  22. #include "StFemtoTrack.h"
  23. #include "StBTofHeader.h"
  24. #include "TBranch.h"
  25. #include "StPhysicalHelixD.hh"
  26. #include "StDcaGeometry.h"
  27. #include <TString.h>
  28. #include <TFile.h>
  29. #include <TLorentzVector.h>
  30. #include <TTree.h>
  31. #include <TH1.h>
  32. #include <TH2.h>
  33. #include <TRandom3.h>
  34. #include <TVectorT.h>
  35. #include <TMatrixTLazy.h>
  36. #include <TMatrixDSymEigen.h>
  37. #include <vector>
  38. #include <iostream>
  39. #ifndef St_NO_NAMESPACES
  40. using namespace std;
  41. #endif
  42. //
  43. // Predefinisions
  44. //
  45. class StFemtoEvent;
  46. class StFemtoTrack;
  47. class StPicoDst;
  48. class StPicoEvent;
  49. class StPicoTrack;
  50. class StFemtoDstPicoRun11Maker : public StMaker
  51. {
  52. public:
  53. StFemtoDstPicoRun11Maker(StPicoDstMaker *picoMaker,
  54. const Char_t *oFileName);
  55. ~StFemtoDstPicoRun11Maker();
  56. void Clear(Option_t *option = "");
  57. Int_t Init();
  58. Int_t Make();
  59. Int_t Finish();
  60. void SetCompressionLevel(Int_t comp) { mCompression = comp; }
  61. //
  62. // Setters
  63. //
  64. // global parameters of the maker
  65. void SetPicoDstMaker(StPicoDstMaker *maker) { mPicoMaker = maker; }
  66. void SetSphericityCut(float ptCut) { mPtCut = ptCut; }
  67. // event
  68. void SetVtxZCut(const float& lo, const Float_t& hi) { mPrimVtxZ[0]=lo; mPrimVtxZ[1]=hi; }
  69. void SetVtxRCut(const float& lo, const Float_t& hi) { mPrimVtxR[0]=lo; mPrimVtxR[1]=hi; }
  70. void SetVtxShift(const float& xShift, const Float_t& yShift) { mPrimVtxXShift=xShift; mPrimVtxYShift=yShift; }
  71. void SetVtxVpdVzDiffCut(const float& lo, const Float_t& hi) { mPrimVtxVpdVzDiff[0]=lo; mPrimVtxVpdVzDiff[1]=hi;}
  72. // track
  73. void SetParticleMomentum(const float& lo, const Float_t& hi) { mTrackMomentum[0]=lo; mTrackMomentum[1]=hi; }
  74. void SetTrackDcaGlobal(const float& lo, const Float_t& hi) { mTrackDcaGlobal[0]=lo; mTrackDcaGlobal[1]=hi; }
  75. void SetTrackNHitsFit(const Int_t& lo, const Int_t& hi) { mTrackNHitsFit[0]=lo; mTrackNHitsFit[1]=hi; }
  76. void SetTrackEta(const float& lo, const Float_t& hi) { mTrackEta[0]=lo; mTrackEta[1]=hi; }
  77. //
  78. // Exclusion cuts
  79. //
  80. void SetRemovePions(bool &remove) { mRemovePions = remove; }
  81. void SetRemoveKaons(bool &remove) { mRemoveKaons = remove; }
  82. void SetRemoveProtons(bool &remove) { mRemoveProtons = remove; }
  83. void SetRemoveMomThreshold(float &t) { mPthresh = t; }
  84. void SetTpcPionNSigma(float &lo, Float_t &hi) { mTpcPionNSigma[0] = lo; mTpcPionNSigma[1] = hi; }
  85. void SetTofPionMassSqr(float &lo, Float_t &hi) { mTofPionMassSqr[0] = lo; mTofPionMassSqr[1] = hi; }
  86. void SetTpcKaonNSigma(float &lo, Float_t &hi) { mTpcKaonNSigma[0] = lo; mTpcKaonNSigma[1] = hi; }
  87. void SetTofKaonMassSqr(float &lo, Float_t &hi) { mTofKaonMassSqr[0] = lo; mTofKaonMassSqr[1] = hi; }
  88. void SetTpcProtonNSigma(float &lo, Float_t &hi) { mTpcProtonNSigma[0] = lo; mTpcProtonNSigma[1] = hi; }
  89. void SetTofProtonMassSqr(float &lo, Float_t &hi) { mTofProtonMassSqr[0] = lo; mTofProtonMassSqr[1] = hi; }
  90. private:
  91. const Char_t *mOutFileName;
  92. TFile *mOutFile;
  93. TTree *mTree;
  94. Int_t mCompression; // see ROOT documentation for more info
  95. Int_t mNBytes; // number of writed bytes to the mTree
  96. //
  97. // Global counters
  98. //
  99. Int_t mNEventsIn;
  100. Int_t mNEventsPassed;
  101. bool isGlobalTrack;
  102. //
  103. // Sphericity
  104. //
  105. TMatrixTSym<double> *matrix; // transverse sphericity matrix
  106. float mPtCut;
  107. //
  108. // Event cuts
  109. //
  110. float mPrimVtxZ[2];
  111. float mPrimVtxR[2];
  112. float mPrimVtxVpdVzDiff[2];
  113. float mPrimVtxXShift;
  114. float mPrimVtxYShift;
  115. //
  116. // Single-particle cuts
  117. //
  118. float mTrackMomentum[2];
  119. float mTrackDcaGlobal[2];
  120. UShort_t mTrackNHitsFit[2];
  121. float mTrackEta[2];
  122. //
  123. //Cuts for exclusion
  124. //
  125. bool mRemovePions;
  126. bool mRemoveKaons;
  127. bool mRemoveProtons;
  128. float mPthresh;
  129. float mTpcPionNSigma[2];
  130. float mTofPionMassSqr[2];
  131. float mTpcKaonNSigma[2];
  132. float mTofKaonMassSqr[2];
  133. float mTpcProtonNSigma[2];
  134. float mTofProtonMassSqr[2];
  135. //
  136. // Global variables
  137. //
  138. StPicoDstMaker *mPicoMaker;
  139. StPicoTrack *mPicoTrack;
  140. StThreeVectorF mPrimP, mGlobP, mDca;
  141. float mMassSqr;
  142. bool mIsTofTrack;
  143. TRandom3 *mRandom;
  144. unsigned int mTmap0, mTmap1;
  145. //
  146. // Femto event structure
  147. //
  148. StFemtoEvent *mFemtoEvent;
  149. //
  150. // Internal class methods
  151. //
  152. //
  153. bool AcceptPrimVtx(const StThreeVectorF &vtxPos, float vpdVz);
  154. bool AcceptTrack();
  155. bool AcceptRefMult2();
  156. bool AcceptDcaGlobal(float dcaToPrimVtx);
  157. void CalcDca(const StPhysicalHelixD &helix,
  158. const StThreeVectorF &vtxPos);
  159. void TopologyMapCalc();
  160. //
  161. // Pion, Kaon and Proton selection
  162. //
  163. bool IsTpcPion();
  164. bool IsTofPion();
  165. bool IsTpcKaon();
  166. bool IsTofKaon();
  167. bool IsTpcProton();
  168. bool IsTofProton();
  169. ClassDef(StFemtoDstPicoRun11Maker, 1)
  170. };
  171. #endif