CMS 3D CMS Logo

DreamSD.h
Go to the documentation of this file.
1 #ifndef SimG4CMS_DreamSD_h
2 #define SimG4CMS_DreamSD_h
3 
7 
11 
12 #include "G4PhysicsFreeVector.hh"
13 
14 #include <map>
15 
16 const int MAXPHOTONS = 500; // Maximum number of photons we can store
17 
18 class G4LogicalVolume;
19 
20 class DreamSD : public CaloSD {
21 public:
22  DreamSD(const std::string &,
23  const DDCompactView *,
24  const cms::DDCompactView *,
26  edm::ParameterSet const &,
27  const SimTrackManager *);
28  ~DreamSD() override {}
29 
30  uint32_t setDetUnitId(const G4Step *) override;
31 
32 protected:
33  double getEnergyDeposit(const G4Step *) override;
34  void initRun() override;
35 
36 private:
37  typedef std::pair<double, double> Doubles;
38  typedef std::map<G4LogicalVolume *, Doubles> DimensionMap;
39 
40  void initMap(const std::string &);
41  void fillMap(const std::string &, double, double);
42  double curve_LY(const G4Step *, int);
43  double crystalLength(G4LogicalVolume *) const;
44  double crystalWidth(G4LogicalVolume *) const;
45 
47  double cherenkovDeposit_(const G4Step *aStep);
49  double getAverageNumberOfPhotons_(const double charge,
50  const double beta,
51  const G4Material *aMaterial,
52  const G4MaterialPropertyVector *rIndex);
54  double getPhotonEnergyDeposit_(const G4ParticleMomentum &p, const G4ThreeVector &x, const G4Step *aStep);
56  bool setPbWO2MaterialProperties_(G4Material *aMaterial);
57 
58  static constexpr double k_ScaleFromDDDToG4 = 1.0;
59  static constexpr double k_ScaleFromDD4hepToG4 = 1.0 / dd4hep::mm;
60 
63 
65  double birk1_, birk2_, birk3_;
66  double slopeLY_;
67  DimensionMap xtalLMap_; // Store length and width
68 
69  int side_;
70 
72  std::unique_ptr<G4PhysicsFreeVector> chAngleIntegrals_;
73  G4MaterialPropertiesTable *materialPropertiesTable_;
74 
75  int nphotons_;
76 };
77 
78 #endif // DreamSD_h
const DDCompactView * cpvDDD_
Definition: DreamSD.h:61
double crystalLength(G4LogicalVolume *) const
Definition: DreamSD.cc:223
static constexpr double k_ScaleFromDD4hepToG4
Definition: DreamSD.h:59
bool readBothSide_
Definition: DreamSD.h:64
double getPhotonEnergyDeposit_(const G4ParticleMomentum &p, const G4ThreeVector &x, const G4Step *aStep)
Returns energy deposit for a given photon.
Definition: DreamSD.cc:504
Definition: CaloSD.h:40
DimensionMap xtalLMap_
Definition: DreamSD.h:67
void fillMap(const std::string &, double, double)
Definition: DreamSD.cc:176
uint32_t setDetUnitId(const G4Step *) override
Definition: DreamSD.cc:107
bool setPbWO2MaterialProperties_(G4Material *aMaterial)
Sets material properties at run-time...
Definition: DreamSD.cc:422
static constexpr double k_ScaleFromDDDToG4
Definition: DreamSD.h:58
double birk3_
Definition: DreamSD.h:65
bool useBirk_
Definition: DreamSD.h:64
void initRun() override
Definition: DreamSD.cc:88
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
double crystalWidth(G4LogicalVolume *) const
Definition: DreamSD.cc:232
double cherenkovDeposit_(const G4Step *aStep)
Returns the total energy due to Cherenkov radiation.
Definition: DreamSD.cc:243
bool dd4hep_
Definition: DreamSD.h:64
int nphotons_
Definition: DreamSD.h:75
std::unique_ptr< G4PhysicsFreeVector > chAngleIntegrals_
Table of Cherenkov angle integrals vs photon momentum.
Definition: DreamSD.h:72
double getAverageNumberOfPhotons_(const double charge, const double beta, const G4Material *aMaterial, const G4MaterialPropertyVector *rIndex)
Returns average number of photons created by track.
Definition: DreamSD.cc:359
~DreamSD() override
Definition: DreamSD.h:28
int side_
Definition: DreamSD.h:69
G4MaterialPropertiesTable * materialPropertiesTable_
Definition: DreamSD.h:73
std::pair< double, double > Doubles
Definition: DreamSD.h:37
const int MAXPHOTONS
Definition: DreamSD.h:16
std::map< G4LogicalVolume *, Doubles > DimensionMap
Definition: DreamSD.h:38
double curve_LY(const G4Step *, int)
Definition: DreamSD.cc:196
double birk2_
Definition: DreamSD.h:65
DreamSD(const std::string &, const DDCompactView *, const cms::DDCompactView *, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: DreamSD.cc:32
const cms::DDCompactView * cpvDD4hep_
Definition: DreamSD.h:62
double getEnergyDeposit(const G4Step *) override
Definition: DreamSD.cc:68
bool doCherenkov_
Definition: DreamSD.h:64
double birk1_
Definition: DreamSD.h:65
double slopeLY_
Definition: DreamSD.h:66
void initMap(const std::string &)
Definition: DreamSD.cc:121