59 double iphi2phi(
int iphi,
int ieta)
const;
73 : src_(consumes<typename edm::
View<
T> >(iConfig.getParameter<edm::
InputTag>(
"src"))),
74 useHF_(iConfig.getParameter<bool>(
"useHF")) {
75 produces<CaloTowerCollection>();
87 typedef std::pair<int, int> EtaPhi;
88 typedef std::map<EtaPhi, double> EtaPhiMap;
93 for (
auto const& particle :
inputs) {
94 double eta = particle.eta();
96 int ieta = eta2ieta(eta);
97 int iphi = phi2iphi(particle.phi(), ieta);
99 if (!useHF_ &&
abs(ieta) > 29)
102 EtaPhi ep(ieta, iphi);
103 towers_[ep] += particle.et();
106 auto prod = std::make_unique<CaloTowerCollection>();
107 prod->reserve(towers_.size());
108 for (
auto const&
tower : towers_) {
109 EtaPhi ep =
tower.first;
110 double et =
tower.second;
113 int iphi = ep.second;
121 prod->emplace_back(newTowerId, p4.e(), 0, 0, 0, 0, p4,
point,
point);
134 double xeta = fabs(eta);
135 while (xeta >
hi::etaedge[ieta] && ieta < ietaMax - 1) {
156 iphi = n * (iphi - 1) + 1;
172 int myphi = (iphi - 1) / n + 1;
174 phi = 2. *
M_PI * (myphi - 0.5) / nphi *
n;
196 desc.
add<
bool>(
"useHF",
true);
199 descriptions.
add(
"PFTowers", desc);
203 descriptions.
add(
"PackedPFTowers", desc);
int eta2ieta(double eta) const
constexpr int32_t ceil(float num)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
double iphi2phi(int iphi, int ieta) const
#define DEFINE_FWK_MODULE(type)
int phi2iphi(double phi, int ieta) const
ParticleTowerProducer(const edm::ParameterSet &)
static constexpr int ietaMax
double ieta2eta(int ieta) const
edm::EDGetTokenT< typename edm::View< T > > src_
ParticleTowerProducer< reco::PFCandidate > PFTowers
Abs< T >::type abs(const T &t)
bool get(ProductID const &oid, Handle< PROD > &result) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
ParticleTowerProducer< pat::PackedCandidate > PackedPFTowers
void produce(edm::Event &, const edm::EventSetup &) override
constexpr valType make0To2pi(valType angle)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Particle reconstructed by the particle flow algorithm.
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
constexpr std::array< double, 42 > etaedge
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point