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 
24 
25 #include "G4String.hh"
26 #include <map>
27 #include <string>
28 
29 class DDCompactView;
30 class DDFilteredView;
31 class G4LogicalVolume;
32 class G4Material;
33 class G4Step;
34 class HcalTestNS;
35 class TH1F;
36 
37 class HCalSD : public CaloSD, public Observer<const BeginOfJob*> {
38 public:
39  HCalSD(const std::string&,
40  const DDCompactView&,
42  edm::ParameterSet const&,
43  const SimTrackManager*);
44  ~HCalSD() override = default;
45  uint32_t setDetUnitId(const G4Step* step) override;
47 
48 protected:
49  double getEnergyDeposit(const G4Step*) override;
50  bool getFromLibrary(const G4Step*) override;
51  using CaloSD::update;
52  void update(const BeginOfJob*) override;
53  void initRun() override;
54  bool filterHit(CaloG4Hit*, double) override;
55 
56 private:
57  void fillLogVolumeVector(const std::string&,
58  const std::string&,
59  const DDCompactView&,
60  std::vector<const G4LogicalVolume*>&,
61  std::vector<G4String>&);
62 
63  uint32_t setDetUnitId(int, const G4ThreeVector&, int, int);
65  std::vector<double> getDDDArray(const std::string&, const DDsvalues_type&);
66  std::vector<G4String> getNames(DDFilteredView&);
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 
98  std::unique_ptr<HFDarkening> m_HFDarkening;
99  std::unique_ptr<HcalTestNS> m_HcalTestNS;
100 
101  bool isHF;
109  double weight_;
110  int depth_;
111  std::vector<double> gpar;
112  std::vector<int> hfLevels;
113  std::vector<G4String> hfNames, fibreNames, matNames;
114  std::vector<const G4Material*> materials;
115  std::vector<const G4LogicalVolume*> hfLV, fibreLV, pmtLV, fibre1LV, fibre2LV;
116  std::map<uint32_t, double> layerWeights;
117  TH1F *hit_[9], *time_[9], *dist_[9], *hzvem, *hzvhad;
118 };
119 
120 #endif // HCalSD_h
type
Definition: HCALResponse.h:21
void readWeightFromFile(const std::string &)
Definition: HCalSD.cc:999
std::vector< const G4LogicalVolume * > hfLV
Definition: HCalSD.h:115
bool useParam
Definition: HCalSD.h:106
double eminHitHE
Definition: HCalSD.h:107
TH1F * time_[9]
Definition: HCalSD.h:117
void hitForFibre(const G4Step *step)
Definition: HCalSD.cc:807
bool useLayerWt
Definition: HCalSD.h:103
Definition: CaloSD.h:38
const HcalDDDSimConstants * hcalConstants
Definition: HCalSD.h:95
std::unique_ptr< HFShowerParam > showerParam
Definition: HCalSD.h:91
double weight_
Definition: HCalSD.h:109
std::vector< double > gpar
Definition: HCalSD.h:111
bool useFibreBundle
Definition: HCalSD.h:103
double betaThr
Definition: HCalSD.h:105
double deliveredLumi
Definition: HCalSD.h:108
double eminHitHB
Definition: HCalSD.h:107
bool useShowerLibrary
Definition: HCalSD.h:106
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &)
Definition: HCalSD.cc:636
void plotProfile(const G4Step *step, const G4ThreeVector &pos, double edep, double time, int id)
Definition: HCalSD.cc:1043
double birk2
Definition: HCalSD.h:105
bool usePMTHit
Definition: HCalSD.h:103
std::vector< const G4LogicalVolume * > fibre2LV
Definition: HCalSD.h:115
void modifyDepth(HcalNumberingFromDDD::HcalID &id)
Definition: HCalSD.cc:1114
void update(const BeginOfJob *) override
This routine will be called when the appropriate signal arrives.
Definition: HCalSD.cc:539
void setNumberingScheme(HcalNumberingScheme *)
Definition: HCalSD.cc:532
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
bool agingFlagHE
Definition: HCalSD.h:102
double birk1
Definition: HCalSD.h:105
std::unique_ptr< HFShowerPMT > showerPMT
Definition: HCalSD.h:92
TH1F * hzvhad
Definition: HCalSD.h:117
bool isItConicalBundle(const G4LogicalVolume *)
Definition: HCalSD.cc:732
double eminHitHF
Definition: HCalSD.h:107
Definition: HCalSD.h:37
std::unique_ptr< HcalNumberingFromDDD > numberingFromDDD
Definition: HCalSD.h:87
TH1F * hit_[9]
Definition: HCalSD.h:117
HCalSD(const std::string &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: HCalSD.cc:48
bool agingFlagHB
Definition: HCalSD.h:102
bool testNumber
Definition: HCalSD.h:104
const std::vector< std::string > & getNames() const
~HCalSD() override=default
bool useBirk
Definition: HCalSD.h:103
std::unique_ptr< HFDarkening > m_HFDarkening
Definition: HCalSD.h:98
double birk3
Definition: HCalSD.h:105
const HBHEDarkening * m_HEDarkening
Definition: HCalSD.h:97
bool applyFidCut
Definition: HCalSD.h:106
TH1F * dist_[9]
Definition: HCalSD.h:117
std::unique_ptr< HcalTestNS > m_HcalTestNS
Definition: HCalSD.h:99
void plotHF(const G4ThreeVector &pos, bool emType)
Definition: HCalSD.cc:1103
std::vector< int > hfLevels
Definition: HCalSD.h:112
void getFromParam(const G4Step *step, bool &isKilled)
Definition: HCalSD.cc:849
void getFromHFLibrary(const G4Step *step, bool &isKilled)
Definition: HCalSD.cc:764
uint32_t setDetUnitId(const G4Step *step) override
Definition: HCalSD.cc:520
bool isItStraightBundle(const G4LogicalVolume *)
Definition: HCalSD.cc:724
bool testNS_
Definition: HCalSD.h:104
bool getFromLibrary(const G4Step *) override
Definition: HCalSD.cc:331
double eminHitHO
Definition: HCalSD.h:107
TH1F * hzvem
Definition: HCalSD.h:117
std::vector< const G4LogicalVolume * > pmtLV
Definition: HCalSD.h:115
bool filterHit(CaloG4Hit *, double) override
Definition: HCalSD.cc:590
bool neutralDensity
Definition: HCalSD.h:104
bool isHF
Definition: HCalSD.h:101
void getHitFibreBundle(const G4Step *step, bool type)
Definition: HCalSD.cc:937
double getEnergyDeposit(const G4Step *) override
Definition: HCalSD.cc:388
std::unique_ptr< HFShowerFibreBundle > showerBundle
Definition: HCalSD.h:93
bool isItPMT(const G4LogicalVolume *)
Definition: HCalSD.cc:716
bool isItinFidVolume(const G4ThreeVector &)
Definition: HCalSD.cc:748
void getHitPMT(const G4Step *step)
Definition: HCalSD.cc:878
std::unique_ptr< HFShowerLibrary > showerLibrary
Definition: HCalSD.h:89
double layerWeight(int, const G4ThreeVector &, int, int)
Definition: HCalSD.cc:1023
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
int depth_
Definition: HCalSD.h:110
std::map< uint32_t, double > layerWeights
Definition: HCalSD.h:116
bool isItHF(const G4Step *)
Definition: HCalSD.cc:679
std::vector< G4String > fibreNames
Definition: HCalSD.h:113
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12
bool isItScintillator(const G4Material *)
Definition: HCalSD.cc:740
std::unique_ptr< HcalNumberingScheme > numberingScheme
Definition: HCalSD.h:88
std::vector< G4String > hfNames
Definition: HCalSD.h:113
std::unique_ptr< HFShower > hfshower
Definition: HCalSD.h:90
std::vector< const G4LogicalVolume * > fibreLV
Definition: HCalSD.h:115
step
Definition: StallMonitor.cc:94
std::vector< const G4LogicalVolume * > fibre1LV
Definition: HCalSD.h:115
std::vector< const G4Material * > materials
Definition: HCalSD.h:114
void initRun() override
Definition: HCalSD.cc:577
const HBHEDarkening * m_HBDarkening
Definition: HCalSD.h:96
std::vector< G4String > matNames
Definition: HCalSD.h:113
void update(const BeginOfRun *) override
This routine will be called when the appropriate signal arrives.
Definition: CaloSD.cc:460
bool useHF
Definition: HCalSD.h:106
bool isItFibre(const G4LogicalVolume *)
Definition: HCalSD.cc:700
void fillLogVolumeVector(const std::string &, const std::string &, const DDCompactView &, std::vector< const G4LogicalVolume * > &, std::vector< G4String > &)
Definition: HCalSD.cc:298