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 
32 public:
33 
35  edm::ParameterSet const & p, const SimTrackManager*);
36  ~ECalSD() override;
37  uint32_t setDetUnitId(const G4Step*) override;
39 
40 protected:
41 
42  double getEnergyDeposit(const G4Step*) override;
43  int getTrackID(const G4Track*) override;
44  uint16_t getDepth(const G4Step*) override;
45 
46 private:
47 
48  void initMap(const G4String&, const DDCompactView &);
49  uint16_t getRadiationLength(const G4StepPoint* hitPoint,
50  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 
57  std::vector<double> getDDDArray(const std::string&,
58  const DDsvalues_type&);
59  std::vector<std::string> getStringArray(const std::string&,
60  const DDsvalues_type&);
61 
62  // initialised before run
63  bool isEB;
64  bool isEE;
69  double slopeLY, scaleRL;
71  std::map<const G4LogicalVolume*,double> xtalLMap;
72  std::vector<const G4LogicalVolume*> useDepth1, useDepth2, noWeight;
76 
77  // run time cache
78  G4ThreeVector currentLocalPoint;
79  double crystalLength;
80  double crystalDepth;
81  uint16_t depth;
82 
83 #ifdef plotDebug
84  TH2F *g2L_[4];
85 #endif
86 };
87 
88 #endif // ECalSD_h
double crystalLength
Definition: ECalSD.h:79
bool useBirkL3
Definition: ECalSD.h:67
std::vector< std::string > getStringArray(const std::string &, const DDsvalues_type &)
Definition: ECalSD.cc:522
double birkSlope
Definition: ECalSD.h:68
double slopeLY
Definition: ECalSD.h:69
Definition: CaloSD.h:37
std::vector< const G4LogicalVolume * > noWeight
Definition: ECalSD.h:72
void getBaseNumber(const G4Step *)
Definition: ECalSD.cc:458
double birk1
Definition: ECalSD.h:68
std::vector< const G4LogicalVolume * > useDepth2
Definition: ECalSD.h:72
double getEnergyDeposit(const G4Step *) override
Definition: ECalSD.cc:175
bool useWeight
Definition: ECalSD.h:66
double crystalDepth
Definition: ECalSD.h:80
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:83
bool storeLayerTimeSim
Definition: ECalSD.h:66
bool storeRL
Definition: ECalSD.h:66
~ECalSD() override
Definition: ECalSD.cc:171
double getBirkL3(const G4Step *)
Definition: ECalSD.cc:477
int getTrackID(const G4Track *) override
Definition: ECalSD.cc:219
std::string depth1Name
Definition: ECalSD.h:70
EcalBaseNumber theBaseNumber
Definition: ECalSD.h:73
bool storeTrack
Definition: ECalSD.h:66
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
double scaleRL
Definition: ECalSD.h:69
uint16_t getLayerIDForTimeSim()
Definition: ECalSD.cc:291
std::string depth2Name
Definition: ECalSD.h:70
G4ThreeVector currentLocalPoint
Definition: ECalSD.h:78
Definition: ECalSD.h:30
uint16_t getRadiationLength(const G4StepPoint *hitPoint, const G4LogicalVolume *lv)
Definition: ECalSD.cc:260
void initMap(const G4String &, const DDCompactView &)
Definition: ECalSD.cc:315
bool ageingWithSlopeLY
Definition: ECalSD.h:75
bool useBirk
Definition: ECalSD.h:67
bool isEE
Definition: ECalSD.h:64
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &)
Definition: ECalSD.cc:503
std::map< const G4LogicalVolume *, double > xtalLMap
Definition: ECalSD.h:71
bool isEB
Definition: ECalSD.h:63
double birk2
Definition: ECalSD.h:68
std::vector< const G4LogicalVolume * > useDepth1
Definition: ECalSD.h:72
ECalSD(const std::string &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &p, const SimTrackManager *)
Definition: ECalSD.cc:41
uint16_t depth
Definition: ECalSD.h:81
double curve_LY(const G4LogicalVolume *)
Definition: ECalSD.cc:434
EcalNumberingScheme * numberingScheme
Definition: ECalSD.h:65
EnergyResolutionVsLumi ageing
Definition: ECalSD.h:74
void setNumberingScheme(EcalNumberingScheme *)
Definition: ECalSD.cc:306
uint32_t setDetUnitId(const G4Step *) override
Definition: ECalSD.cc:297
double birkCut
Definition: ECalSD.h:68
std::string crystalMat
Definition: ECalSD.h:70
double birk3
Definition: ECalSD.h:68
uint16_t getDepth(const G4Step *) override
Definition: ECalSD.cc:230