|
|
#include <EcalHaloAlgo.h>
|
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) |
|
bool | EBClusterShapeandTimeStudy (reco::HaloClusterCandidateECAL hcand, bool ishlt) |
|
| EcalHaloAlgo (edm::ConsumesCollector iC) |
|
bool | EEClusterShapeandTimeStudy_ITBH (reco::HaloClusterCandidateECAL hcand, bool ishlt) |
|
bool | EEClusterShapeandTimeStudy_OTBH (reco::HaloClusterCandidateECAL hcand, bool ishlt) |
|
float | GetAngleCut () |
|
float | GetEBRecHitEnergyThreshold () |
|
float | GetEERecHitEnergyThreshold () |
|
float | GetESRecHitEnergyThreshold () |
|
std::vector< reco::HaloClusterCandidateECAL > | GetHaloClusterCandidateEB (edm::Handle< EcalRecHitCollection > &ecalrechitcoll, edm::Handle< HBHERecHitCollection > &hbherechitcoll, float et_thresh_seedrh) |
|
std::vector< reco::HaloClusterCandidateECAL > | GetHaloClusterCandidateEE (edm::Handle< EcalRecHitCollection > &ecalrechitcoll, edm::Handle< HBHERecHitCollection > &hbherechitcoll, float et_thresh_seedrh) |
|
float | GetPhiWedgeEnergyThreshold () |
|
int | GetPhiWedgeNHitsThreshold () |
|
float | GetRoundnessCut () |
|
void | SetAngleCut (float a=4.) |
|
void | SetPhiWedgeEnergyThreshold (float SumE) |
|
void | SetPhiWedgeNHitsThreshold (int nhits) |
|
void | SetPhiWedgeThresholds (float SumE, int nhits) |
|
void | SetRecHitEnergyThresholds (float EB, float EE, float ES) |
|
void | SetRoundnessCut (float r=100.) |
|
| ~EcalHaloAlgo () |
|
Definition at line 44 of file EcalHaloAlgo.h.
◆ EcalHaloAlgo()
◆ ~EcalHaloAlgo()
EcalHaloAlgo::~EcalHaloAlgo |
( |
| ) |
|
|
inline |
◆ Calculate()
Definition at line 32 of file EcalHaloAlgo.cc.
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.;
133 wedge.SetPlusZOriginConfidence(PlusZOriginConfidence);
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;
References funct::abs(), Abs(), angle(), edm::SortedCollection< T, SORT >::begin(), CompareTime(), EBRecHitEnergyThreshold, DetId::Ecal, edm::SortedCollection< T, SORT >::end(), geo, geoToken_, GetAngleCut(), edm::EventSetup::getData(), GetHaloClusterCandidateEB(), GetHaloClusterCandidateEE(), reco::EcalHaloData::GetPhiWedges(), GetRoundnessCut(), reco::EcalHaloData::GetShowerShapesAngle(), reco::EcalHaloData::GetShowerShapesRoundness(), CaloGeometry::getSubdetectorGeometry(), reco::EcalHaloData::GetSuperClusters(), mps_fire::i, hit::id, EBDetId::ieta(), edm::helper::Filler< Map >::insert(), EBDetId::iphi(), edm::HandleBase::isValid(), dqmiolumiharvest::j, NHitsThreshold, edm::Handle< T >::product(), edm::RefVector< C, T, F >::push_back(), DetId::rawId(), reco::EcalHaloData::setHaloClusterCandidatesEB(), reco::EcalHaloData::setHaloClusterCandidatesEE(), reco::PhiWedge::SetPlusZOriginConfidence(), jetUpdater_cfi::sort, SumEnergyThreshold, and protons_cff::time.
Referenced by reco::EcalHaloDataProducer::produce().
◆ EBClusterShapeandTimeStudy()
◆ EEClusterShapeandTimeStudy_ITBH()
◆ EEClusterShapeandTimeStudy_OTBH()
◆ GetAngleCut()
float EcalHaloAlgo::GetAngleCut |
( |
| ) |
|
|
inline |
◆ GetEBRecHitEnergyThreshold()
float EcalHaloAlgo::GetEBRecHitEnergyThreshold |
( |
| ) |
|
|
inline |
◆ GetEERecHitEnergyThreshold()
float EcalHaloAlgo::GetEERecHitEnergyThreshold |
( |
| ) |
|
|
inline |
◆ GetESRecHitEnergyThreshold()
float EcalHaloAlgo::GetESRecHitEnergyThreshold |
( |
| ) |
|
|
inline |
◆ GetHaloClusterCandidateEB()
Definition at line 209 of file EcalHaloAlgo.cc.
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;
References funct::abs(), SiPixelRawToDigiRegional_cfi::deltaPhi, EBClusterShapeandTimeStudy(), CaloRecHit::energy(), EcalRecHit::energy(), PVValHelper::eta, getPosition(), electrons_cff::hoe, HBHERecHit::id(), EcalRecHit::id(), EBDetId::ieta(), phi, edm::RefVector< C, T, F >::push_back(), reco::HaloClusterCandidateECAL::setBeamHaloRecHitsCandidates(), reco::HaloClusterCandidateECAL::setClusterEt(), reco::HaloClusterCandidateECAL::setEtStripIPhiSeedMinus1(), reco::HaloClusterCandidateECAL::setEtStripIPhiSeedPlus1(), reco::HaloClusterCandidateECAL::setHoverE(), reco::HaloClusterCandidateECAL::setIsHaloFromPattern(), reco::HaloClusterCandidateECAL::setIsHaloFromPattern_HLT(), reco::HaloClusterCandidateECAL::setNbofCrystalsInEta(), reco::HaloClusterCandidateECAL::setSeedEt(), reco::HaloClusterCandidateECAL::setSeedEta(), reco::HaloClusterCandidateECAL::setSeedPhi(), reco::HaloClusterCandidateECAL::setSeedR(), reco::HaloClusterCandidateECAL::setSeedTime(), reco::HaloClusterCandidateECAL::setSeedZ(), reco::HaloClusterCandidateECAL::setTimeDiscriminator(), edm::SortedCollection< T, SORT >::size(), mathSSE::sqrt(), EcalRecHit::time(), and extraflags_cff::vtx.
Referenced by Calculate().
◆ GetHaloClusterCandidateEE()
Definition at line 337 of file EcalHaloAlgo.cc.
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;
References funct::abs(), SiPixelRawToDigiRegional_cfi::deltaPhi, flavorHistoryFilter_cfi::dr, EEClusterShapeandTimeStudy_ITBH(), EEClusterShapeandTimeStudy_OTBH(), CaloRecHit::energy(), EcalRecHit::energy(), PVValHelper::eta, getPosition(), HBHERecHit::id(), EcalRecHit::id(), phi, funct::pow(), edm::RefVector< C, T, F >::push_back(), reco::HaloClusterCandidateECAL::setBeamHaloRecHitsCandidates(), reco::HaloClusterCandidateECAL::setClusterEt(), reco::HaloClusterCandidateECAL::setClusterSize(), reco::HaloClusterCandidateECAL::setH2overE(), reco::HaloClusterCandidateECAL::setIsHaloFromPattern(), reco::HaloClusterCandidateECAL::setIsHaloFromPattern_HLT(), reco::HaloClusterCandidateECAL::setNbEarlyCrystals(), reco::HaloClusterCandidateECAL::setNbLateCrystals(), reco::HaloClusterCandidateECAL::setSeedEt(), reco::HaloClusterCandidateECAL::setSeedEta(), reco::HaloClusterCandidateECAL::setSeedPhi(), reco::HaloClusterCandidateECAL::setSeedR(), reco::HaloClusterCandidateECAL::setSeedTime(), reco::HaloClusterCandidateECAL::setSeedZ(), reco::HaloClusterCandidateECAL::setTimeDiscriminator(), edm::SortedCollection< T, SORT >::size(), mathSSE::sqrt(), EcalRecHit::time(), and extraflags_cff::vtx.
Referenced by Calculate().
◆ GetPhiWedgeEnergyThreshold()
float EcalHaloAlgo::GetPhiWedgeEnergyThreshold |
( |
| ) |
|
|
inline |
◆ GetPhiWedgeNHitsThreshold()
int EcalHaloAlgo::GetPhiWedgeNHitsThreshold |
( |
| ) |
|
|
inline |
◆ getPosition()
◆ GetRoundnessCut()
float EcalHaloAlgo::GetRoundnessCut |
( |
| ) |
|
|
inline |
◆ SetAngleCut()
void EcalHaloAlgo::SetAngleCut |
( |
float |
a = 4. | ) |
|
|
inline |
◆ SetPhiWedgeEnergyThreshold()
void EcalHaloAlgo::SetPhiWedgeEnergyThreshold |
( |
float |
SumE | ) |
|
|
inline |
◆ SetPhiWedgeNHitsThreshold()
void EcalHaloAlgo::SetPhiWedgeNHitsThreshold |
( |
int |
nhits | ) |
|
|
inline |
◆ SetPhiWedgeThresholds()
void EcalHaloAlgo::SetPhiWedgeThresholds |
( |
float |
SumE, |
|
|
int |
nhits |
|
) |
| |
|
inline |
◆ SetRecHitEnergyThresholds()
void EcalHaloAlgo::SetRecHitEnergyThresholds |
( |
float |
EB, |
|
|
float |
EE, |
|
|
float |
ES |
|
) |
| |
|
inline |
◆ SetRoundnessCut()
void EcalHaloAlgo::SetRoundnessCut |
( |
float |
r = 100. | ) |
|
|
inline |
◆ AngleCut
float EcalHaloAlgo::AngleCut |
|
private |
◆ EBRecHitEnergyThreshold
float EcalHaloAlgo::EBRecHitEnergyThreshold |
|
private |
◆ EERecHitEnergyThreshold
float EcalHaloAlgo::EERecHitEnergyThreshold |
|
private |
◆ ESRecHitEnergyThreshold
float EcalHaloAlgo::ESRecHitEnergyThreshold |
|
private |
◆ geo
◆ geoToken_
◆ NHitsThreshold
int EcalHaloAlgo::NHitsThreshold |
|
private |
◆ RoundnessCut
float EcalHaloAlgo::RoundnessCut |
|
private |
◆ SumEnergyThreshold
float EcalHaloAlgo::SumEnergyThreshold |
|
private |
bool EEClusterShapeandTimeStudy_OTBH(reco::HaloClusterCandidateECAL hcand, bool ishlt)
void setNbEarlyCrystals(int x)
int ieta() const
get the crystal ieta
void insert(const H &h, I begin, I end)
std::vector< EcalRecHit >::const_iterator const_iterator
float ESRecHitEnergyThreshold
constexpr float energy() const
T const * product() const
float EERecHitEnergyThreshold
DetId id() const
get the id
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
edm::ValueMap< float > & GetShowerShapesAngle()
void setSeedTime(double x)
void setTimeDiscriminator(double x)
double getSeedTime() const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geoToken_
int getNbLateCrystals() const
double getTimeDiscriminator() const
void setSeedEta(double x)
void setIsHaloFromPattern_HLT(bool x)
bool EEClusterShapeandTimeStudy_ITBH(reco::HaloClusterCandidateECAL hcand, bool ishlt)
void setHaloClusterCandidatesEE(const std::vector< HaloClusterCandidateECAL > &x)
void setBeamHaloRecHitsCandidates(edm::RefVector< EcalRecHitCollection > x)
double getEtStripIPhiSeedPlus1() const
bool EBClusterShapeandTimeStudy(reco::HaloClusterCandidateECAL hcand, bool ishlt)
const_iterator begin() const
math::XYZPoint getPosition(const DetId &id, reco::Vertex::Point vtx)
void setSeedPhi(double x)
std::vector< reco::HaloClusterCandidateECAL > GetHaloClusterCandidateEB(edm::Handle< EcalRecHitCollection > &ecalrechitcoll, edm::Handle< HBHERecHitCollection > &hbherechitcoll, float et_thresh_seedrh)
std::vector< reco::HaloClusterCandidateECAL > GetHaloClusterCandidateEE(edm::Handle< EcalRecHitCollection > &ecalrechitcoll, edm::Handle< HBHERecHitCollection > &hbherechitcoll, float et_thresh_seedrh)
float EBRecHitEnergyThreshold
XYZPointD XYZPoint
point in space with cartesian internal representation
const_iterator end() const
void setEtStripIPhiSeedPlus1(double x)
double getEtStripIPhiSeedMinus1() const
void setHaloClusterCandidatesEB(const std::vector< HaloClusterCandidateECAL > &x)
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
int getNbEarlyCrystals() const
void setClusterEt(double x)
bool getData(T &iHolder) const
void setIsHaloFromPattern(bool x)
math::XYZPoint Point
point in the space
constexpr uint32_t rawId() const
get the raw id
bool CompareTime(const EcalRecHit *x, const EcalRecHit *y)
edm::RefVector< reco::SuperClusterCollection > & GetSuperClusters()
void setNbofCrystalsInEta(double x)
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
int getNbofCrystalsInEta() const
Power< A, B >::type pow(const A &a, const B &b)
void setH2overE(double x)
Abs< T >::type abs(const T &t)
void setClusterSize(int x)
edm::ValueMap< float > & GetShowerShapesRoundness()
constexpr HcalDetId id() const
get the id
void setEtStripIPhiSeedMinus1(double x)
void setNbLateCrystals(int x)
int getClusterSize() const
const std::vector< PhiWedge > & GetPhiWedges() const