MpdUrqmdGenerator.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. // -------------------------------------------------------------------------
  2. // ----- MpdUrqmdGenerator header file -----
  3. // ----- Created 11/06/04 by V. Friese / D.Bertini -----
  4. // -------------------------------------------------------------------------
  5. /** MpdUrqmdGenerator.h
  6. *@ author V.Friese <v.friese@gsi.de>
  7. *@author D.Bertini <d.bertini@gsi.de>
  8. *
  9. The MpdUrqmdGenerator reads the output file 14 (ftn14) from UrQMD. The UrQMD
  10. calculation has to be performed in the CM system of the collision; Lorentz
  11. transformation into the lab is performed by this class.
  12. Derived from FairGenerator.
  13. **/
  14. #define GZIP_SUPPORT // version with gz support
  15. #ifndef MPDURQMDGENERATOR_H
  16. #define MPDURQMDGENERATOR_H
  17. #include "FairGenerator.h"
  18. #include <fstream>
  19. #include <map>
  20. #ifdef GZIP_SUPPORT
  21. #ifndef __CINT__
  22. #include <zlib.h>
  23. #endif
  24. #endif
  25. class TVirtualMCStack;
  26. class FairPrimaryGenerator;
  27. class MpdUrqmdGenerator : public FairGenerator
  28. {
  29. public:
  30. /** Default constructor without arguments should not be used. **/
  31. MpdUrqmdGenerator();
  32. /** Standard constructor.
  33. * @param fileName The input file name
  34. **/
  35. MpdUrqmdGenerator(const char* fileName);
  36. /** Destructor. **/
  37. ~MpdUrqmdGenerator();
  38. /** Reads on event from the input file and pushes the tracks onto
  39. ** the stack. Abstract method in base class.
  40. ** @param pStack pointer to the stack
  41. ** @param ver not used
  42. **/
  43. Bool_t ReadEvent(FairPrimaryGenerator* primGen);
  44. //Skip some events in file
  45. Bool_t SkipEvents(Int_t count);
  46. void SetEventPlane(Double_t phiMin, Double_t phiMax);
  47. private:
  48. #ifdef GZIP_SUPPORT
  49. #ifndef __CINT__
  50. gzFile fInputFile; //! Input file
  51. #endif
  52. #else
  53. FILE* fInputFile; //! Input file
  54. #endif
  55. std::map<Int_t,Int_t> fParticleTable; //! Map from UrQMD PID to PDGPID
  56. Double32_t fPhiMin, fPhiMax; // Limits of event plane angle
  57. Bool_t fEventPlaneSet; // Flag whether event plane angle is used
  58. const Char_t* fFileName; //! Input file name
  59. /** Private method ReadConversionTable. Reads the conversion table
  60. from UrQMD particle code to PDG particle code and fills the
  61. conversion map. Is called from the constructor. **/
  62. void ReadConversionTable();
  63. MpdUrqmdGenerator(const MpdUrqmdGenerator&);
  64. MpdUrqmdGenerator& operator=(const MpdUrqmdGenerator&);
  65. ClassDef(MpdUrqmdGenerator,1);
  66. };
  67. #endif