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 effectiveAreaBarrel_(config.getParameter<double>(
"effectiveAreaBarrel")),
43 effectiveAreaEndcap_(config.getParameter<double>(
"effectiveAreaEndcap")) {
45 std::string recoCandidateProducerName =
"recoCandidateProducer";
49 produces <T1IsolationMap>();
60 std::string recoCandidateProducerName =
"recoCandidateProducer";
67 desc.
add<
bool>(
"doRhoCorrection",
false);
68 desc.
add<
double>(
"rhoMax", 9.9999999E7);
69 desc.
add<
double>(
"rhoScale", 1.0);
70 desc.
add<
double>(
"effectiveAreaBarrel", 0.101);
71 desc.
add<
double>(
"effectiveAreaEndcap", 0.046);
72 desc.
add<
double>(
"drMax", 0.3);
73 desc.
add<
double>(
"drVetoBarrel", 0.0);
74 desc.
add<
double>(
"drVetoEndcap", 0.0);
75 desc.
add<
double>(
"etaStripBarrel", 0.0);
76 desc.
add<
double>(
"etaStripEndcap", 0.0);
77 desc.
add<
double>(
"energyBarrel", 0.0);
78 desc.
add<
double>(
"energyEndcap", 0.0);
87 if (doRhoCorrection_) {
100 iEvent.
getByToken(recoCandidateProducer_,recoCandHandle);
101 iEvent.
getByToken(pfClusterProducer_, clusterHandle);
103 EcalPFClusterIsolation<T1> isoAlgo(drMax_, drVetoBarrel_, drVetoEndcap_, etaStripBarrel_, etaStripEndcap_, energyBarrel_, energyEndcap_);
106 for (
unsigned int iReco = 0; iReco < recoCandHandle->size(); iReco++) {
107 T1Ref candRef(recoCandHandle, iReco);
109 float sum = isoAlgo.
getSum(candRef, clusterHandle);
111 if (doRhoCorrection_) {
112 if (fabs(candRef->eta()) < 1.479)
113 sum = sum - rho*effectiveAreaBarrel_;
115 sum = sum - rho*effectiveAreaEndcap_;
118 recoCandMap.
insert(candRef, sum);
121 std::auto_ptr<T1IsolationMap> mapForEvent(
new T1IsolationMap(recoCandMap));
122 iEvent.
put(mapForEvent);
T getParameter(std::string const &) const
std::string defaultModuleLabel()
edm::EDGetTokenT< T1Collection > recoCandidateProducer_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
void produce(edm::Event &, const edm::EventSetup &) override
HLTEcalPFClusterIsolationProducer< reco::RecoChargedCandidate > MuonHLTEcalPFClusterIsolationProducer
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
HLTEcalPFClusterIsolationProducer(const edm::ParameterSet &)
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