CMS 3D CMS Logo

DreamSD.h
Go to the documentation of this file.
1 #ifndef SimG4CMS_DreamSD_h
2 #define SimG4CMS_DreamSD_h
3 
6 
7 #include "G4PhysicsOrderedFreeVector.hh"
8 
9 #include <DD4hep/DD4hepUnits.h>
10 
11 #include <map>
12 
13 const int MAXPHOTONS = 500; // Maximum number of photons we can store
14 
15 class G4LogicalVolume;
16 
17 class DreamSD : public CaloSD {
18 public:
19  DreamSD(const std::string &,
20  const edm::EventSetup &,
22  edm::ParameterSet const &,
23  const SimTrackManager *);
24  ~DreamSD() override {}
25 
26  uint32_t setDetUnitId(const G4Step *) override;
27 
28 protected:
29  double getEnergyDeposit(const G4Step *) override;
30  void initRun() override;
31 
32 private:
33  typedef std::pair<double, double> Doubles;
34  typedef std::map<G4LogicalVolume *, Doubles> DimensionMap;
35 
36  void initMap(const std::string &, const edm::EventSetup &);
37  void fillMap(const std::string &, double, double);
38  double curve_LY(const G4Step *, int);
39  double crystalLength(G4LogicalVolume *) const;
40  double crystalWidth(G4LogicalVolume *) const;
41 
43  double cherenkovDeposit_(const G4Step *aStep);
45  double getAverageNumberOfPhotons_(const double charge,
46  const double beta,
47  const G4Material *aMaterial,
48  const G4MaterialPropertyVector *rIndex);
50  double getPhotonEnergyDeposit_(const G4ParticleMomentum &p, const G4ThreeVector &x, const G4Step *aStep);
52  bool setPbWO2MaterialProperties_(G4Material *aMaterial);
53 
54  static constexpr double k_ScaleFromDDDToG4 = 1.0;
55  static constexpr double k_ScaleFromDD4HepToG4 = 1.0 / dd4hep::mm;
56 
58  double birk1_, birk2_, birk3_;
59  double slopeLY_;
60  DimensionMap xtalLMap_; // Store length and width
61 
62  int side_;
63 
65  std::unique_ptr<G4PhysicsOrderedFreeVector> chAngleIntegrals_;
66  G4MaterialPropertiesTable *materialPropertiesTable_;
67 
68  int nphotons_;
69 };
70 
71 #endif // DreamSD_h
DreamSD::chAngleIntegrals_
std::unique_ptr< G4PhysicsOrderedFreeVector > chAngleIntegrals_
Table of Cherenkov angle integrals vs photon momentum.
Definition: DreamSD.h:65
DreamSD::readBothSide_
bool readBothSide_
Definition: DreamSD.h:57
SimTrackManager
Definition: SimTrackManager.h:35
DreamSD::Doubles
std::pair< double, double > Doubles
Definition: DreamSD.h:33
MessageLogger.h
DreamSD::DimensionMap
std::map< G4LogicalVolume *, Doubles > DimensionMap
Definition: DreamSD.h:34
DreamSD::fillMap
void fillMap(const std::string &, double, double)
Definition: DreamSD.cc:194
HLT_FULL_cff.beta
beta
Definition: HLT_FULL_cff.py:8686
DreamSD::k_ScaleFromDDDToG4
static constexpr double k_ScaleFromDDDToG4
Definition: DreamSD.h:54
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
DreamSD::initRun
void initRun() override
Definition: DreamSD.cc:92
DreamSD::cherenkovDeposit_
double cherenkovDeposit_(const G4Step *aStep)
Returns the total energy due to Cherenkov radiation.
Definition: DreamSD.cc:260
DreamSD
Definition: DreamSD.h:17
DreamSD::dd4hep_
bool dd4hep_
Definition: DreamSD.h:57
DreamSD::getPhotonEnergyDeposit_
double getPhotonEnergyDeposit_(const G4ParticleMomentum &p, const G4ThreeVector &x, const G4Step *aStep)
Returns energy deposit for a given photon.
Definition: DreamSD.cc:520
DDAxes::x
DreamSD::crystalWidth
double crystalWidth(G4LogicalVolume *) const
Definition: DreamSD.cc:249
DreamSD::doCherenkov_
bool doCherenkov_
Definition: DreamSD.h:57
DreamSD::materialPropertiesTable_
G4MaterialPropertiesTable * materialPropertiesTable_
Definition: DreamSD.h:66
DreamSD::setDetUnitId
uint32_t setDetUnitId(const G4Step *) override
Definition: DreamSD.cc:111
DreamSD::initMap
void initMap(const std::string &, const edm::EventSetup &)
Definition: DreamSD.cc:125
DreamSD::useBirk_
bool useBirk_
Definition: DreamSD.h:57
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:376
DreamSD::xtalLMap_
DimensionMap xtalLMap_
Definition: DreamSD.h:60
SensitiveDetectorCatalog
Definition: SensitiveDetectorCatalog.h:10
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DreamSD::setPbWO2MaterialProperties_
bool setPbWO2MaterialProperties_(G4Material *aMaterial)
Sets material properties at run-time...
Definition: DreamSD.cc:439
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
DreamSD::birk1_
double birk1_
Definition: DreamSD.h:58
edm::ParameterSet
Definition: ParameterSet.h:47
CaloSD.h
DreamSD::~DreamSD
~DreamSD() override
Definition: DreamSD.h:24
edm::EventSetup
Definition: EventSetup.h:58
DreamSD::birk2_
double birk2_
Definition: DreamSD.h:58
DreamSD::k_ScaleFromDD4HepToG4
static constexpr double k_ScaleFromDD4HepToG4
Definition: DreamSD.h:55
MAXPHOTONS
const int MAXPHOTONS
Definition: DreamSD.h:13
DreamSD::crystalLength
double crystalLength(G4LogicalVolume *) const
Definition: DreamSD.cc:240
DreamSD::nphotons_
int nphotons_
Definition: DreamSD.h:68
DreamSD::getEnergyDeposit
double getEnergyDeposit(const G4Step *) override
Definition: DreamSD.cc:72
DreamSD::curve_LY
double curve_LY(const G4Step *, int)
Definition: DreamSD.cc:213
DreamSD::side_
int side_
Definition: DreamSD.h:62
DreamSD::DreamSD
DreamSD(const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: DreamSD.cc:37
DreamSD::slopeLY_
double slopeLY_
Definition: DreamSD.h:59
CaloSD
Definition: CaloSD.h:38
DreamSD::birk3_
double birk3_
Definition: DreamSD.h:58