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 
20 
21 #ifdef plotDebug
22 #include <TH2F.h>
23 #endif
24 #include <string>
25 #include <map>
26 
27 class EcalBaseNumber;
28 class G4LogicalVolume;
30 
31 class ECalSD : public CaloSD {
32 public:
33  ECalSD(const std::string &,
36  edm::ParameterSet const &p,
37  const SimTrackManager *);
38  ~ECalSD() override;
39  uint32_t setDetUnitId(const G4Step *) override;
41 
42 protected:
43  double getEnergyDeposit(const G4Step *) override;
44  int getTrackID(const G4Track *) override;
45  uint16_t getDepth(const G4Step *) override;
46  double EnergyCorrected(const G4Step &, const G4Track *) override;
47 
48 private:
49  void initMap();
50  uint16_t getRadiationLength(const G4StepPoint *hitPoint, const G4LogicalVolume *lv);
51  uint16_t getLayerIDForTimeSim();
52  double curve_LY(const G4LogicalVolume *);
53 
54  void getBaseNumber(const G4Step *);
55  double getBirkL3(const G4Step *);
56  bool isXtal(const G4LogicalVolume *);
57 
58  // initialised before run
60  std::unique_ptr<EcalNumberingScheme> numberingScheme_;
64  double slopeLY, scaleRL;
66  std::map<const G4LogicalVolume *, double> xtalLMap;
67  std::vector<const G4LogicalVolume *> useDepth1, useDepth2, noWeight;
71 
72  // run time cache
73  G4ThreeVector currentLocalPoint;
74  double crystalLength;
75  double crystalDepth;
76  uint16_t depth;
77 #ifdef plotDebug
78  TH2F *g2L_[4];
79 #endif
80 };
81 
82 #endif // ECalSD_h
double crystalLength
Definition: ECalSD.h:74
bool isXtal(const G4LogicalVolume *)
Definition: ECalSD.cc:498
bool useBirkL3
Definition: ECalSD.h:62
double birkSlope
Definition: ECalSD.h:63
double slopeLY
Definition: ECalSD.h:64
Definition: CaloSD.h:40
std::vector< const G4LogicalVolume * > useDepth2
Definition: ECalSD.h:67
void getBaseNumber(const G4Step *)
Definition: ECalSD.cc:453
std::vector< const G4LogicalVolume * > noWeight
Definition: ECalSD.h:67
double birk1
Definition: ECalSD.h:63
double getEnergyDeposit(const G4Step *) override
Definition: ECalSD.cc:180
bool useWeight
Definition: ECalSD.h:61
std::unique_ptr< EcalNumberingScheme > numberingScheme_
Definition: ECalSD.h:60
double crystalDepth
Definition: ECalSD.h:75
bool storeLayerTimeSim
Definition: ECalSD.h:61
bool storeRL
Definition: ECalSD.h:61
~ECalSD() override
Definition: ECalSD.cc:178
double getBirkL3(const G4Step *)
Definition: ECalSD.cc:472
void initMap()
Definition: ECalSD.cc:334
int getTrackID(const G4Track *) override
Definition: ECalSD.cc:244
std::string depth1Name
Definition: ECalSD.h:65
std::map< const G4LogicalVolume *, double > xtalLMap
Definition: ECalSD.h:66
EcalBaseNumber theBaseNumber
Definition: ECalSD.h:68
bool storeTrack
Definition: ECalSD.h:61
double scaleRL
Definition: ECalSD.h:64
uint16_t getLayerIDForTimeSim()
Definition: ECalSD.cc:313
const EcalSimulationParameters * ecalSimParameters_
Definition: ECalSD.h:59
std::string depth2Name
Definition: ECalSD.h:65
G4ThreeVector currentLocalPoint
Definition: ECalSD.h:73
Definition: ECalSD.h:31
uint16_t getRadiationLength(const G4StepPoint *hitPoint, const G4LogicalVolume *lv)
Definition: ECalSD.cc:287
std::vector< const G4LogicalVolume * > useDepth1
Definition: ECalSD.h:67
bool ageingWithSlopeLY
Definition: ECalSD.h:70
bool useBirk
Definition: ECalSD.h:62
ECalSD(const std::string &, const EcalSimulationParameters *, const SensitiveDetectorCatalog &, edm::ParameterSet const &p, const SimTrackManager *)
Definition: ECalSD.cc:41
double birk2
Definition: ECalSD.h:63
uint16_t depth
Definition: ECalSD.h:76
double curve_LY(const G4LogicalVolume *)
Definition: ECalSD.cc:427
EnergyResolutionVsLumi ageing
Definition: ECalSD.h:69
void setNumberingScheme(EcalNumberingScheme *)
Definition: ECalSD.cc:327
uint32_t setDetUnitId(const G4Step *) override
Definition: ECalSD.cc:318
double EnergyCorrected(const G4Step &, const G4Track *) override
Definition: ECalSD.cc:229
double birkCut
Definition: ECalSD.h:63
std::string crystalMat
Definition: ECalSD.h:65
double birk3
Definition: ECalSD.h:63
uint16_t getDepth(const G4Step *) override
Definition: ECalSD.cc:255