CMS 3D CMS Logo

HFShowerLibrary.h
Go to the documentation of this file.
1 #ifndef SimG4CMS_HFShowerLibrary_h
2 #define SimG4CMS_HFShowerLibrary_h 1
3 // File: HFShowerLibrary.h
5 // Description: Gets information from a shower library
7 
14 
15 #include "G4ThreeVector.hh"
16 
17 //ROOT
18 #include "TROOT.h"
19 #include "TFile.h"
20 #include "TTree.h"
21 
22 #include <string>
23 #include <memory>
24 
25 class DDCompactView;
26 class G4Step;
27 class G4ParticleTable;
28 
30 public:
31  //Constructor and Destructor
34 
35 public:
36  struct Hit {
37  Hit() {}
38  G4ThreeVector position;
39  int depth;
40  double time;
41  };
42 
43  void initRun(G4ParticleTable *, const HcalDDDSimConstants *);
44  std::vector<Hit> getHits(const G4Step *aStep, bool &ok, double weight, bool onlyLong = false);
45  std::vector<Hit> fillHits(const G4ThreeVector &p,
46  const G4ThreeVector &v,
47  int parCode,
48  double parEnergy,
49  bool &ok,
50  double weight,
51  double time,
52  bool onlyLong = false);
53 
54 protected:
55  bool rInside(double r);
56  void getRecord(int, int);
57  void loadEventInfo(TBranch *);
58  void interpolate(int, double);
59  void extrapolate(int, double);
60  void storePhoton(int j);
61  std::vector<double> getDDDArray(const std::string &, const DDsvalues_type &, int &);
62 
63 private:
65  TFile *hf;
66  TBranch *emBranch, *hadBranch;
67 
71  std::vector<double> pmom;
72 
73  double probMax, backProb;
74  double dphi, rMin, rMax;
75  std::vector<double> gpar;
76 
77  int npe;
81 };
82 #endif
std::vector< Hit > getHits(const G4Step *aStep, bool &ok, double weight, bool onlyLong=false)
void getRecord(int, int)
HFShowerPhotonCollection pe
Definition: weight.py:1
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
std::vector< HFShowerPhoton > HFShowerPhotonCollection
void loadEventInfo(TBranch *)
std::vector< double > gpar
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &, int &)
HFShowerPhotonCollection * photo
TBranch * emBranch
std::vector< double > pmom
G4ThreeVector position
void extrapolate(int, double)
HFShowerLibrary(const std::string &name, const DDCompactView &cpv, edm::ParameterSet const &p)
void storePhoton(int j)
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12
std::vector< Hit > fillHits(const G4ThreeVector &p, const G4ThreeVector &v, int parCode, double parEnergy, bool &ok, double weight, double time, bool onlyLong=false)
HFShowerPhotonCollection photon
bool rInside(double r)
void interpolate(int, double)
void initRun(G4ParticleTable *, const HcalDDDSimConstants *)
TBranch * hadBranch