CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
13 
14 #include "G4ParticleTable.hh"
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 
29 
30 public:
31 
32  //Constructor and Destructor
33  HFShowerLibrary(std::string & name, const DDCompactView & cpv,
34  edm::ParameterSet const & p);
36 
37 public:
38 
39  struct Hit {
40  Hit() {}
41  G4ThreeVector position;
42  int depth;
43  double time;
44  };
45 
46  void initRun(G4ParticleTable * theParticleTable);
47  std::vector<Hit> getHits(G4Step * aStep, bool & ok, bool onlyLong=false);
48 
49 protected:
50 
51  bool rInside(double r);
52  void getRecord(int, int);
53  void loadEventInfo(TBranch *);
54  void interpolate(int, double);
55  void extrapolate(int, double);
56  void storePhoton(int j);
57  std::vector<double> getDDDArray(const std::string&, const DDsvalues_type&,
58  int&);
59 
60 private:
61 
63  TFile * hf;
64  TBranch *emBranch, *hadBranch;
65 
66  bool verbose;
69  std::vector<double> pmom;
70 
71  double probMax, backProb;
72  double dphi, rMin, rMax;
73  std::vector<double> gpar;
74 
78 
79  int npe;
80  std::vector<HFShowerPhoton> pe;
81  std::vector<HFShowerPhoton> photon;
82 
83 };
84 #endif
std::vector< Hit > getHits(G4Step *aStep, bool &ok, bool onlyLong=false)
void getRecord(int, int)
type of data representation of DDCompactView
Definition: DDCompactView.h:81
HFShowerLibrary(std::string &name, const DDCompactView &cpv, edm::ParameterSet const &p)
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::maps an index to a DDValue. The index corresponds to the index assigned to the name of the std::...
Definition: DDsvalues.h:19
void loadEventInfo(TBranch *)
int j
Definition: DBlmapReader.cc:9
std::vector< double > gpar
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &, int &)
std::vector< HFShowerPhoton > photon
TBranch * emBranch
std::vector< HFShowerPhoton > pe
std::vector< double > pmom
G4ThreeVector position
void initRun(G4ParticleTable *theParticleTable)
void extrapolate(int, double)
void storePhoton(int j)
bool rInside(double r)
void interpolate(int, double)
TBranch * hadBranch