test
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 
14 
15 #include "G4ParticleTable.hh"
16 #include "G4ThreeVector.hh"
17 
18 //ROOT
19 #include "TROOT.h"
20 #include "TFile.h"
21 #include "TTree.h"
22 
23 #include <string>
24 #include <memory>
25 
26 class DDCompactView;
27 class G4Step;
28 
30 
31 public:
32 
33  //Constructor and Destructor
35  edm::ParameterSet const & p);
37 
38 public:
39 
40  struct Hit {
41  Hit() {}
42  G4ThreeVector position;
43  int depth;
44  double time;
45  };
46 
47  void initRun(G4ParticleTable *, HcalDDDSimConstants*);
48  std::vector<Hit> getHits(G4Step * aStep, bool &ok, double weight,
49  bool onlyLong=false);
50  std::vector<Hit> fillHits(G4ThreeVector & p, G4ThreeVector & v,
51  int parCode, double parEnergy, bool & ok,
52  double weight, double time, bool onlyLong=false);
53 protected:
54 
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&,
62  int&);
63 
64 private:
65 
67  TFile * hf;
68  TBranch *emBranch, *hadBranch;
69 
73  std::vector<double> pmom;
74 
75  double probMax, backProb;
76  double dphi, rMin, rMax;
77  std::vector<double> gpar;
78 
82 
83  int npe;
87 
88 };
89 #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:77
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 extrapolate(int, double)
void storePhoton(int j)
HFShowerPhotonCollection photon
bool rInside(double r)
void initRun(G4ParticleTable *, HcalDDDSimConstants *)
void interpolate(int, double)
TBranch * hadBranch