CMS 3D CMS Logo

ECalSD.h
Go to the documentation of this file.
1 #ifndef SimG4CMS_ECalSD_h
2 #define SimG4CMS_ECalSD_h
3 // File: ECalSD.h
5 // Description: Stores hits of Electromagnetic calorimeters in appropriate
6 // container
7 // Use in your sensitive detector builder:
8 // ECalSD* ecalSD = new ECalSD(SDname, new CaloNumberingScheme());
10 //#define plotDebug
11 
18 
19 #include "G4String.hh"
20 #ifdef plotDebug
21 #include <TH2F.h>
22 #endif
23 #include <string>
24 #include <map>
25 
26 class EcalBaseNumber;
27 class G4LogicalVolume;
29 
30 class ECalSD : public CaloSD {
31 public:
32  ECalSD(const std::string &,
33  const DDCompactView &,
35  edm::ParameterSet const &p,
36  const SimTrackManager *);
37  ~ECalSD() override;
38  uint32_t setDetUnitId(const G4Step *) override;
40 
41 protected:
42  double getEnergyDeposit(const G4Step *) override;
43  int getTrackID(const G4Track *) override;
44  uint16_t getDepth(const G4Step *) override;
45 
46 private:
47  void initMap(const G4String &, const DDCompactView &);
48  uint16_t getRadiationLength(const G4StepPoint *hitPoint, const G4LogicalVolume *lv);
49  uint16_t getLayerIDForTimeSim();
50  double curve_LY(const G4LogicalVolume *);
51 
52  void getBaseNumber(const G4Step *);
53  double getBirkL3(const G4Step *);
54 
55  std::vector<double> getDDDArray(const std::string &, const DDsvalues_type &);
56  std::vector<std::string> getStringArray(const std::string &, const DDsvalues_type &);
57 
58  // initialised before run
59  bool isEB;
60  bool isEE;
65  double slopeLY, scaleRL;
67  std::map<const G4LogicalVolume *, double> xtalLMap;
68  std::vector<const G4LogicalVolume *> useDepth1, useDepth2, noWeight;
72 
73  // run time cache
74  G4ThreeVector currentLocalPoint;
75  double crystalLength;
76  double crystalDepth;
77  uint16_t depth;
78 
79 #ifdef plotDebug
80  TH2F *g2L_[4];
81 #endif
82 };
83 
84 #endif // ECalSD_h
double crystalLength
Definition: ECalSD.h:75
bool useBirkL3
Definition: ECalSD.h:63
std::vector< std::string > getStringArray(const std::string &, const DDsvalues_type &)
Definition: ECalSD.cc:503
double birkSlope
Definition: ECalSD.h:64
double slopeLY
Definition: ECalSD.h:65
Definition: CaloSD.h:38
std::vector< const G4LogicalVolume * > useDepth2
Definition: ECalSD.h:68
void getBaseNumber(const G4Step *)
Definition: ECalSD.cc:442
std::vector< const G4LogicalVolume * > noWeight
Definition: ECalSD.h:68
double birk1
Definition: ECalSD.h:64
double getEnergyDeposit(const G4Step *) override
Definition: ECalSD.cc:182
bool useWeight
Definition: ECalSD.h:62
double crystalDepth
Definition: ECalSD.h:76
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
bool storeLayerTimeSim
Definition: ECalSD.h:62
bool storeRL
Definition: ECalSD.h:62
~ECalSD() override
Definition: ECalSD.cc:180
double getBirkL3(const G4Step *)
Definition: ECalSD.cc:460
int getTrackID(const G4Track *) override
Definition: ECalSD.cc:229
std::string depth1Name
Definition: ECalSD.h:66
std::map< const G4LogicalVolume *, double > xtalLMap
Definition: ECalSD.h:67
EcalBaseNumber theBaseNumber
Definition: ECalSD.h:69
bool storeTrack
Definition: ECalSD.h:62
double scaleRL
Definition: ECalSD.h:65
uint16_t getLayerIDForTimeSim()
Definition: ECalSD.cc:290
std::string depth2Name
Definition: ECalSD.h:66
G4ThreeVector currentLocalPoint
Definition: ECalSD.h:74
Definition: ECalSD.h:30
uint16_t getRadiationLength(const G4StepPoint *hitPoint, const G4LogicalVolume *lv)
Definition: ECalSD.cc:266
void initMap(const G4String &, const DDCompactView &)
Definition: ECalSD.cc:313
std::vector< const G4LogicalVolume * > useDepth1
Definition: ECalSD.h:68
bool ageingWithSlopeLY
Definition: ECalSD.h:71
bool useBirk
Definition: ECalSD.h:63
bool isEE
Definition: ECalSD.h:60
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &)
Definition: ECalSD.cc:486
bool isEB
Definition: ECalSD.h:59
double birk2
Definition: ECalSD.h:64
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12
ECalSD(const std::string &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &p, const SimTrackManager *)
Definition: ECalSD.cc:41
uint16_t depth
Definition: ECalSD.h:77
double curve_LY(const G4LogicalVolume *)
Definition: ECalSD.cc:421
EcalNumberingScheme * numberingScheme
Definition: ECalSD.h:61
EnergyResolutionVsLumi ageing
Definition: ECalSD.h:70
void setNumberingScheme(EcalNumberingScheme *)
Definition: ECalSD.cc:304
uint32_t setDetUnitId(const G4Step *) override
Definition: ECalSD.cc:295
double birkCut
Definition: ECalSD.h:64
std::string crystalMat
Definition: ECalSD.h:66
double birk3
Definition: ECalSD.h:64
uint16_t getDepth(const G4Step *) override
Definition: ECalSD.cc:240