37 template <
typename T1>
69 template <
typename T1>
71 : layerClusterProducer_(
73 rhoProducer_(consumes<double>(
config.getParameter<
edm::
InputTag>(
"rhoProducer"))),
74 drMax_(
config.getParameter<double>(
"drMax")),
75 drVetoEM_(
config.getParameter<double>(
"drVetoEM")),
76 drVetoHad_(
config.getParameter<double>(
"drVetoHad")),
77 minEnergyEM_(
config.getParameter<double>(
"minEnergyEM")),
78 minEnergyHad_(
config.getParameter<double>(
"minEnergyHad")),
79 minEtEM_(
config.getParameter<double>(
"minEtEM")),
80 minEtHad_(
config.getParameter<double>(
"minEtHad")),
82 doRhoCorrection_(
config.getParameter<
bool>(
"doRhoCorrection")),
83 rhoMax_(
config.getParameter<double>(
"rhoMax")),
84 rhoScale_(
config.getParameter<double>(
"rhoScale")),
85 effectiveAreas_(
config.getParameter<
std::
vector<double>>(
"effectiveAreas")) {
89 <<
"effectiveAreas should have two elements for em and had components. \n";
92 std::string recoCandidateProducerName =
"recoCandidateProducer";
95 recoCandidateProducerName =
"recoEcalCandidateProducer";
98 produces<T1IsolationMap>();
99 produces<T1IsolationMap>(
"em");
100 produces<T1IsolationMap>(
"had");
103 template <
typename T1>
105 std::string recoCandidateProducerName =
"recoCandidateProducer";
108 recoCandidateProducerName =
"recoEcalCandidateProducer";
114 desc.add<
bool>(
"doRhoCorrection",
false);
115 desc.add<
bool>(
"useEt",
false);
116 desc.add<
double>(
"rhoMax", 9.9999999E7);
117 desc.add<
double>(
"rhoScale", 1.0);
118 desc.add<
double>(
"drMax", 0.3);
119 desc.add<
double>(
"drVetoEM", 0.0);
120 desc.add<
double>(
"drVetoHad", 0.0);
121 desc.add<
double>(
"minEnergyEM", 0.0);
122 desc.add<
double>(
"minEnergyHad", 0.0);
123 desc.add<
double>(
"minEtEM", 0.0);
124 desc.add<
double>(
"minEtHad", 0.0);
125 desc.add<std::vector<double>>(
"effectiveAreas", {0.0, 0.0});
129 template <
typename T1>
133 if (doRhoCorrection_) {
134 iEvent.getByToken(rhoProducer_, rhoHandle);
144 iEvent.getByToken(recoCandidateProducer_, recoCandHandle);
145 iEvent.getByToken(layerClusterProducer_, clusterHandle);
153 for (
unsigned int iReco = 0; iReco < recoCandHandle->size(); iReco++) {
154 T1Ref candRef(recoCandHandle, iReco);
176 if (doRhoCorrection_) {
177 sumEm = sumEm -
rho * effectiveAreas_.at(0);
178 sumHad = sumHad -
rho * effectiveAreas_.at(1);
181 float sum = sumEm + sumHad;
183 recoCandMap.
insert(candRef, sum);
184 recoCandMapEm.
insert(candRef, sumEm);
185 recoCandMapHad.
insert(candRef, sumHad);
188 iEvent.put(std::make_unique<T1IsolationMap>(recoCandMap));
189 iEvent.put(std::make_unique<T1IsolationMap>(recoCandMapEm),
"em");
190 iEvent.put(std::make_unique<T1IsolationMap>(recoCandMapHad),
"had");
std::vector< T1 > T1Collection
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const std::vector< double > effectiveAreas_
HLTHGCalLayerClusterIsolationProducer< reco::RecoChargedCandidate > MuonHLTHGCalLayerClusterIsolationProducer
HLTHGCalLayerClusterIsolationProducer< reco::RecoEcalCandidate > EgammaHLTHGCalLayerClusterIsolationProducer
void produce(edm::Event &, const edm::EventSetup &) override
T const * product() const
~HLTHGCalLayerClusterIsolationProducer() override=default
std::string defaultModuleLabel()
const bool doRhoCorrection_
const double minEnergyHad_
HLTHGCalLayerClusterIsolationProducer(const edm::ParameterSet &)
edm::Ref< T1Collection > T1Ref
std::vector< CaloCluster > CaloClusterCollection
collection of CaloCluster objects
#define DEFINE_FWK_MODULE(type)
edm::AssociationMap< edm::OneToValue< std::vector< T1 >, float > > T1IsolationMap
const edm::EDGetTokenT< reco::CaloClusterCollection > layerClusterProducer_
void insert(const key_type &k, const data_type &v)
insert an association
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< double > rhoProducer_
edm::EDGetTokenT< T1Collection > recoCandidateProducer_
const double minEnergyEM_