CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
PileupJetIDVarProducer Class Reference
Inheritance diagram for PileupJetIDVarProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PileupJetIDVarProducer (const edm::ParameterSet &iConfig)
 
 ~PileupJetIDVarProducer () override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

edm::EDGetTokenT< edm::View< pat::Jet > > srcJet_
 
edm::EDGetTokenT< edm::ValueMap< StoredPileupJetIdentifier > > srcPileupJetId_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 13 of file PileupJetIDVarProducer.cc.

Constructor & Destructor Documentation

◆ PileupJetIDVarProducer()

PileupJetIDVarProducer::PileupJetIDVarProducer ( const edm::ParameterSet iConfig)
inlineexplicit

Definition at line 15 of file PileupJetIDVarProducer.cc.

19  produces<edm::ValueMap<float>>("dR2Mean");
20  produces<edm::ValueMap<float>>("majW");
21  produces<edm::ValueMap<float>>("minW");
22  produces<edm::ValueMap<float>>("frac01");
23  produces<edm::ValueMap<float>>("frac02");
24  produces<edm::ValueMap<float>>("frac03");
25  produces<edm::ValueMap<float>>("frac04");
26  produces<edm::ValueMap<float>>("ptD");
27  produces<edm::ValueMap<float>>("beta");
28  produces<edm::ValueMap<float>>("pull");
29  produces<edm::ValueMap<float>>("jetR");
30  produces<edm::ValueMap<float>>("jetRchg");
31  produces<edm::ValueMap<int>>("nCharged");
32  }

◆ ~PileupJetIDVarProducer()

PileupJetIDVarProducer::~PileupJetIDVarProducer ( )
inlineoverride

Definition at line 33 of file PileupJetIDVarProducer.cc.

33 {};

Member Function Documentation

◆ fillDescriptions()

void PileupJetIDVarProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 169 of file PileupJetIDVarProducer.cc.

