31 rhoProducer_ (consumes<double>(config.getParameter<edm::
InputTag>(
"rhoProducer"))),
32 drMax_ (config.getParameter<double>(
"drMax")),
33 drVetoBarrel_ (config.getParameter<double>(
"drVetoBarrel")),
34 drVetoEndcap_ (config.getParameter<double>(
"drVetoEndcap")),
35 etaStripBarrel_ (config.getParameter<double>(
"etaStripBarrel")),
36 etaStripEndcap_ (config.getParameter<double>(
"etaStripEndcap")),
37 energyBarrel_ (config.getParameter<double>(
"energyBarrel")),
38 energyEndcap_ (config.getParameter<double>(
"energyEndcap")),
39 doRhoCorrection_ (config.getParameter<bool>(
"doRhoCorrection")),
40 rhoMax_ (config.getParameter<double>(
"rhoMax")),
41 rhoScale_ (config.getParameter<double>(
"rhoScale")),
42 effectiveAreas_ (config.getParameter<std::vector<double> >(
"effectiveAreas")),
43 absEtaLowEdges_ (config.getParameter<std::vector<double> >(
"absEtaLowEdges")) {
47 throw cms::Exception(
"IncompatibleVects") <<
"absEtaLowEdges and effectiveAreas should be of the same size. \n";
50 throw cms::Exception(
"IncompleteCoverage") <<
"absEtaLowEdges should start from 0. \n";
54 throw cms::Exception(
"ImproperBinning") <<
"absEtaLowEdges entries should be in increasing order. \n";
58 std::string recoCandidateProducerName =
"recoCandidateProducer";
62 produces <T1IsolationMap>();
73 std::string recoCandidateProducerName =
"recoCandidateProducer";
80 desc.
add<
bool>(
"doRhoCorrection",
false);
81 desc.
add<
double>(
"rhoMax", 9.9999999E7);
82 desc.
add<
double>(
"rhoScale", 1.0);
83 desc.
add<
double>(
"drMax", 0.3);
84 desc.
add<
double>(
"drVetoBarrel", 0.0);
85 desc.
add<
double>(
"drVetoEndcap", 0.0);
86 desc.
add<
double>(
"etaStripBarrel", 0.0);
87 desc.
add<
double>(
"etaStripEndcap", 0.0);
88 desc.
add<
double>(
"energyBarrel", 0.0);
89 desc.
add<
double>(
"energyEndcap", 0.0);
90 desc.
add<std::vector<double> >(
"effectiveAreas", {0.29, 0.21});
91 desc.
add<std::vector<double> >(
"absEtaLowEdges", {0.0, 1.479});
100 if (doRhoCorrection_) {
113 iEvent.
getByToken(recoCandidateProducer_,recoCandHandle);
114 iEvent.
getByToken(pfClusterProducer_, clusterHandle);
116 EcalPFClusterIsolation<T1> isoAlgo(drMax_, drVetoBarrel_, drVetoEndcap_, etaStripBarrel_, etaStripEndcap_, energyBarrel_, energyEndcap_);
119 for (
unsigned int iReco = 0; iReco < recoCandHandle->size(); iReco++) {
120 T1Ref candRef(recoCandHandle, iReco);
122 float sum = isoAlgo.
getSum(candRef, clusterHandle);
124 if (doRhoCorrection_) {
126 auto cEta =
std::abs(candRef->eta());
127 for (
int bIt = absEtaLowEdges_.size() - 1; bIt > -1; bIt--) {
128 if ( cEta > absEtaLowEdges_.at(bIt) ) {
134 sum = sum - rho*effectiveAreas_.at(iEA);
137 recoCandMap.
insert(candRef, sum);
140 iEvent.
put(std::make_unique<T1IsolationMap>(recoCandMap));
T getParameter(std::string const &) const
std::string defaultModuleLabel()
edm::EDGetTokenT< T1Collection > recoCandidateProducer_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
const std::vector< double > absEtaLowEdges_
void produce(edm::Event &, const edm::EventSetup &) override
HLTEcalPFClusterIsolationProducer< reco::RecoChargedCandidate > MuonHLTEcalPFClusterIsolationProducer
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
HLTEcalPFClusterIsolationProducer(const edm::ParameterSet &)
Abs< T >::type abs(const T &t)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
T const * product() const
void insert(const key_type &k, const data_type &v)
insert an association
double getSum(T1Ref, edm::Handle< std::vector< reco::PFCluster > >)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
~HLTEcalPFClusterIsolationProducer()
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
HLTEcalPFClusterIsolationProducer< reco::RecoEcalCandidate > EgammaHLTEcalPFClusterIsolationProducer
const bool doRhoCorrection_
const std::vector< double > effectiveAreas_