StFemtoDstMaker_StarGen.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #ifndef STFEMTODSTMAKER_STARGEN_HH
  2. #define STFEMTODSTMAKER_STARGEN_HH
  3. #include "StMaker.h"
  4. #include "StThreeVector.hh"
  5. #include "StThreeVectorF.hh"
  6. #include "TRandom3.h"
  7. #include <StarGenerator/EVENT/StarGenParticle.h>
  8. #include <StarGenerator/EVENT/StarGenEvent.h>
  9. #include <TDatabasePDG.h>
  10. #include "TSystem.h"
  11. #include "TChain.h"
  12. #include "StFemtoEvent.h"
  13. #include "StFemtoTrack.h"
  14. #include <TString.h>
  15. #include <TFile.h>
  16. #include <TLorentzVector.h>
  17. #include <TTree.h>
  18. #include <TH1.h>
  19. #include <TH2.h>
  20. #include <TVectorT.h>
  21. #include <TMatrixTLazy.h>
  22. #include <TMatrixDSymEigen.h>
  23. #include <vector>
  24. #include <iostream>
  25. #ifndef St_NO_NAMESPACES
  26. using namespace std;
  27. #endif
  28. //
  29. // Predefinisions
  30. //
  31. class StFemtoEvent;
  32. class StFemtoTrack;
  33. //_________________
  34. class StFemtoDstMaker_StarGen : public StMaker
  35. {
  36. public:
  37. StFemtoDstMaker_StarGen(const char *dirName, const char *fileName, const char *oFileName,
  38. const char *filter = ".", int maxFiles = 1e9);
  39. ~StFemtoDstMaker_StarGen();
  40. void Clear(Option_t *option = "");
  41. Int_t Init();
  42. Int_t Make();
  43. Int_t Finish();
  44. void CleanVariables();
  45. int GetNEvents();
  46. void SetCompressionLevel(Int_t comp) { mCompression = comp; }
  47. //
  48. // Setters
  49. //
  50. // track
  51. void SetParticleMomentum(const float& lo, const float& hi) { mTrackMomentum[0]=lo; mTrackMomentum[1]=hi; }
  52. void SetTrackEta(const float& lo, const float& hi) { mTrackEta[0]=lo; mTrackEta[1]=hi; }
  53. void SetPtCut(float ptCut) { mPtCut = ptCut; }
  54. private:
  55. const char *mOutFileName;
  56. TFile *mOutFile;
  57. int mCompression; // see ROOT documentation for more info
  58. int mNBytes; // number of writed bytes to the mTree
  59. bool mIsGoodTrack;
  60. string mDir;
  61. string mFileName;
  62. string mFilter;
  63. unsigned int mEventIndex;
  64. unsigned int mNEvents;
  65. //
  66. // Single-particle cuts
  67. //
  68. float mTrackMomentum[2];
  69. float mTrackEta[2];
  70. //
  71. // Femto event structure
  72. //
  73. StFemtoEvent *mFemtoEvent;
  74. TDatabasePDG *mDb;
  75. TChain *mTChain;
  76. TTree *mTree;
  77. StarGenEvent *mSGEvent;
  78. float mTotalTracks;
  79. int mMaxFiles;
  80. TRandom3 *mRandy;
  81. float mPtCut;
  82. TMatrixTSym<double> *mMatrix; // transverse sphericity matrix
  83. //
  84. // Internal class methods
  85. //
  86. bool AcceptTrack(const TLorentzVector &p);
  87. int InitRead(string dir, string fileName,
  88. string filter, int maxFiles);
  89. int FillChain(TChain *aChain, const char *fileName,
  90. int faxFiles);
  91. int FillChain(TChain *chain, char *dir,
  92. const char *filter, int maxFiles);
  93. void UninitRead();
  94. float dedxMean(float mass, float momentum);
  95. void TopologyMap(unsigned int *tmap1, unsigned int *tmap2, float ptot);
  96. ClassDef(StFemtoDstMaker_StarGen, 1)
  97. };
  98. #endif