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
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, double weight,
48  bool onlyLong=false);
49  std::vector<Hit> fillHits(G4ThreeVector & p, G4ThreeVector & v,
50  int parCode, double parEnergy, bool & ok,
51  double weight, double time, bool onlyLong=false);
52 protected:
53 
54  bool rInside(double r);
55  void getRecord(int, int);
56  void loadEventInfo(TBranch *);
57  void interpolate(int, double);
58  void extrapolate(int, double);
59  void storePhoton(int j);
60  std::vector<double> getDDDArray(const std::string&, const DDsvalues_type&,
61  int&);
62 
63 private:
64 
66  TFile * hf;
67  TBranch *emBranch, *hadBranch;
68 
72  std::vector<double> pmom;
73 
74  double probMax, backProb;
75  double dphi, rMin, rMax;
76  std::vector<double> gpar;
77 
81 
82  int npe;
86 
87 };
88 #endif
std::vector< Hit > fillHits(G4ThreeVector &p, G4ThreeVector &v, int parCode, double parEnergy, bool &ok, double weight, double time, bool onlyLong=false)
void getRecord(int, int)
std::vector< Hit > getHits(G4Step *aStep, bool &ok, double weight, bool onlyLong=false)
HFShowerPhotonCollection pe
type of data representation of DDCompactView
Definition: DDCompactView.h:76
HFShowerLibrary(std::string &name, const DDCompactView &cpv, edm::ParameterSet const &p)
std::vector< HFShowerPhoton > HFShowerPhotonCollection
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 &)
HFShowerPhotonCollection * photo
TBranch * emBranch
std::vector< double > pmom
G4ThreeVector position
void initRun(G4ParticleTable *theParticleTable)
void extrapolate(int, double)
void storePhoton(int j)
int weight
Definition: histoStyle.py:50
HFShowerPhotonCollection photon
bool rInside(double r)
void interpolate(int, double)
TBranch * hadBranch