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 
26 
27 #include "G4String.hh"
28 #include <map>
29 #include <string>
30 
31 class DDFilteredView;
32 class G4LogicalVolume;
33 class G4Material;
34 class G4Step;
35 class HcalTestNS;
36 class TH1F;
37 
38 class HCalSD : public CaloSD, public Observer<const BeginOfJob*> {
39 public:
40  HCalSD(const std::string&,
41  const HcalDDDSimConstants*,
42  const HcalDDDRecConstants*,
44  const HBHEDarkening*,
45  const HBHEDarkening*,
47  edm::ParameterSet const&,
48  const SimTrackManager*);
49  ~HCalSD() override = default;
50  uint32_t setDetUnitId(const G4Step* step) override;
52 
53 protected:
54  double getEnergyDeposit(const G4Step*) override;
55  bool getFromLibrary(const G4Step*) override;
56  using CaloSD::update;
57  void update(const BeginOfJob*) override;
58  void initRun() override;
59  bool filterHit(CaloG4Hit*, double) override;
60 
61 private:
62  void fillLogVolumeVector(const std::string&, const std::vector<std::string>&, std::vector<const G4LogicalVolume*>&);
63  uint32_t setDetUnitId(int, const G4ThreeVector&, int, int);
65  bool isItHF(const G4Step*);
66  bool isItHF(const G4String&);
67  bool isItFibre(const G4LogicalVolume*);
68  bool isItFibre(const G4String&);
69  bool isItPMT(const G4LogicalVolume*);
70  bool isItStraightBundle(const G4LogicalVolume*);
71  bool isItConicalBundle(const G4LogicalVolume*);
72  bool isItScintillator(const G4Material*);
73  bool isItinFidVolume(const G4ThreeVector&);
74  void getFromHFLibrary(const G4Step* step, bool& isKilled);
75  void hitForFibre(const G4Step* step);
76  void getFromParam(const G4Step* step, bool& isKilled);
77  void getHitPMT(const G4Step* step);
78  void getHitFibreBundle(const G4Step* step, bool type);
79  void readWeightFromFile(const std::string&);
80  double layerWeight(int, const G4ThreeVector&, int, int);
81  void plotProfile(const G4Step* step, const G4ThreeVector& pos, double edep, double time, int id);
82  void plotHF(const G4ThreeVector& pos, bool emType);
84 
85  std::unique_ptr<HcalNumberingFromDDD> numberingFromDDD;
86  std::unique_ptr<HcalNumberingScheme> numberingScheme;
87  std::unique_ptr<HFShowerLibrary> showerLibrary;
88  std::unique_ptr<HFShower> hfshower;
89  std::unique_ptr<HFShowerParam> showerParam;
90  std::unique_ptr<HFShowerPMT> showerPMT;
91  std::unique_ptr<HFShowerFibreBundle> showerBundle;
92 
97  std::unique_ptr<HFDarkening> m_HFDarkening;
98  std::unique_ptr<HcalTestNS> m_HcalTestNS;
99 
100  bool isHF;
108  double weight_;
109  int depth_;
110  std::vector<double> gpar;
111  std::vector<int> hfLevels;
112  std::vector<std::string> hfNames;
113  std::vector<std::string> fibreNames;
114  std::vector<std::string> matNames;
115  std::vector<const G4Material*> materials;
116  std::vector<const G4LogicalVolume*> hfLV, fibreLV, pmtLV, fibre1LV, fibre2LV;
117  std::map<uint32_t, double> layerWeights;
118  TH1F *hit_[9], *time_[9], *dist_[9], *hzvem, *hzvhad;
119 };
120 
121 #endif // HCalSD_h
std::vector< std::string > matNames
Definition: HCalSD.h:114
void readWeightFromFile(const std::string &)
Definition: HCalSD.cc:922
std::vector< const G4LogicalVolume * > hfLV
Definition: HCalSD.h:116
bool useParam
Definition: HCalSD.h:105
double eminHitHE
Definition: HCalSD.h:106
TH1F * time_[9]
Definition: HCalSD.h:118
void hitForFibre(const G4Step *step)
Definition: HCalSD.cc:729
bool useLayerWt
Definition: HCalSD.h:102
Definition: CaloSD.h:40
std::vector< std::string > fibreNames
Definition: HCalSD.h:113
std::unique_ptr< HFShowerParam > showerParam
Definition: HCalSD.h:89
double weight_
Definition: HCalSD.h:108
std::vector< double > gpar
Definition: HCalSD.h:110
bool useFibreBundle
Definition: HCalSD.h:102
const HcalDDDSimConstants * hcalConstants_
Definition: HCalSD.h:93
double betaThr
Definition: HCalSD.h:104
double deliveredLumi
Definition: HCalSD.h:107
double eminHitHB
Definition: HCalSD.h:106
bool useShowerLibrary
Definition: HCalSD.h:105
std::vector< std::string > hfNames
Definition: HCalSD.h:112
void plotProfile(const G4Step *step, const G4ThreeVector &pos, double edep, double time, int id)
Definition: HCalSD.cc:966
double birk2
Definition: HCalSD.h:104
bool usePMTHit
Definition: HCalSD.h:102
std::vector< const G4LogicalVolume * > fibre2LV
Definition: HCalSD.h:116
void modifyDepth(HcalNumberingFromDDD::HcalID &id)
Definition: HCalSD.cc:1039
void update(const BeginOfJob *) override
This routine will be called when the appropriate signal arrives.
Definition: HCalSD.cc:551
void setNumberingScheme(HcalNumberingScheme *)
Definition: HCalSD.cc:544
bool agingFlagHE
Definition: HCalSD.h:101
double birk1
Definition: HCalSD.h:104
std::unique_ptr< HFShowerPMT > showerPMT
Definition: HCalSD.h:90
TH1F * hzvhad
Definition: HCalSD.h:118
bool isItConicalBundle(const G4LogicalVolume *)
Definition: HCalSD.cc:654
HCalSD(const std::string &, const HcalDDDSimConstants *, const HcalDDDRecConstants *, const HcalSimulationConstants *, const HBHEDarkening *, const HBHEDarkening *, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: HCalSD.cc:42
double eminHitHF
Definition: HCalSD.h:106
Definition: HCalSD.h:38
std::unique_ptr< HcalNumberingFromDDD > numberingFromDDD
Definition: HCalSD.h:85
TH1F * hit_[9]
Definition: HCalSD.h:118
bool agingFlagHB
Definition: HCalSD.h:101
bool testNumber
Definition: HCalSD.h:103
~HCalSD() override=default
bool useBirk
Definition: HCalSD.h:102
std::unique_ptr< HFDarkening > m_HFDarkening
Definition: HCalSD.h:97
double birk3
Definition: HCalSD.h:104
const HBHEDarkening * m_HEDarkening
Definition: HCalSD.h:96
bool applyFidCut
Definition: HCalSD.h:105
TH1F * dist_[9]
Definition: HCalSD.h:118
std::unique_ptr< HcalTestNS > m_HcalTestNS
Definition: HCalSD.h:98
void plotHF(const G4ThreeVector &pos, bool emType)
Definition: HCalSD.cc:1028
std::vector< int > hfLevels
Definition: HCalSD.h:111
void getFromParam(const G4Step *step, bool &isKilled)
Definition: HCalSD.cc:771
void getFromHFLibrary(const G4Step *step, bool &isKilled)
Definition: HCalSD.cc:686
uint32_t setDetUnitId(const G4Step *step) override
Definition: HCalSD.cc:532
bool isItStraightBundle(const G4LogicalVolume *)
Definition: HCalSD.cc:646
bool testNS_
Definition: HCalSD.h:103
bool getFromLibrary(const G4Step *) override
Definition: HCalSD.cc:334
double eminHitHO
Definition: HCalSD.h:106
TH1F * hzvem
Definition: HCalSD.h:118
std::vector< const G4LogicalVolume * > pmtLV
Definition: HCalSD.h:116
bool filterHit(CaloG4Hit *, double) override
Definition: HCalSD.cc:555
bool neutralDensity
Definition: HCalSD.h:103
bool isHF
Definition: HCalSD.h:100
void fillLogVolumeVector(const std::string &, const std::vector< std::string > &, std::vector< const G4LogicalVolume *> &)
Definition: HCalSD.cc:309
void getHitFibreBundle(const G4Step *step, bool type)
Definition: HCalSD.cc:860
double getEnergyDeposit(const G4Step *) override
Definition: HCalSD.cc:398
std::unique_ptr< HFShowerFibreBundle > showerBundle
Definition: HCalSD.h:91
bool isItPMT(const G4LogicalVolume *)
Definition: HCalSD.cc:638
bool isItinFidVolume(const G4ThreeVector &)
Definition: HCalSD.cc:670
void getHitPMT(const G4Step *step)
Definition: HCalSD.cc:801
std::unique_ptr< HFShowerLibrary > showerLibrary
Definition: HCalSD.h:87
double layerWeight(int, const G4ThreeVector &, int, int)
Definition: HCalSD.cc:946
const HcalSimulationConstants * hcalSimConstants_
Definition: HCalSD.h:94
int depth_
Definition: HCalSD.h:109
std::map< uint32_t, double > layerWeights
Definition: HCalSD.h:117
bool isItHF(const G4Step *)
Definition: HCalSD.cc:601
bool isItScintillator(const G4Material *)
Definition: HCalSD.cc:662
std::unique_ptr< HcalNumberingScheme > numberingScheme
Definition: HCalSD.h:86
std::unique_ptr< HFShower > hfshower
Definition: HCalSD.h:88
std::vector< const G4LogicalVolume * > fibreLV
Definition: HCalSD.h:116
step
Definition: StallMonitor.cc:98
std::vector< const G4LogicalVolume * > fibre1LV
Definition: HCalSD.h:116
tmp
align.sh
Definition: createJobs.py:716
std::vector< const G4Material * > materials
Definition: HCalSD.h:115
void initRun() override
Definition: HCalSD.cc:553
const HBHEDarkening * m_HBDarkening
Definition: HCalSD.h:95
void update(const BeginOfRun *) override
This routine will be called when the appropriate signal arrives.
Definition: CaloSD.cc:679
bool useHF
Definition: HCalSD.h:105
bool isItFibre(const G4LogicalVolume *)
Definition: HCalSD.cc:622