CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
PileupJPTJetIdProducer Class Reference
Inheritance diagram for PileupJPTJetIdProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PileupJPTJetIdProducer (const edm::ParameterSet &)
 
 ~PileupJPTJetIdProducer () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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

Private Attributes

bool allowMissingInputs_
 
edm::EDGetTokenT< edm::View< reco::JPTJet > > input_token_
 
edm::InputTag jets_
 
cms::PileupJPTJetIdAlgopualgo
 
int verbosity
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer 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
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 22 of file PileupJPTJetIdProducer.cc.

Constructor & Destructor Documentation

◆ PileupJPTJetIdProducer()

PileupJPTJetIdProducer::PileupJPTJetIdProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 38 of file PileupJPTJetIdProducer.cc.

38  {
39  jets_ = iConfig.getParameter<edm::InputTag>("jets");
40  input_token_ = consumes<edm::View<reco::JPTJet>>(jets_);
41  verbosity = iConfig.getParameter<int>("Verbosity");
42  allowMissingInputs_ = iConfig.getUntrackedParameter<bool>("AllowMissingInputs", false);
43  pualgo = new cms::PileupJPTJetIdAlgo(iConfig);
45  produces<edm::ValueMap<float>>("JPTPUDiscriminant");
46  produces<edm::ValueMap<int>>("JPTPUId");
47 }

References allowMissingInputs_, cms::PileupJPTJetIdAlgo::bookMVAReader(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), input_token_, jets_, pualgo, and verbosity.

◆ ~PileupJPTJetIdProducer()

PileupJPTJetIdProducer::~PileupJPTJetIdProducer ( )
override

Definition at line 50 of file PileupJPTJetIdProducer.cc.

50 {}

Member Function Documentation

◆ produce()

void PileupJPTJetIdProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

|eta|<2.6

Implements edm::EDProducer.

Definition at line 53 of file PileupJPTJetIdProducer.cc.

53  {
54  using namespace edm;
55  using namespace std;
56  using namespace reco;
58  iEvent.getByToken(input_token_, jets);
59  vector<float> mva;
60  vector<int> idflag;
61  for (unsigned int i = 0; i < jets->size(); ++i) {
62  int b = -1;
63  const JPTJet& jet = jets->at(i);
64 
65  float mvapu = pualgo->fillJPTBlock(&jet);
66 
67  mva.push_back(mvapu);
68 
69  // Get PUid type
71  //WP 95% JPT PUID > 0.3
72  //WP 90% JPT PUID > 0.7
73  //WP 80% JPT PUID > 0.9
74 
75  //|eta|>=2.6
76  //WP 90% JPT PUID > -0.55
77  //WP 80% JPT PUID > -0.3
78  //WP 70% JPT PUID > -0.1
79 
80  if (fabs(jet.eta()) < 2.6) {
81  if (mvapu > 0.3)
82  b = 0;
83  if (mvapu > 0.7)
84  b = 1;
85  if (mvapu > 0.9)
86  b = 2;
87  } else {
88  if (mvapu > -0.55)
89  b = 0;
90  if (mvapu > -0.3)
91  b = 1;
92  if (mvapu > -0.1)
93  b = 2;
94  }
95 
96  idflag.push_back(b);
97 
98  if (verbosity > 0)
99  std::cout << " PUID producer::Corrected JPT Jet is " << jet.pt() << " " << jet.eta() << " " << jet.phi() << " "
100  << jet.getSpecific().Zch << std::endl;
101  }
102 
103  auto mvaout = std::make_unique<ValueMap<float>>();
104  ValueMap<float>::Filler mvafiller(*mvaout);
105  mvafiller.insert(jets, mva.begin(), mva.end());
106  mvafiller.fill();
107  iEvent.put(std::move(mvaout), "JPTPUDiscriminant");
108 
109  auto idflagout = std::make_unique<ValueMap<int>>();
110  ValueMap<int>::Filler idflagfiller(*idflagout);
111  idflagfiller.insert(jets, idflag.begin(), idflag.end());
112  idflagfiller.fill();
113  iEvent.put(std::move(idflagout), "JPTPUId");
114 }

References b, gather_cfg::cout, cms::PileupJPTJetIdAlgo::fillJPTBlock(), mps_fire::i, iEvent, input_token_, metsig::jet, singleTopDQM_cfi::jets, eostools::move(), beam_dqm_sourceclient-live_cfg::mva, pualgo, and verbosity.

Member Data Documentation

◆ allowMissingInputs_

bool PileupJPTJetIdProducer::allowMissingInputs_
private

Definition at line 32 of file PileupJPTJetIdProducer.cc.

Referenced by PileupJPTJetIdProducer().

◆ input_token_

edm::EDGetTokenT<edm::View<reco::JPTJet> > PileupJPTJetIdProducer::input_token_
private

Definition at line 31 of file PileupJPTJetIdProducer.cc.

Referenced by PileupJPTJetIdProducer(), and produce().

◆ jets_

edm::InputTag PileupJPTJetIdProducer::jets_
private

Definition at line 30 of file PileupJPTJetIdProducer.cc.

Referenced by PileupJPTJetIdProducer().

◆ pualgo

cms::PileupJPTJetIdAlgo* PileupJPTJetIdProducer::pualgo
private

Definition at line 34 of file PileupJPTJetIdProducer.cc.

Referenced by PileupJPTJetIdProducer(), and produce().

◆ verbosity

int PileupJPTJetIdProducer::verbosity
private

Definition at line 33 of file PileupJPTJetIdProducer.cc.

Referenced by PileupJPTJetIdProducer(), and produce().

PileupJPTJetIdProducer::input_token_
edm::EDGetTokenT< edm::View< reco::JPTJet > > input_token_
Definition: PileupJPTJetIdProducer.cc:31
reco::JPTJet
Jets made from CaloJets corrected for ZSP and tracks.
Definition: JPTJet.h:28
mps_fire.i
i
Definition: mps_fire.py:428
PileupJPTJetIdProducer::verbosity
int verbosity
Definition: PileupJPTJetIdProducer.cc:33
edm
HLT enums.
Definition: AlignableModifier.h:19
cms::PileupJPTJetIdAlgo::fillJPTBlock
float fillJPTBlock(const reco::JPTJet *jet)
Definition: PileupJPTJetIdAlgo.cc:104
gather_cfg.cout
cout
Definition: gather_cfg.py:144
cms::PileupJPTJetIdAlgo::bookMVAReader
void bookMVAReader()
Definition: PileupJPTJetIdAlgo.cc:63
PileupJPTJetIdProducer::pualgo
cms::PileupJPTJetIdAlgo * pualgo
Definition: PileupJPTJetIdProducer.cc:34
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
beam_dqm_sourceclient-live_cfg.mva
mva
Definition: beam_dqm_sourceclient-live_cfg.py:126
edm::Handle
Definition: AssociativeIterator.h:50
PileupJPTJetIdProducer::jets_
edm::InputTag jets_
Definition: PileupJPTJetIdProducer.cc:30
b
double b
Definition: hdecay.h:118
cms::PileupJPTJetIdAlgo
Definition: PileupJPTJetIdAlgo.h:27
iEvent
int iEvent
Definition: GenABIO.cc:224
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
metsig::jet
Definition: SignAlgoResolutions.h:47
edm::ValueMap
Definition: ValueMap.h:107
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::InputTag
Definition: InputTag.h:15
PileupJPTJetIdProducer::allowMissingInputs_
bool allowMissingInputs_
Definition: PileupJPTJetIdProducer.cc:32