PandaRoot
PndEvtGenGenerator.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 // -------------------------------------------------------------------------
14 // ----- PndEvtGenGenerator header file -----
15 // ----- Created 05/02/07 by S.Spataro -----
16 // -------------------------------------------------------------------------
17 
26 #ifndef PND_EVTGENGENERATOR_H
27 #define PND_EVTGENGENERATOR_H
28 
29 #include "FairGenerator.h"
30 #include "TString.h"
31 #include <fstream>
32 
33 class TClonesArray;
34 class TFile;
35 class TTree;
36 class TVirtualMCStack;
37 class FairPrimaryGenerator;
38 class TF1;
39 
40 class PndEvtGenGenerator : public FairGenerator {
41 
42  public:
45 
49  PndEvtGenGenerator(const Char_t *fileName);
50  PndEvtGenGenerator(const Char_t *fileName, Double_t Rsigma, TF1 *DensityFunction);
51 
53  virtual ~PndEvtGenGenerator();
54 
59  virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen);
60 
61  protected:
62  Bool_t ReadAsciiEvent(FairPrimaryGenerator *primGen);
63  Bool_t ReadRootEvent(FairPrimaryGenerator *primGen);
64  Bool_t Init();
65 
66  private:
67  Bool_t SetBranchAddresses();
68 
69  Int_t iEvent;
70  TString fFileName;
71  TFile *fInputRootFile;
72  TTree *fInputTree;
73  FILE *fInputAsciiFile;
74 
75  Double_t *fRPx, *fRPy, *fRPz;
76  Double_t *fRVx, *fRVy, *fRVz;
77  Int_t *fRPdg;
78  Int_t *fRDF, *fRDL;
79  Int_t fRNTrk;
80 
81  Bool_t fFileType;
82 
83  int fGasmode;
84  double fRsigma;
85 
86  TF1 *fDensityFunction;
87 
90  void CloseInput();
91 
92  ClassDef(PndEvtGenGenerator, 1);
93 };
94 
95 #endif
Bool_t ReadRootEvent(FairPrimaryGenerator *primGen)
virtual ~PndEvtGenGenerator()
Bool_t ReadAsciiEvent(FairPrimaryGenerator *primGen)
virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen)