CMS 3D CMS Logo

ECalSD.cc
Go to the documentation of this file.
1 // File: ECalSD.cc
3 // Description: Sensitive Detector class for electromagnetic calorimeters
18 
20 
21 #include "G4LogicalVolumeStore.hh"
22 #include "G4LogicalVolume.hh"
23 #include "G4Step.hh"
24 #include "G4Track.hh"
25 #include "G4VProcess.hh"
26 
27 #include "G4SystemOfUnits.hh"
28 
29 #include<algorithm>
30 
31 //#define EDM_ML_DEBUG
32 
33 template <class T>
34 bool any(const std::vector<T> & v, const T &what) {
35  return std::find(v.begin(), v.end(), what) != v.end();
36 }
37 
38 ECalSD::ECalSD(G4String name, const DDCompactView & cpv,
39  const SensitiveDetectorCatalog & clg,
40  edm::ParameterSet const & p, const SimTrackManager* manager) :
41  CaloSD(name, cpv, clg, p, manager,
42  (float)(p.getParameter<edm::ParameterSet>("ECalSD").getParameter<double>("TimeSliceUnit")),
43  p.getParameter<edm::ParameterSet>("ECalSD").getParameter<bool>("IgnoreTrackID")),
44  numberingScheme(0){
45 
46  // static SimpleConfigurable<bool> on1(false, "ECalSD:UseBirkLaw");
47  // static SimpleConfigurable<double> bk1(0.00463,"ECalSD:BirkC1");
48  // static SimpleConfigurable<double> bk2(-0.03, "ECalSD:BirkC2");
49  // static SimpleConfigurable<double> bk3(1.0, "ECalSD:BirkC3");
50  // Values from NIM A484 (2002) 239-244: as implemented in Geant3
51  // useBirk = on1.value();
52  // birk1 = bk1.value()*(g/(MeV*cm2));
53  // birk2 = bk2.value()*(g/(MeV*cm2))*(g/(MeV*cm2));
54 
56  useBirk = m_EC.getParameter<bool>("UseBirkLaw");
57  useBirkL3 = m_EC.getParameter<bool>("BirkL3Parametrization");
58  birk1 = m_EC.getParameter<double>("BirkC1")*(g/(MeV*cm2));
59  birk2 = m_EC.getParameter<double>("BirkC2");
60  birk3 = m_EC.getParameter<double>("BirkC3");
61  birkSlope = m_EC.getParameter<double>("BirkSlope");
62  birkCut = m_EC.getParameter<double>("BirkCut");
63  slopeLY = m_EC.getParameter<double>("SlopeLightYield");
64  storeTrack = m_EC.getParameter<bool>("StoreSecondary");
65  crystalMat = m_EC.getUntrackedParameter<std::string>("XtalMat","E_PbWO4");
66  bool isItTB = m_EC.getUntrackedParameter<bool>("TestBeam", false);
67  bool nullNS = m_EC.getUntrackedParameter<bool>("NullNumbering", false);
68  storeRL = m_EC.getUntrackedParameter<bool>("StoreRadLength", false);
69  scaleRL = m_EC.getUntrackedParameter<double>("ScaleRadLength",1.0);
70 
71  //Changes for improved timing simulation
72  storeLayerTimeSim = m_EC.getUntrackedParameter<bool>("StoreLayerTimeSim", false);
73 
74  ageingWithSlopeLY = m_EC.getUntrackedParameter<bool>("AgeingWithSlopeLY", false);
75  if(ageingWithSlopeLY) ageing.setLumies(p.getParameter<edm::ParameterSet>("ECalSD").getParameter<double>("DelivLuminosity"),
76  p.getParameter<edm::ParameterSet>("ECalSD").getParameter<double>("InstLuminosity"));
77 
78  //Material list for HB/HE/HO sensitive detectors
79  std::string attribute = "ReadOutName";
80  DDSpecificsMatchesValueFilter filter{DDValue(attribute,name,0)};
81  DDFilteredView fv(cpv,filter);
82  fv.firstChild();
84  // Use of Weight
85  useWeight= true;
86  std::vector<double> tempD = getDDDArray("EnergyWeight",sv);
87  if (tempD.size() > 0) { if (tempD[0] < 0.1) useWeight = false; }
88 #ifdef EDM_ML_DEBUG
89  edm::LogInfo("EcalSim") << "ECalSD:: useWeight " << tempD.size() << ":"
90  << useWeight << std::endl;
91 #endif
92  std::vector<std::string> tempS = getStringArray("Depth1Name",sv);
93  if (tempS.size() > 0) depth1Name = tempS[0];
94  else depth1Name = " ";
95  tempS = getStringArray("Depth2Name",sv);
96  if (tempS.size() > 0) depth2Name = tempS[0];
97  else depth2Name = " ";
98 #ifdef EDM_ML_DEBUG
99  edm::LogInfo("EcalSim") << "Names (Depth 1):" << depth1Name << " (Depth 2):"
100  << depth2Name << std::endl;
101 #endif
102  EcalNumberingScheme* scheme=0;
103  if (nullNS) scheme = 0;
104  else if (name == "EcalHitsEB")
105  {
106  scheme = dynamic_cast<EcalNumberingScheme*>(new EcalBarrelNumberingScheme());
107  isEB=1;
108  }
109  else if (name == "EcalHitsEE")
110  {
111  scheme = dynamic_cast<EcalNumberingScheme*>(new EcalEndcapNumberingScheme());
112  isEE=1;
113  }
114  else if (name == "EcalHitsES")
115  {
116  if (isItTB) scheme = dynamic_cast<EcalNumberingScheme*>(new ESTBNumberingScheme());
117  else scheme = dynamic_cast<EcalNumberingScheme*>(new EcalPreshowerNumberingScheme());
118  useWeight = false;
119  }
120  else {edm::LogWarning("EcalSim") << "ECalSD: ReadoutName not supported\n";}
121 
122 
123  if (scheme) setNumberingScheme(scheme);
124 #ifdef EDM_ML_DEBUG
125  LogDebug("EcalSim") << "Constructing a ECalSD with name " << GetName();
126 #endif
127  if (useWeight) {
128  edm::LogInfo("EcalSim") << "ECalSD:: Use of Birks law is set to "
129  << useBirk << " with three constants kB = "
130  << birk1 << ", C1 = " << birk2 << ", C2 = "
131  << birk3 <<"\n Use of L3 parametrization "
132  << useBirkL3 << " with slope " << birkSlope
133  << " and cut off " << birkCut << "\n"
134  << " Slope for Light yield is set to "
135  << slopeLY;
136  } else {
137  edm::LogInfo("EcalSim") << "ECalSD:: energy deposit is not corrected "
138  << " by Birk or light yield curve";
139  }
140 
141  edm::LogInfo("EcalSim") << "ECalSD:: Suppression Flag " << suppressHeavy
142  << "\tprotons below " << kmaxProton << " MeV,"
143  << "\tneutrons below " << kmaxNeutron << " MeV"
144  << "\tions below " << kmaxIon << " MeV"
145  << "\n\tDepth1 Name = " << depth1Name
146  << "\tDepth2 Name = " << depth2Name
147  << "\n\tstoreRL" << storeRL << ":" << scaleRL
148  << "\tstoreLayerTimeSim " << storeLayerTimeSim
149  << "\n\ttime Granularity " << p.getParameter<edm::ParameterSet>("ECalSD").getParameter<double>("TimeSliceUnit") << " ns";
150  if (useWeight) initMap(name,cpv);
151 }
152 
154  if (numberingScheme) delete numberingScheme;
155 }
156 
157 double ECalSD::getEnergyDeposit(G4Step * aStep) {
158 
159  if (aStep == NULL) {
160  return 0;
161  } else {
162  preStepPoint = aStep->GetPreStepPoint();
163  G4Track* theTrack = aStep->GetTrack();
164  double wt2 = theTrack->GetWeight();
165  G4String nameVolume = preStepPoint->GetPhysicalVolume()->GetName();
166 
167  // take into account light collection curve for crystals
168  double weight = 1.;
169  if (suppressHeavy) {
170  TrackInformation * trkInfo = (TrackInformation *)(theTrack->GetUserInformation());
171  if (trkInfo) {
172  int pdg = theTrack->GetDefinition()->GetPDGEncoding();
173  if (!(trkInfo->isPrimary())) { // Only secondary particles
174  double ke = theTrack->GetKineticEnergy()/MeV;
175  if (((pdg/1000000000 == 1 && ((pdg/10000)%100) > 0 &&
176  ((pdg/10)%100) > 0)) && (ke<kmaxIon)) weight = 0;
177  if ((pdg == 2212) && (ke < kmaxProton)) weight = 0;
178  if ((pdg == 2112) && (ke < kmaxNeutron)) weight = 0;
179 #ifdef EDM_ML_DEBUG
180  if (weight == 0)
181  LogDebug("EcalSim") << "Ignore Track " << theTrack->GetTrackID()
182  << " Type " << theTrack->GetDefinition()->GetParticleName()
183  << " Kinetic Energy " << ke << " MeV";
184 #endif
185  }
186  }
187  }
188  G4LogicalVolume* lv = aStep->GetPreStepPoint()->GetTouchable()->GetVolume(0)->GetLogicalVolume();
189  if (useWeight && !any(noWeight,lv)) {
190  weight *= curve_LY(aStep);
191  if (useBirk) {
192  if (useBirkL3) weight *= getBirkL3(aStep);
193  else weight *= getAttenuation(aStep, birk1, birk2, birk3);
194  }
195  }
196  double wt1 = getResponseWt(theTrack);
197  double edep = aStep->GetTotalEnergyDeposit()*weight*wt1;
198  /*
199  if(wt2 != 1.0) {
200  std::cout << "ECalSD:: " << nameVolume
201  <<" LightWeight= " <<weight << " wt1= " <<wt1
202  << " wt2= " << wt2 << " "
203  << " Weighted Energy Deposit " << edep/MeV << " MeV"
204  << std::endl;
205  std::cout << theTrack->GetDefinition()->GetParticleName()
206  << " " << theTrack->GetKineticEnergy()
207  << " Id=" << theTrack->GetTrackID()
208  << " IdP=" << theTrack->GetParentID();
209  const G4VProcess* pr = theTrack->GetCreatorProcess();
210  if(pr) std::cout << " from " << pr->GetProcessName();
211  std::cout << std::endl;
212  }
213  */
214  if(wt2 > 0.0) { edep *= wt2; }
215 #ifdef EDM_ML_DEBUG
216  LogDebug("EcalSim") << "ECalSD:: " << nameVolume
217  <<" Light Collection Efficiency " <<weight << ":" <<wt1
218  << " Weighted Energy Deposit " << edep/MeV << " MeV";
219 #endif
220  return edep;
221  }
222 }
223 
224 int ECalSD::getTrackID(G4Track* aTrack) {
225 
226  int primaryID(0);
227  bool flag(false);
228  if (storeTrack) {
229  G4LogicalVolume* lv = preStepPoint->GetTouchable()->GetVolume(0)->GetLogicalVolume();
230  if (any(useDepth1,lv)) {
231  flag = true;
232  } else if (any(useDepth2,lv)) {
233  flag = true;
234  }
235  }
236  if (flag) {
237  forceSave = true;
238  primaryID = aTrack->GetTrackID();
239  } else {
240  primaryID = CaloSD::getTrackID(aTrack);
241  }
242  return primaryID;
243 }
244 
245 uint16_t ECalSD::getDepth(G4Step * aStep) {
246  G4LogicalVolume* lv = aStep->GetPreStepPoint()->GetTouchable()->GetVolume(0)->GetLogicalVolume();
247  if (storeRL) {
248  return getRadiationLength(aStep);
249  } else if (storeLayerTimeSim) {
250  return getLayerIDForTimeSim(aStep);
251  } else {
252  if (any(useDepth1,lv)) return 1;
253  else if (any(useDepth2,lv)) return 2;
254  else return 0;
255  }
256 }
257 
258 uint16_t ECalSD::getRadiationLength(G4Step * aStep) {
259 
260  uint16_t thisX0 = 0;
261  if (aStep != NULL) {
262  G4StepPoint* hitPoint = aStep->GetPreStepPoint();
263  G4LogicalVolume* lv = hitPoint->GetTouchable()->GetVolume(0)->GetLogicalVolume();
264 #ifdef EDM_ML_DEBUG
265  edm::LogInfo("EcalSim") << lv->GetName() << " useWight " << useWeight;
266 #endif
267  if (useWeight) {
268  G4ThreeVector localPoint = setToLocal(hitPoint->GetPosition(),
269  hitPoint->GetTouchable());
270  double crlength = crystalLength(lv);
271  double radl = hitPoint->GetMaterial()->GetRadlen();
272  double detz = (float)(0.5*crlength + localPoint.z());
273  thisX0 = (uint16_t)floor(scaleRL*detz/radl);
274 #ifdef EDM_ML_DEBUG
275  edm::LogInfo("EcalSim") << "Crystal Length " << crlength << " Radl "
276  << radl << " DetZ " << detz << " " << thisX0;
277 #endif
278  }
279  }
280  return thisX0;
281 }
282 
283 uint16_t ECalSD::getLayerIDForTimeSim(G4Step * aStep)
284 {
285  constexpr char refl[] = "refl";
286  float layerSize = 1*cm; //layer size in cm
287  if (!isEB && !isEE)
288  return 0;
289 
290  if (aStep != NULL ) {
291  G4StepPoint* hitPoint = aStep->GetPreStepPoint();
292  G4LogicalVolume* lv = hitPoint->GetTouchable()->GetVolume(0)->GetLogicalVolume();
293  G4ThreeVector localPoint = setToLocal(hitPoint->GetPosition(),
294  hitPoint->GetTouchable());
295  double crlength = crystalLength(lv);
296  double detz;
297 
298  const auto& name = lv->GetName();
299 
300  if( name.size() > 4 && name.compare(name.size()-4,4,refl) == 0 )
301  {
302  if (isEB)
303  detz = (float)(0.5*crlength + localPoint.z());
304  else
305  detz = (float)(0.5*crlength - localPoint.z());
306  }
307  else
308  {
309  if (isEB)
310  detz = (float)(0.5*crlength - localPoint.z());
311  else
312  detz = (float)(0.5*crlength + localPoint.z());
313  }
314  if (detz<0)
315  detz=0;
316  return 100+(int)detz/layerSize;
317  }
318  return 0;
319 }
320 
321 uint32_t ECalSD::setDetUnitId(G4Step * aStep) {
322  if (numberingScheme == 0) {
323  return EBDetId(1,1)();
324  } else {
325  getBaseNumber(aStep);
327  }
328 }
329 
331  if (scheme != 0) {
332  edm::LogInfo("EcalSim") << "EcalSD: updates numbering scheme for "
333  << GetName() << "\n";
334  if (numberingScheme) delete numberingScheme;
335  numberingScheme = scheme;
336  }
337 }
338 
339 
340 void ECalSD::initMap(G4String sd, const DDCompactView & cpv) {
341 
342  G4String attribute = "ReadOutName";
344  DDFilteredView fv(cpv,filter);
345  fv.firstChild();
346 
347  std::vector<G4LogicalVolume*> lvused;
348  const G4LogicalVolumeStore * lvs = G4LogicalVolumeStore::GetInstance();
349  std::vector<G4LogicalVolume *>::const_iterator lvcite;
350  std::map<std::string, G4LogicalVolume *> nameMap;
351  for (auto lvi = lvs->begin(), lve = lvs->end(); lvi != lve; ++lvi)
352  nameMap.insert(std::make_pair((*lvi)->GetName(), *lvi));
353 
354  bool dodet=true;
355  while (dodet) {
356  const std::string &matname = fv.logicalPart().material().name().name();
357  const std::string &lvname = fv.logicalPart().name().name();
358  G4LogicalVolume* lv = nameMap[lvname];
359  if (depth1Name != " ") {
360  if (strncmp(lvname.c_str(), depth1Name.c_str(), 4) == 0) {
361  if (!any(useDepth1, lv)) {
362  useDepth1.push_back(lv);
363 #ifdef EDM_ML_DEBUG
364  edm::LogInfo("EcalSim") << "ECalSD::initMap Logical Volume "
365  << lvname <<" in Depth 1 volume list\n";
366 #endif
367  }
368  G4LogicalVolume* lvr = nameMap[lvname + "_refl"];
369  if (lvr != 0 && !any(useDepth1, lvr)) {
370  useDepth1.push_back(lvr);
371 #ifdef EDM_ML_DEBUG
372  edm::LogInfo("EcalSim") << "ECalSD::initMap Logical Volume "
373  << lvname << "_refl"
374  <<" in Depth 1 volume list\n";
375 #endif
376  }
377  }
378  }
379  if (depth2Name != " ") {
380  if (strncmp(lvname.c_str(), depth2Name.c_str(), 4) == 0) {
381  if (!any(useDepth2, lv)) {
382  useDepth2.push_back(lv);
383 #ifdef EDM_ML_DEBUG
384  edm::LogInfo("EcalSim") << "ECalSD::initMap Logical Volume "
385  << lvname <<" in Depth 2 volume list\n";
386 #endif
387  }
388  G4LogicalVolume* lvr = nameMap[lvname + "_refl"];
389  if (lvr != 0 && !any(useDepth2,lvr)) {
390  useDepth2.push_back(lvr);
391 #ifdef EDM_ML_DEBUG
392  edm::LogInfo("EcalSim") << "ECalSD::initMap Logical Volume "
393  << lvname << "_refl"
394  <<" in Depth 2 volume list\n";
395 #endif
396  }
397  }
398  }
399  if (lv != 0) {
400  if (crystalMat.size() == matname.size() && !strcmp(crystalMat.c_str(), matname.c_str())) {
401  if (!any(lvused,lv)) {
402  lvused.push_back(lv);
403  const DDSolid & sol = fv.logicalPart().solid();
404  const std::vector<double> & paras = sol.parameters();
405 #ifdef EDM_ML_DEBUG
406  LogDebug("EcalSim") << "ECalSD::initMap (for " << sd << "): Solid "
407  << lvname << " Shape " << sol.shape()
408  << " Parameter 0 = "<< paras[0]
409  << " Logical Volume " << lv;
410 #endif
411  if (sol.shape() == ddtrap) {
412  double dz = 2*paras[0];
413  xtalLMap.insert(std::pair<G4LogicalVolume*,double>(lv,dz));
414  lv = nameMap[lvname + "_refl"];
415  if (lv != 0)
416  xtalLMap.insert(std::pair<G4LogicalVolume*,double>(lv,dz));
417  }
418  }
419  } else {
420  if (!any(noWeight,lv)) {
421  noWeight.push_back(lv);
422 #ifdef EDM_ML_DEBUG
423  LogDebug("EcalSim") << "ECalSD::initMap Logical Volume " << lvname
424  << " Material " << matname <<" in noWeight list";
425 #endif
426  }
427  lv = nameMap[lvname];
428  if (lv != 0 && !any(noWeight,lv)) {
429  noWeight.push_back(lv);
430 #ifdef EDM_ML_DEBUG
431  LogDebug("EcalSim") << "ECalSD::initMap Logical Volume " << lvname
432  << " Material " << matname <<" in noWeight list";
433 #endif
434  }
435  }
436  }
437  dodet = fv.next();
438  }
439 #ifdef EDM_ML_DEBUG
440  LogDebug("EcalSim") << "ECalSD: Length Table for " << attribute << " = "
441  << sd << ":";
442  std::map<G4LogicalVolume*,double>::const_iterator ite = xtalLMap.begin();
443  int i=0;
444  for (; ite != xtalLMap.end(); ite++, i++) {
445  G4String name = "Unknown";
446  if (ite->first != 0) name = (ite->first)->GetName();
447  LogDebug("EcalSim") << " " << i << " " << ite->first << " " << name
448  << " L = " << ite->second;
449  }
450 #endif
451 }
452 
453 double ECalSD::curve_LY(G4Step* aStep) {
454 
455  G4StepPoint* stepPoint = aStep->GetPreStepPoint();
456  G4LogicalVolume* lv = stepPoint->GetTouchable()->GetVolume(0)->GetLogicalVolume();
457 
458  double weight = 1.;
459  G4ThreeVector localPoint = setToLocal(stepPoint->GetPosition(),
460  stepPoint->GetTouchable());
461 
462  double crlength = crystalLength(lv);
463 
464  if(ageingWithSlopeLY){
465  //position along the crystal in mm from 0 to 230 (in EB)
466  double depth = 0.5 * crlength + localPoint.z();
467 
468  if (depth >= -0.1 || depth <= crlength+0.1)
469  weight = ageing.calcLightCollectionEfficiencyWeighted(currentID.unitID(), depth/crlength);
470  }
471  else{
472  double dapd = 0.5 * crlength - localPoint.z();
473  if (dapd >= -0.1 || dapd <= crlength+0.1) {
474  if (dapd <= 100.)
475  weight = 1.0 + slopeLY - dapd * 0.01 * slopeLY;
476  } else {
477  edm::LogWarning("EcalSim") << "ECalSD: light coll curve : wrong distance "
478  << "to APD " << dapd << " crlength = "
479  << crlength <<" crystal name = " <<lv->GetName()
480  << " z of localPoint = " << localPoint.z()
481  << " take weight = " << weight;
482  }
483  }
484  return weight;
485 }
486 
487 double ECalSD::crystalLength(G4LogicalVolume* lv) {
488 
489  double length= 230.;
490  std::map<G4LogicalVolume*,double>::const_iterator ite = xtalLMap.find(lv);
491  if (ite != xtalLMap.end()) length = ite->second;
492  return length;
493 }
494 
495 void ECalSD::getBaseNumber(const G4Step* aStep) {
496 
498  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
499  int theSize = touch->GetHistoryDepth()+1;
500  if ( theBaseNumber.getCapacity() < theSize ) theBaseNumber.setSize(theSize);
501  //Get name and copy numbers
502  if ( theSize > 1 ) {
503  for (int ii = 0; ii < theSize ; ii++) {
504  theBaseNumber.addLevel(touch->GetVolume(ii)->GetName(),touch->GetReplicaNumber(ii));
505 #ifdef EDM_ML_DEBUG
506  LogDebug("EcalSim") << "ECalSD::getBaseNumber(): Adding level " << ii
507  << ": " << touch->GetVolume(ii)->GetName() << "["
508  << touch->GetReplicaNumber(ii) << "]";
509 #endif
510  }
511  }
512 
513 }
514 
515 double ECalSD::getBirkL3(G4Step* aStep) {
516 
517  double weight = 1.;
518  double charge = aStep->GetPreStepPoint()->GetCharge();
519 
520  if (charge != 0. && aStep->GetStepLength() > 0) {
521  G4Material* mat = aStep->GetPreStepPoint()->GetMaterial();
522  double density = mat->GetDensity();
523  double dedx = aStep->GetTotalEnergyDeposit()/aStep->GetStepLength();
524  double rkb = birk1/density;
525  if (dedx > 0) {
526  weight = 1. - birkSlope*log(rkb*dedx);
527  if (weight < birkCut) weight = birkCut;
528  else if (weight > 1.) weight = 1.;
529  }
530 #ifdef EDM_ML_DEBUG
531  LogDebug("EcalSim") << "ECalSD::getBirkL3 in " << mat->GetName()
532  << " Charge " << charge << " dE/dx " << dedx
533  << " Birk Const " << rkb << " Weight = " << weight
534  << " dE " << aStep->GetTotalEnergyDeposit();
535 #endif
536  }
537  return weight;
538 
539 }
540 
541 std::vector<double> ECalSD::getDDDArray(const std::string & str,
542  const DDsvalues_type & sv) {
543 
544 #ifdef EDM_ML_DEBUG
545  LogDebug("EcalSim") << "ECalSD:getDDDArray called for " << str;
546 #endif
547  DDValue value(str);
548  if (DDfetch(&sv,value)) {
549 #ifdef EDM_ML_DEBUG
550  LogDebug("EcalSim") << value;
551 #endif
552  const std::vector<double> & fvec = value.doubles();
553  return fvec;
554  } else {
555  std::vector<double> fvec;
556  return fvec;
557  }
558 }
559 
560 std::vector<std::string> ECalSD::getStringArray(const std::string & str,
561  const DDsvalues_type & sv) {
562 
563 #ifdef EDM_ML_DEBUG
564  LogDebug("EcalSim") << "ECalSD:getStringArray called for " << str;
565 #endif
566  DDValue value(str);
567  if (DDfetch(&sv,value)) {
568 #ifdef EDM_ML_DEBUG
569  LogDebug("EcalSim") << value;
570 #endif
571  const std::vector<std::string> & fvec = value.strings();
572  return fvec;
573  } else {
574  std::vector<std::string> fvec;
575  return fvec;
576  }
577 }
#define LogDebug(id)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:147
bool useBirkL3
Definition: ECalSD.h:54
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const std::vector< double > & doubles() const
a reference to the double-valued values stored in the given instance of DDValue
Definition: DDValue.cc:137
double kmaxNeutron
Definition: CaloSD.h:134
const N & name() const
Definition: DDBase.h:78
std::vector< std::string > getStringArray(const std::string &, const DDsvalues_type &)
Definition: ECalSD.cc:560
double birkSlope
Definition: ECalSD.h:55
double slopeLY
Definition: ECalSD.h:56
std::vector< G4LogicalVolume * > useDepth1
Definition: ECalSD.h:59
void setLumies(double x, double y)
Definition: CaloSD.h:42
void getBaseNumber(const G4Step *)
Definition: ECalSD.cc:495
virtual double getEnergyDeposit(G4Step *)
Definition: ECalSD.cc:157
bool any(const std::vector< T > &v, const T &what)
Definition: ECalSD.cc:34
double birk1
Definition: ECalSD.h:55
virtual int getTrackID(G4Track *)
Definition: CaloSD.cc:574
bool useWeight
Definition: ECalSD.h:53
#define NULL
Definition: scimark2.h:8
Definition: weight.py:1
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
type of data representation of DDCompactView
Definition: DDCompactView.h:90
double kmaxProton
Definition: CaloSD.h:134
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:80
bool storeLayerTimeSim
Definition: ECalSD.h:53
std::vector< G4LogicalVolume * > noWeight
Definition: ECalSD.h:59
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
#define constexpr
bool storeRL
Definition: ECalSD.h:53
std::vector< G4LogicalVolume * > useDepth2
Definition: ECalSD.h:59
A DDSolid represents the shape of a part.
Definition: DDSolid.h:38
static TrackerG4SimHitNumberingScheme & numberingScheme(const DDCompactView &cpv, const GeometricDet &det)
virtual uint16_t getDepth(G4Step *)
Definition: ECalSD.cc:245
const double MeV
bool forceSave
Definition: CaloSD.h:137
std::string depth1Name
Definition: ECalSD.h:57
void addLevel(const std::string &name, const int &copyNumber)
virtual ~ECalSD()
Definition: ECalSD.cc:153
EcalBaseNumber theBaseNumber
Definition: ECalSD.h:60
bool storeTrack
Definition: ECalSD.h:53
double kmaxIon
Definition: CaloSD.h:134
bool suppressHeavy
Definition: CaloSD.h:132
bool next()
set current node to the next node in the filtered tree
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:56
double crystalLength(G4LogicalVolume *)
Definition: ECalSD.cc:487
virtual uint16_t getLayerIDForTimeSim(G4Step *)
Definition: ECalSD.cc:283
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:141
virtual int getTrackID(G4Track *)
Definition: ECalSD.cc:224
double getAttenuation(G4Step *aStep, double birk1, double birk2, double birk3)
Definition: CaloSD.cc:465
void initMap(G4String, const DDCompactView &)
Definition: ECalSD.cc:340
G4Track * theTrack
Definition: CaloSD.h:118
ii
Definition: cuy.py:588
const std::vector< std::string > & strings() const
a reference to the std::string-valued values stored in the given instance of DDValue ...
Definition: DDValue.h:61
double curve_LY(G4Step *)
Definition: ECalSD.cc:453
std::string depth2Name
Definition: ECalSD.h:57
G4StepPoint * preStepPoint
Definition: CaloSD.h:120
bool ageingWithSlopeLY
Definition: ECalSD.h:62
bool useBirk
Definition: ECalSD.h:54
bool isEE
Definition: ECalSD.h:51
virtual uint32_t getUnitID(const EcalBaseNumber &baseNumber) const =0
std::vector< double > getDDDArray(const std::string &, const DDsvalues_type &)
Definition: ECalSD.cc:541
CaloHitID currentID
Definition: CaloSD.h:117
double sd
virtual uint16_t getRadiationLength(G4Step *)
Definition: ECalSD.cc:258
double getBirkL3(G4Step *)
Definition: ECalSD.cc:515
int ke
bool isPrimary() const
double calcLightCollectionEfficiencyWeighted(DetId id, double z)
DDsvalues_type mergedSpecifics() const
ECalSD(G4String, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &p, const SimTrackManager *)
Definition: ECalSD.cc:38
bool isEB
Definition: ECalSD.h:50
double getResponseWt(G4Track *)
Definition: CaloSD.cc:607
HLT enums.
double birk2
Definition: ECalSD.h:55
bool firstChild()
set the current node to the first child ...
Pt3D refl(const Pt3D &p)
virtual uint32_t setDetUnitId(G4Step *)
Definition: ECalSD.cc:321
EcalNumberingScheme * numberingScheme
Definition: ECalSD.h:52
EnergyResolutionVsLumi ageing
Definition: ECalSD.h:61
std::map< G4LogicalVolume *, double > xtalLMap
Definition: ECalSD.h:58
uint32_t unitID() const
Definition: CaloHitID.h:22
void setNumberingScheme(EcalNumberingScheme *)
Definition: ECalSD.cc:330
void setSize(const int &size)
long double T
double birkCut
Definition: ECalSD.h:55
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
const DDMaterial & material(void) const
Returns a reference object of the material this LogicalPart is made of.
std::string crystalMat
Definition: ECalSD.h:57
double birk3
Definition: ECalSD.h:55
G4ThreeVector setToLocal(const G4ThreeVector &, const G4VTouchable *)
Definition: CaloSD.cc:296