|
|
#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 () |
|
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()
EcalHaloAlgo::~EcalHaloAlgo |
( |
| ) |
|
|
inline |
◆ Calculate()
Definition at line 31 of file EcalHaloAlgo.cc.
46 float MinTimeHits[361];
48 float MaxTimeHits[361];
51 for (
int i = 0;
i < 361;
i++) {
54 MinTimeHits[
i] = 9999.;
55 MaxTimeHits[
i] = -9999.;
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++) {
94 PhiWedge wedge(SumE[iPhi], iPhi, NumHits[iPhi], MinTimeHits[iPhi], MaxTimeHits[iPhi]);
99 std::vector<const EcalRecHit*> Hits;
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.;
132 wedge.SetPlusZOriginConfidence(PlusZOriginConfidence);
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];
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;
201 std::vector<HaloClusterCandidateECAL> haloclustercands_EE;
207 return TheEcalHaloData;
References funct::abs(), Abs(), angle(), edm::SortedCollection< T, SORT >::begin(), CompareTime(), DetId::Ecal, edm::SortedCollection< T, SORT >::end(), edm::EventSetup::get(), get, reco::EcalHaloData::GetPhiWedges(), 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, edm::Handle< T >::product(), edm::ESHandle< T >::product(), edm::RefVector< C, T, F >::push_back(), DetId::rawId(), reco::EcalHaloData::setHaloClusterCandidatesEB(), reco::EcalHaloData::setHaloClusterCandidatesEE(), reco::PhiWedge::SetPlusZOriginConfidence(), and ntuplemaker::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 210 of file EcalHaloAlgo.cc.
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;
332 TheHaloClusterCandsEB.push_back(clustercand);
335 return TheHaloClusterCandsEB;
References funct::abs(), SiPixelRawToDigiRegional_cfi::deltaPhi, CaloRecHit::energy(), EcalRecHit::energy(), PVValHelper::eta, electrons_cff::hoe, HBHERecHit::id(), EcalRecHit::id(), EBDetId::ieta(), 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 badGlobalMuonTaggersAOD_cff::vtx.
◆ GetHaloClusterCandidateEE()
Definition at line 338 of file EcalHaloAlgo.cc.
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 =
475 bool isbeamhalofrompattern_hlt =
479 TheHaloClusterCandsEE.push_back(clustercand);
482 return TheHaloClusterCandsEE;
References funct::abs(), SiPixelRawToDigiRegional_cfi::deltaPhi, flavorHistoryFilter_cfi::dr, CaloRecHit::energy(), EcalRecHit::energy(), PVValHelper::eta, HBHERecHit::id(), EcalRecHit::id(), 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 badGlobalMuonTaggersAOD_cff::vtx.
◆ 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
◆ NHitsThreshold
int EcalHaloAlgo::NHitsThreshold |
|
private |
◆ RoundnessCut
float EcalHaloAlgo::RoundnessCut |
|
private |
◆ SumEnergyThreshold
float EcalHaloAlgo::SumEnergyThreshold |
|
private |
T const * product() const
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
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)
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