CMS 3D CMS Logo

CastorShowerLibrary.h
Go to the documentation of this file.
1 #ifndef SimG4CMS_CastorShowerLibrary_h
2 #define SimG4CMS_CastorShowerLibrary_h
3 // File: CastorShowerLibrary.h
5 // Description: Gets information from a shower library
6 // Adapted from HFShowerLibrary class
7 //
8 // Wagner Carvalho (wcarvalh@cern.ch)
9 //
11 
16 
17 #include "G4ParticleTable.hh"
18 #include "G4ThreeVector.hh"
19 
20 #include <string>
21 #include <memory>
22 
23 class G4Step;
24 class TFile;
25 class TBranch;
26 
28 public:
29  //Constructor and Destructor
32 
33 public:
34  CastorShowerEvent getShowerHits(const G4Step *, bool &);
35  int FindEnergyBin(double);
36  int FindEtaBin(double);
37  int FindPhiBin(double);
38 
39 protected:
40  void initFile(edm::ParameterSet const &);
41  CastorShowerEvent getRecord(int, int);
42  void loadEventInfo(TBranch *);
43  // if eta or phi is not given, take into account only the binning in energy
44  CastorShowerEvent select(int, double, double = 0, double = 9);
45 
46 private:
47  TFile *hf;
48  TBranch *emBranch, *hadBranch; // pointer to CastorShowerEvent-type branch
49 
50  bool verbose;
51  unsigned int nMomBin, totEvents, evtPerBin;
52 
53  std::vector<double> pmom;
54 
55  // new variables (bins in eta and phi)
56  unsigned int nBinsE, nBinsEta, nBinsPhi;
58  std::vector<double> SLenergies;
59  std::vector<double> SLetas;
60  std::vector<double> SLphis;
61 };
62 #endif
CastorShowerLibrary(const std::string &name, edm::ParameterSet const &p)
std::vector< double > pmom
std::vector< double > SLetas
CastorShowerEvent getShowerHits(const G4Step *, bool &)
std::vector< double > SLphis
void initFile(edm::ParameterSet const &)
std::vector< double > SLenergies
void loadEventInfo(TBranch *)
CastorShowerEvent select(int, double, double=0, double=9)
CastorShowerEvent getRecord(int, int)