MpdLAQGSMGenerator.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // -------------------------------------------------------------------------
  2. // ----- MpdLAQGSMGenerator header file -----
  3. // -------------------------------------------------------------------------
  4. /** MpdLAQGSMGenerator
  5. *@author Elena Litvinenko <litvin@nf.jinr.ru>
  6. *@version 15.02.2016
  7. *
  8. ** The MpdLAQGSMGenerator uses the ASCII input
  9. ** provided by K.Gudima LAQGSM event generator.
  10. **/
  11. #ifndef MPDLAQGSMGENERATOR_H
  12. #define MPDLAQGSMGENERATOR_H 1
  13. #include "FairGenerator.h"
  14. #include <fstream>
  15. #include <map>
  16. #include <vector>
  17. #ifndef __CINT__
  18. #include <zlib.h>
  19. #endif
  20. class TDatabasePDG;
  21. class FairPrimaryGenerator;
  22. class FairIon;
  23. class MpdLAQGSMGenerator : public FairGenerator
  24. {
  25. struct la_tab_t {
  26. Int_t pdg;
  27. Int_t Z;
  28. Int_t strange;
  29. Int_t lepton;
  30. Int_t A;
  31. Float_t mass;
  32. char name[10];
  33. };
  34. public:
  35. /** Default constructor without arguments should not be used. **/
  36. MpdLAQGSMGenerator();
  37. /** Standard constructor.
  38. ** @param fileName The input file name
  39. **/
  40. MpdLAQGSMGenerator(const char* fileName, const Bool_t use_collider_system=kTRUE, Int_t QGSM_format_ID=0,Int_t Max_Event_Number=0);
  41. /** Destructor. **/
  42. virtual ~MpdLAQGSMGenerator();
  43. // static la_tab_t la_tab[78]; //! list of light particles known for MpdLAQGSMGenerator
  44. void Init (const char *light_particles_filename=0); // fill list of known light particles
  45. /** Reads on event from the input file and pushes the tracks onto
  46. ** the stack. Abstract method in base class.
  47. ** @param primGen pointer to the FairPrimaryGenerator
  48. **/
  49. virtual Bool_t ReadEvent(FairPrimaryGenerator* primGen);
  50. virtual Bool_t GetEventHeader(char *ss);
  51. Bool_t SkipEvents(Int_t nSkip); //AZ
  52. Bool_t general_fgets (char *ss, Int_t nn=250, FILE* p=0);
  53. Bool_t general_feof (void *p);
  54. private:
  55. FILE* fInputFile; //! Input file
  56. #ifndef __CINT__
  57. gzFile fGZInputFile; //! GZ Input file
  58. #endif
  59. const Char_t* fFileName; //! Input file Name
  60. TDatabasePDG* fPDG; //! PDG database
  61. Int_t fQGSM_format_ID; // Reflect format changes
  62. Bool_t fUseColliderSystem; // kTRUE- for NICA/MPD, kFALSE - for lab system (CBM)
  63. //la_tab_t la_tab[84]; //! list of light particles known for MpdLAQGSMGenerator
  64. std::vector<la_tab_t*> fLa_tab; //! list of light particles known for MpdLAQGSMGenerator
  65. Bool_t fGZ_input; //! 0: ascii input, 1: gzipped input
  66. /** Private method CloseInput. Just for convenience. Closes the
  67. ** input file properly. Called from destructor and from ReadEvent. **/
  68. void CloseInput();
  69. /** Private method RegisterIons. Goes through the input file and registers
  70. ** any ion needed. **/
  71. Int_t RegisterIons(Int_t Max_Event_Number=0);
  72. Int_t RegisterIons1(); //AZ
  73. Int_t CreatePdgCode(Int_t Z, Int_t A, Int_t Strange,Int_t user=0);
  74. Bool_t FindParticle (Int_t Z, Int_t strange, Int_t lepton, Int_t A, Float_t mass, Int_t &PDG, char name[11]);
  75. Bool_t CreateNucleus (Int_t Z, Float_t mass, Int_t pdgCode, char pdgName[11]);
  76. /** STL map from ion name to FairIon **/
  77. std::map<TString, FairIon*> fIonMap; //!
  78. ClassDef(MpdLAQGSMGenerator,1);
  79. };
  80. #endif