1 #ifndef EgammaTowerIsolation_h 2 #define EgammaTowerIsolation_h 35 template <
unsigned int NC>
47 constexpr
static unsigned int NCuts = NC;
67 for (std::size_t
i = 0;
i !=
NCuts; ++
i) {
87 uint32_t*
mem =
nullptr;
89 mem =
new uint32_t[
nt * 6];
95 id = (uint32_t*)(
st) +
nt;
104 std::atomic<uint32_t>
create = 0;
105 std::atomic<uint32_t>
comp = 0;
106 std::atomic<uint32_t> span = 0;
114 template <
unsigned int NC>
127 for (std::size_t
i = 0;
i !=
NCuts; ++
i) {
135 std::vector<float>
e(
nt);
139 for (std::size_t
k = 0;
k !=
nt; ++
k) {
142 std::push_heap(
index,
index +
k + 1, [&
e](uint32_t
i, uint32_t
j) {
return e[
i] <
e[
j]; });
146 for (std::size_t
i = 0;
i !=
nt; ++
i) {
151 st[
i] = 1.f / std::cosh(
eta[
i]);
157 template <
unsigned int NC>
158 template <
typename I>
168 float candEta = sc.
eta();
169 float candPhi = sc.
phi();
173 uint32_t il = lb -
eta;
181 for (std::size_t
i = il;
i != iu; ++
i) {
183 float tt =
et ? st[
i] : 1.f;
184 for (std::size_t
j = 0;
j != NCuts; ++
j) {
185 if (dr2 < extRadius2_[
j]) {
186 if (dr2 >= intRadius2_[
j]) {
209 return getSum(
true, sc, detIdToExclude);
213 return getSum(
false, sc, detIdToExclude);
216 const std::vector<CaloTowerDetId>* detIdToExclude =
nullptr)
const {
217 return getSum(
true, *sc, detIdToExclude);
220 return getSum(
false, *sc, detIdToExclude);
def create(alignables, pedeDump, additionalData, outputFile, config)
EgammaTowerIsolationNew()
double getTowerESum(const reco::Candidate *cand, const std::vector< CaloTowerDetId > *detIdToExclude=nullptr) const
static constexpr unsigned int NCuts
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
double phi() const
azimuthal angle of cluster centroid
~EgammaTowerIsolationNew()
void setRadius(float const extRadius[NC], float const intRadius[NC])
const std::complex< double > I
void compute(bool et, Sum &sum, reco::Candidate const &cand, I first, I last) const
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
double getTowerESum(reco::SuperCluster const *sc, const std::vector< CaloTowerDetId > *detIdToExclude=nullptr) const
double getTowerEtSum(const reco::Candidate *cand, const std::vector< CaloTowerDetId > *detIdToExclude=nullptr) const
EgammaTowerIsolation(float extRadiusI, float intRadiusI, float etLow, signed int depth, const CaloTowerCollection *towers)
double eta() const
pseudorapidity of cluster centroid
double getTowerEtSum(reco::SuperCluster const *sc, const std::vector< CaloTowerDetId > *detIdToExclude=nullptr) const
double getSum(bool et, reco::SuperCluster const &sc, const std::vector< CaloTowerDetId > *detIdToExclude) const