12 constexpr
float c_cm_per_ns = 29.9792458;
47 float MinTimeHits[361];
49 float MaxTimeHits[361];
52 for (
int i = 0;
i < 361;
i++) {
55 MinTimeHits[
i] = 9999.;
56 MaxTimeHits[
i] = -9999.;
71 auto cell = (TheSubGeometry) ? (TheSubGeometry->getGeometry(
id)) :
nullptr;
76 int iPhi = EcalID.
iphi();
81 SumE[iPhi] +=
hit->energy();
85 MinTimeHits[iPhi] =
time < MinTimeHits[iPhi] ?
time : MinTimeHits[iPhi];
86 MaxTimeHits[iPhi] =
time > MaxTimeHits[iPhi] ?
time : MaxTimeHits[iPhi];
92 for (
int iPhi = 1; iPhi < 361; iPhi++) {
95 PhiWedge wedge(SumE[iPhi], iPhi, NumHits[iPhi], MinTimeHits[iPhi], MaxTimeHits[iPhi]);
100 std::vector<const EcalRecHit*> Hits;
108 int Hit_iPhi = EcalID.iphi();
110 if (Hit_iPhi != iPhi)
112 Hits.push_back(&(*
hit));
115 float MinusToPlus = 0.;
116 float PlusToMinus = 0.;
117 for (
unsigned int i = 0;
i < Hits.size();
i++) {
120 int ieta_i = EcalID_i.
ieta();
121 for (
unsigned int j = (
i + 1);
j < Hits.size();
j++) {
124 int ieta_j = EcalID_j.
ieta();
132 float PlusZOriginConfidence = (PlusToMinus + MinusToPlus) ? PlusToMinus / (PlusToMinus + MinusToPlus) : -1.;
138 std::vector<float> vShowerShapes_Roundness;
139 std::vector<float> vShowerShapes_Angle;
140 if (TheSuperClusters.
isValid()) {
141 for (reco::SuperClusterCollection::const_iterator cluster = TheSuperClusters->begin();
142 cluster != TheSuperClusters->end();
144 if (
abs(cluster->eta()) <= 1.48) {
145 vector<float> shapes = EcalClusterTools::roundnessBarrelSuperClusters(*cluster, (*TheEBRecHits.
product()));
146 float roundness = shapes[0];
147 float angle = shapes[1];
152 bool BelongsToPhoton =
false;
154 for (reco::PhotonCollection::const_iterator iPhoton = ThePhotons->begin(); iPhoton != ThePhotons->end();
157 if (TheClusterRef == iPhoton->superCluster()) {
158 BelongsToPhoton =
true;
165 if (BelongsToPhoton) {
169 vShowerShapes_Roundness.push_back(shapes[0]);
170 vShowerShapes_Angle.push_back(shapes[1]);
172 vShowerShapes_Roundness.push_back(-1.);
173 vShowerShapes_Angle.push_back(-1.);
178 TheRoundnessFiller.
insert(TheSuperClusters, vShowerShapes_Roundness.begin(), vShowerShapes_Roundness.end());
179 TheRoundnessFiller.fill();
182 TheAngleFiller.
insert(TheSuperClusters, vShowerShapes_Angle.begin(), vShowerShapes_Angle.end());
183 TheAngleFiller.fill();
197 std::vector<HaloClusterCandidateECAL> haloclustercands_EB;
200 std::vector<HaloClusterCandidateECAL> haloclustercands_EE;
206 return TheEcalHaloData;
212 float et_thresh_seedrh) {
213 std::vector<HaloClusterCandidateECAL> TheHaloClusterCandsEB;
216 for (
size_t ihit = 0; ihit < ecalrechitcoll->
size(); ++ihit) {
219 const EcalRecHit& rechit = (*ecalrechitcoll)[ihit];
223 double rhet = rechit.
energy() *
sqrt(rhpos.perp2() / rhpos.mag2());
224 if (rhet < et_thresh_seedrh)
226 double eta = rhpos.eta();
227 double phi = rhpos.phi();
231 int nbcrystalsameeta(0);
232 double timediscriminator(0);
233 double etstrip_iphiseedplus1(0), etstrip_iphiseedminus1(0);
237 for (
size_t jhit = 0; jhit < ecalrechitcoll->
size(); ++jhit) {
238 const EcalRecHit& rechitj = (*ecalrechitcoll)[jhit];
242 double etaj = rhposj.eta();
243 double phij = rhposj.phi();
245 double deta =
eta - etaj;
252 double rhetj = rechitj.
energy() *
sqrt(rhposj.perp2() / rhposj.mag2());
267 etstrip_iphiseedplus1 += rhetj;
269 etstrip_iphiseedminus1 += rhetj;
279 double rhtj = rechitj.
time();
281 int rhietaj = detj.
ieta();
282 timediscriminator += std::log10(rhetj) *
283 (rhtj + 0.5 * (
sqrt(16900 + 9 * rhietaj * rhietaj) - 3 *
std::abs(rhietaj)) / c_cm_per_ns);
291 for (
size_t jhit = 0; jhit < hbherechitcoll->
size(); ++jhit) {
292 const HBHERecHit& rechitj = (*hbherechitcoll)[jhit];
294 double rhetj = rechitj.
energy() *
sqrt(rhposj.perp2() / rhposj.mag2());
297 double etaj = rhposj.eta();
298 double phij = rhposj.phi();
299 double deta =
eta - etaj;
305 hoe += rhetj / etcluster;
331 TheHaloClusterCandsEB.push_back(clustercand);
334 return TheHaloClusterCandsEB;
340 float et_thresh_seedrh) {
341 std::vector<HaloClusterCandidateECAL> TheHaloClusterCandsEE;
345 for (
size_t ihit = 0; ihit < ecalrechitcoll->
size(); ++ihit) {
348 const EcalRecHit& rechit = (*ecalrechitcoll)[ihit];
351 double rhet = rechit.
energy() *
sqrt(rhpos.perp2() / rhpos.mag2());
352 if (rhet < et_thresh_seedrh)
354 double eta = rhpos.eta();
355 double phi = rhpos.phi();
356 double rhr =
sqrt(rhpos.perp2());
360 double timediscriminator(0);
362 int nbcrystalssmallt(0);
363 int nbcrystalshight(0);
366 for (
size_t jhit = 0; jhit < ecalrechitcoll->
size(); ++jhit) {
367 const EcalRecHit& rechitj = (*ecalrechitcoll)[jhit];
372 if (rhposj.z() * rhpos.z() < 0)
375 double etaj = rhposj.eta();
376 double phij = rhposj.phi();
383 double rhetj = rechitj.
energy() *
sqrt(rhposj.perp2() / rhposj.mag2());
401 double rhtj = rechitj.
time();
411 double corrt_j = rhtj +
sqrt(rhposj.x() * rhposj.x() + rhposj.y() * rhposj.y() + 320. * 320.) / c_cm_per_ns -
416 timediscriminator += 0.5 * (
pow((corrt_j - 0.3) / 0.4, 2) -
pow((corrt_j - 0.) / 0.4, 2));
427 for (
size_t jhit = 0; jhit < hbherechitcoll->
size(); ++jhit) {
428 const HBHERecHit& rechitj = (*hbherechitcoll)[jhit];
432 if (rhposj.z() * rhpos.z() < 0)
438 double rhetj = rechitj.
energy() *
sqrt(rhposj.perp2() / rhposj.mag2());
442 double phij = rhposj.phi();
446 double rhrj =
sqrt(rhposj.perp2());
450 h2oe += rhetj / etcluster;
470 bool isbeamhalofrompattern =
474 bool isbeamhalofrompattern_hlt =
478 TheHaloClusterCandsEE.push_back(clustercand);
481 return TheHaloClusterCandsEE;