11 constexpr
float c_cm_per_ns = 29.9792458;
22 EBRecHitEnergyThreshold = 0.;
23 EERecHitEnergyThreshold = 0.;
24 ESRecHitEnergyThreshold = 0.;
25 SumEnergyThreshold = 0.;
46 float MinTimeHits[361];
48 float MaxTimeHits[361];
51 for (
int i = 0;
i < 361;
i++) {
54 MinTimeHits[
i] = 9999.;
55 MaxTimeHits[
i] = -9999.;
61 if (
hit->energy() < EBRecHitEnergyThreshold)
70 auto cell = (TheSubGeometry) ? (TheSubGeometry->getGeometry(
id)) :
nullptr;
75 int iPhi = EcalID.
iphi();
80 SumE[iPhi] +=
hit->energy();
84 MinTimeHits[iPhi] =
time < MinTimeHits[iPhi] ?
time : MinTimeHits[iPhi];
85 MaxTimeHits[iPhi] =
time > MaxTimeHits[iPhi] ?
time : MaxTimeHits[iPhi];
91 for (
int iPhi = 1; iPhi < 361; iPhi++) {
92 if (SumE[iPhi] >= SumEnergyThreshold && NumHits[iPhi] > NHitsThreshold) {
94 PhiWedge wedge(SumE[iPhi], iPhi, NumHits[iPhi], MinTimeHits[iPhi], MaxTimeHits[iPhi]);
99 std::vector<const EcalRecHit*> Hits;
101 if (
hit->energy() < EBRecHitEnergyThreshold)
107 int Hit_iPhi = EcalID.iphi();
109 if (Hit_iPhi != iPhi)
111 Hits.push_back(&(*
hit));
114 float MinusToPlus = 0.;
115 float PlusToMinus = 0.;
116 for (
unsigned int i = 0;
i < Hits.size();
i++) {
119 int ieta_i = EcalID_i.
ieta();
120 for (
unsigned int j = (
i + 1);
j < Hits.size();
j++) {
123 int ieta_j = EcalID_j.
ieta();
131 float PlusZOriginConfidence = (PlusToMinus + MinusToPlus) ? PlusToMinus / (PlusToMinus + MinusToPlus) : -1.;
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();
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];
149 if ((roundness >= 0 && roundness < GetRoundnessCut()) &&
angle >= 0 &&
angle < GetAngleCut()) {
151 bool BelongsToPhoton =
false;
153 for (reco::PhotonCollection::const_iterator iPhoton = ThePhotons->begin(); iPhoton != ThePhotons->end();
156 if (TheClusterRef == iPhoton->superCluster()) {
157 BelongsToPhoton =
true;
164 if (BelongsToPhoton) {
168 vShowerShapes_Roundness.push_back(shapes[0]);
169 vShowerShapes_Angle.push_back(shapes[1]);
171 vShowerShapes_Roundness.push_back(-1.);
172 vShowerShapes_Angle.push_back(-1.);
177 TheRoundnessFiller.
insert(TheSuperClusters, vShowerShapes_Roundness.begin(), vShowerShapes_Roundness.end());
178 TheRoundnessFiller.fill();
181 TheAngleFiller.
insert(TheSuperClusters, vShowerShapes_Angle.begin(), vShowerShapes_Angle.end());
182 TheAngleFiller.fill();
198 std::vector<HaloClusterCandidateECAL> haloclustercands_EB;
199 haloclustercands_EB = GetHaloClusterCandidateEB(TheEBRecHits, TheHBHERecHits, 5);
201 std::vector<HaloClusterCandidateECAL> haloclustercands_EE;
202 haloclustercands_EE = GetHaloClusterCandidateEE(TheEERecHits, TheHBHERecHits, 10);
207 return TheEcalHaloData;
213 float et_thresh_seedrh) {
214 std::vector<HaloClusterCandidateECAL> TheHaloClusterCandsEB;
217 for (
size_t ihit = 0; ihit < ecalrechitcoll->
size(); ++ihit) {
220 const EcalRecHit& rechit = (*ecalrechitcoll)[ihit];
224 double rhet = rechit.
energy() *
sqrt(rhpos.perp2() / rhpos.mag2());
225 if (rhet < et_thresh_seedrh)
227 double eta = rhpos.eta();
228 double phi = rhpos.phi();
232 int nbcrystalsameeta(0);
233 double timediscriminator(0);
234 double etstrip_iphiseedplus1(0), etstrip_iphiseedminus1(0);
238 for (
size_t jhit = 0; jhit < ecalrechitcoll->
size(); ++jhit) {
239 const EcalRecHit& rechitj = (*ecalrechitcoll)[jhit];
243 double etaj = rhposj.eta();
244 double phij = rhposj.phi();
246 double deta =
eta - etaj;
253 double rhetj = rechitj.
energy() *
sqrt(rhposj.perp2() / rhposj.mag2());
268 etstrip_iphiseedplus1 += rhetj;
270 etstrip_iphiseedminus1 += rhetj;
280 double rhtj = rechitj.
time();
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);
292 for (
size_t jhit = 0; jhit < hbherechitcoll->
size(); ++jhit) {
293 const HBHERecHit& rechitj = (*hbherechitcoll)[jhit];
295 double rhetj = rechitj.
energy() *
sqrt(rhposj.perp2() / rhposj.mag2());
298 double etaj = rhposj.eta();
299 double phij = rhposj.phi();
300 double deta =
eta - etaj;
306 hoe += rhetj / etcluster;
326 bool isbeamhalofrompattern = EBClusterShapeandTimeStudy(clustercand,
false);
329 bool isbeamhalofrompattern_hlt = EBClusterShapeandTimeStudy(clustercand,
true);
332 TheHaloClusterCandsEB.push_back(clustercand);
335 return TheHaloClusterCandsEB;
341 float et_thresh_seedrh) {
342 std::vector<HaloClusterCandidateECAL> TheHaloClusterCandsEE;
346 for (
size_t ihit = 0; ihit < ecalrechitcoll->
size(); ++ihit) {
349 const EcalRecHit& rechit = (*ecalrechitcoll)[ihit];
352 double rhet = rechit.
energy() *
sqrt(rhpos.perp2() / rhpos.mag2());
353 if (rhet < et_thresh_seedrh)
355 double eta = rhpos.eta();
356 double phi = rhpos.phi();
357 double rhr =
sqrt(rhpos.perp2());
361 double timediscriminator(0);
363 int nbcrystalssmallt(0);
364 int nbcrystalshight(0);
367 for (
size_t jhit = 0; jhit < ecalrechitcoll->
size(); ++jhit) {
368 const EcalRecHit& rechitj = (*ecalrechitcoll)[jhit];
373 if (rhposj.z() * rhpos.z() < 0)
376 double etaj = rhposj.eta();
377 double phij = rhposj.phi();
384 double rhetj = rechitj.
energy() *
sqrt(rhposj.perp2() / rhposj.mag2());
402 double rhtj = rechitj.
time();
412 double corrt_j = rhtj +
sqrt(rhposj.x() * rhposj.x() + rhposj.y() * rhposj.y() + 320. * 320.) / c_cm_per_ns -
417 timediscriminator += 0.5 * (
pow((corrt_j - 0.3) / 0.4, 2) -
pow((corrt_j - 0.) / 0.4, 2));
428 for (
size_t jhit = 0; jhit < hbherechitcoll->
size(); ++jhit) {
429 const HBHERecHit& rechitj = (*hbherechitcoll)[jhit];
433 if (rhposj.z() * rhpos.z() < 0)
439 double rhetj = rechitj.
energy() *
sqrt(rhposj.perp2() / rhposj.mag2());
443 double phij = rhposj.phi();
447 double rhrj =
sqrt(rhposj.perp2());
451 h2oe += rhetj / etcluster;
471 bool isbeamhalofrompattern =
472 EEClusterShapeandTimeStudy_ITBH(clustercand,
false) || EEClusterShapeandTimeStudy_OTBH(clustercand,
false);
475 bool isbeamhalofrompattern_hlt =
476 EEClusterShapeandTimeStudy_ITBH(clustercand,
true) || EEClusterShapeandTimeStudy_OTBH(clustercand,
true);
479 TheHaloClusterCandsEE.push_back(clustercand);
482 return TheHaloClusterCandsEE;