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 <DD4hep/DD4hepUnits.h>
15 
16 #include <map>
17 
18 const int MAXPHOTONS = 500; // Maximum number of photons we can store
19 
20 class G4LogicalVolume;
21 
22 class DreamSD : public CaloSD {
23 public:
24  DreamSD(const std::string &,
25  const DDCompactView *,
26  const cms::DDCompactView *,
28  edm::ParameterSet const &,
29  const SimTrackManager *);
30  ~DreamSD() override {}
31 
32  uint32_t setDetUnitId(const G4Step *) override;
33 
34 protected:
35  double getEnergyDeposit(const G4Step *) override;
36  void initRun() override;
37 
38 private:
39  typedef std::pair<double, double> Doubles;
40  typedef std::map<G4LogicalVolume *, Doubles> DimensionMap;
41 
42  void initMap(const std::string &);
43  void fillMap(const std::string &, double, double);
44  double curve_LY(const G4Step *, int);
45  double crystalLength(G4LogicalVolume *) const;
46  double crystalWidth(G4LogicalVolume *) const;
47 
49  double cherenkovDeposit_(const G4Step *aStep);
51  double getAverageNumberOfPhotons_(const double charge,
52  const double beta,
53  const G4Material *aMaterial,
54  const G4MaterialPropertyVector *rIndex);
56  double getPhotonEnergyDeposit_(const G4ParticleMomentum &p, const G4ThreeVector &x, const G4Step *aStep);
58  bool setPbWO2MaterialProperties_(G4Material *aMaterial);
59 
60  static constexpr double k_ScaleFromDDDToG4 = 1.0;
61  static constexpr double k_ScaleFromDD4HepToG4 = 1.0 / dd4hep::mm;
62 
65 
67  double birk1_, birk2_, birk3_;
68  double slopeLY_;
69  DimensionMap xtalLMap_; // Store length and width
70 
71  int side_;
72 
74  std::unique_ptr<G4PhysicsFreeVector> chAngleIntegrals_;
75  G4MaterialPropertiesTable *materialPropertiesTable_;
76 
77  int nphotons_;
78 };
79 
80 #endif // DreamSD_h
DreamSD::readBothSide_
bool readBothSide_
Definition: DreamSD.h:66
SimTrackManager
Definition: SimTrackManager.h:35
DreamSD::Doubles
std::pair< double, double > Doubles
Definition: DreamSD.h:39
MessageLogger.h
DreamSD::initMap
void initMap(const std::string &)
Definition: DreamSD.cc:123
DreamSD::DimensionMap
std::map< G4LogicalVolume *, Doubles > DimensionMap
Definition: DreamSD.h:40
DreamSD::fillMap
void fillMap(const std::string &, double, double)
Definition: DreamSD.cc:188
HLT_FULL_cff.beta
beta
Definition: HLT_FULL_cff.py:8651
DreamSD::k_ScaleFromDDDToG4
static constexpr double k_ScaleFromDDDToG4
Definition: DreamSD.h:60
DreamSD::cpvDD4Hep_
const cms::DDCompactView * cpvDD4Hep_
Definition: DreamSD.h:64
DreamSD::initRun
void initRun() override
Definition: DreamSD.cc:90
DreamSD::cherenkovDeposit_
double cherenkovDeposit_(const G4Step *aStep)
Returns the total energy due to Cherenkov radiation.
Definition: DreamSD.cc:254
DreamSD
Definition: DreamSD.h:22
DreamSD::dd4hep_
bool dd4hep_
Definition: DreamSD.h:66
DreamSD::getPhotonEnergyDeposit_
double getPhotonEnergyDeposit_(const G4ParticleMomentum &p, const G4ThreeVector &x, const G4Step *aStep)
Returns energy deposit for a given photon.
Definition: DreamSD.cc:514
DreamSD::chAngleIntegrals_
std::unique_ptr< G4PhysicsFreeVector > chAngleIntegrals_
Table of Cherenkov angle integrals vs photon momentum.
Definition: DreamSD.h:74
DreamSD::DreamSD
DreamSD(const std::string &, const DDCompactView *, const cms::DDCompactView *, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: DreamSD.cc:34
DDAxes::x
DreamSD::crystalWidth
double crystalWidth(G4LogicalVolume *) const
Definition: DreamSD.cc:243
DreamSD::doCherenkov_
bool doCherenkov_
Definition: DreamSD.h:66
DreamSD::materialPropertiesTable_
G4MaterialPropertiesTable * materialPropertiesTable_
Definition: DreamSD.h:75
DDCompactView.h
DreamSD::setDetUnitId
uint32_t setDetUnitId(const G4Step *) override
Definition: DreamSD.cc:109
DreamSD::useBirk_
bool useBirk_
Definition: DreamSD.h:66
DreamSD::getAverageNumberOfPhotons_
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:370
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
DreamSD::xtalLMap_
DimensionMap xtalLMap_
Definition: DreamSD.h:69
SensitiveDetectorCatalog
Definition: SensitiveDetectorCatalog.h:10
DDCompactView.h
DreamSD::setPbWO2MaterialProperties_
bool setPbWO2MaterialProperties_(G4Material *aMaterial)
Sets material properties at run-time...
Definition: DreamSD.cc:433
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
DreamSD::birk1_
double birk1_
Definition: DreamSD.h:67
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CaloSD.h
DreamSD::~DreamSD
~DreamSD() override
Definition: DreamSD.h:30
DreamSD::birk2_
double birk2_
Definition: DreamSD.h:67
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DreamSD::k_ScaleFromDD4HepToG4
static constexpr double k_ScaleFromDD4HepToG4
Definition: DreamSD.h:61
DreamSD::cpvDDD_
const DDCompactView * cpvDDD_
Definition: DreamSD.h:63
MAXPHOTONS
const int MAXPHOTONS
Definition: DreamSD.h:18
DreamSD::crystalLength
double crystalLength(G4LogicalVolume *) const
Definition: DreamSD.cc:234
DreamSD::nphotons_
int nphotons_
Definition: DreamSD.h:77
Frameworkfwd.h
cms::DDCompactView
Definition: DDCompactView.h:31
DreamSD::getEnergyDeposit
double getEnergyDeposit(const G4Step *) override
Definition: DreamSD.cc:70
ParameterSetfwd.h
DreamSD::curve_LY
double curve_LY(const G4Step *, int)
Definition: DreamSD.cc:207
DreamSD::side_
int side_
Definition: DreamSD.h:71
DreamSD::slopeLY_
double slopeLY_
Definition: DreamSD.h:68
CaloSD
Definition: CaloSD.h:39
DreamSD::birk3_
double birk3_
Definition: DreamSD.h:67