CMS 3D CMS Logo

EgammaHcalPFClusterIsolationProducer.cc
Go to the documentation of this file.
3 
5 
10 
14 
16 
19 
20 #include <typeinfo>
21 
22 template <typename T1>
24  :
25 
26  emObjectProducer_(consumes<T1Collection>(config.getParameter<edm::InputTag>("candidateProducer"))),
27  pfClusterProducerHCAL_(
28  consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducerHCAL"))),
29  pfClusterProducerHFEM_(
30  consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducerHFEM"))),
31  pfClusterProducerHFHAD_(
32  consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducerHFHAD"))),
33  useHF_(config.getParameter<bool>("useHF")),
34  drMax_(config.getParameter<double>("drMax")),
35  drVetoBarrel_(config.getParameter<double>("drVetoBarrel")),
36  drVetoEndcap_(config.getParameter<double>("drVetoEndcap")),
37  etaStripBarrel_(config.getParameter<double>("etaStripBarrel")),
38  etaStripEndcap_(config.getParameter<double>("etaStripEndcap")),
39  energyBarrel_(config.getParameter<double>("energyBarrel")),
40  energyEndcap_(config.getParameter<double>("energyEndcap")),
41  useEt_(config.getParameter<bool>("useEt")) {
42  produces<edm::ValueMap<float>>();
43 }
44 
45 template <typename T1>
47 
48 template <typename T1>
51  desc.add<edm::InputTag>("candidateProducer", edm::InputTag("gedGsfElectrons"));
52  desc.add<edm::InputTag>("pfClusterProducerHCAL", edm::InputTag("particleFlowClusterHCAL"));
53  desc.ifValue(
54  edm::ParameterDescription<bool>("useHF", false, true),
56  "pfClusterProducerHFEM", edm::InputTag("hltParticleFlowClusterHFEM"), true) and
58  "pfClusterProducerHFHAD", edm::InputTag("hltParticleFlowClusterHFHAD"), true)) or
59  false >> (edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFEM", edm::InputTag(""), true) and
60  edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFHAD", edm::InputTag(""), true)));
61  desc.add<double>("drMax", 0.3);
62  desc.add<double>("drVetoBarrel", 0.0);
63  desc.add<double>("drVetoEndcap", 0.0);
64  desc.add<double>("etaStripBarrel", 0.0);
65  desc.add<double>("etaStripEndcap", 0.0);
66  desc.add<double>("energyBarrel", 0.0);
67  desc.add<double>("energyEndcap", 0.0);
68  desc.add<bool>("useEt", true);
70 }
71 
72 template <typename T1>
74  edm::Handle<T1Collection> emObjectHandle;
75  iEvent.getByToken(emObjectProducer_, emObjectHandle);
76 
77  auto isoMap = std::make_unique<edm::ValueMap<float>>();
79  std::vector<float> retV(emObjectHandle->size(), 0);
80 
81  std::vector<edm::Handle<reco::PFClusterCollection>> clusterHandles;
83  iEvent.getByToken(pfClusterProducerHCAL_, clusterHandle);
84  clusterHandles.push_back(clusterHandle);
85 
86  if (useHF_) {
88  iEvent.getByToken(pfClusterProducerHFEM_, clusterHandle);
89  clusterHandles.push_back(clusterHandle);
90 
91  iEvent.getByToken(pfClusterProducerHFHAD_, clusterHandle);
92  clusterHandles.push_back(clusterHandle);
93  }
94 
96  drMax_, drVetoBarrel_, drVetoEndcap_, etaStripBarrel_, etaStripEndcap_, energyBarrel_, energyEndcap_, useEt_);
97 
98  for (unsigned int iReco = 0; iReco < emObjectHandle->size(); iReco++) {
99  T1Ref candRef(emObjectHandle, iReco);
100  retV[iReco] = isoAlgo.getSum(candRef, clusterHandles);
101  }
102 
103  filler.insert(emObjectHandle, retV.begin(), retV.end());
104  filler.fill();
105 
106  iEvent.put(std::move(isoMap));
107 }
108 
111 
defaultModuleLabel.h
ConfigurationDescriptions.h
Handle.h
electrons_cff.bool
bool
Definition: electrons_cff.py:393
ESHandle.h
HcalPFClusterIsolation::getSum
double getSum(const T1Ref candRef, const std::vector< edm::Handle< reco::PFClusterCollection >> &clusterHandles)
Definition: HcalPFClusterIsolation.cc:32
edm
HLT enums.
Definition: AlignableModifier.h:19
EgammaHcalPFClusterIsolationProducer::T1Collection
std::vector< T1 > T1Collection
Definition: EgammaHcalPFClusterIsolationProducer.h:23
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89353
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
EgammaHcalPFClusterIsolationProducer::~EgammaHcalPFClusterIsolationProducer
~EgammaHcalPFClusterIsolationProducer() override
Definition: EgammaHcalPFClusterIsolationProducer.cc:46
TypeID.h
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::Handle
Definition: AssociativeIterator.h:50
edm::Ref
Definition: AssociativeIterator.h:58
EgammaHcalPFClusterIsolationProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: EgammaHcalPFClusterIsolationProducer.cc:49
config
Definition: config.py:1
MakerMacros.h
Photon.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
EgammaHcalPFClusterIsolationProducer.h
EgammaHcalPFClusterIsolationProducer::EgammaHcalPFClusterIsolationProducer
EgammaHcalPFClusterIsolationProducer(const edm::ParameterSet &)
Definition: EgammaHcalPFClusterIsolationProducer.cc:23
EgammaHcalPFClusterIsolationProducer
Definition: EgammaHcalPFClusterIsolationProducer.h:21
ParameterSetDescription.h
GsfElectron.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
edm::ParameterSet
Definition: ParameterSet.h:47
defaultModuleLabel
std::string defaultModuleLabel()
Definition: defaultModuleLabel.h:16
CandAssociation.h
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
EgammaHcalPFClusterIsolationProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: EgammaHcalPFClusterIsolationProducer.cc:73
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
ElectronHcalPFClusterIsolationProducer
EgammaHcalPFClusterIsolationProducer< reco::GsfElectron > ElectronHcalPFClusterIsolationProducer
Definition: EgammaHcalPFClusterIsolationProducer.cc:109
EventSetup.h
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
PhotonHcalPFClusterIsolationProducer
EgammaHcalPFClusterIsolationProducer< reco::Photon > PhotonHcalPFClusterIsolationProducer
Definition: EgammaHcalPFClusterIsolationProducer.cc:110
edm::helper::Filler
Definition: ValueMap.h:22
HcalPFClusterIsolation.h
edm::Event
Definition: Event.h:73
HcalPFClusterIsolation
Definition: HcalPFClusterIsolation.h:17
edm::ParameterDescription
Definition: ParameterDescription.h:110
l1t::PFClusterCollection
std::vector< l1t::PFCluster > PFClusterCollection
Definition: PFCluster.h:73
edm::InputTag
Definition: InputTag.h:15