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 edm::EventSetup&,
43  edm::ParameterSet const&,
44  const SimTrackManager*);
45  ~HCalSD() override = default;
46  uint32_t setDetUnitId(const G4Step* step) override;
48 
49 protected:
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  void fillLogVolumeVector(const std::string&, const std::vector<std::string>&, std::vector<const G4LogicalVolume*>&);
59  uint32_t setDetUnitId(int, const G4ThreeVector&, int, int);
61  bool isItHF(const G4Step*);
62  bool isItHF(const G4String&);
63  bool isItFibre(const G4LogicalVolume*);
64  bool isItFibre(const G4String&);
65  bool isItPMT(const G4LogicalVolume*);
66  bool isItStraightBundle(const G4LogicalVolume*);
67  bool isItConicalBundle(const G4LogicalVolume*);
68  bool isItScintillator(const G4Material*);
69  bool isItinFidVolume(const G4ThreeVector&);
70  void getFromHFLibrary(const G4Step* step, bool& isKilled);
71  void hitForFibre(const G4Step* step);
72  void getFromParam(const G4Step* step, bool& isKilled);
73  void getHitPMT(const G4Step* step);
74  void getHitFibreBundle(const G4Step* step, bool type);
75  void readWeightFromFile(const std::string&);
76  double layerWeight(int, const G4ThreeVector&, int, int);
77  void plotProfile(const G4Step* step, const G4ThreeVector& pos, double edep, double time, int id);
78  void plotHF(const G4ThreeVector& pos, bool emType);
80 
81  std::unique_ptr<HcalNumberingFromDDD> numberingFromDDD;
82  std::unique_ptr<HcalNumberingScheme> numberingScheme;
83  std::unique_ptr<HFShowerLibrary> showerLibrary;
84  std::unique_ptr<HFShower> hfshower;
85  std::unique_ptr<HFShowerParam> showerParam;
86  std::unique_ptr<HFShowerPMT> showerPMT;
87  std::unique_ptr<HFShowerFibreBundle> showerBundle;
88 
93  std::unique_ptr<HFDarkening> m_HFDarkening;
94  std::unique_ptr<HcalTestNS> m_HcalTestNS;
95 
96  bool isHF;
104  double weight_;
105  int depth_;
106  std::vector<double> gpar;
107  std::vector<int> hfLevels;
108  std::vector<std::string> hfNames;
109  std::vector<std::string> fibreNames;
110  std::vector<std::string> matNames;
111  std::vector<const G4Material*> materials;
112  std::vector<const G4LogicalVolume*> hfLV, fibreLV, pmtLV, fibre1LV, fibre2LV;
113  std::map<uint32_t, double> layerWeights;
114  TH1F *hit_[9], *time_[9], *dist_[9], *hzvem, *hzvhad;
115 };
116 
117 #endif // HCalSD_h
HCalSD::fibreLV
std::vector< const G4LogicalVolume * > fibreLV
Definition: HCalSD.h:112
HCalSD::isItStraightBundle
bool isItStraightBundle(const G4LogicalVolume *)
Definition: HCalSD.cc:666
SimTrackManager
Definition: SimTrackManager.h:35
HCalSD::testNS_
bool testNS_
Definition: HCalSD.h:99
HCalSD::hfLevels
std::vector< int > hfLevels
Definition: HCalSD.h:107
HCalSD::getFromHFLibrary
void getFromHFLibrary(const G4Step *step, bool &isKilled)
Definition: HCalSD.cc:706
Observer
Definition: Observer.h:23
HcalNumberingFromDDD::HcalID
Definition: HcalNumberingFromDDD.h:21
BeginOfJob.h
step
step
Definition: StallMonitor.cc:94
HBHEDarkening.h
HCalSD
Definition: HCalSD.h:38
HCalSD::agingFlagHE
bool agingFlagHE
Definition: HCalSD.h:97
HCalSD::m_HBDarkening
const HBHEDarkening * m_HBDarkening
Definition: HCalSD.h:91
HFShowerPMT.h
HCalSD::getFromParam
void getFromParam(const G4Step *step, bool &isKilled)
Definition: HCalSD.cc:791
HcalTestNS
Definition: HcalTestNS.h:8
HCalSD::pmtLV
std::vector< const G4LogicalVolume * > pmtLV
Definition: HCalSD.h:112
pos
Definition: PixelAliasList.h:18
HCalSD::neutralDensity
bool neutralDensity
Definition: HCalSD.h:99
CaloSD::update
void update(const BeginOfRun *) override
This routine will be called when the appropriate signal arrives.
Definition: CaloSD.cc:539
HFShowerParam.h
HCalSD::getHitFibreBundle
void getHitFibreBundle(const G4Step *step, bool type)
Definition: HCalSD.cc:880
HCalSD::getEnergyDeposit
double getEnergyDeposit(const G4Step *) override
Definition: HCalSD.cc:420
HCalSD::hit_
TH1F * hit_[9]
Definition: HCalSD.h:114
HcalTestNS.h
HCalSD::HCalSD
HCalSD(const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: HCalSD.cc:47
HCalSD::isItPMT
bool isItPMT(const G4LogicalVolume *)
Definition: HCalSD.cc:658
HCalSD::~HCalSD
~HCalSD() override=default
HCalSD::useBirk
bool useBirk
Definition: HCalSD.h:98
HCalSD::isItinFidVolume
bool isItinFidVolume(const G4ThreeVector &)
Definition: HCalSD.cc:690
HCalSD::isHF
bool isHF
Definition: HCalSD.h:96
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
HcalNumberingFromDDD.h
HCalSD::depth_
int depth_
Definition: HCalSD.h:105
ESGetToken.h
HCalSD::applyFidCut
bool applyFidCut
Definition: HCalSD.h:101
HCalSD::getHitPMT
void getHitPMT(const G4Step *step)
Definition: HCalSD.cc:821
HcalDDDSimConstants
Definition: HcalDDDSimConstants.h:24
HCalSD::layerWeight
double layerWeight(int, const G4ThreeVector &, int, int)
Definition: HCalSD.cc:966
HcalParametersRcd.h
HCalSD::m_HcalTestNS
std::unique_ptr< HcalTestNS > m_HcalTestNS
Definition: HCalSD.h:94
HCalSD::layerWeights
std::map< uint32_t, double > layerWeights
Definition: HCalSD.h:113
HCalSD::hfNames
std::vector< std::string > hfNames
Definition: HCalSD.h:108
HCalSD::fibre1LV
std::vector< const G4LogicalVolume * > fibre1LV
Definition: HCalSD.h:112
HCalSD::eminHitHO
double eminHitHO
Definition: HCalSD.h:102
HcalSimulationConstants
Definition: HcalSimulationConstants.h:15
HCalSD::hzvem
TH1F * hzvem
Definition: HCalSD.h:114
HcalNumberingScheme.h
HCalSD::update
void update(const BeginOfJob *) override
This routine will be called when the appropriate signal arrives.
Definition: HCalSD.cc:571
SensitiveDetectorCatalog
Definition: SensitiveDetectorCatalog.h:10
HCalSD::initRun
void initRun() override
Definition: HCalSD.cc:573
HCalSD::birk1
double birk1
Definition: HCalSD.h:100
BeginOfJob
Definition: BeginOfJob.h:8
HCalSD::filterHit
bool filterHit(CaloG4Hit *, double) override
Definition: HCalSD.cc:575
HCalSD::modifyDepth
void modifyDepth(HcalNumberingFromDDD::HcalID &id)
Definition: HCalSD.cc:1057
HCalSD::useHF
bool useHF
Definition: HCalSD.h:101
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HFShower.h
HCalSD::readWeightFromFile
void readWeightFromFile(const std::string &)
Definition: HCalSD.cc:942
HCalSD::hfLV
std::vector< const G4LogicalVolume * > hfLV
Definition: HCalSD.h:112
HCalSD::eminHitHF
double eminHitHF
Definition: HCalSD.h:102
HCalSD::useParam
bool useParam
Definition: HCalSD.h:101
HCalSD::eminHitHE
double eminHitHE
Definition: HCalSD.h:102
edm::ParameterSet
Definition: ParameterSet.h:47
HCalSD::isItConicalBundle
bool isItConicalBundle(const G4LogicalVolume *)
Definition: HCalSD.cc:674
CaloSD.h
HCalSD::numberingFromDDD
std::unique_ptr< HcalNumberingFromDDD > numberingFromDDD
Definition: HCalSD.h:81
HFShowerLibrary.h
HCalSD::time_
TH1F * time_[9]
Definition: HCalSD.h:114
HCalSD::hcalSimConstants_
const HcalSimulationConstants * hcalSimConstants_
Definition: HCalSD.h:90
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
HCalSD::showerBundle
std::unique_ptr< HFShowerFibreBundle > showerBundle
Definition: HCalSD.h:87
HCalSD::hitForFibre
void hitForFibre(const G4Step *step)
Definition: HCalSD.cc:749
HCalSD::isItHF
bool isItHF(const G4Step *)
Definition: HCalSD.cc:621
HCalSD::hcalConstants_
const HcalDDDSimConstants * hcalConstants_
Definition: HCalSD.h:89
HCalSD::agingFlagHB
bool agingFlagHB
Definition: HCalSD.h:97
HBHEDarkening
Definition: HBHEDarkening.h:17
HCalSD::showerLibrary
std::unique_ptr< HFShowerLibrary > showerLibrary
Definition: HCalSD.h:83
HCalSD::isItScintillator
bool isItScintillator(const G4Material *)
Definition: HCalSD.cc:682
HCalSD::fibreNames
std::vector< std::string > fibreNames
Definition: HCalSD.h:109
HFShowerFibreBundle.h
HCalSD::hfshower
std::unique_ptr< HFShower > hfshower
Definition: HCalSD.h:84
edm::EventSetup
Definition: EventSetup.h:57
CaloG4Hit
Definition: CaloG4Hit.h:32
HCalSD::dist_
TH1F * dist_[9]
Definition: HCalSD.h:114
HCalSD::gpar
std::vector< double > gpar
Definition: HCalSD.h:106
HCalSD::useFibreBundle
bool useFibreBundle
Definition: HCalSD.h:98
HCalSD::m_HFDarkening
std::unique_ptr< HFDarkening > m_HFDarkening
Definition: HCalSD.h:93
HCalSD::fibre2LV
std::vector< const G4LogicalVolume * > fibre2LV
Definition: HCalSD.h:112
HCalSD::betaThr
double betaThr
Definition: HCalSD.h:100
HFDarkening.h
HcalNumberingScheme
Definition: HcalNumberingScheme.h:13
HCalSD::setNumberingScheme
void setNumberingScheme(HcalNumberingScheme *)
Definition: HCalSD.cc:564
HCalSD::plotHF
void plotHF(const G4ThreeVector &pos, bool emType)
Definition: HCalSD.cc:1046
HCalSD::usePMTHit
bool usePMTHit
Definition: HCalSD.h:98
HCalSD::eminHitHB
double eminHitHB
Definition: HCalSD.h:102
HCalSD::plotProfile
void plotProfile(const G4Step *step, const G4ThreeVector &pos, double edep, double time, int id)
Definition: HCalSD.cc:986
HCalSD::materials
std::vector< const G4Material * > materials
Definition: HCalSD.h:111
HCalSD::getFromLibrary
bool getFromLibrary(const G4Step *) override
Definition: HCalSD.cc:363
HCalSD::setDetUnitId
uint32_t setDetUnitId(const G4Step *step) override
Definition: HCalSD.cc:552
HCalSD::showerPMT
std::unique_ptr< HFShowerPMT > showerPMT
Definition: HCalSD.h:86
HCalSD::useShowerLibrary
bool useShowerLibrary
Definition: HCalSD.h:101
HCalSD::birk2
double birk2
Definition: HCalSD.h:100
HcalSimulationConstants.h
HCalSD::isItFibre
bool isItFibre(const G4LogicalVolume *)
Definition: HCalSD.cc:642
DDFilteredView
Definition: DDFilteredView.h:20
HCalSD::matNames
std::vector< std::string > matNames
Definition: HCalSD.h:110
HCalSD::testNumber
bool testNumber
Definition: HCalSD.h:99
HCalSD::hzvhad
TH1F * hzvhad
Definition: HCalSD.h:114
HCalSD::fillLogVolumeVector
void fillLogVolumeVector(const std::string &, const std::vector< std::string > &, std::vector< const G4LogicalVolume * > &)
Definition: HCalSD.cc:338
ntuplemaker.time
time
Definition: ntuplemaker.py:310
HCalSD::m_HEDarkening
const HBHEDarkening * m_HEDarkening
Definition: HCalSD.h:92
HCalSD::showerParam
std::unique_ptr< HFShowerParam > showerParam
Definition: HCalSD.h:85
HCalSD::weight_
double weight_
Definition: HCalSD.h:104
HCalSD::useLayerWt
bool useLayerWt
Definition: HCalSD.h:98
CaloSD
Definition: CaloSD.h:38
HCalSD::deliveredLumi
double deliveredLumi
Definition: HCalSD.h:103
HcalDDDSimConstants.h
HCalSD::birk3
double birk3
Definition: HCalSD.h:100
HCalSD::numberingScheme
std::unique_ptr< HcalNumberingScheme > numberingScheme
Definition: HCalSD.h:82