66 ecalBarrelRecHitCollection_{consumes(
config.getParameter<
edm::InputTag>(
"ecalBarrelRecHitCollection"))},
67 ecalEndcapRecHitCollection_{consumes(
config.getParameter<
edm::InputTag>(
"ecalEndcapRecHitCollection"))} {
69 egIsoPtMinBarrel_ =
config.getParameter<
double>(
"etMinBarrel");
70 egIsoEMinBarrel_ =
config.getParameter<
double>(
"eMinBarrel");
71 egIsoPtMinEndcap_ =
config.getParameter<
double>(
"etMinEndcap");
72 egIsoEMinEndcap_ =
config.getParameter<
double>(
"eMinEndcap");
73 egIsoConeSizeInBarrel_ =
config.getParameter<
double>(
"intRadiusBarrel");
74 egIsoConeSizeInEndcap_ =
config.getParameter<
double>(
"intRadiusEndcap");
75 egIsoConeSizeOut_ =
config.getParameter<
double>(
"extRadius");
76 egIsoJurassicWidth_ =
config.getParameter<
double>(
"jurassicWidth");
79 useIsolEt_ =
config.getParameter<
bool>(
"useIsolEt");
80 tryBoth_ =
config.getParameter<
bool>(
"tryBoth");
81 subtract_ =
config.getParameter<
bool>(
"subtract");
82 useNumCrystals_ =
config.getParameter<
bool>(
"useNumCrystals");
83 vetoClustered_ =
config.getParameter<
bool>(
"vetoClustered");
90 produces<edm::ValueMap<double>>();
114 auto isoMap = std::make_unique<edm::ValueMap<double>>();
116 std::vector<double> retV(emObjectHandle->size(), 0);
124 *ecalBarrelRecHitHandle,
136 *ecalEndcapRecHitHandle,
142 for (
size_t i = 0;
i < emObjectHandle->size(); ++
i) {
147 double isoValue = 0.;
154 ecalBarrelIsol.getEtSum(&(emObjectHandle->at(
i))) + ecalEndcapIsol.
getEtSum(&(emObjectHandle->at(
i)));
156 isoValue = ecalBarrelIsol.getEnergySum(&(emObjectHandle->at(
i))) +
158 }
else if (fabs(superClus->eta()) < 1.479) {
160 isoValue = ecalBarrelIsol.getEtSum(&(emObjectHandle->at(
i)));
162 isoValue = ecalBarrelIsol.getEnergySum(&(emObjectHandle->at(
i)));
165 isoValue = ecalEndcapIsol.
getEtSum(&(emObjectHandle->at(
i)));
167 isoValue = ecalEndcapIsol.
getEnergySum(&(emObjectHandle->at(
i)));
171 double subtractVal = 0;
174 subtractVal = superClus.
get()->rawEnergy() *
sin(2 * atan(
exp(-superClus.
get()->eta())));
176 subtractVal = superClus.
get()->rawEnergy();
179 isoValue -= subtractVal;
186 filler.insert(emObjectHandle, retV.begin(), retV.end());
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
const edm::EDGetTokenT< EcalRecHitCollection > ecalEndcapRecHitCollection_
double egIsoConeSizeInEndcap_
const edm::EDGetTokenT< EcalRecHitCollection > ecalBarrelRecHitCollection_
double getEtSum(const reco::Candidate *emObject) const
#define DEFINE_FWK_MODULE(type)
const edm::EDGetTokenT< edm::View< reco::Candidate > > emObjectProducer_
Sin< T >::type sin(const T &t)
Exp< T >::type exp(const T &t)
EgammaEcalRecHitIsolationProducer(const edm::ParameterSet &)
double getEnergySum(const reco::Candidate *emObject) const
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::ESGetToken< EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd > sevLvToken_
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
void setUseNumCrystals(bool b=true)
double egIsoJurassicWidth_
double egIsoConeSizeInBarrel_
T const * get() const
Returns C++ pointer to the item.
T const * product() const
T getParameter(std::string const &) const
tuple config
parse the configuration file
void setVetoClustered(bool b=true)
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometrytoken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const