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 
39 public:
40 
41  HCalSD(const std::string& , const DDCompactView &,
43  edm::ParameterSet const &, const SimTrackManager*);
44  ~HCalSD() override = default;
45  uint32_t setDetUnitId(const G4Step* step) override;
47 
48 protected:
49 
50  double getEnergyDeposit(const G4Step*) override;
51  bool getFromLibrary(const G4Step*) override;
52  using CaloSD::update;
53  void update(const BeginOfJob *) override;
54  void initRun() override;
55  bool filterHit(CaloG4Hit*, double) override;
56 
57 private:
58 
59  void fillLogVolumeVector(const std::string&, const std::string&,
60  const DDCompactView&,
61  std::vector<const G4LogicalVolume*>&,
62  std::vector<G4String>&);
63 
64  uint32_t setDetUnitId(int, const G4ThreeVector&, int, int);
66  std::vector<double> getDDDArray(const std::string&,
67  const DDsvalues_type&);
68  std::vector<G4String> getNames(DDFilteredView&);
69  bool isItHF(const G4Step *);
70  bool isItHF(const G4String&);
71  bool isItFibre(const G4LogicalVolume*);
72  bool isItFibre(const G4String&);
73  bool isItPMT(const G4LogicalVolume*);
74  bool isItStraightBundle(const G4LogicalVolume*);
75  bool isItConicalBundle(const G4LogicalVolume*);
76  bool isItScintillator(const G4Material*);
77  bool isItinFidVolume (const G4ThreeVector&);
78  void getFromHFLibrary(const G4Step * step, bool& isKilled);
79  void hitForFibre(const G4Step * step);
80  void getFromParam(const G4Step * step, bool& isKilled);
81  void getHitPMT(const G4Step * step);
82  void getHitFibreBundle(const G4Step * step, bool type);
83  void readWeightFromFile(const std::string&);
84  double layerWeight(int, const G4ThreeVector&, int, int);
85  void plotProfile(const G4Step* step, const G4ThreeVector& pos,
86  double edep, double time, int id);
87  void plotHF(const G4ThreeVector& pos, bool emType);
89 
90  std::unique_ptr<HcalNumberingFromDDD> numberingFromDDD;
91  std::unique_ptr<HcalNumberingScheme> numberingScheme;
92  std::unique_ptr<HFShowerLibrary> showerLibrary;
93  std::unique_ptr<HFShower> hfshower;
94  std::unique_ptr<HFShowerParam> showerParam;
95  std::unique_ptr<HFShowerPMT> showerPMT;
96  std::unique_ptr<HFShowerFibreBundle> showerBundle;
97 
101  std::unique_ptr<HFDarkening> m_HFDarkening;
102  std::unique_ptr<HcalTestNS> m_HcalTestNS;
103 
104  bool isHF;
112  double weight_;
113  int depth_;
114  std::vector<double> gpar;
115  std::vector<int> hfLevels;
116  std::vector<G4String> hfNames, fibreNames, matNames;
117  std::vector<const G4Material*> materials;
118  std::vector<const G4LogicalVolume*> hfLV, fibreLV, pmtLV, fibre1LV, fibre2LV;
119  std::map<uint32_t,double> layerWeights;
120  TH1F *hit_[9], *time_[9], *dist_[9], *hzvem, *hzvhad;
121 
122 };
123 
124 #endif // HCalSD_h
type
Definition: HCALResponse.h:21
void readWeightFromFile(const std::string &)
Definition: HCalSD.cc:972
std::vector< const G4LogicalVolume * > hfLV
Definition: HCalSD.h:118
bool useParam
Definition: HCalSD.h:109
double eminHitHE
Definition: HCalSD.h:110
TH1F * time_[9]
Definition: HCalSD.h:120
void hitForFibre(const G4Step *step)
Definition: HCalSD.cc:778
bool useLayerWt
Definition: HCalSD.h:106
Definition: CaloSD.h:37
const HcalDDDSimConstants * hcalConstants
Definition: HCalSD.h:98
std::unique_ptr< HFShowerParam > showerParam
Definition: HCalSD.h:94
double weight_
Definition: HCalSD.h:112
std::vector< double > gpar
Definition: HCalSD.h:114
bool useFibreBundle
Definition: HCalSD.h:106
double betaThr
Definition: HCalSD.h:108
double deliveredLumi
Definition: HCalSD.h:111
double eminHitHB
Definition: HCalSD.h:110
bool useShowerLibrary
Definition: HCalSD.h:109
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &)
Definition: HCalSD.cc:626
void plotProfile(const G4Step *step, const G4ThreeVector &pos, double edep, double time, int id)
Definition: HCalSD.cc:1020
double birk2
Definition: HCalSD.h:108
bool usePMTHit
Definition: HCalSD.h:106
std::vector< const G4LogicalVolume * > fibre2LV
Definition: HCalSD.h:118
void modifyDepth(HcalNumberingFromDDD::HcalID &id)
Definition: HCalSD.cc:1078
void update(const BeginOfJob *) override
This routine will be called when the appropriate signal arrives.
Definition: HCalSD.cc:536
void setNumberingScheme(HcalNumberingScheme *)
Definition: HCalSD.cc:528
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
bool agingFlagHE
Definition: HCalSD.h:105
double birk1
Definition: HCalSD.h:108
std::unique_ptr< HFShowerPMT > showerPMT
Definition: HCalSD.h:95
TH1F * hzvhad
Definition: HCalSD.h:120
bool isItConicalBundle(const G4LogicalVolume *)
Definition: HCalSD.cc:708
double eminHitHF
Definition: HCalSD.h:110
Definition: HCalSD.h:37
std::unique_ptr< HcalNumberingFromDDD > numberingFromDDD
Definition: HCalSD.h:90
TH1F * hit_[9]
Definition: HCalSD.h:120
HCalSD(const std::string &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: HCalSD.cc:48
bool agingFlagHB
Definition: HCalSD.h:105
bool testNumber
Definition: HCalSD.h:107
const std::vector< std::string > & getNames() const
~HCalSD() override=default
bool useBirk
Definition: HCalSD.h:106
std::unique_ptr< HFDarkening > m_HFDarkening
Definition: HCalSD.h:101
double birk3
Definition: HCalSD.h:108
const HBHEDarkening * m_HEDarkening
Definition: HCalSD.h:100
bool applyFidCut
Definition: HCalSD.h:109
TH1F * dist_[9]
Definition: HCalSD.h:120
std::unique_ptr< HcalTestNS > m_HcalTestNS
Definition: HCalSD.h:102
void plotHF(const G4ThreeVector &pos, bool emType)
Definition: HCalSD.cc:1069
std::vector< int > hfLevels
Definition: HCalSD.h:115
void getFromParam(const G4Step *step, bool &isKilled)
Definition: HCalSD.cc:820
void getFromHFLibrary(const G4Step *step, bool &isKilled)
Definition: HCalSD.cc:735
uint32_t setDetUnitId(const G4Step *step) override
Definition: HCalSD.cc:515
bool isItStraightBundle(const G4LogicalVolume *)
Definition: HCalSD.cc:703
bool testNS_
Definition: HCalSD.h:107
bool getFromLibrary(const G4Step *) override
Definition: HCalSD.cc:316
double eminHitHO
Definition: HCalSD.h:110
TH1F * hzvem
Definition: HCalSD.h:120
std::vector< const G4LogicalVolume * > pmtLV
Definition: HCalSD.h:118
bool filterHit(CaloG4Hit *, double) override
Definition: HCalSD.cc:582
bool neutralDensity
Definition: HCalSD.h:107
bool isHF
Definition: HCalSD.h:104
void getHitFibreBundle(const G4Step *step, bool type)
Definition: HCalSD.cc:911
double getEnergyDeposit(const G4Step *) override
Definition: HCalSD.cc:384
std::unique_ptr< HFShowerFibreBundle > showerBundle
Definition: HCalSD.h:96
bool isItPMT(const G4LogicalVolume *)
Definition: HCalSD.cc:698
bool isItinFidVolume(const G4ThreeVector &)
Definition: HCalSD.cc:718
void getHitPMT(const G4Step *step)
Definition: HCalSD.cc:850
std::unique_ptr< HFShowerLibrary > showerLibrary
Definition: HCalSD.h:92
double layerWeight(int, const G4ThreeVector &, int, int)
Definition: HCalSD.cc:998
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
int depth_
Definition: HCalSD.h:113
bool isItHF(const G4Step *)
Definition: HCalSD.cc:671
std::vector< G4String > fibreNames
Definition: HCalSD.h:116
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12
bool isItScintillator(const G4Material *)
Definition: HCalSD.cc:713
std::unique_ptr< HcalNumberingScheme > numberingScheme
Definition: HCalSD.h:91
std::vector< G4String > hfNames
Definition: HCalSD.h:116
std::unique_ptr< HFShower > hfshower
Definition: HCalSD.h:93
std::vector< const G4LogicalVolume * > fibreLV
Definition: HCalSD.h:118
std::map< uint32_t, double > layerWeights
Definition: HCalSD.h:119
step
std::vector< const G4LogicalVolume * > fibre1LV
Definition: HCalSD.h:118
std::vector< const G4Material * > materials
Definition: HCalSD.h:117
void initRun() override
Definition: HCalSD.cc:574
const HBHEDarkening * m_HBDarkening
Definition: HCalSD.h:99
std::vector< G4String > matNames
Definition: HCalSD.h:116
void update(const BeginOfRun *) override
This routine will be called when the appropriate signal arrives.
Definition: CaloSD.cc:484
bool useHF
Definition: HCalSD.h:109
bool isItFibre(const G4LogicalVolume *)
Definition: HCalSD.cc:688
void fillLogVolumeVector(const std::string &, const std::string &, const DDCompactView &, std::vector< const G4LogicalVolume * > &, std::vector< G4String > &)
Definition: HCalSD.cc:285