|
|
Go to the documentation of this file.
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");
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const edm::EDGetTokenT< double > rhoProducer_
T const * product() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
HLTHGCalLayerClusterIsolationProducer< reco::RecoEcalCandidate > EgammaHLTHGCalLayerClusterIsolationProducer
~HLTHGCalLayerClusterIsolationProducer() override=default
const std::vector< double > effectiveAreas_
#define DEFINE_FWK_MODULE(type)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< CaloCluster > CaloClusterCollection
collection of CaloCluster objects
HLTHGCalLayerClusterIsolationProducer(const edm::ParameterSet &)
const bool doRhoCorrection_
edm::Ref< T1Collection > T1Ref
std::string defaultModuleLabel()
edm::AssociationMap< edm::OneToValue< std::vector< T1 >, float > > T1IsolationMap
const double minEnergyHad_
edm::EDGetTokenT< T1Collection > recoCandidateProducer_
const edm::EDGetTokenT< reco::CaloClusterCollection > layerClusterProducer_
void insert(const key_type &k, const data_type &v)
insert an association
const double minEnergyEM_
HLTHGCalLayerClusterIsolationProducer< reco::RecoChargedCandidate > MuonHLTHGCalLayerClusterIsolationProducer
void produce(edm::Event &, const edm::EventSetup &) override
std::vector< T1 > T1Collection