CMS 3D CMS Logo

DreamSD.cc
Go to the documentation of this file.
1 
2 #include <memory>
3 
13 
14 #include "G4LogicalVolume.hh"
15 #include "G4LogicalVolumeStore.hh"
16 #include "G4Poisson.hh"
17 #include "G4Step.hh"
18 #include "G4Track.hh"
19 #include "G4VProcess.hh"
20 
21 // Histogramming
23 
24 // Cherenkov
27 
28 #include "G4PhysicalConstants.hh"
29 #include "G4SystemOfUnits.hh"
30 
31 //#define EDM_ML_DEBUG
32 
33 //________________________________________________________________________________________
35  const DDCompactView *cpvDDD,
36  const cms::DDCompactView *cpvDD4Hep,
37  const SensitiveDetectorCatalog &clg,
38  edm::ParameterSet const &p,
39  const SimTrackManager *manager)
40  : CaloSD(name, clg, p, manager), cpvDDD_(cpvDDD), cpvDD4Hep_(cpvDD4Hep) {
41  edm::ParameterSet m_EC = p.getParameter<edm::ParameterSet>("ECalSD");
42  useBirk_ = m_EC.getParameter<bool>("UseBirkLaw");
43  doCherenkov_ = m_EC.getParameter<bool>("doCherenkov");
44  birk1_ = m_EC.getParameter<double>("BirkC1") * (CLHEP::g / (CLHEP::MeV * CLHEP::cm2));
45  birk2_ = m_EC.getParameter<double>("BirkC2");
46  birk3_ = m_EC.getParameter<double>("BirkC3");
47  slopeLY_ = m_EC.getParameter<double>("SlopeLightYield");
48  readBothSide_ = m_EC.getUntrackedParameter<bool>("ReadBothSide", false);
49  dd4hep_ = p.getParameter<bool>("g4GeometryDD4hepSource");
50 
51  chAngleIntegrals_.reset(nullptr);
52 
53  edm::LogVerbatim("EcalSim") << "Constructing a DreamSD with name " << GetName()
54  << "\nDreamSD:: Use of Birks law is set to " << useBirk_
55  << " with three constants kB = " << birk1_ << ", C1 = " << birk2_ << ", C2 = " << birk3_
56  << "\n Slope for Light yield is set to " << slopeLY_
57  << "\n Parameterization of Cherenkov is set to " << doCherenkov_
58  << ", readout both sides is " << readBothSide_ << " and dd4hep flag " << dd4hep_;
59 #ifdef EDM_ML_DEBUG
60  edm::LogVerbatim("EcalSim") << GetName() << " initialized";
61  const G4LogicalVolumeStore *lvs = G4LogicalVolumeStore::GetInstance();
62  unsigned int k(0);
63  for (auto lvcite = lvs->begin(); lvcite != lvs->end(); ++lvcite, ++k)
64  edm::LogVerbatim("EcalSim") << "Volume[" << k << "] " << (*lvcite)->GetName();
65 #endif
66  initMap(name);
67 }
68 
69 //________________________________________________________________________________________
70 double DreamSD::getEnergyDeposit(const G4Step *aStep) {
71  // take into account light collection curve for crystals
72  double weight = curve_LY(aStep, side_);
73  if (useBirk_)
75  double edep = aStep->GetTotalEnergyDeposit() * weight;
76 
77  // Get Cerenkov contribution
78  if (doCherenkov_) {
79  edep += cherenkovDeposit_(aStep);
80  }
81 #ifdef EDM_ML_DEBUG
82  edm::LogVerbatim("EcalSim") << "DreamSD:: " << aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName() << " Side "
83  << side_ << " Light Collection Efficiency " << weight << " Weighted Energy Deposit "
84  << edep / CLHEP::MeV << " MeV";
85 #endif
86  return edep;
87 }
88 
89 //________________________________________________________________________________________
91  // Get the material and set properties if needed
92  DimensionMap::const_iterator ite = xtalLMap_.begin();
93  const G4LogicalVolume *lv = (ite->first);
94  G4Material *material = lv->GetMaterial();
95 #ifdef EDM_ML_DEBUG
96  edm::LogVerbatim("EcalSim") << "DreamSD::initRun: Initializes for material " << material->GetName() << " in "
97  << lv->GetName();
98 #endif
99  materialPropertiesTable_ = material->GetMaterialPropertiesTable();
101  if (!setPbWO2MaterialProperties_(material)) {
102  edm::LogWarning("EcalSim") << "Couldn't retrieve material properties table\n Material = " << material->GetName();
103  }
104  materialPropertiesTable_ = material->GetMaterialPropertiesTable();
105  }
106 }
107 
108 //________________________________________________________________________________________
109 uint32_t DreamSD::setDetUnitId(const G4Step *aStep) {
110  const G4VTouchable *touch = aStep->GetPreStepPoint()->GetTouchable();
111  uint32_t id = (touch->GetReplicaNumber(1)) * 10 + (touch->GetReplicaNumber(0));
112  side_ = readBothSide_ ? -1 : 1;
113  if (side_ < 0) {
114  ++id;
115  }
116 #ifdef EDM_ML_DEBUG
117  edm::LogVerbatim("EcalSim") << "DreamSD:: ID " << id;
118 #endif
119  return id;
120 }
121 
122 //________________________________________________________________________________________
124  if (dd4hep_) {
125  const cms::DDFilter filter("ReadOutName", sd);
127  while (fv.firstChild()) {
128  std::string name = static_cast<std::string>(dd4hep::dd::noNamespace(fv.name()));
129  std::vector<double> paras(fv.parameters());
130 #ifdef EDM_ML_DEBUG
131  edm::LogVerbatim("EcalSim") << "DreamSD::initMap (for " << sd << "): Solid " << name << " Shape "
132  << cms::dd::name(cms::DDSolidShapeMap, fv.shape()) << " Parameter 0 = " << paras[0];
133 #endif
134  // Set length to be the largest size, width the smallest
135  std::sort(paras.begin(), paras.end());
136  double length = 2.0 * k_ScaleFromDD4HepToG4 * paras.back();
137  double width = 2.0 * k_ScaleFromDD4HepToG4 * paras.front();
138  fillMap(name, length, width);
139  }
140  } else {
141  DDSpecificsMatchesValueFilter filter{DDValue("ReadOutName", sd, 0)};
142  DDFilteredView fv((*cpvDDD_), filter);
143  fv.firstChild();
144  bool dodet = true;
145  const G4LogicalVolumeStore *lvs = G4LogicalVolumeStore::GetInstance();
146  while (dodet) {
147  const DDSolid &sol = fv.logicalPart().solid();
148  std::vector<double> paras(sol.parameters());
149  G4String name = sol.name().name();
150 #ifdef EDM_ML_DEBUG
151  edm::LogVerbatim("EcalSim") << "DreamSD::initMap (for " << sd << "): Solid " << name << " Shape " << sol.shape()
152  << " Parameter 0 = " << paras[0];
153 #endif
154  // Set length to be the largest size, width the smallest
155  std::sort(paras.begin(), paras.end());
156  double length = 2.0 * k_ScaleFromDDDToG4 * paras.back();
157  double width = 2.0 * k_ScaleFromDDDToG4 * paras.front();
158  G4LogicalVolume *lv = nullptr;
159  for (auto lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++)
160  if ((*lvcite)->GetName() == name) {
161  lv = (*lvcite);
162  break;
163  }
164  xtalLMap_.insert(std::pair<G4LogicalVolume *, Doubles>(lv, Doubles(length, width)));
165 #ifdef EDM_ML_DEBUG
166  edm::LogVerbatim("EcalSim") << "DreamSD " << name << ":" << lv << ":" << length << ":" << width;
167 #endif
168  dodet = fv.next();
169  }
170  }
171 #ifdef EDM_ML_DEBUG
172  edm::LogVerbatim("EcalSim") << "DreamSD: Length Table for ReadOutName = " << sd << ":";
173 #endif
174  DimensionMap::const_iterator ite = xtalLMap_.begin();
175  int i = 0;
176  for (; ite != xtalLMap_.end(); ite++, i++) {
177  G4String name = "Unknown";
178  if (ite->first != nullptr)
179  name = (ite->first)->GetName();
180 #ifdef EDM_ML_DEBUG
181  edm::LogVerbatim("EcalSim") << " " << i << " " << ite->first << " " << name << " L = " << ite->second.first
182  << " W = " << ite->second.second;
183 #endif
184  }
185 }
186 
187 //________________________________________________________________________________________
188 void DreamSD::fillMap(const std::string &name, double length, double width) {
189  const G4LogicalVolumeStore *lvs = G4LogicalVolumeStore::GetInstance();
190  edm::LogVerbatim("EcalSim") << "LV Store with " << lvs->size() << " elements";
191  G4LogicalVolume *lv = nullptr;
192  for (auto lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++) {
193  edm::LogVerbatim("EcalSim") << name << " vs " << (*lvcite)->GetName();
194  if ((*lvcite)->GetName() == static_cast<G4String>(name)) {
195  lv = (*lvcite);
196  break;
197  }
198  }
199 #ifdef EDM_ML_DEBUG
200  edm::LogVerbatim("EcalSim") << "DreamSD::fillMap (for " << name << " Logical Volume " << lv << " Length " << length
201  << " Width " << width;
202 #endif
203  xtalLMap_.insert(std::pair<G4LogicalVolume *, Doubles>(lv, Doubles(length, width)));
204 }
205 
206 //________________________________________________________________________________________
207 double DreamSD::curve_LY(const G4Step *aStep, int flag) {
208  auto const stepPoint = aStep->GetPreStepPoint();
209  auto const lv = stepPoint->GetTouchable()->GetVolume(0)->GetLogicalVolume();
210  G4String nameVolume = lv->GetName();
211 
212  double weight = 1.;
213  G4ThreeVector localPoint = setToLocal(stepPoint->GetPosition(), stepPoint->GetTouchable());
214  double crlength = crystalLength(lv);
215  double localz = localPoint.x();
216  double dapd = 0.5 * crlength - flag * localz; // Distance from closest APD
217  if (dapd >= -0.1 || dapd <= crlength + 0.1) {
218  if (dapd <= 100.)
219  weight = 1.0 + slopeLY_ - dapd * 0.01 * slopeLY_;
220  } else {
221  edm::LogWarning("EcalSim") << "DreamSD: light coll curve : wrong distance "
222  << "to APD " << dapd << " crlength = " << crlength << " crystal name = " << nameVolume
223  << " z of localPoint = " << localz << " take weight = " << weight;
224  }
225 #ifdef EDM_ML_DEBUG
226  edm::LogVerbatim("EcalSim") << "DreamSD, light coll curve : " << dapd << " crlength = " << crlength
227  << " crystal name = " << nameVolume << " z of localPoint = " << localz
228  << " take weight = " << weight;
229 #endif
230  return weight;
231 }
232 
233 //________________________________________________________________________________________
234 double DreamSD::crystalLength(G4LogicalVolume *lv) const {
235  double length = -1.;
236  DimensionMap::const_iterator ite = xtalLMap_.find(lv);
237  if (ite != xtalLMap_.end())
238  length = ite->second.first;
239  return length;
240 }
241 
242 //________________________________________________________________________________________
243 double DreamSD::crystalWidth(G4LogicalVolume *lv) const {
244  double width = -1.;
245  DimensionMap::const_iterator ite = xtalLMap_.find(lv);
246  if (ite != xtalLMap_.end())
247  width = ite->second.second;
248  return width;
249 }
250 
251 //________________________________________________________________________________________
252 // Calculate total cherenkov deposit
253 // Inspired by Geant4's Cherenkov implementation
254 double DreamSD::cherenkovDeposit_(const G4Step *aStep) {
255  double cherenkovEnergy = 0;
257  return cherenkovEnergy;
258  G4Material *material = aStep->GetTrack()->GetMaterial();
259 
260  // Retrieve refractive index
261  G4MaterialPropertyVector *Rindex = materialPropertiesTable_->GetProperty("RINDEX");
262  if (Rindex == nullptr) {
263  edm::LogWarning("EcalSim") << "Couldn't retrieve refractive index";
264  return cherenkovEnergy;
265  }
266 
267  // V.Ivanchenko - temporary close log output for 9.5
268  // Material refraction properties
269  int Rlength = Rindex->GetVectorLength() - 1;
270  double Pmin = Rindex->Energy(0);
271  double Pmax = Rindex->Energy(Rlength);
272 #ifdef EDM_ML_DEBUG
273  edm::LogVerbatim("EcalSim") << "Material properties: \n Pmin = " << Pmin << " Pmax = " << Pmax;
274 #endif
275  // Get particle properties
276  const G4StepPoint *pPreStepPoint = aStep->GetPreStepPoint();
277  const G4StepPoint *pPostStepPoint = aStep->GetPostStepPoint();
278  const G4ThreeVector &x0 = pPreStepPoint->GetPosition();
279  G4ThreeVector p0 = aStep->GetDeltaPosition().unit();
280  const G4DynamicParticle *aParticle = aStep->GetTrack()->GetDynamicParticle();
281  const double charge = aParticle->GetDefinition()->GetPDGCharge();
282  // beta is averaged over step
283  double beta = 0.5 * (pPreStepPoint->GetBeta() + pPostStepPoint->GetBeta());
284  double BetaInverse = 1.0 / beta;
285 
286 #ifdef EDM_ML_DEBUG
287  edm::LogVerbatim("EcalSim") << "Particle properties: \n charge = " << charge << " beta = " << beta;
288 #endif
289 
290  // Now get number of photons generated in this step
291  double meanNumberOfPhotons = getAverageNumberOfPhotons_(charge, beta, material, Rindex);
292  if (meanNumberOfPhotons <= 0.0) { // Don't do anything
293 #ifdef EDM_ML_DEBUG
294  edm::LogVerbatim("EcalSim") << "Mean number of photons is zero: " << meanNumberOfPhotons << ", stopping here";
295 #endif
296  return cherenkovEnergy;
297  }
298 
299  // number of photons is in unit of Geant4...
300  meanNumberOfPhotons *= aStep->GetStepLength();
301 
302  // Now get a poisson distribution
303  int numPhotons = static_cast<int>(G4Poisson(meanNumberOfPhotons));
304  // edm::LogVerbatim("EcalSim") << "Number of photons = " << numPhotons;
305  if (numPhotons <= 0) {
306 #ifdef EDM_ML_DEBUG
307  edm::LogVerbatim("EcalSim") << "Poission number of photons is zero: " << numPhotons << ", stopping here";
308 #endif
309  return cherenkovEnergy;
310  }
311 
312  // Material refraction properties
313  double dp = Pmax - Pmin;
314  double maxCos = BetaInverse / (*Rindex)[Rlength];
315  double maxSin2 = (1.0 - maxCos) * (1.0 + maxCos);
316 
317  // Finally: get contribution of each photon
318  for (int iPhoton = 0; iPhoton < numPhotons; ++iPhoton) {
319  // Determine photon momentum
320  double randomNumber;
321  double sampledMomentum, sampledRI;
322  double cosTheta, sin2Theta;
323 
324  // sample a momentum (not sure why this is needed!)
325  do {
326  randomNumber = G4UniformRand();
327  sampledMomentum = Pmin + randomNumber * dp;
328  sampledRI = Rindex->Value(sampledMomentum);
329  cosTheta = BetaInverse / sampledRI;
330 
331  sin2Theta = (1.0 - cosTheta) * (1.0 + cosTheta);
332  randomNumber = G4UniformRand();
333 
334  } while (randomNumber * maxSin2 > sin2Theta);
335 
336  // Generate random position of photon on cone surface
337  // defined by Theta
338  randomNumber = G4UniformRand();
339 
340  double phi = twopi * randomNumber;
341  double sinPhi = sin(phi);
342  double cosPhi = cos(phi);
343 
344  // Create photon momentum direction vector
345  // The momentum direction is still w.r.t. the coordinate system where the
346  // primary particle direction is aligned with the z axis
347  double sinTheta = sqrt(sin2Theta);
348  double px = sinTheta * cosPhi;
349  double py = sinTheta * sinPhi;
350  double pz = cosTheta;
351  G4ThreeVector photonDirection(px, py, pz);
352 
353  // Rotate momentum direction back to global (crystal) reference system
354  photonDirection.rotateUz(p0);
355 
356  // Create photon position and momentum
357  randomNumber = G4UniformRand();
358  G4ThreeVector photonPosition = x0 + randomNumber * aStep->GetDeltaPosition();
359  G4ThreeVector photonMomentum = sampledMomentum * photonDirection;
360 
361  // Collect energy on APD
362  cherenkovEnergy += getPhotonEnergyDeposit_(photonMomentum, photonPosition, aStep);
363  }
364  return cherenkovEnergy;
365 }
366 
367 //________________________________________________________________________________________
368 // Returns number of photons produced per GEANT-unit (millimeter) in the current
369 // medium. From G4Cerenkov.cc
371  const double beta,
372  const G4Material *aMaterial,
373  const G4MaterialPropertyVector *Rindex) {
374  const double rFact = 369.81 / (eV * cm);
375 
376  if (beta <= 0.0)
377  return 0.0;
378 
379  double BetaInverse = 1. / beta;
380 
381  // Vectors used in computation of Cerenkov Angle Integral:
382  // - Refraction Indices for the current material
383  // - new G4PhysicsOrderedFreeVector allocated to hold CAI's
384 
385  // Min and Max photon momenta
386  int Rlength = Rindex->GetVectorLength() - 1;
387  double Pmin = Rindex->Energy(0);
388  double Pmax = Rindex->Energy(Rlength);
389 
390  // Min and Max Refraction Indices
391  double nMin = (*Rindex)[0];
392  double nMax = (*Rindex)[Rlength];
393 
394  // Max Cerenkov Angle Integral
395  double CAImax = chAngleIntegrals_.get()->GetMaxEnergy();
396 
397  double dp = 0., ge = 0., CAImin = 0.;
398 
399  // If n(Pmax) < 1/Beta -- no photons generated
400  if (nMax < BetaInverse) {
401  }
402 
403  // otherwise if n(Pmin) >= 1/Beta -- photons generated
404  else if (nMin > BetaInverse) {
405  dp = Pmax - Pmin;
406  ge = CAImax;
407  }
408  // If n(Pmin) < 1/Beta, and n(Pmax) >= 1/Beta, then
409  // we need to find a P such that the value of n(P) == 1/Beta.
410  // Interpolation is performed by the GetPhotonEnergy() and
411  // GetProperty() methods of the G4MaterialPropertiesTable and
412  // the GetValue() method of G4PhysicsVector.
413  else {
414  Pmin = Rindex->Value(BetaInverse);
415  dp = Pmax - Pmin;
416  // need boolean for current implementation of G4PhysicsVector
417  // ==> being phased out
418  double CAImin = chAngleIntegrals_->Value(Pmin);
419  ge = CAImax - CAImin;
420  }
421 
422  // Calculate number of photons
423  double numPhotons = rFact * charge / eplus * charge / eplus * (dp - ge * BetaInverse * BetaInverse);
424 
425  edm::LogVerbatim("EcalSim") << "@SUB=getAverageNumberOfPhotons\nCAImin = " << CAImin << "\nCAImax = " << CAImax
426  << "\ndp = " << dp << ", ge = " << ge << "\nnumPhotons = " << numPhotons;
427  return numPhotons;
428 }
429 
430 //________________________________________________________________________________________
431 // Set lead tungstate material properties on the fly.
432 // Values from Ts42 detector construction
433 bool DreamSD::setPbWO2MaterialProperties_(G4Material *aMaterial) {
434  std::string pbWO2Name("E_PbWO4");
435  if (pbWO2Name != aMaterial->GetName()) { // Wrong material!
436  edm::LogWarning("EcalSim") << "This is not the right material: "
437  << "expecting " << pbWO2Name << ", got " << aMaterial->GetName();
438  return false;
439  }
440 
441  G4MaterialPropertiesTable *table = new G4MaterialPropertiesTable();
442 
443  // Refractive index as a function of photon momentum
444  // FIXME: Should somehow put that in the configuration
445  const int nEntries = 14;
446  double PhotonEnergy[nEntries] = {1.7712 * eV,
447  1.8368 * eV,
448  1.90745 * eV,
449  1.98375 * eV,
450  2.0664 * eV,
451  2.15625 * eV,
452  2.25426 * eV,
453  2.3616 * eV,
454  2.47968 * eV,
455  2.61019 * eV,
456  2.75521 * eV,
457  2.91728 * eV,
458  3.09961 * eV,
459  3.30625 * eV};
460  double RefractiveIndex[nEntries] = {2.17728,
461  2.18025,
462  2.18357,
463  2.18753,
464  2.19285,
465  2.19813,
466  2.20441,
467  2.21337,
468  2.22328,
469  2.23619,
470  2.25203,
471  2.27381,
472  2.30282,
473  2.34666};
474 
475  table->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex, nEntries);
476  aMaterial->SetMaterialPropertiesTable(table); // FIXME: could this leak? What does G4 do?
477 
478  // Calculate Cherenkov angle integrals:
479  // This is an ad-hoc solution (we hold it in the class, not in the material)
480  chAngleIntegrals_ = std::make_unique<G4PhysicsFreeVector>(nEntries);
481 
482  int index = 0;
483  double currentRI = RefractiveIndex[index];
484  double currentPM = PhotonEnergy[index];
485  double currentCAI = 0.0;
486  chAngleIntegrals_.get()->PutValue(0, currentPM, currentCAI);
487  double prevPM = currentPM;
488  double prevCAI = currentCAI;
489  double prevRI = currentRI;
490  while (++index < nEntries) {
491  currentRI = RefractiveIndex[index];
492  currentPM = PhotonEnergy[index];
493  currentCAI = 0.5 * (1.0 / (prevRI * prevRI) + 1.0 / (currentRI * currentRI));
494  currentCAI = prevCAI + (currentPM - prevPM) * currentCAI;
495 
496  chAngleIntegrals_.get()->PutValue(index, currentPM, currentCAI);
497 
498  prevPM = currentPM;
499  prevCAI = currentCAI;
500  prevRI = currentRI;
501  }
502 
503 #ifdef EDM_ML_DEBUG
504  edm::LogVerbatim("EcalSim") << "Material properties set for " << aMaterial->GetName();
505 #endif
506  return true;
507 }
508 
509 //________________________________________________________________________________________
510 // Calculate energy deposit of a photon on APD
511 // - simple tracing to APD position (straight line);
512 // - configurable reflection probability if not straight to APD;
513 // - APD response function
514 double DreamSD::getPhotonEnergyDeposit_(const G4ThreeVector &p, const G4ThreeVector &x, const G4Step *aStep) {
515  double energy = 0;
516 
517  // Crystal dimensions
518 
519  // edm::LogVerbatim("EcalSim") << p << x;
520 
521  // 1. Check if this photon goes straight to the APD:
522  // - assume that APD is at x=xtalLength/2.0
523  // - extrapolate from x=x0 to x=xtalLength/2.0 using momentum in x-y
524 
525  G4StepPoint *stepPoint = aStep->GetPreStepPoint();
526  G4LogicalVolume *lv = stepPoint->GetTouchable()->GetVolume(0)->GetLogicalVolume();
527  G4String nameVolume = lv->GetName();
528 
529  double crlength = crystalLength(lv);
530  double crwidth = crystalWidth(lv);
531  double dapd = 0.5 * crlength - x.x(); // Distance from closest APD
532  double y = p.y() / p.x() * dapd;
533 
534 #ifdef EDM_ML_DEBUG
535  edm::LogVerbatim("EcalSim") << "Distance to APD: " << dapd << " - y at APD: " << y;
536 #endif
537  // Not straight: compute probability
538  if (std::abs(y) > crwidth * 0.5) {
539  }
540 
541  // 2. Retrieve efficiency for this wavelength (in nm, from MeV)
542  double waveLength = p.mag() * 1.239e8;
543 
544  energy = p.mag() * PMTResponse::getEfficiency(waveLength);
545 #ifdef EDM_ML_DEBUG
546  edm::LogVerbatim("EcalSim") << "Wavelength: " << waveLength << " - Energy: " << energy;
547 #endif
548  return energy;
549 }
DreamSD::readBothSide_
bool readBothSide_
Definition: DreamSD.h:66
DDAxes::y
ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
SimTrackManager
Definition: SimTrackManager.h:35
DreamSD::Doubles
std::pair< double, double > Doubles
Definition: DreamSD.h:39
mps_fire.i
i
Definition: mps_fire.py:428
cms::DDFilteredView::parameters
const std::vector< double > parameters() const
extract shape parameters
Definition: DDFilteredView.cc:536
DreamSD::initMap
void initMap(const std::string &)
Definition: DreamSD.cc:123
metDiagnosticParameterSet_cfi.nMin
nMin
Definition: metDiagnosticParameterSet_cfi.py:10
DreamSD::fillMap
void fillMap(const std::string &, double, double)
Definition: DreamSD.cc:188
HLT_FULL_cff.beta
beta
Definition: HLT_FULL_cff.py:8651
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
mps_merge.weight
weight
Definition: mps_merge.py:88
DreamSD::k_ScaleFromDDDToG4
static constexpr double k_ScaleFromDDDToG4
Definition: DreamSD.h:60
DDFilteredView::logicalPart
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
Definition: DDFilteredView.cc:16
DDSplit.h
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
PMTResponse.h
DreamSD::dd4hep_
bool dd4hep_
Definition: DreamSD.h:66
CaloSD::getAttenuation
double getAttenuation(const G4Step *aStep, double birk1, double birk2, double birk3) const
Definition: CaloSD.cc:683
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
MeV
const double MeV
DreamSD::DreamSD
DreamSD(const std::string &, const DDCompactView *, const cms::DDCompactView *, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
Definition: DreamSD.cc:34
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DDAxes::x
DreamSD::crystalWidth
double crystalWidth(G4LogicalVolume *) const
Definition: DreamSD.cc:243
DreamSD::doCherenkov_
bool doCherenkov_
Definition: DreamSD.h:66
cms::DDFilteredView
Definition: DDFilteredView.h:70
DreamSD::materialPropertiesTable_
G4MaterialPropertiesTable * materialPropertiesTable_
Definition: DreamSD.h:75
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
DDCompactView.h
Phase1L1TJetProducer_cfi.cosPhi
cosPhi
Definition: Phase1L1TJetProducer_cfi.py:40
cms::DDFilteredView::name
std::string_view name() const
Definition: DDFilteredView.cc:857
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DreamSD::setDetUnitId
uint32_t setDetUnitId(const G4Step *) override
Definition: DreamSD.cc:109
DDSolid::shape
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:123
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DDFilteredView::firstChild
bool firstChild()
set the current node to the first child ...
Definition: DDFilteredView.cc:86
DDFilteredView.h
cms::DDFilter
Definition: DDFilteredView.h:59
cms::dd::name
std::string name(Mapping a, V value)
Definition: DDSolidShapes.h:31
CaloSD::setToLocal
G4ThreeVector setToLocal(const G4ThreeVector &, const G4VTouchable *) const
Definition: CaloSD.cc:385
Calorimetry_cff.dp
dp
Definition: Calorimetry_cff.py:158
DreamSD::useBirk_
bool useBirk_
Definition: DreamSD.h:66
Service.h
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
Phase1L1TJetProducer_cfi.sinPhi
sinPhi
Definition: Phase1L1TJetProducer_cfi.py:39
DDFilteredView::next
bool next()
set current node to the next node in the filtered tree
Definition: DDFilteredView.cc:67
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
DDBase::name
const N & name() const
Definition: DDBase.h:59
cms::DDFilteredView::firstChild
bool firstChild()
set the current node to the first child
Definition: DDFilteredView.cc:268
DreamSD::xtalLMap_
DimensionMap xtalLMap_
Definition: DreamSD.h:69
DDSolid.h
cms::DDFilteredView::shape
const cms::DDSolidShape shape() const
Definition: DDFilteredView.cc:553
SensitiveDetectorCatalog
Definition: SensitiveDetectorCatalog.h:10
DDFilteredView.h
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
DDCompactView.h
dqmdumpme.k
k
Definition: dqmdumpme.py:60
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
DDValue.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
PMTResponse::getEfficiency
static double getEfficiency(const double &waveLengthNm)
Return efficiency for given photon wavelength (in nm)
Definition: PMTResponse.cc:6
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
DreamSD.h
DDFilter.h
DDName::name
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
TrackInformation.h
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
DDAxes::phi
DreamSD::cpvDDD_
const DDCompactView * cpvDDD_
Definition: DreamSD.h:63
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
DreamSD::crystalLength
double crystalLength(G4LogicalVolume *) const
Definition: DreamSD.cc:234
dataAnalyzerFineBiningParameters_cff.Pmax
Pmax
Definition: dataAnalyzerFineBiningParameters_cff.py:10
DDValue
Definition: DDValue.h:22
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
genVertex_cff.x
x
Definition: genVertex_cff.py:13
cms::DDCompactView
Definition: DDCompactView.h:31
DreamSD::getEnergyDeposit
double getEnergyDeposit(const G4Step *) override
Definition: DreamSD.cc:70
DDSolid::parameters
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:125
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDSolid
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
DDSpecificsMatchesValueFilter
Definition: DDFilter.h:70
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
DreamSD::curve_LY
double curve_LY(const G4Step *, int)
Definition: DreamSD.cc:207
DreamSD::side_
int side_
Definition: DreamSD.h:71
sd
double sd
Definition: CascadeWrapper.h:113
DDFilteredView
Definition: DDFilteredView.h:20
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DreamSD::slopeLY_
double slopeLY_
Definition: DreamSD.h:68
TableParser.table
table
Definition: TableParser.py:111
edm::Log
Definition: MessageLogger.h:70
DDLogicalPart::solid
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Definition: DDLogicalPart.cc:120
cms::DDSolidShapeMap
const std::array< const cms::dd::NameValuePair< DDSolidShape >, 21 > DDSolidShapeMap
Definition: DDSolidShapes.h:99
metDiagnosticParameterSet_cfi.nMax
nMax
Definition: metDiagnosticParameterSet_cfi.py:11
weight
Definition: weight.py:1
CaloSD
Definition: CaloSD.h:39
g
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:117
DreamSD::birk3_
double birk3_
Definition: DreamSD.h:67