#include <EgammaTowerIsolation.h>
Classes | |
struct | Sum |
Public Member Functions | |
void | compute (bool et, Sum &sum, reco::Candidate const &cand, CaloTowerDetId const *first, CaloTowerDetId const *last) const |
void | compute (bool et, Sum &sum, reco::SuperCluster const &sc, CaloTowerDetId const *first, CaloTowerDetId const *last) const |
EgammaTowerIsolationNew (float extRadius[NC], float intRadius[NC], CaloTowerCollection const &towers) | |
EgammaTowerIsolationNew () | |
void | initSoa () |
void | setRadius (float const extRadius[NC], float const intRadius[NC]) |
~EgammaTowerIsolationNew () | |
Public Attributes | |
float * | eta |
float | extRadius2_ [NCuts] |
float * | h2 |
float * | he |
uint32_t * | id |
float | intRadius2_ [NCuts] |
float | maxEta |
uint32_t * | mem = nullptr |
const uint32_t | nt |
float * | phi |
float * | st |
Static Public Attributes | |
static constexpr unsigned int | NCuts = NC |
Definition at line 39 of file EgammaTowerIsolation.h.
EgammaTowerIsolationNew< NC >::EgammaTowerIsolationNew | ( | ) | [inline] |
Definition at line 56 of file EgammaTowerIsolation.h.
: nt(0){}
EgammaTowerIsolationNew< NC >::EgammaTowerIsolationNew | ( | float | extRadius[NC], |
float | intRadius[NC], | ||
CaloTowerCollection const & | towers | ||
) | [inline] |
Definition at line 117 of file EgammaTowerIsolation.h.
References etiStat::Count::count, alignCSCRings::e, EgammaTowerIsolationNew< NC >::eta, EgammaTowerIsolationNew< NC >::extRadius2_, EgammaTowerIsolationNew< NC >::h2, EgammaTowerIsolationNew< NC >::he, i, getHLTprescales::index, EgammaTowerIsolationNew< NC >::initSoa(), EgammaTowerIsolationNew< NC >::intRadius2_, j, gen::k, EgammaTowerIsolationNew< NC >::NCuts, EgammaTowerIsolationNew< NC >::nt, EgammaTowerIsolationNew< NC >::phi, and EgammaTowerIsolationNew< NC >::st.
: maxEta(*std::max_element(extRadius,extRadius+NC)), nt(towers.size()) { if (nt==0) return; initSoa(); etiStat::Count::count.create++; for (std::size_t i=0; i!=NCuts; ++i) { extRadius2_[i]=extRadius[i]*extRadius[i]; intRadius2_[i]=intRadius[i]*intRadius[i]; } // sort in eta (kd-tree anoverkill,does not vectorize...) uint32_t index[nt]; float e[nt]; for (std::size_t k=0; k!=nt; ++k) { e[k]=towers[k].eta(); index[k]=k; std::push_heap(index,index+k+1,[&e](uint32_t i, uint32_t j){ return e[i]<e[j];}); } std::sort_heap(index,index+nt,[&e](uint32_t i, uint32_t j){ return e[i]<e[j];}); for (std::size_t i=0;i!=nt; ++i) { auto j = index[i]; eta[i]=towers[j].eta(); phi[i]=towers[j].phi(); id[i]=towers[j].id(); st[i] = 1.f/std::cosh(eta[i]); // std::sin(towers[j].theta()); //; he[i] = towers[j].hadEnergy(); h2[i] = towers[j].hadEnergyHeOuterLayer(); } }
EgammaTowerIsolationNew< NC >::~EgammaTowerIsolationNew | ( | ) | [inline] |
Definition at line 62 of file EgammaTowerIsolation.h.
{ delete[] mem;}
void EgammaTowerIsolationNew< NC >::compute | ( | bool | et, |
Sum & | sum, | ||
reco::Candidate const & | cand, | ||
CaloTowerDetId const * | first, | ||
CaloTowerDetId const * | last | ||
) | const [inline] |
Definition at line 64 of file EgammaTowerIsolation.h.
Referenced by EgammaTowerIsolationNew< 1 >::compute(), and EgammaTowerIsolation::getSum().
{ reco::SuperCluster const & sc = *cand.get<reco::SuperClusterRef>().get(); return compute(et,sum,sc,first,last); }
void EgammaTowerIsolationNew< NC >::compute | ( | bool | et, |
Sum & | sum, | ||
reco::SuperCluster const & | sc, | ||
CaloTowerDetId const * | first, | ||
CaloTowerDetId const * | last | ||
) | const [inline] |
Definition at line 159 of file EgammaTowerIsolation.h.
References etiStat::Count::count, reco::deltaR2(), eta, reco::CaloCluster::eta(), spr::find(), EgammaTowerIsolationNew< NC >::Sum::h2, EgammaTowerIsolationNew< NC >::Sum::h2BC, EgammaTowerIsolationNew< NC >::Sum::heBC, i, j, prof2calltree::last, maxEta, min, nt, convertSQLiteXML::ok, phi, reco::CaloCluster::phi(), and groupFilesInBlocks::tt.
{ if (nt==0) return; etiStat::Count::count.comp++; float candEta = sc.eta(); float candPhi = sc.phi(); auto lb = std::lower_bound(eta,eta+nt,candEta-maxEta); auto ub = std::upper_bound(lb,eta+nt,candEta+maxEta); uint32_t il = lb-eta; uint32_t iu = std::min(nt,uint32_t(ub-eta+1)); etiStat::Count::count.span += (iu-il); bool ok[iu-il]; for (std::size_t i=il;i!=iu; ++i) ok[i-il] = (std::find(first,last,id[i])==last); // should be restricted in eta.... for (std::size_t i=il;i!=iu; ++i) { float dr2 = reco::deltaR2(candEta,candPhi,eta[i], phi[i]); float tt = et ? st[i] : 1.f; for (std::size_t j=0; j!=NCuts; ++j) { if (dr2<extRadius2_[j]) { if (dr2>=intRadius2_[j]) { sum.he[j] +=he[i]*tt; sum.h2[j] +=h2[i]*tt; } if(ok[i-il]) { sum.heBC[j] +=he[i]*tt; sum.h2BC[j] +=h2[i]*tt; } } } } }
void EgammaTowerIsolationNew< NC >::initSoa | ( | ) | [inline] |
void EgammaTowerIsolationNew< NC >::setRadius | ( | float const | extRadius[NC], |
float const | intRadius[NC] | ||
) | [inline] |
Definition at line 70 of file EgammaTowerIsolation.h.
Referenced by EgammaTowerIsolation::getSum().
float* EgammaTowerIsolationNew< NC >::eta |
Definition at line 86 of file EgammaTowerIsolation.h.
Referenced by EgammaTowerIsolationNew< NC >::EgammaTowerIsolationNew(), and EgammaTowerIsolationNew< 1 >::initSoa().
float EgammaTowerIsolationNew< NC >::extRadius2_[NCuts] |
Definition at line 80 of file EgammaTowerIsolation.h.
Referenced by EgammaTowerIsolationNew< NC >::EgammaTowerIsolationNew(), and EgammaTowerIsolationNew< 1 >::setRadius().
float* EgammaTowerIsolationNew< NC >::h2 |
Definition at line 89 of file EgammaTowerIsolation.h.
Referenced by EgammaTowerIsolationNew< NC >::EgammaTowerIsolationNew(), EgammaTowerIsolation::getSum(), and EgammaTowerIsolationNew< 1 >::initSoa().
float* EgammaTowerIsolationNew< NC >::he |
Definition at line 88 of file EgammaTowerIsolation.h.
Referenced by EgammaTowerIsolationNew< NC >::EgammaTowerIsolationNew(), EgammaTowerIsolation::getSum(), and EgammaTowerIsolationNew< 1 >::initSoa().
uint32_t* EgammaTowerIsolationNew< NC >::id |
Definition at line 91 of file EgammaTowerIsolation.h.
float EgammaTowerIsolationNew< NC >::intRadius2_[NCuts] |
Definition at line 81 of file EgammaTowerIsolation.h.
Referenced by EgammaTowerIsolationNew< NC >::EgammaTowerIsolationNew(), and EgammaTowerIsolationNew< 1 >::setRadius().
float EgammaTowerIsolationNew< NC >::maxEta |
Definition at line 83 of file EgammaTowerIsolation.h.
Referenced by EgammaTowerIsolationNew< 1 >::setRadius().
uint32_t* EgammaTowerIsolationNew< NC >::mem = nullptr |
Definition at line 92 of file EgammaTowerIsolation.h.
Referenced by EgammaTowerIsolationNew< 1 >::initSoa(), and EgammaTowerIsolationNew< 1 >::~EgammaTowerIsolationNew().
constexpr unsigned int EgammaTowerIsolationNew< NC >::NCuts = NC [static] |
Definition at line 52 of file EgammaTowerIsolation.h.
Referenced by EgammaTowerIsolationNew< NC >::EgammaTowerIsolationNew(), and EgammaTowerIsolationNew< 1 >::setRadius().
const uint32_t EgammaTowerIsolationNew< NC >::nt |
Definition at line 85 of file EgammaTowerIsolation.h.
Referenced by EgammaTowerIsolation::EgammaTowerIsolation(), EgammaTowerIsolationNew< NC >::EgammaTowerIsolationNew(), and EgammaTowerIsolationNew< 1 >::initSoa().
float* EgammaTowerIsolationNew< NC >::phi |
Definition at line 87 of file EgammaTowerIsolation.h.
Referenced by EgammaTowerIsolationNew< NC >::EgammaTowerIsolationNew(), and EgammaTowerIsolationNew< 1 >::initSoa().
float* EgammaTowerIsolationNew< NC >::st |
Definition at line 90 of file EgammaTowerIsolation.h.
Referenced by EgammaTowerIsolationNew< NC >::EgammaTowerIsolationNew(), and EgammaTowerIsolationNew< 1 >::initSoa().