|
|
Go to the documentation of this file. 1 #ifndef EgammaTowerIsolation_h
2 #define EgammaTowerIsolation_h
35 template <
unsigned int NC>
47 constexpr
static unsigned int NCuts = NC;
65 for (std::size_t
i = 0;
i !=
NCuts; ++
i) {
85 uint32_t*
mem =
nullptr;
87 mem =
new uint32_t[
nt * 6];
93 id = (uint32_t*)(
st) +
nt;
102 std::atomic<uint32_t>
create = 0;
103 std::atomic<uint32_t>
comp = 0;
104 std::atomic<uint32_t> span = 0;
112 template <
unsigned int NC>
125 for (std::size_t
i = 0;
i !=
NCuts; ++
i) {
133 std::vector<float>
e(
nt);
137 for (std::size_t
k = 0;
k !=
nt; ++
k) {
140 std::push_heap(
index,
index +
k + 1, [&
e](uint32_t
i, uint32_t
j) {
return e[
i] <
e[
j]; });
144 for (std::size_t
i = 0;
i !=
nt; ++
i) {
149 st[
i] = 1.f / std::cosh(
eta[
i]);
155 template <
unsigned int NC>
165 float candEta = sc.
eta();
166 float candPhi = sc.
phi();
170 uint32_t il = lb -
eta;
178 for (std::size_t
i = il;
i != iu; ++
i) {
180 float tt =
et ? st[
i] : 1.f;
181 for (std::size_t
j = 0;
j != NCuts; ++
j) {
182 if (dr2 < extRadius2_[
j]) {
183 if (dr2 >= intRadius2_[
j]) {
206 return getSum(
true, sc, detIdToExclude);
210 return getSum(
false, sc, detIdToExclude);
213 const std::vector<CaloTowerDetId>* detIdToExclude =
nullptr)
const {
214 return getSum(
true, *sc, detIdToExclude);
217 return getSum(
false, *sc, detIdToExclude);
double phi() const
azimuthal angle of cluster centroid
EgammaTowerIsolationNew()
def create(alignables, pedeDump, additionalData, outputFile, config)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
double getTowerESum(const reco::Candidate *cand, const std::vector< CaloTowerDetId > *detIdToExclude=nullptr) const
__host__ constexpr __device__ RandomIt upper_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
void setRadius(float const extRadius[NC], float const intRadius[NC])
__host__ constexpr __device__ RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
~EgammaTowerIsolationNew()
double eta() const
pseudorapidity of cluster centroid
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
constexpr static unsigned int NCuts
double getSum(bool et, reco::SuperCluster const &sc, const std::vector< CaloTowerDetId > *detIdToExclude) const
double getTowerEtSum(reco::SuperCluster const *sc, const std::vector< CaloTowerDetId > *detIdToExclude=nullptr) const
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)
void compute(bool et, Sum &sum, reco::Candidate const &cand, CaloTowerDetId const *first, CaloTowerDetId const *last) const