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  void initEvent(const BeginOfEvent*) override;
61  void endEvent() override;
62 
63 private:
64  void fillLogVolumeVector(const std::string&, const std::vector<std::string>&, std::vector<const G4LogicalVolume*>&);
65  uint32_t setDetUnitId(int, const G4ThreeVector&, int, int);
67  bool isItHF(const G4Step*);
68  bool isItHF(const G4String&);
69  bool isItFibre(const G4LogicalVolume*);
70  bool isItFibre(const G4String&);
71  bool isItPMT(const G4LogicalVolume*);
72  bool isItStraightBundle(const G4LogicalVolume*);
73  bool isItConicalBundle(const G4LogicalVolume*);
74  bool isItScintillator(const G4Material*);
75  bool isItinFidVolume(const G4ThreeVector&);
76  void getFromHFLibrary(const G4Step* step, bool& isKilled);
77  void hitForFibre(const G4Step* step);
78  void getFromParam(const G4Step* step, bool& isKilled);
79  void getHitPMT(const G4Step* step);
80  void getHitFibreBundle(const G4Step* step, bool type);
81  void readWeightFromFile(const std::string&);
82  double layerWeight(int, const G4ThreeVector&, int, int);
83  void plotProfile(const G4Step* step, const G4ThreeVector& pos, double edep, double time, int id);
84  void plotHF(const G4ThreeVector& pos, bool emType);
86 
87  std::unique_ptr<HcalNumberingFromDDD> numberingFromDDD;
88  std::unique_ptr<HcalNumberingScheme> numberingScheme;
89  std::unique_ptr<HFShowerLibrary> showerLibrary;
90  std::unique_ptr<HFShower> hfshower;
91  std::unique_ptr<HFShowerParam> showerParam;
92  std::unique_ptr<HFShowerPMT> showerPMT;
93  std::unique_ptr<HFShowerFibreBundle> showerBundle;
94 
99  std::unique_ptr<HFDarkening> m_HFDarkening;
100  std::unique_ptr<HcalTestNS> m_HcalTestNS;
101 
102  static constexpr double maxZ_ = 10000.0;
103  static constexpr double minRoff_ = -1500.0;
104  static constexpr double maxRoff_ = 450.0;
105  static constexpr double slopeHE_ = 0.4;
106  bool isHF;
114  double weight_;
115  int depth_;
116  std::vector<double> gpar;
117  std::vector<int> hfLevels;
118  std::vector<std::string> hfNames;
119  std::vector<std::string> fibreNames;
120  std::vector<std::string> matNames;
121  std::vector<const G4Material*> materials;
122  std::vector<const G4LogicalVolume*> hfLV, fibreLV, pmtLV, fibre1LV, fibre2LV;
123  std::map<uint32_t, double> layerWeights;
124  TH1F *hit_[9], *time_[9], *dist_[9], *hzvem, *hzvhad;
125  std::vector<int> detNull_;
126 };
127 
128 #endif // HCalSD_h
std::vector< std::string > matNames
Definition: HCalSD.h:120
void readWeightFromFile(const std::string &)
Definition: HCalSD.cc:954
std::vector< const G4LogicalVolume * > hfLV
Definition: HCalSD.h:122
bool useParam
Definition: HCalSD.h:111
double eminHitHE
Definition: HCalSD.h:112
TH1F * time_[9]
Definition: HCalSD.h:124
void hitForFibre(const G4Step *step)
Definition: HCalSD.cc:761
void initEvent(const BeginOfEvent *) override
Definition: HCalSD.cc:1085
bool useLayerWt
Definition: HCalSD.h:108
Definition: CaloSD.h:40
std::vector< std::string > fibreNames
Definition: HCalSD.h:119
static constexpr double slopeHE_
Definition: HCalSD.h:105
std::unique_ptr< HFShowerParam > showerParam
Definition: HCalSD.h:91
double weight_
Definition: HCalSD.h:114
std::vector< double > gpar
Definition: HCalSD.h:116
bool useFibreBundle
Definition: HCalSD.h:108
const HcalDDDSimConstants * hcalConstants_
Definition: HCalSD.h:95
double betaThr
Definition: HCalSD.h:110
double deliveredLumi
Definition: HCalSD.h:113
void endEvent() override
Definition: HCalSD.cc:1091
double eminHitHB
Definition: HCalSD.h:112
bool useShowerLibrary
Definition: HCalSD.h:111
std::vector< std::string > hfNames
Definition: HCalSD.h:118
void plotProfile(const G4Step *step, const G4ThreeVector &pos, double edep, double time, int id)
Definition: HCalSD.cc:998
double birk2
Definition: HCalSD.h:110
bool usePMTHit
Definition: HCalSD.h:108
std::vector< const G4LogicalVolume * > fibre2LV
Definition: HCalSD.h:122
void modifyDepth(HcalNumberingFromDDD::HcalID &id)
Definition: HCalSD.cc:1071
void update(const BeginOfJob *) override
This routine will be called when the appropriate signal arrives.
Definition: HCalSD.cc:552
void setNumberingScheme(HcalNumberingScheme *)
Definition: HCalSD.cc:545
bool agingFlagHE
Definition: HCalSD.h:107
double birk1
Definition: HCalSD.h:110
std::unique_ptr< HFShowerPMT > showerPMT
Definition: HCalSD.h:92
TH1F * hzvhad
Definition: HCalSD.h:124
bool isItConicalBundle(const G4LogicalVolume *)
Definition: HCalSD.cc:686
HCalSD(const std::string &, const HcalDDDSimConstants *, const HcalDDDRecConstants *, const HcalSimulationConstants *, const HBHEDarkening *, const HBHEDarkening *, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: HCalSD.cc:43
double eminHitHF
Definition: HCalSD.h:112
Definition: HCalSD.h:38
static constexpr double minRoff_
Definition: HCalSD.h:103
std::unique_ptr< HcalNumberingFromDDD > numberingFromDDD
Definition: HCalSD.h:87
TH1F * hit_[9]
Definition: HCalSD.h:124
bool agingFlagHB
Definition: HCalSD.h:107
bool testNumber
Definition: HCalSD.h:109
~HCalSD() override=default
bool useBirk
Definition: HCalSD.h:108
std::unique_ptr< HFDarkening > m_HFDarkening
Definition: HCalSD.h:99
double birk3
Definition: HCalSD.h:110
const HBHEDarkening * m_HEDarkening
Definition: HCalSD.h:98
bool applyFidCut
Definition: HCalSD.h:111
TH1F * dist_[9]
Definition: HCalSD.h:124
std::unique_ptr< HcalTestNS > m_HcalTestNS
Definition: HCalSD.h:100
void plotHF(const G4ThreeVector &pos, bool emType)
Definition: HCalSD.cc:1060
std::vector< int > hfLevels
Definition: HCalSD.h:117
void getFromParam(const G4Step *step, bool &isKilled)
Definition: HCalSD.cc:803
void getFromHFLibrary(const G4Step *step, bool &isKilled)
Definition: HCalSD.cc:718
uint32_t setDetUnitId(const G4Step *step) override
Definition: HCalSD.cc:533
bool isItStraightBundle(const G4LogicalVolume *)
Definition: HCalSD.cc:678
bool testNS_
Definition: HCalSD.h:109
bool getFromLibrary(const G4Step *) override
Definition: HCalSD.cc:335
double eminHitHO
Definition: HCalSD.h:112
TH1F * hzvem
Definition: HCalSD.h:124
std::vector< const G4LogicalVolume * > pmtLV
Definition: HCalSD.h:122
bool filterHit(CaloG4Hit *, double) override
Definition: HCalSD.cc:556
bool neutralDensity
Definition: HCalSD.h:109
bool isHF
Definition: HCalSD.h:106
void fillLogVolumeVector(const std::string &, const std::vector< std::string > &, std::vector< const G4LogicalVolume *> &)
Definition: HCalSD.cc:310
static constexpr double maxZ_
Definition: HCalSD.h:102
void getHitFibreBundle(const G4Step *step, bool type)
Definition: HCalSD.cc:892
double getEnergyDeposit(const G4Step *) override
Definition: HCalSD.cc:399
std::unique_ptr< HFShowerFibreBundle > showerBundle
Definition: HCalSD.h:93
bool isItPMT(const G4LogicalVolume *)
Definition: HCalSD.cc:670
bool isItinFidVolume(const G4ThreeVector &)
Definition: HCalSD.cc:702
void getHitPMT(const G4Step *step)
Definition: HCalSD.cc:833
std::vector< int > detNull_
Definition: HCalSD.h:125
std::unique_ptr< HFShowerLibrary > showerLibrary
Definition: HCalSD.h:89
double layerWeight(int, const G4ThreeVector &, int, int)
Definition: HCalSD.cc:978
const HcalSimulationConstants * hcalSimConstants_
Definition: HCalSD.h:96
int depth_
Definition: HCalSD.h:115
std::map< uint32_t, double > layerWeights
Definition: HCalSD.h:123
bool isItHF(const G4Step *)
Definition: HCalSD.cc:633
bool isItScintillator(const G4Material *)
Definition: HCalSD.cc:694
std::unique_ptr< HcalNumberingScheme > numberingScheme
Definition: HCalSD.h:88
std::unique_ptr< HFShower > hfshower
Definition: HCalSD.h:90
std::vector< const G4LogicalVolume * > fibreLV
Definition: HCalSD.h:122
step
Definition: StallMonitor.cc:98
std::vector< const G4LogicalVolume * > fibre1LV
Definition: HCalSD.h:122
tmp
align.sh
Definition: createJobs.py:716
std::vector< const G4Material * > materials
Definition: HCalSD.h:121
void initRun() override
Definition: HCalSD.cc:554
const HBHEDarkening * m_HBDarkening
Definition: HCalSD.h:97
static constexpr double maxRoff_
Definition: HCalSD.h:104
void update(const BeginOfRun *) override
This routine will be called when the appropriate signal arrives.
Definition: CaloSD.cc:688
bool useHF
Definition: HCalSD.h:111
bool isItFibre(const G4LogicalVolume *)
Definition: HCalSD.cc:654