31 std::string recoCandidateProducerName =
"recoCandidateProducer";
38 drVetoBarrel_ = config.
getParameter<
double>(
"drVetoBarrel");
39 drVetoEndcap_ = config.
getParameter<
double>(
"drVetoEndcap");
40 etaStripBarrel_ = config.
getParameter<
double>(
"etaStripBarrel");
41 etaStripEndcap_ = config.
getParameter<
double>(
"etaStripEndcap");
42 energyBarrel_ = config.
getParameter<
double>(
"energyBarrel");
43 energyEndcap_ = config.
getParameter<
double>(
"energyEndcap");
45 doRhoCorrection_ = config.
getParameter<
bool>(
"doRhoCorrection");
51 effectiveAreaBarrel_ = config.
getParameter<
double>(
"effectiveAreaBarrel");
52 effectiveAreaEndcap_ = config.
getParameter<
double>(
"effectiveAreaEndcap");
54 produces <T1IsolationMap>();
65 std::string recoCandidateProducerName =
"recoCandidateProducer";
72 desc.
add<
bool>(
"doRhoCorrection",
false);
73 desc.
add<
double>(
"rhoMax", 9.9999999E7);
74 desc.
add<
double>(
"rhoScale", 1.0);
75 desc.
add<
double>(
"effectiveAreaBarrel", 0.101);
76 desc.
add<
double>(
"effectiveAreaEndcap", 0.046);
77 desc.
add<
double>(
"drMax", 0.3);
78 desc.
add<
double>(
"drVetoBarrel", 0.0);
79 desc.
add<
double>(
"drVetoEndcap", 0.0);
80 desc.
add<
double>(
"etaStripBarrel", 0.0);
81 desc.
add<
double>(
"etaStripEndcap", 0.0);
82 desc.
add<
double>(
"energyBarrel", 0.0);
83 desc.
add<
double>(
"energyEndcap", 0.0);
90 float dR2 =
deltaR2(candRef->eta(), candRef->phi(), pfclu->eta(), pfclu->phi());
91 if(dR2 > (drMax_*drMax_))
94 if (candRef->superCluster().
isNonnull()) {
96 for (
reco::CaloCluster_iterator it = candRef->superCluster()->clustersBegin(); it != candRef->superCluster()->clustersEnd(); ++it) {
97 if ((*it)->seed() == pfclu->seed()) {
106 template<
typename T1>
109 float dR2 =
deltaR2(candRef->eta(), candRef->phi(), pfclu->eta(), pfclu->phi());
110 if(dR2 > (drMax_*drMax_) || dR2 < drVeto2_)
116 template<
typename T1>
121 if (doRhoCorrection_) {
134 iEvent.
getByToken(recoCandidateProducer_,recoCandHandle);
135 iEvent.
getByToken(pfClusterProducer_, clusterHandle);
142 for (
unsigned int iReco = 0; iReco < recoCandHandle->size(); iReco++) {
143 T1Ref candRef(recoCandHandle, iReco);
145 if (fabs(candRef->eta()) < 1.479) {
146 drVeto2_ = drVetoBarrel_*drVetoBarrel_;
147 etaStrip = etaStripBarrel_;
149 drVeto2_ = drVetoEndcap_*drVetoEndcap_;
150 etaStrip = etaStripEndcap_;
154 for (
size_t i=0;
i<clusterHandle->size();
i++) {
157 if (fabs(candRef->eta()) < 1.479) {
158 if (fabs(pfclu->pt()) < energyBarrel_)
161 if (fabs(pfclu->energy()) < energyEndcap_)
165 float dEta = fabs(candRef->eta() - pfclu->eta());
166 if(dEta < etaStrip)
continue;
167 if (not computedRVeto(candRef, pfclu))
173 if (doRhoCorrection_) {
174 if (fabs(candRef->eta()) < 1.479)
175 sum = sum - rho*effectiveAreaBarrel_;
177 sum = sum - rho*effectiveAreaEndcap_;
180 recoCandMap.
insert(candRef, sum);
183 std::auto_ptr<T1IsolationMap> mapForEvent(
new T1IsolationMap(recoCandMap));
184 iEvent.
put(mapForEvent);
T getParameter(std::string const &) const
bool isNonnull() const
Checks for non-null.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
bool computedRVeto(T1Ref candRef, reco::PFClusterRef pfclu)
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 &)
double deltaR2(const T1 &t1, const T2 &t2)
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
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual void produce(edm::Event &, const edm::EventSetup &)
~HLTEcalPFClusterIsolationProducer()
HLTEcalPFClusterIsolationProducer< reco::RecoEcalCandidate > EgammaHLTEcalPFClusterIsolationProducer