MpdSmashGenerator.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * File: MpdSmashGenerator.h
  3. * Author: Igor Altsybeev et al.
  4. *
  5. * Created on 17/07/2020
  6. */
  7. #ifndef MPDSMASHGENERATOR_H_H
  8. #define MPDSMASHGENERATOR_H_H
  9. #include "FairGenerator.h"
  10. #include "TTree.h"
  11. #include "TRandom3.h"
  12. #include <fstream>
  13. const UInt_t MAX_N_PART = 1e4;
  14. class TVirtualMCStack;
  15. class FairPrimaryGenerator;
  16. class TFile;
  17. //class TTree;
  18. class MpdSmashGenerator : public FairGenerator {
  19. public:
  20. /** Default constructor without arguments should not be used. **/
  21. MpdSmashGenerator();
  22. /** Standard constructor.
  23. * @param fileName The input file name
  24. **/
  25. MpdSmashGenerator(TString fileName);
  26. /** Destructor. **/
  27. ~MpdSmashGenerator();
  28. void SetRandomRP( bool flag_isRandomRP ) { fIsRandomRP = flag_isRandomRP; }
  29. int GetNeventsInTree() { return fInputTree ? fInputTree->GetEntries() : -1; }
  30. Bool_t ReadEvent(FairPrimaryGenerator* primGen);
  31. void SkipEvents(Int_t ev) {
  32. fEventNumber = ev;
  33. }
  34. private:
  35. TFile * fInputFile; //! Input file
  36. TString fFileName; //! Input file name
  37. TTree *fInputTree; //! Input SMASH tree
  38. // TChain *fInputTree;
  39. // Vars to be read from SMASH tree:
  40. Double_t fImpPar; //!
  41. Int_t fNpart; //!
  42. Bool_t fEmptyEv; //!
  43. Double_t fPx[MAX_N_PART]; //!
  44. Double_t fPy[MAX_N_PART]; //!
  45. Double_t fPz[MAX_N_PART]; //!
  46. Int_t fPID[MAX_N_PART]; //!
  47. Int_t fCharge[MAX_N_PART]; //!
  48. //
  49. Int_t fEventNumber; //!
  50. Bool_t fIsRandomRP; //! // random/fixed reaction plane
  51. Double_t fPsiRP; //! // reaction plane angle
  52. TRandom3 *fRandom; //!
  53. MpdSmashGenerator(const MpdSmashGenerator&);
  54. MpdSmashGenerator& operator=(const MpdSmashGenerator&);
  55. ClassDef(MpdSmashGenerator, 2);
  56. };
  57. #endif /* MPDSMASHGENERATOR_H */