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 
23 
24 #include "G4String.hh"
25 #include <map>
26 #include <string>
27 #include <TH1F.h>
28 
29 class DDCompactView;
30 class DDFilteredView;
31 class G4LogicalVolume;
32 class G4Material;
33 class G4Step;
34 class HcalTestNS;
35 
36 class HCalSD : public CaloSD, public Observer<const BeginOfJob *> {
37 
38 public:
39 
40  HCalSD(const std::string& , const DDCompactView &, const SensitiveDetectorCatalog &,
41  edm::ParameterSet const &, const SimTrackManager*);
42  ~HCalSD() override;
43  bool ProcessHits(G4Step * , G4TouchableHistory * ) override;
44  double getEnergyDeposit(G4Step* ) override;
45  uint32_t setDetUnitId(const G4Step* step) override;
47 
48 protected:
49 
50  void update(const BeginOfJob *) override;
51  void initRun() override;
52  bool filterHit(CaloG4Hit*, double) override;
53 
54 private:
55 
56  uint32_t setDetUnitId(int, const G4ThreeVector&, int, int);
58  std::vector<double> getDDDArray(const std::string&,
59  const DDsvalues_type&);
60  std::vector<G4String> getNames(DDFilteredView&);
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 getFromLibrary(G4Step * step, double weight);
71  void hitForFibre(const G4Step * step, double weight);
72  void getFromParam(G4Step * step, double weight);
73  void getHitPMT(const G4Step * step);
74  void getHitFibreBundle(const G4Step * step, bool type);
75  int setTrackID(const G4Step * step);
76  void readWeightFromFile(const std::string&);
77  double layerWeight(int, const G4ThreeVector&, int, int);
78  void plotProfile(const G4Step* step, const G4ThreeVector& pos,
79  double edep, double time, int id);
80  void plotHF(const G4ThreeVector& pos, bool emType);
82 
94  std::unique_ptr<HFDarkening> m_HFDarkening;
98  double birk1, birk2, birk3, betaThr;
103  std::vector<double> gpar;
104  std::vector<int> hfLevels;
105  std::vector<G4String> hfNames, fibreNames, matNames;
106  std::vector<const G4Material*> materials;
107  std::vector<const G4LogicalVolume*> hfLV, fibreLV, pmtLV, fibre1LV, fibre2LV;
108  std::map<uint32_t,double> layerWeights;
109  TH1F *hit_[9], *time_[9], *dist_[9], *hzvem, *hzvhad;
110 
111 };
112 
113 #endif // HCalSD_h
type
Definition: HCALResponse.h:21
void readWeightFromFile(const std::string &)
Definition: HCalSD.cc:1090
std::vector< const G4LogicalVolume * > hfLV
Definition: HCalSD.h:107
bool useParam
Definition: HCalSD.h:99
double eminHitHE
Definition: HCalSD.h:100
HFShowerParam * showerParam
Definition: HCalSD.h:88
TH1F * time_[9]
Definition: HCalSD.h:109
void getFromParam(G4Step *step, double weight)
Definition: HCalSD.cc:900
G4int depth_
Definition: HCalSD.h:102
bool useLayerWt
Definition: HCalSD.h:96
Definition: CaloSD.h:42
std::vector< double > gpar
Definition: HCalSD.h:103
bool useFibreBundle
Definition: HCalSD.h:96
double betaThr
Definition: HCalSD.h:98
double deliveredLumi
Definition: HCalSD.h:101
HFShowerFibreBundle * showerBundle
Definition: HCalSD.h:90
double eminHitHB
Definition: HCalSD.h:100
bool useShowerLibrary
Definition: HCalSD.h:99
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &)
Definition: HCalSD.cc:669
void plotProfile(const G4Step *step, const G4ThreeVector &pos, double edep, double time, int id)
Definition: HCalSD.cc:1138
Definition: weight.py:1
double birk2
Definition: HCalSD.h:98
void getFromLibrary(G4Step *step, double weight)
Definition: HCalSD.cc:785
bool usePMTHit
Definition: HCalSD.h:96
std::vector< const G4LogicalVolume * > fibre2LV
Definition: HCalSD.h:107
void modifyDepth(HcalNumberingFromDDD::HcalID &id)
Definition: HCalSD.cc:1194
void update(const BeginOfJob *) override
This routine will be called when the appropriate signal arrives.
Definition: HCalSD.cc:572
void setNumberingScheme(HcalNumberingScheme *)
Definition: HCalSD.cc:564
type of data representation of DDCompactView
Definition: DDCompactView.h:90
bool agingFlagHE
Definition: HCalSD.h:91
double birk1
Definition: HCalSD.h:98
TH1F * hzvhad
Definition: HCalSD.h:109
int setTrackID(const G4Step *step)
Definition: HCalSD.cc:1069
bool isItConicalBundle(const G4LogicalVolume *)
Definition: HCalSD.cc:756
bool ProcessHits(G4Step *, G4TouchableHistory *) override
Definition: HCalSD.cc:358
double eminHitHF
Definition: HCalSD.h:100
Definition: HCalSD.h:36
TH1F * hit_[9]
Definition: HCalSD.h:109
HCalSD(const std::string &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: HCalSD.cc:44
bool agingFlagHB
Definition: HCalSD.h:91
bool testNumber
Definition: HCalSD.h:97
const std::vector< std::string > & getNames() const
HFShower * hfshower
Definition: HCalSD.h:87
bool useBirk
Definition: HCalSD.h:96
std::unique_ptr< HFDarkening > m_HFDarkening
Definition: HCalSD.h:94
double birk3
Definition: HCalSD.h:98
const HBHEDarkening * m_HEDarkening
Definition: HCalSD.h:93
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
std::maps an index to a DDValue. The index corresponds to the index assigned to the name of the std::...
Definition: DDsvalues.h:20
bool applyFidCut
Definition: HCalSD.h:99
TH1F * dist_[9]
Definition: HCalSD.h:109
void plotHF(const G4ThreeVector &pos, bool emType)
Definition: HCalSD.cc:1185
HcalNumberingScheme * numberingScheme
Definition: HCalSD.h:85
std::vector< int > hfLevels
Definition: HCalSD.h:104
uint32_t setDetUnitId(const G4Step *step) override
Definition: HCalSD.cc:551
bool isItStraightBundle(const G4LogicalVolume *)
Definition: HCalSD.cc:750
bool testNS_
Definition: HCalSD.h:97
G4int mupPDG
Definition: HCalSD.h:102
~HCalSD() override
Definition: HCalSD.cc:346
double eminHitHO
Definition: HCalSD.h:100
TH1F * hzvem
Definition: HCalSD.h:109
std::vector< const G4LogicalVolume * > pmtLV
Definition: HCalSD.h:107
bool filterHit(CaloG4Hit *, double) override
Definition: HCalSD.cc:625
bool neutralDensity
Definition: HCalSD.h:97
void getHitFibreBundle(const G4Step *step, bool type)
Definition: HCalSD.cc:1006
void hitForFibre(const G4Step *step, double weight)
Definition: HCalSD.cc:848
bool isItPMT(const G4LogicalVolume *)
Definition: HCalSD.cc:744
bool isItinFidVolume(const G4ThreeVector &)
Definition: HCalSD.cc:768
void getHitPMT(const G4Step *step)
Definition: HCalSD.cc:939
HcalNumberingFromDDD * numberingFromDDD
Definition: HCalSD.h:84
double layerWeight(int, const G4ThreeVector &, int, int)
Definition: HCalSD.cc:1116
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
bool isItHF(const G4Step *)
Definition: HCalSD.cc:714
std::vector< G4String > fibreNames
Definition: HCalSD.h:105
bool isItScintillator(const G4Material *)
Definition: HCalSD.cc:762
std::vector< G4String > hfNames
Definition: HCalSD.h:105
std::vector< const G4LogicalVolume * > fibreLV
Definition: HCalSD.h:107
G4int mumPDG
Definition: HCalSD.h:102
HcalTestNS * hcalTestNS_
Definition: HCalSD.h:95
std::map< uint32_t, double > layerWeights
Definition: HCalSD.h:108
step
HFShowerPMT * showerPMT
Definition: HCalSD.h:89
std::vector< const G4LogicalVolume * > fibre1LV
Definition: HCalSD.h:107
HFShowerLibrary * showerLibrary
Definition: HCalSD.h:86
std::vector< const G4Material * > materials
Definition: HCalSD.h:106
void initRun() override
Definition: HCalSD.cc:609
const HBHEDarkening * m_HBDarkening
Definition: HCalSD.h:92
double getEnergyDeposit(G4Step *) override
Definition: HCalSD.cc:463
std::vector< G4String > matNames
Definition: HCalSD.h:105
bool useHF
Definition: HCalSD.h:99
bool isItFibre(const G4LogicalVolume *)
Definition: HCalSD.cc:732
HcalDDDSimConstants * hcalConstants
Definition: HCalSD.h:83