CMS 3D CMS Logo

EcalHaloAlgo.cc
Go to the documentation of this file.
3 
4 /*
5  [class]: EcalHaloAlgo
6  [authors]: R. Remington, The University of Florida
7  [description]: See EcalHaloAlgo.h
8  [date]: October 15, 2009
9 */
10 namespace {
11  constexpr float c_cm_per_ns = 29.9792458;
12 };
13 using namespace std;
14 using namespace reco;
15 using namespace edm;
16 
17 bool CompareTime(const EcalRecHit* x, const EcalRecHit* y) { return x->time() < y->time(); }
18 
20  RoundnessCut = 0;
21  AngleCut = 0;
22  EBRecHitEnergyThreshold = 0.;
23  EERecHitEnergyThreshold = 0.;
24  ESRecHitEnergyThreshold = 0.;
25  SumEnergyThreshold = 0.;
26  NHitsThreshold = 0;
27 
28  geo = nullptr;
29 }
30 
34  edm::Handle<EBRecHitCollection>& TheEBRecHits,
35  edm::Handle<EERecHitCollection>& TheEERecHits,
36  edm::Handle<ESRecHitCollection>& TheESRecHits,
37  edm::Handle<HBHERecHitCollection>& TheHBHERecHits,
38  const edm::EventSetup& TheSetup) {
39  EcalHaloData TheEcalHaloData;
40 
41  // Store energy sum of rechits as a function of iPhi (iphi goes from 1 to 72)
42  float SumE[361];
43  // Store number of rechits as a function of iPhi
44  int NumHits[361];
45  // Store minimum time of rechit as a function of iPhi
46  float MinTimeHits[361];
47  // Store maximum time of rechit as a function of iPhi
48  float MaxTimeHits[361];
49 
50  // initialize
51  for (int i = 0; i < 361; i++) {
52  SumE[i] = 0.;
53  NumHits[i] = 0;
54  MinTimeHits[i] = 9999.;
55  MaxTimeHits[i] = -9999.;
56  }
57 
58  // Loop over EB RecHits
59  for (EBRecHitCollection::const_iterator hit = TheEBRecHits->begin(); hit != TheEBRecHits->end(); hit++) {
60  // Arbitrary threshold to kill noise (needs to be optimized with data)
61  if (hit->energy() < EBRecHitEnergyThreshold)
62  continue;
63 
64  // Get Det Id of the rechit
65  DetId id = DetId(hit->id());
66 
67  // Get EB geometry
68  const CaloSubdetectorGeometry* TheSubGeometry = TheCaloGeometry.getSubdetectorGeometry(DetId::Ecal, 1);
69  EBDetId EcalID(id.rawId());
70  auto cell = (TheSubGeometry) ? (TheSubGeometry->getGeometry(id)) : nullptr;
71 
72  if (cell) {
73  // GlobalPoint globalpos = cell->getPosition();
74  // float r = TMath::Sqrt ( globalpos.y()*globalpos.y() + globalpos.x()*globalpos.x());
75  int iPhi = EcalID.iphi();
76 
77  if (iPhi < 361) // just to be safe
78  {
79  //iPhi = (iPhi-1)/5 +1; // convert ecal iphi to phiwedge iphi (e.g. there are 5 crystal per phi wedge, as in calotowers )
80  SumE[iPhi] += hit->energy();
81  NumHits[iPhi]++;
82 
83  float time = hit->time();
84  MinTimeHits[iPhi] = time < MinTimeHits[iPhi] ? time : MinTimeHits[iPhi];
85  MaxTimeHits[iPhi] = time > MaxTimeHits[iPhi] ? time : MaxTimeHits[iPhi];
86  }
87  }
88  }
89 
90  //for( int iPhi = 1 ; iPhi < 73; iPhi++ )
91  for (int iPhi = 1; iPhi < 361; iPhi++) {
92  if (SumE[iPhi] >= SumEnergyThreshold && NumHits[iPhi] > NHitsThreshold) {
93  // Build PhiWedge and store to EcalHaloData if energy or #hits pass thresholds
94  PhiWedge wedge(SumE[iPhi], iPhi, NumHits[iPhi], MinTimeHits[iPhi], MaxTimeHits[iPhi]);
95 
96  // Loop over rechits again to calculate direction based on timing info
97 
98  // Loop over EB RecHits
99  std::vector<const EcalRecHit*> Hits;
100  for (EBRecHitCollection::const_iterator hit = TheEBRecHits->begin(); hit != TheEBRecHits->end(); hit++) {
101  if (hit->energy() < EBRecHitEnergyThreshold)
102  continue;
103 
104  // Get Det Id of the rechit
105  DetId id = DetId(hit->id());
106  EBDetId EcalID(id.rawId());
107  int Hit_iPhi = EcalID.iphi();
108  //Hit_iPhi = (Hit_iPhi-1)/5 +1; // convert ecal iphi to phiwedge iphi
109  if (Hit_iPhi != iPhi)
110  continue;
111  Hits.push_back(&(*hit));
112  }
113  std::sort(Hits.begin(), Hits.end(), CompareTime);
114  float MinusToPlus = 0.;
115  float PlusToMinus = 0.;
116  for (unsigned int i = 0; i < Hits.size(); i++) {
117  DetId id_i = DetId(Hits[i]->id());
118  EBDetId EcalID_i(id_i.rawId());
119  int ieta_i = EcalID_i.ieta();
120  for (unsigned int j = (i + 1); j < Hits.size(); j++) {
121  DetId id_j = DetId(Hits[j]->id());
122  EBDetId EcalID_j(id_j.rawId());
123  int ieta_j = EcalID_j.ieta();
124  if (ieta_i > ieta_j)
125  PlusToMinus += TMath::Abs(ieta_j - ieta_i);
126  else
127  MinusToPlus += TMath::Abs(ieta_j - ieta_i);
128  }
129  }
130 
131  float PlusZOriginConfidence = (PlusToMinus + MinusToPlus) ? PlusToMinus / (PlusToMinus + MinusToPlus) : -1.;
132  wedge.SetPlusZOriginConfidence(PlusZOriginConfidence);
133  TheEcalHaloData.GetPhiWedges().push_back(wedge);
134  }
135  }
136 
137  std::vector<float> vShowerShapes_Roundness;
138  std::vector<float> vShowerShapes_Angle;
139  if (TheSuperClusters.isValid()) {
140  for (reco::SuperClusterCollection::const_iterator cluster = TheSuperClusters->begin();
141  cluster != TheSuperClusters->end();
142  cluster++) {
143  if (abs(cluster->eta()) <= 1.48) {
144  vector<float> shapes = EcalClusterTools::roundnessBarrelSuperClusters(*cluster, (*TheEBRecHits.product()));
145  float roundness = shapes[0];
146  float angle = shapes[1];
147 
148  // Check if supercluster belongs to photon and passes the cuts on roundness and angle, if so store the reference to it
149  if ((roundness >= 0 && roundness < GetRoundnessCut()) && angle >= 0 && angle < GetAngleCut()) {
150  edm::Ref<SuperClusterCollection> TheClusterRef(TheSuperClusters, cluster - TheSuperClusters->begin());
151  bool BelongsToPhoton = false;
152  if (ThePhotons.isValid()) {
153  for (reco::PhotonCollection::const_iterator iPhoton = ThePhotons->begin(); iPhoton != ThePhotons->end();
154  iPhoton++) {
155  if (iPhoton->isEB())
156  if (TheClusterRef == iPhoton->superCluster()) {
157  BelongsToPhoton = true;
158  break;
159  }
160  }
161  }
162  //Only store refs to suspicious EB SuperClusters which belong to Photons
163  //Showershape variables are more discriminating for these cases
164  if (BelongsToPhoton) {
165  TheEcalHaloData.GetSuperClusters().push_back(TheClusterRef);
166  }
167  }
168  vShowerShapes_Roundness.push_back(shapes[0]);
169  vShowerShapes_Angle.push_back(shapes[1]);
170  } else {
171  vShowerShapes_Roundness.push_back(-1.);
172  vShowerShapes_Angle.push_back(-1.);
173  }
174  }
175 
176  edm::ValueMap<float>::Filler TheRoundnessFiller(TheEcalHaloData.GetShowerShapesRoundness());
177  TheRoundnessFiller.insert(TheSuperClusters, vShowerShapes_Roundness.begin(), vShowerShapes_Roundness.end());
178  TheRoundnessFiller.fill();
179 
180  edm::ValueMap<float>::Filler TheAngleFiller(TheEcalHaloData.GetShowerShapesAngle());
181  TheAngleFiller.insert(TheSuperClusters, vShowerShapes_Angle.begin(), vShowerShapes_Angle.end());
182  TheAngleFiller.fill();
183  }
184 
186  TheSetup.get<CaloGeometryRecord>().get(pGeo);
187  geo = pGeo.product();
188 
189  //Halo cluster building:
190  //Various clusters are built, depending on the subdetector.
191  //In barrel, one looks for deposits narrow in phi.
192  //In endcaps, one looks for localized deposits (dr condition in EE where r =sqrt(dphi*dphi+deta*deta)
193  //H/E condition is also applied in EB.
194  //The halo cluster building step targets a large efficiency (ideally >99%) for beam halo deposits.
195  //These clusters are used as input for the halo pattern finding methods in EcalHaloAlgo and for the CSC-calo matching methods in GlobalHaloAlgo.
196 
197  //Et threshold hardcoded for now. Might one to get it from config
198  std::vector<HaloClusterCandidateECAL> haloclustercands_EB;
199  haloclustercands_EB = GetHaloClusterCandidateEB(TheEBRecHits, TheHBHERecHits, 5);
200 
201  std::vector<HaloClusterCandidateECAL> haloclustercands_EE;
202  haloclustercands_EE = GetHaloClusterCandidateEE(TheEERecHits, TheHBHERecHits, 10);
203 
204  TheEcalHaloData.setHaloClusterCandidatesEB(haloclustercands_EB);
205  TheEcalHaloData.setHaloClusterCandidatesEE(haloclustercands_EE);
206 
207  return TheEcalHaloData;
208 }
209 
210 std::vector<HaloClusterCandidateECAL> EcalHaloAlgo::GetHaloClusterCandidateEB(
211  edm::Handle<EcalRecHitCollection>& ecalrechitcoll,
212  edm::Handle<HBHERecHitCollection>& hbherechitcoll,
213  float et_thresh_seedrh) {
214  std::vector<HaloClusterCandidateECAL> TheHaloClusterCandsEB;
215  reco::Vertex::Point vtx(0, 0, 0);
216 
217  for (size_t ihit = 0; ihit < ecalrechitcoll->size(); ++ihit) {
218  HaloClusterCandidateECAL clustercand;
219 
220  const EcalRecHit& rechit = (*ecalrechitcoll)[ihit];
221  math::XYZPoint rhpos = getPosition(rechit.id(), vtx);
222  //Et condition
223 
224  double rhet = rechit.energy() * sqrt(rhpos.perp2() / rhpos.mag2());
225  if (rhet < et_thresh_seedrh)
226  continue;
227  double eta = rhpos.eta();
228  double phi = rhpos.phi();
229 
230  bool isiso = true;
231  double etcluster(0);
232  int nbcrystalsameeta(0);
233  double timediscriminator(0);
234  double etstrip_iphiseedplus1(0), etstrip_iphiseedminus1(0);
235 
236  //Building the cluster
238  for (size_t jhit = 0; jhit < ecalrechitcoll->size(); ++jhit) {
239  const EcalRecHit& rechitj = (*ecalrechitcoll)[jhit];
240  EcalRecHitRef rhRef(ecalrechitcoll, jhit);
241  math::XYZPoint rhposj = getPosition(rechitj.id(), vtx);
242 
243  double etaj = rhposj.eta();
244  double phij = rhposj.phi();
245 
246  double deta = eta - etaj;
247  double dphi = deltaPhi(phi, phij);
248  if (std::abs(deta) > 0.2)
249  continue; //This means +/-11 crystals in eta
250  if (std::abs(dphi) > 0.08)
251  continue; //This means +/-4 crystals in phi
252 
253  double rhetj = rechitj.energy() * sqrt(rhposj.perp2() / rhposj.mag2());
254  //Rechits with et between 1 and 2 GeV are saved in the rh list but not used in the calculation of the halocluster variables
255  if (rhetj < 1)
256  continue;
257  bhrhcandidates.push_back(rhRef);
258  if (rhetj < 2)
259  continue;
260 
261  if (std::abs(dphi) > 0.03) {
262  isiso = false;
263  break;
264  } //The strip should be isolated
265  if (std::abs(dphi) < 0.01)
266  nbcrystalsameeta++;
267  if (dphi > 0.01)
268  etstrip_iphiseedplus1 += rhetj;
269  if (dphi < -0.01)
270  etstrip_iphiseedminus1 += rhetj;
271  etcluster += rhetj;
272  //Timing discriminator
273  //We assign a weight to the rechit defined as:
274  //Log10(Et)*f(T,R,Z)
275  //where f(T,R,Z) is the separation curve between halo-like and IP-like times.
276  //The time difference between a deposit from a outgoing IT halo and a deposit coming from a particle emitted at the IP is given by:
277  //dt= ( - sqrt(R^2+z^2) + |z| )/c
278  //Here we take R to be 130 cm.
279  //For EB, the function was parametrized as a function of ieta instead of Z.
280  double rhtj = rechitj.time();
281  EBDetId detj = rechitj.id();
282  int rhietaj = detj.ieta();
283  timediscriminator += std::log10(rhetj) *
284  (rhtj + 0.5 * (sqrt(16900 + 9 * rhietaj * rhietaj) - 3 * std::abs(rhietaj)) / c_cm_per_ns);
285  }
286  //Isolation condition
287  if (!isiso)
288  continue;
289 
290  //Calculate H/E
291  double hoe(0);
292  for (size_t jhit = 0; jhit < hbherechitcoll->size(); ++jhit) {
293  const HBHERecHit& rechitj = (*hbherechitcoll)[jhit];
294  math::XYZPoint rhposj = getPosition(rechitj.id(), vtx);
295  double rhetj = rechitj.energy() * sqrt(rhposj.perp2() / rhposj.mag2());
296  if (rhetj < 2)
297  continue;
298  double etaj = rhposj.eta();
299  double phij = rhposj.phi();
300  double deta = eta - etaj;
301  double dphi = deltaPhi(phi, phij);
302  if (std::abs(deta) > 0.2)
303  continue;
304  if (std::abs(dphi) > 0.2)
305  continue;
306  hoe += rhetj / etcluster;
307  }
308  //H/E condition
309  if (hoe > 0.1)
310  continue;
311 
312  clustercand.setClusterEt(etcluster);
313  clustercand.setSeedEt(rhet);
314  clustercand.setSeedEta(eta);
315  clustercand.setSeedPhi(phi);
316  clustercand.setSeedZ(rhpos.Z());
317  clustercand.setSeedR(sqrt(rhpos.perp2()));
318  clustercand.setSeedTime(rechit.time());
319  clustercand.setHoverE(hoe);
320  clustercand.setNbofCrystalsInEta(nbcrystalsameeta);
321  clustercand.setEtStripIPhiSeedPlus1(etstrip_iphiseedplus1);
322  clustercand.setEtStripIPhiSeedMinus1(etstrip_iphiseedminus1);
323  clustercand.setTimeDiscriminator(timediscriminator);
324  clustercand.setBeamHaloRecHitsCandidates(bhrhcandidates);
325 
326  bool isbeamhalofrompattern = EBClusterShapeandTimeStudy(clustercand, false);
327  clustercand.setIsHaloFromPattern(isbeamhalofrompattern);
328 
329  bool isbeamhalofrompattern_hlt = EBClusterShapeandTimeStudy(clustercand, true);
330  clustercand.setIsHaloFromPattern_HLT(isbeamhalofrompattern_hlt);
331 
332  TheHaloClusterCandsEB.push_back(clustercand);
333  }
334 
335  return TheHaloClusterCandsEB;
336 }
337 
338 std::vector<HaloClusterCandidateECAL> EcalHaloAlgo::GetHaloClusterCandidateEE(
339  edm::Handle<EcalRecHitCollection>& ecalrechitcoll,
340  edm::Handle<HBHERecHitCollection>& hbherechitcoll,
341  float et_thresh_seedrh) {
342  std::vector<HaloClusterCandidateECAL> TheHaloClusterCandsEE;
343 
344  reco::Vertex::Point vtx(0, 0, 0);
345 
346  for (size_t ihit = 0; ihit < ecalrechitcoll->size(); ++ihit) {
347  HaloClusterCandidateECAL clustercand;
348 
349  const EcalRecHit& rechit = (*ecalrechitcoll)[ihit];
350  math::XYZPoint rhpos = getPosition(rechit.id(), vtx);
351  //Et condition
352  double rhet = rechit.energy() * sqrt(rhpos.perp2() / rhpos.mag2());
353  if (rhet < et_thresh_seedrh)
354  continue;
355  double eta = rhpos.eta();
356  double phi = rhpos.phi();
357  double rhr = sqrt(rhpos.perp2());
358 
359  bool isiso = true;
360  double etcluster(0);
361  double timediscriminator(0);
362  int clustersize(0);
363  int nbcrystalssmallt(0);
364  int nbcrystalshight(0);
365  //Building the cluster
367  for (size_t jhit = 0; jhit < ecalrechitcoll->size(); ++jhit) {
368  const EcalRecHit& rechitj = (*ecalrechitcoll)[jhit];
369  EcalRecHitRef rhRef(ecalrechitcoll, jhit);
370  math::XYZPoint rhposj = getPosition(rechitj.id(), vtx);
371 
372  //Ask the hits to be in the same endcap
373  if (rhposj.z() * rhpos.z() < 0)
374  continue;
375 
376  double etaj = rhposj.eta();
377  double phij = rhposj.phi();
378  double dr = sqrt((eta - etaj) * (eta - etaj) + deltaPhi(phi, phij) * deltaPhi(phi, phij));
379 
380  //Outer cone
381  if (dr > 0.3)
382  continue;
383 
384  double rhetj = rechitj.energy() * sqrt(rhposj.perp2() / rhposj.mag2());
385  //Rechits with et between 1 and 2 GeV are saved in the rh list but not used in the calculation of the halocluster variables
386  if (rhetj < 1)
387  continue;
388  bhrhcandidates.push_back(rhRef);
389  if (rhetj < 2)
390  continue;
391 
392  //Isolation between outer and inner cone
393  if (dr > 0.05) {
394  isiso = false;
395  break;
396  } //The deposit should be isolated
397 
398  etcluster += rhetj;
399 
400  //Timing infos:
401  //Here we target both IT and OT beam halo
402  double rhtj = rechitj.time();
403 
404  //Discriminating variables for OT beam halo:
405  if (rhtj > 1)
406  nbcrystalshight++;
407  if (rhtj < 0)
408  nbcrystalssmallt++;
409  //Timing test (likelihood ratio), only for seeds with large R (100 cm) and for crystals with et>5,
410  //This targets IT beam halo (t around - 1ns)
411  if (rhtj > 5) {
412  double corrt_j = rhtj + sqrt(rhposj.x() * rhposj.x() + rhposj.y() * rhposj.y() + 320. * 320.) / c_cm_per_ns -
413  320. / c_cm_per_ns;
414  //BH is modeled by a Gaussian peaking at 0.
415  //Collisions is modeled by a Gaussian peaking at 0.3
416  //The width is similar and taken to be 0.4
417  timediscriminator += 0.5 * (pow((corrt_j - 0.3) / 0.4, 2) - pow((corrt_j - 0.) / 0.4, 2));
418  clustersize++;
419  }
420  }
421  //Isolation condition
422  if (!isiso)
423  continue;
424 
425  //Calculate H2/E
426  //Only second hcal layer is considered as it can happen that a shower initiated in EE reaches HCAL first layer
427  double h2oe(0);
428  for (size_t jhit = 0; jhit < hbherechitcoll->size(); ++jhit) {
429  const HBHERecHit& rechitj = (*hbherechitcoll)[jhit];
430  math::XYZPoint rhposj = getPosition(rechitj.id(), vtx);
431 
432  //Ask the hits to be in the same endcap
433  if (rhposj.z() * rhpos.z() < 0)
434  continue;
435  //Selects only second HCAL layer
436  if (std::abs(rhposj.z()) < 425)
437  continue;
438 
439  double rhetj = rechitj.energy() * sqrt(rhposj.perp2() / rhposj.mag2());
440  if (rhetj < 2)
441  continue;
442 
443  double phij = rhposj.phi();
444  if (std::abs(deltaPhi(phi, phij)) > 0.4)
445  continue;
446 
447  double rhrj = sqrt(rhposj.perp2());
448  if (std::abs(rhr - rhrj) > 50)
449  continue;
450 
451  h2oe += rhetj / etcluster;
452  }
453  //H/E condition
454  if (h2oe > 0.1)
455  continue;
456 
457  clustercand.setClusterEt(etcluster);
458  clustercand.setSeedEt(rhet);
459  clustercand.setSeedEta(eta);
460  clustercand.setSeedPhi(phi);
461  clustercand.setSeedZ(rhpos.Z());
462  clustercand.setSeedR(sqrt(rhpos.perp2()));
463  clustercand.setSeedTime(rechit.time());
464  clustercand.setH2overE(h2oe);
465  clustercand.setNbEarlyCrystals(nbcrystalssmallt);
466  clustercand.setNbLateCrystals(nbcrystalshight);
467  clustercand.setClusterSize(clustersize);
468  clustercand.setTimeDiscriminator(timediscriminator);
469  clustercand.setBeamHaloRecHitsCandidates(bhrhcandidates);
470 
471  bool isbeamhalofrompattern =
472  EEClusterShapeandTimeStudy_ITBH(clustercand, false) || EEClusterShapeandTimeStudy_OTBH(clustercand, false);
473  clustercand.setIsHaloFromPattern(isbeamhalofrompattern);
474 
475  bool isbeamhalofrompattern_hlt =
476  EEClusterShapeandTimeStudy_ITBH(clustercand, true) || EEClusterShapeandTimeStudy_OTBH(clustercand, true);
477  clustercand.setIsHaloFromPattern_HLT(isbeamhalofrompattern_hlt);
478 
479  TheHaloClusterCandsEE.push_back(clustercand);
480  }
481 
482  return TheHaloClusterCandsEE;
483 }
484 
486  //Conditions on the central strip size in eta.
487  //For low size, extra conditions on seed et, isolation and cluster timing
488  //The time condition only targets IT beam halo.
489  //EB rechits from OT beam halos are typically too late (around 5 ns or more) and seem therefore already cleaned by the reconstruction.
490 
491  if (hcand.getSeedEt() < 5)
492  return false;
493  if (hcand.getNbofCrystalsInEta() < 4)
494  return false;
495  if (hcand.getNbofCrystalsInEta() == 4 && hcand.getSeedEt() < 10)
496  return false;
497  if (hcand.getNbofCrystalsInEta() == 4 && hcand.getEtStripIPhiSeedPlus1() > 0.1 &&
498  hcand.getEtStripIPhiSeedMinus1() > 0.1)
499  return false;
500  if (hcand.getNbofCrystalsInEta() <= 5 && hcand.getTimeDiscriminator() >= 0.)
501  return false;
502 
503  //For HLT, only use conditions without timing and tighten seed et condition
504  if (ishlt && hcand.getNbofCrystalsInEta() <= 5)
505  return false;
506  if (ishlt && hcand.getSeedEt() < 10)
507  return false;
508 
509  hcand.setIsHaloFromPattern(true);
510 
511  return true;
512 }
513 
515  //Separate conditions targeting IT and OT beam halos
516  //For OT beam halos, just require enough crystals with large T
517  if (hcand.getSeedEt() < 20)
518  return false;
519  if (hcand.getSeedTime() < 0.5)
520  return false;
521  if (hcand.getNbLateCrystals() - hcand.getNbEarlyCrystals() < 2)
522  return false;
523 
524  //The use of time information does not allow this method to work at HLT
525  if (ishlt)
526  return false;
527 
528  hcand.setIsHaloFromPattern(true);
529 
530  return true;
531 }
532 
534  //Separate conditions targeting IT and OT beam halos
535  //For IT beam halos, fakes from collisions are higher => require the cluster size to be small.
536  //Only halos with R>100 cm are considered here.
537  //For lower values, the time difference with particles from collisions is too small
538  //IT outgoing beam halos that interact in EE at low R is probably the most difficult category to deal with:
539  //Their signature is very close to the one of photon from collisions (similar cluster shape and timing)
540  if (hcand.getSeedEt() < 20)
541  return false;
542  if (hcand.getSeedR() < 100)
543  return false;
544  if (hcand.getTimeDiscriminator() < 1)
545  return false;
546  if (hcand.getClusterSize() < 2)
547  return false;
548  if (hcand.getClusterSize() > 4)
549  return false;
550 
551  //The use of time information does not allow this method to work at HLT
552  if (ishlt)
553  return false;
554 
555  hcand.setIsHaloFromPattern(true);
556 
557  return true;
558 }
559 
561  const GlobalPoint& pos = geo->getPosition(id);
562  math::XYZPoint posV(pos.x() - vtx.x(), pos.y() - vtx.y(), pos.z() - vtx.z());
563  return posV;
564 }
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
EcalHaloAlgo::EEClusterShapeandTimeStudy_OTBH
bool EEClusterShapeandTimeStudy_OTBH(reco::HaloClusterCandidateECAL hcand, bool ishlt)
Definition: EcalHaloAlgo.cc:514
reco::HaloClusterCandidateECAL::setNbEarlyCrystals
void setNbEarlyCrystals(int x)
Definition: HaloClusterCandidateECAL.h:67
EcalRecHit
Definition: EcalRecHit.h:15
EBDetId::ieta
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49
edm::helper::Filler::insert
void insert(const H &h, I begin, I end)
Definition: ValueMap.h:53
mps_fire.i
i
Definition: mps_fire.py:355
edm::SortedCollection< EcalRecHit >::const_iterator
std::vector< EcalRecHit >::const_iterator const_iterator
Definition: SortedCollection.h:80
hit::id
unsigned int id
Definition: SiStripHitEffFromCalibTree.cc:92
CaloRecHit::energy
constexpr float energy() const
Definition: CaloRecHit.h:29
edm::Handle::product
T const * product() const
Definition: Handle.h:70
reco::HaloClusterCandidateECAL::setSeedR
void setSeedR(double x)
Definition: HaloClusterCandidateECAL.h:54
EcalRecHit::id
DetId id() const
get the id
Definition: EcalRecHit.h:77
reco::HaloClusterCandidateECAL::getSeedEt
double getSeedEt() const
Definition: HaloClusterCandidateECAL.h:27
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
EBDetId
Definition: EBDetId.h:17
edm
HLT enums.
Definition: AlignableModifier.h:19
HBHERecHit
Definition: HBHERecHit.h:13
reco::EcalHaloData::GetShowerShapesAngle
edm::ValueMap< float > & GetShowerShapesAngle()
Definition: EcalHaloData.h:44
pos
Definition: PixelAliasList.h:18
reco::HaloClusterCandidateECAL::setSeedTime
void setSeedTime(double x)
Definition: HaloClusterCandidateECAL.h:55
reco::HaloClusterCandidateECAL::setTimeDiscriminator
void setTimeDiscriminator(double x)
Definition: HaloClusterCandidateECAL.h:56
reco::HaloClusterCandidateECAL::getSeedTime
double getSeedTime() const
Definition: HaloClusterCandidateECAL.h:32
CaloGeometry::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
edm::SortedCollection::size
size_type size() const
Definition: SortedCollection.h:215
edm::RefVector
Definition: EDProductfwd.h:27
EcalRecHit::energy
float energy() const
Definition: EcalRecHit.h:68
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle< reco::PhotonCollection >
reco::HaloClusterCandidateECAL::getNbLateCrystals
int getNbLateCrystals() const
Definition: HaloClusterCandidateECAL.h:46
reco::HaloClusterCandidateECAL::getTimeDiscriminator
double getTimeDiscriminator() const
Definition: HaloClusterCandidateECAL.h:33
reco::HaloClusterCandidateECAL::setSeedEta
void setSeedEta(double x)
Definition: HaloClusterCandidateECAL.h:51
reco::HaloClusterCandidateECAL::setIsHaloFromPattern_HLT
void setIsHaloFromPattern_HLT(bool x)
Definition: HaloClusterCandidateECAL.h:58
edm::Ref< SuperClusterCollection >
reco::HaloClusterCandidateECAL::setSeedZ
void setSeedZ(double x)
Definition: HaloClusterCandidateECAL.h:53
EcalHaloAlgo::EEClusterShapeandTimeStudy_ITBH
bool EEClusterShapeandTimeStudy_ITBH(reco::HaloClusterCandidateECAL hcand, bool ishlt)
Definition: EcalHaloAlgo.cc:533
DetId
Definition: DetId.h:17
reco::EcalHaloData::setHaloClusterCandidatesEE
void setHaloClusterCandidatesEE(const std::vector< HaloClusterCandidateECAL > &x)
Definition: EcalHaloData.h:53
EcalHaloAlgo.h
CaloGeometry
Definition: CaloGeometry.h:21
reco::HaloClusterCandidateECAL::setBeamHaloRecHitsCandidates
void setBeamHaloRecHitsCandidates(edm::RefVector< EcalRecHitCollection > x)
Definition: HaloClusterCandidateECAL.h:59
reco::PhiWedge
Definition: PhiWedge.h:13
reco::HaloClusterCandidateECAL::getEtStripIPhiSeedPlus1
double getEtStripIPhiSeedPlus1() const
Definition: HaloClusterCandidateECAL.h:39
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
Abs
T Abs(T a)
Definition: MathUtil.h:49
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
EcalHaloAlgo::EBClusterShapeandTimeStudy
bool EBClusterShapeandTimeStudy(reco::HaloClusterCandidateECAL hcand, bool ishlt)
Definition: EcalHaloAlgo.cc:485
EcalRecHit::time
float time() const
Definition: EcalRecHit.h:70
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
PVValHelper::eta
Definition: PVValidationHelpers.h:69
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
edm::ESHandle< CaloGeometry >
EcalHaloAlgo::getPosition
math::XYZPoint getPosition(const DetId &id, reco::Vertex::Point vtx)
Definition: EcalHaloAlgo.cc:560
EcalHaloAlgo::EcalHaloAlgo
EcalHaloAlgo()
Definition: EcalHaloAlgo.cc:19
Point3DBase< float, GlobalTag >
reco::HaloClusterCandidateECAL::setSeedPhi
void setSeedPhi(double x)
Definition: HaloClusterCandidateECAL.h:52
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition: badGlobalMuonTaggersAOD_cff.py:5
EcalHaloAlgo::GetHaloClusterCandidateEB
std::vector< reco::HaloClusterCandidateECAL > GetHaloClusterCandidateEB(edm::Handle< EcalRecHitCollection > &ecalrechitcoll, edm::Handle< HBHERecHitCollection > &hbherechitcoll, float et_thresh_seedrh)
Definition: EcalHaloAlgo.cc:210
EcalHaloAlgo::GetHaloClusterCandidateEE
std::vector< reco::HaloClusterCandidateECAL > GetHaloClusterCandidateEE(edm::Handle< EcalRecHitCollection > &ecalrechitcoll, edm::Handle< HBHERecHitCollection > &hbherechitcoll, float et_thresh_seedrh)
Definition: EcalHaloAlgo.cc:338
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
reco::HaloClusterCandidateECAL::getSeedR
double getSeedR() const
Definition: HaloClusterCandidateECAL.h:31
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
reco::HaloClusterCandidateECAL::setEtStripIPhiSeedPlus1
void setEtStripIPhiSeedPlus1(double x)
Definition: HaloClusterCandidateECAL.h:61
EcalHaloAlgo::Calculate
reco::EcalHaloData Calculate(const CaloGeometry &TheCaloGeometry, edm::Handle< reco::PhotonCollection > &ThePhotons, edm::Handle< reco::SuperClusterCollection > &TheSuperClusters, edm::Handle< EBRecHitCollection > &TheEBRecHits, edm::Handle< EERecHitCollection > &TheEERecHits, edm::Handle< ESRecHitCollection > &TheESRecHits, edm::Handle< HBHERecHitCollection > &TheHBHERecHits, const edm::EventSetup &TheSetup)
Definition: EcalHaloAlgo.cc:31
reco::HaloClusterCandidateECAL
Definition: HaloClusterCandidateECAL.h:21
reco::HaloClusterCandidateECAL::getEtStripIPhiSeedMinus1
double getEtStripIPhiSeedMinus1() const
Definition: HaloClusterCandidateECAL.h:40
reco::EcalHaloData
Definition: EcalHaloData.h:21
reco::EcalHaloData::setHaloClusterCandidatesEB
void setHaloClusterCandidatesEB(const std::vector< HaloClusterCandidateECAL > &x)
Definition: EcalHaloData.h:52
edm::EventSetup
Definition: EventSetup.h:57
DetId::Ecal
Definition: DetId.h:27
get
#define get
edm::RefVector::push_back
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67
reco::HaloClusterCandidateECAL::getNbEarlyCrystals
int getNbEarlyCrystals() const
Definition: HaloClusterCandidateECAL.h:45
reco::HaloClusterCandidateECAL::setClusterEt
void setClusterEt(double x)
Definition: HaloClusterCandidateECAL.h:49
electrons_cff.hoe
hoe
Definition: electrons_cff.py:404
ValueMap.h
reco::HaloClusterCandidateECAL::setIsHaloFromPattern
void setIsHaloFromPattern(bool x)
Definition: HaloClusterCandidateECAL.h:57
reco::Vertex::Point
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
std
Definition: JetResolutionObject.h:76
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
reco::HaloClusterCandidateECAL::setSeedEt
void setSeedEt(double x)
Definition: HaloClusterCandidateECAL.h:50
CompareTime
bool CompareTime(const EcalRecHit *x, const EcalRecHit *y)
Definition: EcalHaloAlgo.cc:17
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
reco::EcalHaloData::GetSuperClusters
edm::RefVector< reco::SuperClusterCollection > & GetSuperClusters()
Definition: EcalHaloData.h:37
reco::HaloClusterCandidateECAL::setNbofCrystalsInEta
void setNbofCrystalsInEta(double x)
Definition: HaloClusterCandidateECAL.h:64
angle
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
reco::HaloClusterCandidateECAL::getNbofCrystalsInEta
int getNbofCrystalsInEta() const
Definition: HaloClusterCandidateECAL.h:42
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
EBDetId::iphi
int iphi() const
get the crystal iphi
Definition: EBDetId.h:51
reco::HaloClusterCandidateECAL::setH2overE
void setH2overE(double x)
Definition: HaloClusterCandidateECAL.h:66
edm::helper::Filler
Definition: ValueMap.h:22
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::PhiWedge::SetPlusZOriginConfidence
void SetPlusZOriginConfidence(float x)
Definition: PhiWedge.h:69
reco::HaloClusterCandidateECAL::setClusterSize
void setClusterSize(int x)
Definition: HaloClusterCandidateECAL.h:69
reco::EcalHaloData::GetShowerShapesRoundness
edm::ValueMap< float > & GetShowerShapesRoundness()
Definition: EcalHaloData.h:41
HBHERecHit::id
constexpr HcalDetId id() const
get the id
Definition: HBHERecHit.h:39
reco::HaloClusterCandidateECAL::setEtStripIPhiSeedMinus1
void setEtStripIPhiSeedMinus1(double x)
Definition: HaloClusterCandidateECAL.h:62
reco::HaloClusterCandidateECAL::setNbLateCrystals
void setNbLateCrystals(int x)
Definition: HaloClusterCandidateECAL.h:68
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
ntuplemaker.time
time
Definition: ntuplemaker.py:310
reco::HaloClusterCandidateECAL::getClusterSize
int getClusterSize() const
Definition: HaloClusterCandidateECAL.h:47
reco::HaloClusterCandidateECAL::setHoverE
void setHoverE(double x)
Definition: HaloClusterCandidateECAL.h:63
hit
Definition: SiStripHitEffFromCalibTree.cc:88
reco::EcalHaloData::GetPhiWedges
const std::vector< PhiWedge > & GetPhiWedges() const
Definition: EcalHaloData.h:33