CMS 3D CMS Logo

EgammaEcalPFClusterIsolationProducer.cc
Go to the documentation of this file.
3 
8 
12 
14 
17 
18 template <typename T1>
20  :
21 
22  emObjectProducer_(consumes<T1Collection>(config.getParameter<edm::InputTag>("candidateProducer"))),
23  pfClusterProducer_(consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducer"))),
24  drMax_(config.getParameter<double>("drMax")),
25  drVetoBarrel_(config.getParameter<double>("drVetoBarrel")),
26  drVetoEndcap_(config.getParameter<double>("drVetoEndcap")),
27  etaStripBarrel_(config.getParameter<double>("etaStripBarrel")),
28  etaStripEndcap_(config.getParameter<double>("etaStripEndcap")),
29  energyBarrel_(config.getParameter<double>("energyBarrel")),
30  energyEndcap_(config.getParameter<double>("energyEndcap")) {
31  produces<edm::ValueMap<float>>();
32 }
33 
34 template <typename T1>
36 
37 template <typename T1>
40  desc.add<edm::InputTag>("candidateProducer", edm::InputTag("gedGsfElectrons"));
41  desc.add<edm::InputTag>("pfClusterProducer", edm::InputTag("particleFlowClusterECAL"));
42  desc.add<double>("drMax", 0.3);
43  desc.add<double>("drVetoBarrel", 0.0);
44  desc.add<double>("drVetoEndcap", 0.0);
45  desc.add<double>("etaStripBarrel", 0.0);
46  desc.add<double>("etaStripEndcap", 0.0);
47  desc.add<double>("energyBarrel", 0.0);
48  desc.add<double>("energyEndcap", 0.0);
50 }
51 
52 template <typename T1>
54  edm::Handle<T1Collection> emObjectHandle;
55  iEvent.getByToken(emObjectProducer_, emObjectHandle);
56 
57  auto isoMap = std::make_unique<edm::ValueMap<float>>();
59  std::vector<float> retV(emObjectHandle->size(), 0);
60 
62  iEvent.getByToken(pfClusterProducer_, clusterHandle);
63 
65  drMax_, drVetoBarrel_, drVetoEndcap_, etaStripBarrel_, etaStripEndcap_, energyBarrel_, energyEndcap_);
66 
67  for (unsigned int iReco = 0; iReco < emObjectHandle->size(); iReco++) {
68  T1Ref candRef(emObjectHandle, iReco);
69  retV[iReco] = isoAlgo.getSum(candRef, clusterHandle);
70  }
71 
72  filler.insert(emObjectHandle, retV.begin(), retV.end());
73  filler.fill();
74 
75  iEvent.put(std::move(isoMap));
76 }
77 
80 
defaultModuleLabel.h
ConfigurationDescriptions.h
EgammaEcalPFClusterIsolationProducer::T1Collection
std::vector< T1 > T1Collection
Definition: EgammaEcalPFClusterIsolationProducer.h:23
Handle.h
ESHandle.h
edm
HLT enums.
Definition: AlignableModifier.h:19
EgammaEcalPFClusterIsolationProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: EgammaEcalPFClusterIsolationProducer.cc:53
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:85964
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
PhotonEcalPFClusterIsolationProducer
EgammaEcalPFClusterIsolationProducer< reco::Photon > PhotonEcalPFClusterIsolationProducer
Definition: EgammaEcalPFClusterIsolationProducer.cc:79
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
EcalPFClusterIsolation::getSum
double getSum(T1Ref, edm::Handle< std::vector< reco::PFCluster > >)
Definition: EcalPFClusterIsolation.cc:38
edm::Handle
Definition: AssociativeIterator.h:50
edm::Ref
Definition: AssociativeIterator.h:58
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
EgammaEcalPFClusterIsolationProducer.h
EcalPFClusterIsolation.h
ElectronEcalPFClusterIsolationProducer
EgammaEcalPFClusterIsolationProducer< reco::GsfElectron > ElectronEcalPFClusterIsolationProducer
Definition: EgammaEcalPFClusterIsolationProducer.cc:78
EgammaEcalPFClusterIsolationProducer::~EgammaEcalPFClusterIsolationProducer
~EgammaEcalPFClusterIsolationProducer() override
Definition: EgammaEcalPFClusterIsolationProducer.cc:35
ParameterSetDescription.h
GsfElectron.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
EgammaEcalPFClusterIsolationProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: EgammaEcalPFClusterIsolationProducer.cc:38
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
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
EventSetup.h
EcalPFClusterIsolation
Definition: EcalPFClusterIsolation.h:17
edm::helper::Filler
Definition: ValueMap.h:22
EgammaEcalPFClusterIsolationProducer
Definition: EgammaEcalPFClusterIsolationProducer.h:21
edm::Event
Definition: Event.h:73
l1t::PFClusterCollection
std::vector< l1t::PFCluster > PFClusterCollection
Definition: PFCluster.h:73
edm::InputTag
Definition: InputTag.h:15
EgammaEcalPFClusterIsolationProducer::EgammaEcalPFClusterIsolationProducer
EgammaEcalPFClusterIsolationProducer(const edm::ParameterSet &)
Definition: EgammaEcalPFClusterIsolationProducer.cc:19