CMS 3D CMS Logo

EcalSimHitsValidProducer.cc
Go to the documentation of this file.
4 
11 
12 #include "G4PrimaryParticle.hh"
13 #include "G4PrimaryVertex.hh"
14 #include "G4SDManager.hh"
15 #include "G4Step.hh"
16 
17 #include <iostream>
18 
20  : ee1(0.0),
21  ee4(0.0),
22  ee9(0.0),
23  ee16(0.0),
24  ee25(0.0),
25  eb1(0.0),
26  eb4(0.0),
27  eb9(0.0),
28  eb16(0.0),
29  eb25(0.0),
30  totalEInEE(0.0),
31  totalEInEB(0),
32  totalEInES(0.0),
33  totalEInEEzp(0.0),
34  totalEInEEzm(0.0),
35  totalEInESzp(0.0),
36  totalEInESzm(0.0),
37  totalHits(0),
38  nHitsInEE(0),
39  nHitsInEB(0),
40  nHitsInES(0),
41  nHitsIn1ES(0),
42  nHitsIn2ES(0),
43  nCrystalInEB(0),
44  nCrystalInEEzp(0),
45  nCrystalInEEzm(0),
46  nHitsIn1ESzp(0),
47  nHitsIn1ESzm(0),
48  nHitsIn2ESzp(0),
49  nHitsIn2ESzm(0),
50  thePID(0),
51  label(iPSet.getUntrackedParameter<std::string>("instanceLabel", "EcalValidInfo")) {
52  produces<PEcalValidInfo>(label);
53 
54  for (int i = 0; i < 26; i++) {
55  eBX0[i] = 0.0;
56  eEX0[i] = 0.0;
57  }
58  setMT(true);
59 }
60 
62 
64  std::unique_ptr<PEcalValidInfo> product(new PEcalValidInfo);
65  fillEventInfo(*product);
66  e.put(std::move(product), label);
67 }
68 
70  if (ee1 != 0) {
71  product.ee1 = ee1;
72  product.ee4 = ee4;
73  product.ee9 = ee9;
74  product.ee16 = ee16;
75  product.ee25 = ee25;
76  for (int i = 0; i < 26; i++) {
77  product.eEX0.push_back(eEX0[i]);
78  }
79  }
80 
81  if (eb1 != 0) {
82  product.eb1 = eb1;
83  product.eb4 = eb4;
84  product.eb9 = eb9;
85  product.eb16 = eb16;
86  product.eb25 = eb25;
87  for (int i = 0; i < 26; i++) {
88  product.eBX0.push_back(eBX0[i]);
89  }
90  }
91 
92  product.totalEInEE = totalEInEE;
93  product.totalEInEB = totalEInEB;
94  product.totalEInES = totalEInES;
95 
96  product.totalEInEEzp = totalEInEEzp;
97  product.totalEInEEzm = totalEInEEzm;
98 
99  product.totalEInESzp = totalEInESzp;
100  product.totalEInESzm = totalEInESzm;
101 
102  product.totalHits = totalHits;
103  product.nHitsInEE = nHitsInEE;
104  product.nHitsInEB = nHitsInEB;
105  product.nHitsInES = nHitsInES;
106  product.nHitsIn1ES = nHitsIn1ES;
107  product.nHitsIn2ES = nHitsIn2ES;
108  product.nCrystalInEB = nCrystalInEB;
109  product.nCrystalInEEzp = nCrystalInEEzp;
110  product.nCrystalInEEzm = nCrystalInEEzm;
111 
112  product.nHitsIn1ESzp = nHitsIn1ESzp;
113  product.nHitsIn1ESzm = nHitsIn1ESzm;
114  product.nHitsIn2ESzp = nHitsIn2ESzp;
115  product.nHitsIn2ESzm = nHitsIn2ESzm;
116 
117  product.eOf1ES = eOf1ES;
118  product.eOf2ES = eOf2ES;
119  product.zOfES = zOfES;
120 
121  product.eOf1ESzp = eOf1ESzp;
122  product.eOf1ESzm = eOf1ESzm;
123  product.eOf2ESzp = eOf2ESzp;
124  product.eOf2ESzm = eOf2ESzm;
125 
128  product.eOfEECaloG4Hit = eOfEECaloG4Hit;
131  product.tOfEECaloG4Hit = tOfEECaloG4Hit;
132 
135  product.eOfESCaloG4Hit = eOfESCaloG4Hit;
136  product.tOfESCaloG4Hit = tOfESCaloG4Hit;
137 
140  product.eOfEBCaloG4Hit = eOfEBCaloG4Hit;
141  product.tOfEBCaloG4Hit = tOfEBCaloG4Hit;
142 
143  product.theMomentum = theMomentum;
144  product.theVertex = theVertex;
145  product.thePID = thePID;
146 }
147 
149  ee1 = 0.0;
150  ee4 = 0.0;
151  ee9 = 0.0;
152  ee16 = 0.0;
153  ee25 = 0.0;
154 
155  eb1 = 0.0;
156  eb4 = 0.0;
157  eb9 = 0.0;
158  eb16 = 0.0;
159  eb25 = 0.0;
160 
161  totalEInEE = 0.0;
162  totalEInEB = 0.0;
163  totalEInES = 0.0;
164 
165  totalEInEEzp = 0.0;
166  totalEInEEzm = 0.0;
167  totalEInESzp = 0.0;
168  totalEInESzm = 0.0;
169 
170  totalHits = 0;
171  nHitsInEE = 0;
172  nHitsInEB = 0;
173  nHitsInES = 0;
174  nHitsIn1ES = 0;
175  nHitsIn2ES = 0;
176  nCrystalInEB = 0;
177  nCrystalInEEzp = 0;
178  nCrystalInEEzm = 0;
179 
180  nHitsIn1ESzp = 0;
181  nHitsIn1ESzm = 0;
182  nHitsIn2ESzp = 0;
183  nHitsIn2ESzm = 0;
184 
185  for (int i = 0; i < 26; i++) {
186  eBX0[i] = 0.0;
187  eEX0[i] = 0.0;
188  }
189 
190  eOf1ES.clear();
191  eOf2ES.clear();
192  zOfES.clear();
193 
194  eOf1ESzp.clear();
195  eOf1ESzm.clear();
196  eOf2ESzp.clear();
197  eOf2ESzm.clear();
198 
199  phiOfEECaloG4Hit.clear();
200  etaOfEECaloG4Hit.clear();
201  tOfEECaloG4Hit.clear();
202  eOfEECaloG4Hit.clear();
203  eOfEEPlusCaloG4Hit.clear();
204  eOfEEMinusCaloG4Hit.clear();
205 
206  phiOfESCaloG4Hit.clear();
207  etaOfESCaloG4Hit.clear();
208  tOfESCaloG4Hit.clear();
209  eOfESCaloG4Hit.clear();
210 
211  phiOfEBCaloG4Hit.clear();
212  etaOfEBCaloG4Hit.clear();
213  tOfEBCaloG4Hit.clear();
214  eOfEBCaloG4Hit.clear();
215 }
216 
218  int trackID = 0;
219  G4PrimaryParticle *thePrim = nullptr;
220  int nvertex = (*evt)()->GetNumberOfPrimaryVertex();
221  if (nvertex <= 0) {
222  edm::LogWarning("EcalSimHitsValidProducer") << " No Vertex in this Event!";
223  } else {
224  for (int i = 0; i < nvertex; i++) {
225  G4PrimaryVertex *avertex = (*evt)()->GetPrimaryVertex(i);
226  if (avertex == nullptr)
227  edm::LogWarning("EcalSimHitsValidProducer") << " Pointer to vertex is NULL!";
228  else {
229  float x0 = avertex->GetX0();
230  float y0 = avertex->GetY0();
231  float z0 = avertex->GetZ0();
232  float t0 = avertex->GetT0();
233  theVertex.SetCoordinates(x0, y0, z0, t0);
234 
235  int npart = avertex->GetNumberOfParticle();
236  if (npart == 0)
237  edm::LogWarning("EcalSimHitsValidProducer") << " No primary particle in this event";
238  else {
239  if (thePrim == nullptr)
240  thePrim = avertex->GetPrimary(trackID);
241  }
242  }
243  }
244 
245  // the direction of momentum of primary particles
246  double pInit = 0; // etaInit =0, phiInit =0, // UNUSED
247  if (thePrim != nullptr) {
248  double px = thePrim->GetPx();
249  double py = thePrim->GetPy();
250  double pz = thePrim->GetPz();
251  theMomentum.SetCoordinates(px, py, pz, 0.);
252 
253  pInit = std::sqrt(px * px + py * py + pz * pz);
254  if (pInit == 0)
255  edm::LogWarning("EcalSimHitsValidProducer") << " Primary has p = 0 ; ";
256  else {
257  theMomentum.SetE(pInit);
258  }
259 
260  thePID = thePrim->GetPDGcode();
261  } else {
262  edm::LogWarning("EcalSimHitsValidProducer") << " Could not find the primary particle!!";
263  }
264  }
265  // hit map for EB for matrices
266  G4HCofThisEvent *allHC = (*evt)()->GetHCofThisEvent();
267  int EBHCid = G4SDManager::GetSDMpointer()->GetCollectionID("EcalHitsEB");
268  int EEHCid = G4SDManager::GetSDMpointer()->GetCollectionID("EcalHitsEE");
269  int SEHCid = G4SDManager::GetSDMpointer()->GetCollectionID("EcalHitsES");
270 
271  CaloG4HitCollection *theEBHC = (CaloG4HitCollection *)allHC->GetHC(EBHCid);
272  CaloG4HitCollection *theEEHC = (CaloG4HitCollection *)allHC->GetHC(EEHCid);
273  CaloG4HitCollection *theSEHC = (CaloG4HitCollection *)allHC->GetHC(SEHCid);
274 
275  nHitsInEE = theEEHC->entries();
276  nHitsInEB = theEBHC->entries();
277  nHitsInES = theSEHC->entries();
279 
280  // EB Hit collection start
281  MapType ebmap;
282  int theebhc_entries = theEBHC->entries();
283  for (int j = 0; j < theebhc_entries; j++) {
284  CaloG4Hit *aHit = (*theEBHC)[j];
285  totalEInEB += aHit->getEnergyDeposit();
286  float he = aHit->getEnergyDeposit();
287  float htime = aHit->getTimeSlice();
288 
289  math::XYZPoint hpos = aHit->getEntry();
290  float htheta = hpos.theta();
291  float heta = -log(tan(htheta * 0.5));
292  float hphi = hpos.phi();
293 
294  phiOfEBCaloG4Hit.push_back(hphi);
295  etaOfEBCaloG4Hit.push_back(heta);
296  tOfEBCaloG4Hit.push_back(htime);
297  eOfEBCaloG4Hit.push_back(he);
298  uint32_t crystid = aHit->getUnitID();
299  ebmap[crystid] += aHit->getEnergyDeposit();
300  }
301 
302  nCrystalInEB = ebmap.size();
303 
304  // EE Hit collection start
305  MapType eemap, eezpmap, eezmmap;
306  int theeehc_entries = theEEHC->entries();
307  for (int j = 0; j < theeehc_entries; j++) {
308  CaloG4Hit *aHit = (*theEEHC)[j];
309  totalEInEE += aHit->getEnergyDeposit();
310  float he = aHit->getEnergyDeposit();
311  float htime = aHit->getTimeSlice();
312 
313  math::XYZPoint hpos = aHit->getEntry();
314  float htheta = hpos.theta();
315  float heta = -log(tan(htheta * 0.5));
316  float hphi = hpos.phi();
317  phiOfEECaloG4Hit.push_back(hphi);
318  etaOfEECaloG4Hit.push_back(heta);
319  tOfEECaloG4Hit.push_back(htime);
320  eOfEECaloG4Hit.push_back(he);
321 
322  uint32_t crystid = aHit->getUnitID();
323  EEDetId myEEid(crystid);
324  if (myEEid.zside() == -1) {
325  totalEInEEzm += aHit->getEnergyDeposit();
326  eOfEEMinusCaloG4Hit.push_back(he);
327  eezmmap[crystid] += aHit->getEnergyDeposit();
328  }
329  if (myEEid.zside() == 1) {
330  totalEInEEzp += aHit->getEnergyDeposit();
331  eOfEEPlusCaloG4Hit.push_back(he);
332  eezpmap[crystid] += aHit->getEnergyDeposit();
333  }
334 
335  eemap[crystid] += aHit->getEnergyDeposit();
336  }
337 
338  nCrystalInEEzm = eezmmap.size();
339  nCrystalInEEzp = eezpmap.size();
340 
341  // Hits from ES
342  int thesehc_entries = theSEHC->entries();
343  for (int j = 0; j < thesehc_entries; j++) {
344  CaloG4Hit *aHit = (*theSEHC)[j];
345  totalEInES += aHit->getEnergyDeposit();
346  ESDetId esid = ESDetId(aHit->getUnitID());
347 
348  if (esid.zside() == -1) {
349  totalEInESzm += aHit->getEnergyDeposit();
350 
351  if (esid.plane() == 1) {
352  nHitsIn1ESzm++;
353  eOf1ESzm.push_back(aHit->getEnergyDeposit());
354  } else if (esid.plane() == 2) {
355  nHitsIn2ESzm++;
356  eOf2ESzm.push_back(aHit->getEnergyDeposit());
357  }
358  }
359  if (esid.zside() == 1) {
360  totalEInESzp += aHit->getEnergyDeposit();
361 
362  if (esid.plane() == 1) {
363  nHitsIn1ESzp++;
364  eOf1ESzp.push_back(aHit->getEnergyDeposit());
365  } else if (esid.plane() == 2) {
366  nHitsIn2ESzp++;
367  eOf2ESzp.push_back(aHit->getEnergyDeposit());
368  }
369  }
370  }
371 
372  uint32_t eemaxid = getUnitWithMaxEnergy(eemap);
373  uint32_t ebmaxid = getUnitWithMaxEnergy(ebmap);
374  if (eemap[eemaxid] > ebmap[ebmaxid]) {
375  uint32_t centerid = getUnitWithMaxEnergy(eemap);
376  EEDetId myEEid(centerid);
377  int ix = myEEid.ix();
378  int iy = myEEid.iy();
379  int iz = myEEid.zside();
380 
381  ee1 = energyInEEMatrix(1, 1, ix, iy, iz, eemap);
382  ee9 = energyInEEMatrix(3, 3, ix, iy, iz, eemap);
383  ee25 = energyInEEMatrix(5, 5, ix, iy, iz, eemap);
384  MapType neweemap;
385  if (fillEEMatrix(3, 3, ix, iy, iz, neweemap, eemap)) {
386  ee4 = eCluster2x2(neweemap);
387  }
388  if (fillEEMatrix(5, 5, ix, iy, iz, neweemap, eemap)) {
389  ee16 = eCluster4x4(ee9, neweemap);
390  }
391  } else {
392  uint32_t ebcenterid = getUnitWithMaxEnergy(ebmap);
393  EBDetId myEBid(ebcenterid);
394  int bx = myEBid.ietaAbs();
395  int by = myEBid.iphi();
396  int bz = myEBid.zside();
397  eb1 = energyInEBMatrix(1, 1, bx, by, bz, ebmap);
398  eb9 = energyInEBMatrix(3, 3, bx, by, bz, ebmap);
399  eb25 = energyInEBMatrix(5, 5, bx, by, bz, ebmap);
400 
401  MapType newebmap;
402  if (fillEBMatrix(3, 3, bx, by, bz, newebmap, ebmap)) {
403  eb4 = eCluster2x2(newebmap);
404  }
405  if (fillEBMatrix(5, 5, bx, by, bz, newebmap, ebmap)) {
406  eb16 = eCluster4x4(eb9, newebmap);
407  }
408  }
409 }
410 
411 void EcalSimHitsValidProducer::update(const G4Step *aStep) {
412  G4StepPoint *preStepPoint = aStep->GetPreStepPoint();
413  const G4ThreeVector &hitPoint = preStepPoint->GetPosition();
414  G4VPhysicalVolume *currentPV = preStepPoint->GetPhysicalVolume();
415  const G4String &name = currentPV->GetName();
416  std::string crystal;
417  crystal.assign(name, 0, 4);
418 
419  float Edeposit = aStep->GetTotalEnergyDeposit();
420  if (crystal == "EFRY" && Edeposit > 0.0) {
421  float z = hitPoint.z();
422  float detz = fabs(fabs(z) - 3200);
423  int x0 = (int)floor(detz / 8.9);
424  if (x0 < 26) {
425  eEX0[x0] += Edeposit;
426  }
427  }
428  if (crystal == "EBRY" && Edeposit > 0.0) {
429  float x = hitPoint.x();
430  float y = hitPoint.y();
431  float r = sqrt(x * x + y * y);
432  float detr = r - 1290;
433  int x0 = (int)floor(detr / 8.9);
434  if (x0 < 26) {
435  eBX0[x0] += Edeposit;
436  }
437  }
438 }
439 
441  int nCellInEta, int nCellInPhi, int CentralEta, int CentralPhi, int CentralZ, MapType &fillmap, MapType &themap) {
442  int goBackInEta = nCellInEta / 2;
443  int goBackInPhi = nCellInPhi / 2;
444 
445  int startEta = CentralEta - goBackInEta;
446  int startPhi = CentralPhi - goBackInPhi;
447 
448  int i = 0;
449  for (int ieta = startEta; ieta < startEta + nCellInEta; ieta++) {
450  for (int iphi = startPhi; iphi < startPhi + nCellInPhi; iphi++) {
451  uint32_t index;
452 
453  if (EEDetId::validDetId(ieta, iphi, CentralZ)) {
454  index = EEDetId(ieta, iphi, CentralZ).rawId();
455  } else {
456  continue;
457  }
458 
459  fillmap[i++] = themap[index];
460  }
461  }
462  uint32_t centerid = getUnitWithMaxEnergy(themap);
463 
464  if (fillmap[i / 2] == themap[centerid])
465  return true;
466  else
467  return false;
468 }
469 
471  int nCellInEta, int nCellInPhi, int CentralEta, int CentralPhi, int CentralZ, MapType &fillmap, MapType &themap) {
472  int goBackInEta = nCellInEta / 2;
473  int goBackInPhi = nCellInPhi / 2;
474 
475  int startEta = CentralZ * CentralEta - goBackInEta;
476  int startPhi = CentralPhi - goBackInPhi;
477 
478  int i = 0;
479  for (int ieta = startEta; ieta < startEta + nCellInEta; ieta++) {
480  for (int iphi = startPhi; iphi < startPhi + nCellInPhi; iphi++) {
481  uint32_t index;
482  if (abs(ieta) > 85 || abs(ieta) < 1) {
483  continue;
484  }
485  if (iphi < 1) {
486  index = EBDetId(ieta, iphi + 360).rawId();
487  } else if (iphi > 360) {
488  index = EBDetId(ieta, iphi - 360).rawId();
489  } else {
490  index = EBDetId(ieta, iphi).rawId();
491  }
492  fillmap[i++] = themap[index];
493  }
494  }
495 
496  uint32_t ebcenterid = getUnitWithMaxEnergy(themap);
497 
498  if (fillmap[i / 2] == themap[ebcenterid])
499  return true;
500  else
501  return false;
502 }
503 
505  float E22 = 0.;
506  float e012 = themap[0] + themap[1] + themap[2];
507  float e036 = themap[0] + themap[3] + themap[6];
508  float e678 = themap[6] + themap[7] + themap[8];
509  float e258 = themap[2] + themap[5] + themap[8];
510 
511  if ((e012 > e678 || e012 == e678) && (e036 > e258 || e036 == e258))
512  E22 = themap[0] + themap[1] + themap[3] + themap[4];
513  else if ((e012 > e678 || e012 == e678) && (e036 < e258 || e036 == e258))
514  E22 = themap[1] + themap[2] + themap[4] + themap[5];
515  else if ((e012 < e678 || e012 == e678) && (e036 > e258 || e036 == e258))
516  E22 = themap[3] + themap[4] + themap[6] + themap[7];
517  else if ((e012 < e678 || e012 == e678) && (e036 < e258 || e036 == e258))
518  E22 = themap[4] + themap[5] + themap[7] + themap[8];
519 
520  return E22;
521 }
522 
524  float E44 = 0.;
525  float e0_4 = themap[0] + themap[1] + themap[2] + themap[3] + themap[4];
526  float e0_20 = themap[0] + themap[5] + themap[10] + themap[15] + themap[20];
527  float e4_24 = themap[4] + themap[9] + themap[14] + themap[19] + themap[24];
528  float e0_24 = themap[20] + themap[21] + themap[22] + themap[23] + themap[24];
529 
530  if ((e0_4 > e0_24 || e0_4 == e0_24) && (e0_20 > e4_24 || e0_20 == e4_24))
531  E44 = e33 + themap[0] + themap[1] + themap[2] + themap[3] + themap[5] + themap[10] + themap[15];
532  else if ((e0_4 > e0_24 || e0_4 == e0_24) && (e0_20 < e4_24 || e0_20 == e4_24))
533  E44 = e33 + themap[1] + themap[2] + themap[3] + themap[4] + themap[9] + themap[14] + themap[19];
534  else if ((e0_4 < e0_24 || e0_4 == e0_24) && (e0_20 > e4_24 || e0_20 == e4_24))
535  E44 = e33 + themap[5] + themap[10] + themap[15] + themap[20] + themap[21] + themap[22] + themap[23];
536  else if ((e0_4 < e0_24 || e0_4 == e0_24) && (e0_20 < e4_24 || e0_20 == e4_24))
537  E44 = e33 + themap[21] + themap[22] + themap[23] + themap[24] + themap[9] + themap[14] + themap[19];
538 
539  return E44;
540 }
541 
543  int nCellInX, int nCellInY, int centralX, int centralY, int centralZ, MapType &themap) {
544  int ncristals = 0;
545  float totalEnergy = 0.;
546 
547  int goBackInX = nCellInX / 2;
548  int goBackInY = nCellInY / 2;
549  int startX = centralX - goBackInX;
550  int startY = centralY - goBackInY;
551 
552  for (int ix = startX; ix < startX + nCellInX; ix++) {
553  for (int iy = startY; iy < startY + nCellInY; iy++) {
554  uint32_t index;
555  if (EEDetId::validDetId(ix, iy, centralZ)) {
556  index = EEDetId(ix, iy, centralZ).rawId();
557  } else {
558  continue;
559  }
560 
561  totalEnergy += themap[index];
562  ncristals += 1;
563 
564  LogDebug("EcalSimHitsValidProducer")
565  << " EnergyInEEMatrix: ix - iy - E = " << ix << " " << iy << " " << themap[index];
566  }
567  }
568 
569  LogDebug("EcalSimHitsValidProducer") << " EnergyInEEMatrix: energy in " << nCellInX << " cells in x times "
570  << nCellInY << " cells in y matrix = " << totalEnergy << " for " << ncristals
571  << " crystals";
572 
573  return totalEnergy;
574 }
575 
577  int nCellInEta, int nCellInPhi, int centralEta, int centralPhi, int centralZ, MapType &themap) {
578  int ncristals = 0;
579  float totalEnergy = 0.;
580 
581  int goBackInEta = nCellInEta / 2;
582  int goBackInPhi = nCellInPhi / 2;
583  int startEta = centralZ * centralEta - goBackInEta;
584  int startPhi = centralPhi - goBackInPhi;
585 
586  for (int ieta = startEta; ieta < startEta + nCellInEta; ieta++) {
587  for (int iphi = startPhi; iphi < startPhi + nCellInPhi; iphi++) {
588  uint32_t index;
589  if (abs(ieta) > 85 || abs(ieta) < 1) {
590  continue;
591  }
592  if (iphi < 1) {
593  index = EBDetId(ieta, iphi + 360).rawId();
594  } else if (iphi > 360) {
595  index = EBDetId(ieta, iphi - 360).rawId();
596  } else {
597  index = EBDetId(ieta, iphi).rawId();
598  }
599 
600  totalEnergy += themap[index];
601  ncristals += 1;
602 
603  LogDebug("EcalSimHitsValidProducer")
604  << " EnergyInEBMatrix: ieta - iphi - E = " << ieta << " " << iphi << " " << themap[index];
605  }
606  }
607 
608  LogDebug("EcalSimHitsValidProducer") << " EnergyInEBMatrix: energy in " << nCellInEta << " cells in eta times "
609  << nCellInPhi << " cells in phi matrix = " << totalEnergy << " for " << ncristals
610  << " crystals";
611 
612  return totalEnergy;
613 }
614 
616  uint32_t unitWithMaxEnergy = 0;
617  float maxEnergy = 0.;
618 
619  MapType::iterator iter;
620  for (iter = themap.begin(); iter != themap.end(); iter++) {
621  if (maxEnergy < (*iter).second) {
622  maxEnergy = (*iter).second;
623  unitWithMaxEnergy = (*iter).first;
624  }
625  }
626 
627  LogDebug("EcalSimHitsValidProducer") << " Max energy of " << maxEnergy << " MeV was found in Unit id 0x" << std::hex
628  << unitWithMaxEnergy << std::dec;
629 
630  return unitWithMaxEnergy;
631 }
FloatVector eOfEEMinusCaloG4Hit
FloatVector eOfESCaloG4Hit
void update(const BeginOfEvent *) override
This routine will be called when the appropriate signal arrives.
int ietaAbs() const
get the absolute value of the crystal ieta
Definition: EBDetId.h:47
void setMT(bool val)
Definition: SimWatcher.h:44
FloatVector eOfEEPlusCaloG4Hit
FloatVector phiOfEECaloG4Hit
FloatVector tOfEECaloG4Hit
int iphi() const
get the crystal iphi
Definition: EBDetId.h:51
int ix() const
Definition: EEDetId.h:77
FloatVector etaOfEECaloG4Hit
FloatVector phiOfEBCaloG4Hit
math::XYZTLorentzVector theMomentum
double npart
Definition: HydjetWrapper.h:48
int zside() const
Definition: ESDetId.h:39
bool fillEEMatrix(int nCellInEta, int nCellInPhi, int CentralEta, int CentralPhi, int CentralZ, MapType &fillmap, MapType &themap)
FloatVector etaOfEBCaloG4Hit
math::XYZTLorentzVector theVertex
math::XYZTLorentzVector theMomentum
char const * label
math::XYZPoint getEntry() const
Definition: CaloG4Hit.h:46
void fillEventInfo(PEcalValidInfo &)
uint32_t getUnitWithMaxEnergy(MapType &themap)
int plane() const
Definition: ESDetId.h:41
T sqrt(T t)
Definition: SSEVec.h:23
bool fillEBMatrix(int nCellInEta, int nCellInPhi, int CentralEta, int CentralPhi, int CentralZ, MapType &fillmap, MapType &themap)
FloatVector eOfEBCaloG4Hit
float energyInEBMatrix(int nCellInX, int nCellInY, int centralX, int centralY, int centralZ, MapType &themap)
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
FloatVector phiOfESCaloG4Hit
std::map< uint32_t, float, std::less< uint32_t > > MapType
int zside() const
get the z-side of the crystal (1/-1)
Definition: EBDetId.h:45
float energyInEEMatrix(int nCellInX, int nCellInY, int centralX, int centralY, int centralZ, MapType &themap)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
int zside() const
Definition: EEDetId.h:71
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
double getEnergyDeposit() const
Definition: CaloG4Hit.h:79
math::XYZTLorentzVector theVertex
uint32_t getUnitID() const
Definition: CaloG4Hit.h:66
void produce(edm::Event &, const edm::EventSetup &) override
FloatVector etaOfESCaloG4Hit
float eCluster2x2(MapType &themap)
G4THitsCollection< CaloG4Hit > CaloG4HitCollection
double getTimeSlice() const
Definition: CaloG4Hit.h:67
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
FloatVector tOfESCaloG4Hit
Log< level::Warning, false > LogWarning
EcalSimHitsValidProducer(const edm::ParameterSet &)
FloatVector tOfEBCaloG4Hit
FloatVector eOfEECaloG4Hit
def move(src, dest)
Definition: eostools.py:511
int iy() const
Definition: EEDetId.h:83
float eCluster4x4(float e33, MapType &themap)
#define LogDebug(id)