CMS 3D CMS Logo

EgammaEcalPFClusterIsolationProducer.cc
Go to the documentation of this file.
1 //*****************************************************************************
2 // File: EgammaEcalPFClusterIsolationProducer.cc
3 // ----------------------------------------------------------------------------
4 // OrigAuth: Matteo Sani
5 // Institute: UCSD
6 //*****************************************************************************
7 
22 
23 template <typename T1>
25 public:
26  typedef std::vector<T1> T1Collection;
29  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
30 
31  void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
32 
33 private:
36 
37  const double drMax_;
38  const double drVetoBarrel_;
39  const double drVetoEndcap_;
40  const double etaStripBarrel_;
41  const double etaStripEndcap_;
42  const double energyBarrel_;
43  const double energyEndcap_;
44 };
45 
46 template <typename T1>
48  :
49 
50  emObjectProducer_(consumes<T1Collection>(config.getParameter<edm::InputTag>("candidateProducer"))),
51  pfClusterProducer_(consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducer"))),
52  drMax_(config.getParameter<double>("drMax")),
53  drVetoBarrel_(config.getParameter<double>("drVetoBarrel")),
54  drVetoEndcap_(config.getParameter<double>("drVetoEndcap")),
55  etaStripBarrel_(config.getParameter<double>("etaStripBarrel")),
56  etaStripEndcap_(config.getParameter<double>("etaStripEndcap")),
57  energyBarrel_(config.getParameter<double>("energyBarrel")),
58  energyEndcap_(config.getParameter<double>("energyEndcap")) {
59  produces<edm::ValueMap<float>>();
60 }
61 
62 template <typename T1>
65  desc.add<edm::InputTag>("candidateProducer", edm::InputTag("gedGsfElectrons"));
66  desc.add<edm::InputTag>("pfClusterProducer", edm::InputTag("particleFlowClusterECAL"));
67  desc.add<double>("drMax", 0.3);
68  desc.add<double>("drVetoBarrel", 0.0);
69  desc.add<double>("drVetoEndcap", 0.0);
70  desc.add<double>("etaStripBarrel", 0.0);
71  desc.add<double>("etaStripEndcap", 0.0);
72  desc.add<double>("energyBarrel", 0.0);
73  desc.add<double>("energyEndcap", 0.0);
75 }
76 
77 template <typename T1>
80  const edm::EventSetup&) const {
81  auto emObjectHandle = iEvent.getHandle(emObjectProducer_);
82 
83  auto isoMap = std::make_unique<edm::ValueMap<float>>();
85  std::vector<float> retV(emObjectHandle->size(), 0);
86 
87  auto clusterHandle = iEvent.getHandle(pfClusterProducer_);
88 
90  drMax_, drVetoBarrel_, drVetoEndcap_, etaStripBarrel_, etaStripEndcap_, energyBarrel_, energyEndcap_);
91 
92  for (unsigned int iReco = 0; iReco < emObjectHandle->size(); iReco++) {
93  T1Ref candRef(emObjectHandle, iReco);
94  retV[iReco] = isoAlgo.getSum(candRef, clusterHandle);
95  }
96 
97  filler.insert(emObjectHandle, retV.begin(), retV.end());
98  filler.fill();
99 
100  iEvent.put(std::move(isoMap));
101 }
102 
105 
defaultModuleLabel.h
ConfigurationDescriptions.h
edm::StreamID
Definition: StreamID.h:30
EgammaEcalPFClusterIsolationProducer::T1Collection
std::vector< T1 > T1Collection
Definition: EgammaEcalPFClusterIsolationProducer.cc:26
edm::EDGetTokenT< T1Collection >
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
EgammaEcalPFClusterIsolationProducer::pfClusterProducer_
const edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducer_
Definition: EgammaEcalPFClusterIsolationProducer.cc:35
PhotonEcalPFClusterIsolationProducer
EgammaEcalPFClusterIsolationProducer< reco::Photon > PhotonEcalPFClusterIsolationProducer
Definition: EgammaEcalPFClusterIsolationProducer.cc:104
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
EcalPFClusterIsolation::getSum
double getSum(T1Ref, edm::Handle< std::vector< reco::PFCluster > >)
Definition: EcalPFClusterIsolation.cc:38
edm::Ref
Definition: AssociativeIterator.h:58
EgammaEcalPFClusterIsolationProducer::emObjectProducer_
const edm::EDGetTokenT< T1Collection > emObjectProducer_
Definition: EgammaEcalPFClusterIsolationProducer.cc:34
config
Definition: config.py:1
MakerMacros.h
Photon.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
EgammaEcalPFClusterIsolationProducer::produce
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition: EgammaEcalPFClusterIsolationProducer.cc:78
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
EgammaEcalPFClusterIsolationProducer::drVetoBarrel_
const double drVetoBarrel_
Definition: EgammaEcalPFClusterIsolationProducer.cc:38
EcalPFClusterIsolation.h
PFCluster.h
ElectronEcalPFClusterIsolationProducer
EgammaEcalPFClusterIsolationProducer< reco::GsfElectron > ElectronEcalPFClusterIsolationProducer
Definition: EgammaEcalPFClusterIsolationProducer.cc:103
EgammaEcalPFClusterIsolationProducer::drVetoEndcap_
const double drVetoEndcap_
Definition: EgammaEcalPFClusterIsolationProducer.cc:39
ParameterSetDescription.h
GsfElectron.h
edm::global::EDProducer
Definition: EDProducer.h:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
EgammaEcalPFClusterIsolationProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: EgammaEcalPFClusterIsolationProducer.cc:63
edm::ParameterSet
Definition: ParameterSet.h:47
defaultModuleLabel
std::string defaultModuleLabel()
Definition: defaultModuleLabel.h:16
CandAssociation.h
EgammaEcalPFClusterIsolationProducer::etaStripBarrel_
const double etaStripBarrel_
Definition: EgammaEcalPFClusterIsolationProducer.cc:40
Event.h
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
iEvent
int iEvent
Definition: GenABIO.cc:224
PFClusterFwd.h
edm::EventSetup
Definition: EventSetup.h:58
EgammaEcalPFClusterIsolationProducer::drMax_
const double drMax_
Definition: EgammaEcalPFClusterIsolationProducer.cc:37
EgammaEcalPFClusterIsolationProducer::T1Ref
edm::Ref< T1Collection > T1Ref
Definition: EgammaEcalPFClusterIsolationProducer.cc:27
EgammaEcalPFClusterIsolationProducer::energyEndcap_
const double energyEndcap_
Definition: EgammaEcalPFClusterIsolationProducer.cc:43
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
EgammaEcalPFClusterIsolationProducer::etaStripEndcap_
const double etaStripEndcap_
Definition: EgammaEcalPFClusterIsolationProducer.cc:41
EventSetup.h
EcalPFClusterIsolation
Definition: EcalPFClusterIsolation.h:17
edm::helper::Filler
Definition: ValueMap.h:22
EgammaEcalPFClusterIsolationProducer
Definition: EgammaEcalPFClusterIsolationProducer.cc:24
ParameterSet.h
EDProducer.h
edm::Event
Definition: Event.h:73
l1t::PFClusterCollection
std::vector< l1t::PFCluster > PFClusterCollection
Definition: PFCluster.h:73
edm::InputTag
Definition: InputTag.h:15
EgammaEcalPFClusterIsolationProducer::energyBarrel_
const double energyBarrel_
Definition: EgammaEcalPFClusterIsolationProducer.cc:42
EgammaEcalPFClusterIsolationProducer::EgammaEcalPFClusterIsolationProducer
EgammaEcalPFClusterIsolationProducer(const edm::ParameterSet &)
Definition: EgammaEcalPFClusterIsolationProducer.cc:47