CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CastorJetIDProducer Class Reference

#include <RecoJets/JetProducers/plugins/CastorJetIDProducer.cc>

Inheritance diagram for CastorJetIDProducer:
edm::stream::EDProducer<>

Public Member Functions

 CastorJetIDProducer (const edm::ParameterSet &)
 
 ~CastorJetIDProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

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

Private Attributes

reco::helper::CastorJetIDHelper helper_
 
edm::EDGetTokenT< edm::View< reco::BasicJet > > input_jet_token_
 
edm::InputTag src_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Description: Produces a value map of jet—> jet Id

Definition at line 40 of file CastorJetIDProducer.h.

Constructor & Destructor Documentation

◆ CastorJetIDProducer()

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

Definition at line 17 of file CastorJetIDProducer.cc.

18  : src_(iConfig.getParameter<edm::InputTag>("src")), helper_() {
19  produces<reco::CastorJetIDValueMap>();
20 
21  input_jet_token_ = consumes<edm::View<reco::BasicJet> >(src_);
22 }

References input_jet_token_, and src_.

◆ ~CastorJetIDProducer()

CastorJetIDProducer::~CastorJetIDProducer ( )
override

Definition at line 24 of file CastorJetIDProducer.cc.

24 {}

Member Function Documentation

◆ produce()

void CastorJetIDProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 31 of file CastorJetIDProducer.cc.

31  {
32  // get the input jets
34  iEvent.getByToken(input_jet_token_, h_jets);
35 
36  // allocate the jet--->jetid value map
37  auto castorjetIdValueMap = std::make_unique<reco::CastorJetIDValueMap>();
38  // instantiate the filler with the map
39  reco::CastorJetIDValueMap::Filler filler(*castorjetIdValueMap);
40 
41  // allocate the vector of ids
42  size_t njets = h_jets->size();
43  std::vector<reco::CastorJetID> ids(njets);
44 
45  // loop over the jets
46  for (edm::View<reco::BasicJet>::const_iterator jetsBegin = h_jets->begin(), jetsEnd = h_jets->end(), ijet = jetsBegin;
47  ijet != jetsEnd;
48  ++ijet) {
49  // get the id from each jet
50  helper_.calculate(iEvent, *ijet);
51 
52  ids[ijet - jetsBegin].emEnergy = helper_.emEnergy();
53  ids[ijet - jetsBegin].hadEnergy = helper_.hadEnergy();
54  ids[ijet - jetsBegin].fem = helper_.fem();
55  ids[ijet - jetsBegin].depth = helper_.depth();
56  ids[ijet - jetsBegin].width = helper_.width();
57  ids[ijet - jetsBegin].fhot = helper_.fhot();
58  ids[ijet - jetsBegin].sigmaz = helper_.sigmaz();
59  ids[ijet - jetsBegin].nTowers = helper_.nTowers();
60  }
61 
62  // set up the map
63  filler.insert(h_jets, ids.begin(), ids.end());
64 
65  // fill the vals
66  filler.fill();
67 
68  // write map to the event
69  iEvent.put(std::move(castorjetIdValueMap));
70 }

References reco::helper::CastorJetIDHelper::calculate(), reco::helper::CastorJetIDHelper::depth(), reco::helper::CastorJetIDHelper::emEnergy(), reco::helper::CastorJetIDHelper::fem(), reco::helper::CastorJetIDHelper::fhot(), trigObjTnPSource_cfi::filler, reco::helper::CastorJetIDHelper::hadEnergy(), helper_, iEvent, input_jet_token_, eostools::move(), BTaggingMonitoring_cff::njets, reco::helper::CastorJetIDHelper::nTowers(), reco::helper::CastorJetIDHelper::sigmaz(), and reco::helper::CastorJetIDHelper::width().

Member Data Documentation

◆ helper_

reco::helper::CastorJetIDHelper CastorJetIDProducer::helper_
private

Definition at line 50 of file CastorJetIDProducer.h.

Referenced by produce().

◆ input_jet_token_

edm::EDGetTokenT<edm::View<reco::BasicJet> > CastorJetIDProducer::input_jet_token_
private

Definition at line 52 of file CastorJetIDProducer.h.

Referenced by CastorJetIDProducer(), and produce().

◆ src_

edm::InputTag CastorJetIDProducer::src_
private

Definition at line 49 of file CastorJetIDProducer.h.

Referenced by CastorJetIDProducer().

reco::helper::CastorJetIDHelper::sigmaz
double sigmaz() const
Definition: CastorJetIDHelper.h:31
reco::helper::CastorJetIDHelper::fem
double fem() const
Definition: CastorJetIDHelper.h:27
reco::helper::CastorJetIDHelper::depth
double depth() const
Definition: CastorJetIDHelper.h:29
reco::helper::CastorJetIDHelper::nTowers
int nTowers() const
Definition: CastorJetIDHelper.h:32
reco::helper::CastorJetIDHelper::calculate
void calculate(const edm::Event &event, const reco::BasicJet &jet)
Definition: CastorJetIDHelper.cc:26
edm::Handle
Definition: AssociativeIterator.h:50
CastorJetIDProducer::input_jet_token_
edm::EDGetTokenT< edm::View< reco::BasicJet > > input_jet_token_
Definition: CastorJetIDProducer.h:52
reco::helper::CastorJetIDHelper::emEnergy
double emEnergy() const
Definition: CastorJetIDHelper.h:25
CastorJetIDProducer::helper_
reco::helper::CastorJetIDHelper helper_
Definition: CastorJetIDProducer.h:50
CastorJetIDProducer::src_
edm::InputTag src_
Definition: CastorJetIDProducer.h:49
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
BTaggingMonitoring_cff.njets
njets
Definition: BTaggingMonitoring_cff.py:10
reco::helper::CastorJetIDHelper::hadEnergy
double hadEnergy() const
Definition: CastorJetIDHelper.h:26
edm::View::const_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
edm::helper::Filler
Definition: ValueMap.h:22
reco::helper::CastorJetIDHelper::fhot
double fhot() const
Definition: CastorJetIDHelper.h:30
edm::InputTag
Definition: InputTag.h:15
reco::helper::CastorJetIDHelper::width
double width() const
Definition: CastorJetIDHelper.h:28