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:506
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:460
std::vector< const G4LogicalVolume * > noWeight
Definition: ECalSD.h:67
double birk1
Definition: ECalSD.h:63
double getEnergyDeposit(const G4Step *) override
Definition: ECalSD.cc:181
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:179
double getBirkL3(const G4Step *)
Definition: ECalSD.cc:479
void initMap()
Definition: ECalSD.cc:339
int getTrackID(const G4Track *) override
Definition: ECalSD.cc:248
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:318
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:291
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:432
EnergyResolutionVsLumi ageing
Definition: ECalSD.h:69
void setNumberingScheme(EcalNumberingScheme *)
Definition: ECalSD.cc:332
uint32_t setDetUnitId(const G4Step *) override
Definition: ECalSD.cc:323
double EnergyCorrected(const G4Step &, const G4Track *) override
Definition: ECalSD.cc:231
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:259