CMS 3D CMS Logo

HCalSD.h
Go to the documentation of this file.
1 #ifndef SimG4CMS_HCalSD_h
2 #define SimG4CMS_HCalSD_h
3 // File: HCalSD.h
5 // Description: Stores hits of Hadron calorimeter in appropriate container
6 // Use in your sensitive detector builder:
7 // HCalSD* hcalSD = new HCalSD(SDname, new CaloNumberingScheme());
9 
23 
24 #include "G4String.hh"
25 #include <map>
26 #include <string>
27 #include <TH1F.h>
28 
29 class DDCompactView;
30 class DDFilteredView;
31 class G4LogicalVolume;
32 class G4Material;
33 class G4Step;
34 class HcalTestNS;
35 
36 class HCalSD : public CaloSD, public Observer<const BeginOfJob *> {
37 
38 public:
39 
40  HCalSD(G4String , const DDCompactView &, const SensitiveDetectorCatalog &,
41  edm::ParameterSet const &, const SimTrackManager*);
42  virtual ~HCalSD();
43  virtual bool ProcessHits(G4Step * , G4TouchableHistory * );
44  virtual double getEnergyDeposit(G4Step* );
45  virtual uint32_t setDetUnitId(G4Step* step);
47 
48 protected:
49 
50  virtual void update(const BeginOfJob *);
51  virtual void initRun();
52  virtual bool filterHit(CaloG4Hit*, double);
53 
54 private:
55 
56  uint32_t setDetUnitId(int, const G4ThreeVector&, int, int);
58  std::vector<double> getDDDArray(const std::string&,
59  const DDsvalues_type&);
60  std::vector<G4String> getNames(DDFilteredView&);
61  bool isItHF(G4Step *);
62  bool isItHF(G4String);
63  bool isItFibre(G4LogicalVolume*);
64  bool isItFibre(G4String);
65  bool isItPMT(G4LogicalVolume*);
66  bool isItStraightBundle(G4LogicalVolume*);
67  bool isItConicalBundle(G4LogicalVolume*);
68  bool isItScintillator(G4Material*);
69  bool isItinFidVolume (G4ThreeVector&);
70  void getFromLibrary(G4Step * step, double weight);
71  void hitForFibre(G4Step * step, double weight);
72  void getFromParam(G4Step * step, double weight);
73  void getHitPMT(G4Step * step);
74  void getHitFibreBundle(G4Step * step, bool type);
75  int setTrackID(G4Step * step);
77  double layerWeight(int, const G4ThreeVector&, int, int);
78  void plotProfile(G4Step* step, const G4ThreeVector& pos,
79  double edep, double time, int id);
80  void plotHF(G4ThreeVector& pos, bool emType);
82 
94  std::unique_ptr<HFDarkening> m_HFDarkening;
98  double birk1, birk2, birk3, betaThr;
103  std::vector<double> gpar;
104  std::vector<int> hfLevels;
105  std::vector<G4String> hfNames, fibreNames, matNames;
106  std::vector<G4Material*> materials;
107  std::vector<G4LogicalVolume*> hfLV, fibreLV, pmtLV, fibre1LV, fibre2LV;
108  std::map<uint32_t,double> layerWeights;
109  TH1F *hit_[9], *time_[9], *dist_[9], *hzvem, *hzvhad;
110 
111 };
112 
113 #endif // HCalSD_h
HCalSD(G4String, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: HCalSD.cc:44
type
Definition: HCALResponse.h:21
bool useParam
Definition: HCalSD.h:99
double eminHitHE
Definition: HCalSD.h:100
HFShowerParam * showerParam
Definition: HCalSD.h:88
TH1F * time_[9]
Definition: HCalSD.h:109
void hitForFibre(G4Step *step, double weight)
Definition: HCalSD.cc:847
void getFromParam(G4Step *step, double weight)
Definition: HCalSD.cc:899
G4int depth_
Definition: HCalSD.h:102
bool useLayerWt
Definition: HCalSD.h:96
Definition: CaloSD.h:42
virtual void update(const BeginOfJob *)
This routine will be called when the appropriate signal arrives.
Definition: HCalSD.cc:571
bool isItStraightBundle(G4LogicalVolume *)
Definition: HCalSD.cc:749
virtual bool ProcessHits(G4Step *, G4TouchableHistory *)
Definition: HCalSD.cc:357
std::vector< double > gpar
Definition: HCalSD.h:103
bool useFibreBundle
Definition: HCalSD.h:96
bool isItinFidVolume(G4ThreeVector &)
Definition: HCalSD.cc:767
double betaThr
Definition: HCalSD.h:98
double deliveredLumi
Definition: HCalSD.h:101
HFShowerFibreBundle * showerBundle
Definition: HCalSD.h:90
std::vector< G4LogicalVolume * > fibre1LV
Definition: HCalSD.h:107
std::vector< G4LogicalVolume * > fibreLV
Definition: HCalSD.h:107
double eminHitHB
Definition: HCalSD.h:100
bool useShowerLibrary
Definition: HCalSD.h:99
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &)
Definition: HCalSD.cc:668
Definition: weight.py:1
virtual uint32_t setDetUnitId(G4Step *step)
Definition: HCalSD.cc:550
double birk2
Definition: HCalSD.h:98
int setTrackID(G4Step *step)
Definition: HCalSD.cc:1068
void getFromLibrary(G4Step *step, double weight)
Definition: HCalSD.cc:784
bool usePMTHit
Definition: HCalSD.h:96
void modifyDepth(HcalNumberingFromDDD::HcalID &id)
Definition: HCalSD.cc:1192
void setNumberingScheme(HcalNumberingScheme *)
Definition: HCalSD.cc:563
type of data representation of DDCompactView
Definition: DDCompactView.h:90
bool agingFlagHE
Definition: HCalSD.h:91
double birk1
Definition: HCalSD.h:98
bool isItHF(G4Step *)
Definition: HCalSD.cc:713
TH1F * hzvhad
Definition: HCalSD.h:109
double eminHitHF
Definition: HCalSD.h:100
bool isItConicalBundle(G4LogicalVolume *)
Definition: HCalSD.cc:755
Definition: HCalSD.h:36
TH1F * hit_[9]
Definition: HCalSD.h:109
virtual void initRun()
Definition: HCalSD.cc:608
bool agingFlagHB
Definition: HCalSD.h:91
bool testNumber
Definition: HCalSD.h:97
std::vector< G4LogicalVolume * > pmtLV
Definition: HCalSD.h:107
std::vector< G4LogicalVolume * > hfLV
Definition: HCalSD.h:107
bool isItScintillator(G4Material *)
Definition: HCalSD.cc:761
HFShower * hfshower
Definition: HCalSD.h:87
bool useBirk
Definition: HCalSD.h:96
std::unique_ptr< HFDarkening > m_HFDarkening
Definition: HCalSD.h:94
double birk3
Definition: HCalSD.h:98
virtual double getEnergyDeposit(G4Step *)
Definition: HCalSD.cc:462
const HBHEDarkening * m_HEDarkening
Definition: HCalSD.h:93
void plotHF(G4ThreeVector &pos, bool emType)
Definition: HCalSD.cc:1183
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:20
bool applyFidCut
Definition: HCalSD.h:99
TH1F * dist_[9]
Definition: HCalSD.h:109
virtual ~HCalSD()
Definition: HCalSD.cc:345
HcalNumberingScheme * numberingScheme
Definition: HCalSD.h:85
void getHitPMT(G4Step *step)
Definition: HCalSD.cc:938
std::vector< int > hfLevels
Definition: HCalSD.h:104
virtual std::vector< std::string > getNames()
void plotProfile(G4Step *step, const G4ThreeVector &pos, double edep, double time, int id)
Definition: HCalSD.cc:1136
bool isItPMT(G4LogicalVolume *)
Definition: HCalSD.cc:743
bool testNS_
Definition: HCalSD.h:97
G4int mupPDG
Definition: HCalSD.h:102
double eminHitHO
Definition: HCalSD.h:100
TH1F * hzvem
Definition: HCalSD.h:109
void readWeightFromFile(std::string)
Definition: HCalSD.cc:1088
bool neutralDensity
Definition: HCalSD.h:97
void getHitFibreBundle(G4Step *step, bool type)
Definition: HCalSD.cc:1005
HcalNumberingFromDDD * numberingFromDDD
Definition: HCalSD.h:84
double layerWeight(int, const G4ThreeVector &, int, int)
Definition: HCalSD.cc:1114
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
std::vector< G4String > fibreNames
Definition: HCalSD.h:105
std::vector< G4Material * > materials
Definition: HCalSD.h:106
virtual bool filterHit(CaloG4Hit *, double)
Definition: HCalSD.cc:624
std::vector< G4String > hfNames
Definition: HCalSD.h:105
G4int mumPDG
Definition: HCalSD.h:102
HcalTestNS * hcalTestNS_
Definition: HCalSD.h:95
std::map< uint32_t, double > layerWeights
Definition: HCalSD.h:108
step
HFShowerPMT * showerPMT
Definition: HCalSD.h:89
HFShowerLibrary * showerLibrary
Definition: HCalSD.h:86
std::vector< G4LogicalVolume * > fibre2LV
Definition: HCalSD.h:107
const HBHEDarkening * m_HBDarkening
Definition: HCalSD.h:92
std::vector< G4String > matNames
Definition: HCalSD.h:105
bool isItFibre(G4LogicalVolume *)
Definition: HCalSD.cc:731
bool useHF
Definition: HCalSD.h:99
HcalDDDSimConstants * hcalConstants
Definition: HCalSD.h:83