test
CMS 3D CMS Logo

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