169  {
170  //The following says we do not know what parameters are allowed so do no validation
171  // Please change this to state exactly what you do use, even if it is no parameters
173  desc.add<edm::InputTag>("srcJet")->setComment("jet input collection");
174  desc.add<edm::InputTag>("srcPileupJetId")->setComment("StoredPileupJetIdentifier name");
176  modname += "PileupJetIDVarProducer";
177  descriptions.add(modname, desc);
178 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, timingPdfMaker::modname, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ produce()

void PileupJetIDVarProducer::produce ( edm::StreamID  streamID,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 46 of file PileupJetIDVarProducer.cc.

46  {
49 
50  iEvent.getByToken(srcJet_, srcJet);
51  iEvent.getByToken(srcPileupJetId_, srcPileupJetId);
52 
53  unsigned int nJet = srcJet->size();
54 
55  std::vector<float> dR2Mean(nJet, -1);
56  std::vector<float> majW(nJet, -1);
57  std::vector<float> minW(nJet, -1);
58  std::vector<float> frac01(nJet, -1);
59  std::vector<float> frac02(nJet, -1);
60  std::vector<float> frac03(nJet, -1);
61  std::vector<float> frac04(nJet, -1);
62  std::vector<float> ptD(nJet, -1);
63  std::vector<float> beta(nJet, -1);
64  std::vector<float> pull(nJet, -1);
65  std::vector<float> jetR(nJet, -1);
66  std::vector<float> jetRchg(nJet, -1);
67  std::vector<int> nCharged(nJet, -1);
68 
69  for (unsigned int ij = 0; ij < nJet; ij++) {
70  auto jet = srcJet->ptrAt(ij);
71 
72  edm::RefToBase<pat::Jet> jetRef = srcJet->refAt(ij);
73 
74  dR2Mean[ij] = (*srcPileupJetId)[jetRef].dR2Mean();
75  majW[ij] = (*srcPileupJetId)[jetRef].majW();
76  minW[ij] = (*srcPileupJetId)[jetRef].minW();
77  frac01[ij] = (*srcPileupJetId)[jetRef].frac01();
78  frac02[ij] = (*srcPileupJetId)[jetRef].frac02();
79  frac03[ij] = (*srcPileupJetId)[jetRef].frac03();
80  frac04[ij] = (*srcPileupJetId)[jetRef].frac04();
81  ptD[ij] = (*srcPileupJetId)[jetRef].ptD();
82  beta[ij] = (*srcPileupJetId)[jetRef].beta();
83  pull[ij] = (*srcPileupJetId)[jetRef].pull();
84  jetR[ij] = (*srcPileupJetId)[jetRef].jetR();
85  jetRchg[ij] = (*srcPileupJetId)[jetRef].jetRchg();
86  nCharged[ij] = (*srcPileupJetId)[jetRef].nCharged();
87  }
88 
89  std::unique_ptr<edm::ValueMap<float>> dR2MeanV(new edm::ValueMap<float>());
90  edm::ValueMap<float>::Filler filler_dR2Mean(*dR2MeanV);
91  filler_dR2Mean.insert(srcJet, dR2Mean.begin(), dR2Mean.end());
92  filler_dR2Mean.fill();
93  iEvent.put(std::move(dR2MeanV), "dR2Mean");
94 
95  std::unique_ptr<edm::ValueMap<float>> majWV(new edm::ValueMap<float>());
96  edm::ValueMap<float>::Filler filler_majW(*majWV);
97  filler_majW.insert(srcJet, majW.begin(), majW.end());
98  filler_majW.fill();
99  iEvent.put(std::move(majWV), "majW");
100 
101  std::unique_ptr<edm::ValueMap<float>> minWV(new edm::ValueMap<float>());
102  edm::ValueMap<float>::Filler filler_minW(*minWV);
103  filler_minW.insert(srcJet, minW.begin(), minW.end());
104  filler_minW.fill();
105  iEvent.put(std::move(minWV), "minW");
106 
107  std::unique_ptr<edm::ValueMap<float>> frac01V(new edm::ValueMap<float>());
108  edm::ValueMap<float>::Filler filler_frac01(*frac01V);
109  filler_frac01.insert(srcJet, frac01.begin(), frac01.end());
110  filler_frac01.fill();
111  iEvent.put(std::move(frac01V), "frac01");
112 
113  std::unique_ptr<edm::ValueMap<float>> frac02V(new edm::ValueMap<float>());
114  edm::ValueMap<float>::Filler filler_frac02(*frac02V);
115  filler_frac02.insert(srcJet, frac02.begin(), frac02.end());
116  filler_frac02.fill();
117  iEvent.put(std::move(frac02V), "frac02");
118 
119  std::unique_ptr<edm::ValueMap<float>> frac03V(new edm::ValueMap<float>());
120  edm::ValueMap<float>::Filler filler_frac03(*frac03V);
121  filler_frac03.insert(srcJet, frac03.begin(), frac03.end());
122  filler_frac03.fill();
123  iEvent.put(std::move(frac03V), "frac03");
124 
125  std::unique_ptr<edm::ValueMap<float>> frac04V(new edm::ValueMap<float>());
126  edm::ValueMap<float>::Filler filler_frac04(*frac04V);
127  filler_frac04.insert(srcJet, frac04.begin(), frac04.end());
128  filler_frac04.fill();
129  iEvent.put(std::move(frac04V), "frac04");
130 
131  std::unique_ptr<edm::ValueMap<float>> ptDV(new edm::ValueMap<float>());
132  edm::ValueMap<float>::Filler filler_ptD(*ptDV);
133  filler_ptD.insert(srcJet, ptD.begin(), ptD.end());
134  filler_ptD.fill();
135  iEvent.put(std::move(ptDV), "ptD");
136 
137  std::unique_ptr<edm::ValueMap<float>> betaV(new edm::ValueMap<float>());
138  edm::ValueMap<float>::Filler filler_beta(*betaV);
139  filler_beta.insert(srcJet, beta.begin(), beta.end());
140  filler_beta.fill();
141  iEvent.put(std::move(betaV), "beta");
142 
143  std::unique_ptr<edm::ValueMap<float>> pullV(new edm::ValueMap<float>());
144  edm::ValueMap<float>::Filler filler_pull(*pullV);
145  filler_pull.insert(srcJet, pull.begin(), pull.end());
146  filler_pull.fill();
147  iEvent.put(std::move(pullV), "pull");
148 
149  std::unique_ptr<edm::ValueMap<float>> jetRV(new edm::ValueMap<float>());
150  edm::ValueMap<float>::Filler filler_jetR(*jetRV);
151  filler_jetR.insert(srcJet, jetR.begin(), jetR.end());
152  filler_jetR.fill();
153  iEvent.put(std::move(jetRV), "jetR");
154 
155  std::unique_ptr<edm::ValueMap<float>> jetRchgV(new edm::ValueMap<float>());
156  edm::ValueMap<float>::Filler filler_jetRchg(*jetRchgV);
157  filler_jetRchg.insert(srcJet, jetRchg.begin(), jetRchg.end());
158  filler_jetRchg.fill();
159  iEvent.put(std::move(jetRchgV), "jetRchg");
160 
161  std::unique_ptr<edm::ValueMap<int>> nChargedV(new edm::ValueMap<int>());
162  edm::ValueMap<int>::Filler filler_nCharged(*nChargedV);
163  filler_nCharged.insert(srcJet, nCharged.begin(), nCharged.end());
164  filler_nCharged.fill();
165  iEvent.put(std::move(nChargedV), "nCharged");
166 }

References HLT_FULL_cff::beta, edm::helper::Filler< Map >::fill(), iEvent, edm::helper::Filler< Map >::insert(), metsig::jet, LHEJetFilter_cfi::jetR, eostools::move(), HLT_FULL_cff::nCharged, jets_cff::ptD, electrons_cff::srcJet, srcJet_, and srcPileupJetId_.

Member Data Documentation

◆ srcJet_

edm::EDGetTokenT<edm::View<pat::Jet> > PileupJetIDVarProducer::srcJet_
private

Definition at line 41 of file PileupJetIDVarProducer.cc.

Referenced by produce().

◆ srcPileupJetId_

edm::EDGetTokenT<edm::ValueMap<StoredPileupJetIdentifier> > PileupJetIDVarProducer::srcPileupJetId_
private

Definition at line 42 of file PileupJetIDVarProducer.cc.

Referenced by produce().

HLT_FULL_cff.nCharged
nCharged
Definition: HLT_FULL_cff.py:33268
jets_cff.ptD
ptD
Definition: jets_cff.py:149
HLT_FULL_cff.beta
beta
Definition: HLT_FULL_cff.py:8651
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
LHEJetFilter_cfi.jetR
jetR
Definition: LHEJetFilter_cfi.py:5
edm::Handle
Definition: AssociativeIterator.h:50
PileupJetIDVarProducer::srcJet_
edm::EDGetTokenT< edm::View< pat::Jet > > srcJet_
Definition: PileupJetIDVarProducer.cc:41
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::View
Definition: CaloClusterFwd.h:14
iEvent
int iEvent
Definition: GenABIO.cc:224
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
metsig::jet
Definition: SignAlgoResolutions.h:47
edm::ValueMap
Definition: ValueMap.h:107
electrons_cff.srcJet
srcJet
Definition: electrons_cff.py:144
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::RefToBase
Definition: AssociativeIterator.h:54
edm::helper::Filler
Definition: ValueMap.h:22
PileupJetIDVarProducer::srcPileupJetId_
edm::EDGetTokenT< edm::ValueMap< StoredPileupJetIdentifier > > srcPileupJetId_
Definition: PileupJetIDVarProducer.cc:42
edm::EDConsumerBase::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: EDConsumerBase.h:159
timingPdfMaker.modname
modname
Definition: timingPdfMaker.py:217
edm::InputTag
Definition: InputTag.h:15