CMS 3D CMS Logo

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

Public Member Functions

 AlCaDiJetsProducer (const edm::ParameterSet &)
 
void beginJob () override
 
void endJob () override
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~AlCaDiJetsProducer () 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
 
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)
 
 ~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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (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::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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

bool select (reco::PFJetCollection)
 

Private Attributes

edm::InputTag labelHBHE_
 
edm::InputTag labelHF_
 
edm::InputTag labelHO_
 
edm::InputTag labelPFCandidate_
 
edm::InputTag labelPFJet_
 
edm::InputTag labelVertex_
 
double minPtJet_
 
int nAll_
 
int nSelect_
 
edm::EDGetTokenT< edm::SortedCollection< HBHERecHit, edm::StrictWeakOrdering< HBHERecHit > > > tok_HBHE_
 
edm::EDGetTokenT< edm::SortedCollection< HFRecHit, edm::StrictWeakOrdering< HFRecHit > > > tok_HF_
 
edm::EDGetTokenT< edm::SortedCollection< HORecHit, edm::StrictWeakOrdering< HORecHit > > > tok_HO_
 
edm::EDGetTokenT< reco::PFCandidateCollectiontok_PFCand_
 
edm::EDGetTokenT< reco::PFJetCollectiontok_PFJet_
 
edm::EDGetTokenT< reco::VertexCollectiontok_Vertex_
 

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 wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
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<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 40 of file AlCaDiJetsProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 66 of file AlCaDiJetsProducer.cc.

References edm::InputTag::encode(), edm::ParameterSet::getParameter(), labelHBHE_, labelHF_, labelHO_, labelPFCandidate_, labelPFJet_, labelVertex_, minPtJet_, tok_HBHE_, tok_HF_, tok_HO_, tok_PFCand_, tok_PFJet_, and tok_Vertex_.

66  : nAll_(0), nSelect_(0) {
67  // Take input
68  labelPFJet_ = iConfig.getParameter<edm::InputTag>("PFjetInput");
69  labelHBHE_ = iConfig.getParameter<edm::InputTag>("HBHEInput");
70  labelHF_ = iConfig.getParameter<edm::InputTag>("HFInput");
71  labelHO_ = iConfig.getParameter<edm::InputTag>("HOInput");
72  //labelTrigger_ = iConfig.getParameter<edm::InputTag>("TriggerResults");
73  labelPFCandidate_ = iConfig.getParameter<edm::InputTag>("particleFlowInput");
74  labelVertex_ = iConfig.getParameter<edm::InputTag>("VertexInput");
75  minPtJet_ = iConfig.getParameter<double>("MinPtJet");
76 
77  tok_PFJet_ = consumes<reco::PFJetCollection>(labelPFJet_);
78  tok_HBHE_ = consumes<edm::SortedCollection<HBHERecHit, edm::StrictWeakOrdering<HBHERecHit>>>(labelHBHE_);
79  tok_HF_ = consumes<edm::SortedCollection<HFRecHit, edm::StrictWeakOrdering<HFRecHit>>>(labelHF_);
80  tok_HO_ = consumes<edm::SortedCollection<HORecHit, edm::StrictWeakOrdering<HORecHit>>>(labelHO_);
81  //tok_TrigRes_= consumes<edm::TriggerResults>(labelTrigger_);
82  tok_PFCand_ = consumes<reco::PFCandidateCollection>(labelPFCandidate_);
83  tok_Vertex_ = consumes<reco::VertexCollection>(labelVertex_);
84 
85  // register your products
86  produces<reco::PFJetCollection>(labelPFJet_.encode());
87  produces<edm::SortedCollection<HBHERecHit, edm::StrictWeakOrdering<HBHERecHit>>>(labelHBHE_.encode());
88  produces<edm::SortedCollection<HFRecHit, edm::StrictWeakOrdering<HFRecHit>>>(labelHF_.encode());
89  produces<edm::SortedCollection<HORecHit, edm::StrictWeakOrdering<HORecHit>>>(labelHO_.encode());
90  //produces<edm::TriggerResults>(labelTrigger_.encode());
91  produces<reco::PFCandidateCollection>(labelPFCandidate_.encode());
92  produces<reco::VertexCollection>(labelVertex_.encode());
93 }
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::SortedCollection< HBHERecHit, edm::StrictWeakOrdering< HBHERecHit > > > tok_HBHE_
edm::InputTag labelPFCandidate_
edm::EDGetTokenT< edm::SortedCollection< HORecHit, edm::StrictWeakOrdering< HORecHit > > > tok_HO_
edm::InputTag labelHBHE_
edm::EDGetTokenT< reco::PFJetCollection > tok_PFJet_
std::string encode() const
Definition: InputTag.cc:159
edm::EDGetTokenT< edm::SortedCollection< HFRecHit, edm::StrictWeakOrdering< HFRecHit > > > tok_HF_
edm::InputTag labelPFJet_
edm::EDGetTokenT< reco::VertexCollection > tok_Vertex_
edm::EDGetTokenT< reco::PFCandidateCollection > tok_PFCand_
edm::InputTag labelVertex_
AlCaDiJetsProducer::~AlCaDiJetsProducer ( )
override

Definition at line 95 of file AlCaDiJetsProducer.cc.

95 {}

Member Function Documentation

void AlCaDiJetsProducer::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDProducer.

Definition at line 97 of file AlCaDiJetsProducer.cc.

97 {}
void AlCaDiJetsProducer::endJob ( void  )
overridevirtual

Reimplemented from edm::EDProducer.

Definition at line 99 of file AlCaDiJetsProducer.cc.

References nAll_, and nSelect_.

Referenced by o2olib.O2ORunMgr::executeJob().

99  {
100  edm::LogInfo("AlcaDiJets") << "Accepts " << nSelect_ << " events from a total of " << nAll_ << " events";
101 }
void AlCaDiJetsProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 111 of file AlCaDiJetsProducer.cc.

References accept(), edm::SortedCollection< T, SORT >::begin(), DEFINE_FWK_MODULE, edm::InputTag::encode(), edm::SortedCollection< T, SORT >::end(), edm::Event::getByToken(), photonIsolationHIProducer_cfi::hbhe, photonIsolationHIProducer_cfi::hf, photonIsolationHIProducer_cfi::ho, edm::HandleBase::isValid(), labelHBHE_, labelHF_, labelHO_, labelPFCandidate_, labelPFJet_, labelVertex_, eostools::move(), nAll_, nSelect_, pfDeepBoostedJetPreprocessParams_cfi::pfcand, edm::Handle< T >::product(), edm::Event::put(), select(), tok_HBHE_, tok_HF_, tok_HO_, tok_PFCand_, tok_PFJet_, tok_Vertex_, and badGlobalMuonTaggersAOD_cff::vtx.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

111  {
112  nAll_++;
113 
114  // Access the collections from iEvent
116  iEvent.getByToken(tok_PFJet_, pfjet);
117  if (!pfjet.isValid()) {
118  edm::LogWarning("AlCaDiJets") << "AlCaDiJetsProducer: Error! can't get product " << labelPFJet_;
119  return;
120  }
121  const reco::PFJetCollection pfjets = *(pfjet.product());
122 
124  iEvent.getByToken(tok_PFCand_, pfc);
125  if (!pfc.isValid()) {
126  edm::LogWarning("AlCaDiJets") << "AlCaDiJetsProducer: Error! can't get product " << labelPFCandidate_;
127  return;
128  }
129  const reco::PFCandidateCollection pfcand = *(pfc.product());
130 
132  iEvent.getByToken(tok_Vertex_, vt);
133  if (!vt.isValid()) {
134  edm::LogWarning("AlCaDiJets") << "AlCaDiJetsProducer: Error! can't get product " << labelVertex_;
135  return;
136  }
137  const reco::VertexCollection vtx = *(vt.product());
138 
140  iEvent.getByToken(tok_HBHE_, hbhe);
141  if (!hbhe.isValid()) {
142  edm::LogWarning("AlCaDiJets") << "AlCaDiJetsProducer: Error! can't get product " << labelHBHE_;
143  return;
144  }
146 
148  iEvent.getByToken(tok_HO_, ho);
149  if (!ho.isValid()) {
150  edm::LogWarning("AlCaDiJets") << "AlCaDiJetsProducer: Error! can't get product " << labelHO_;
151  return;
152  }
154 
156  iEvent.getByToken(tok_HF_, hf);
157  if (!hf.isValid()) {
158  edm::LogWarning("AlCaDiJets") << "AlCaDiJetsProducer: Error! can't get product " << labelHF_;
159  return;
160  }
162 
163  // See if this event is useful
164  bool accept = select(pfjets);
165  if (accept) {
166  nSelect_++;
167 
168  //Copy from standard place
169  auto miniPFjetCollection = std::make_unique<reco::PFJetCollection>();
170  for (reco::PFJetCollection::const_iterator pfjetItr = pfjets.begin(); pfjetItr != pfjets.end(); pfjetItr++) {
171  miniPFjetCollection->push_back(*pfjetItr);
172  }
173 
174  auto miniPFCandCollection = std::make_unique<reco::PFCandidateCollection>();
175  for (reco::PFCandidateCollection::const_iterator pfcItr = pfcand.begin(); pfcItr != pfcand.end(); pfcItr++) {
176  miniPFCandCollection->push_back(*pfcItr);
177  }
178 
179  auto miniVtxCollection = std::make_unique<reco::VertexCollection>();
180  for (reco::VertexCollection::const_iterator vtxItr = vtx.begin(); vtxItr != vtx.end(); vtxItr++) {
181  miniVtxCollection->push_back(*vtxItr);
182  }
183 
184  auto miniHBHECollection =
185  std::make_unique<edm::SortedCollection<HBHERecHit, edm::StrictWeakOrdering<HBHERecHit>>>();
187  Hithbhe.begin();
188  hbheItr != Hithbhe.end();
189  hbheItr++) {
190  miniHBHECollection->push_back(*hbheItr);
191  }
192 
193  auto miniHOCollection = std::make_unique<edm::SortedCollection<HORecHit, edm::StrictWeakOrdering<HORecHit>>>();
194  for (edm::SortedCollection<HORecHit, edm::StrictWeakOrdering<HORecHit>>::const_iterator hoItr = Hitho.begin();
195  hoItr != Hitho.end();
196  hoItr++) {
197  miniHOCollection->push_back(*hoItr);
198  }
199 
200  auto miniHFCollection = std::make_unique<edm::SortedCollection<HFRecHit, edm::StrictWeakOrdering<HFRecHit>>>();
201  for (edm::SortedCollection<HFRecHit, edm::StrictWeakOrdering<HFRecHit>>::const_iterator hfItr = Hithf.begin();
202  hfItr != Hithf.end();
203  hfItr++) {
204  miniHFCollection->push_back(*hfItr);
205  }
206 
207  //Put them in the event
208  iEvent.put(std::move(miniPFjetCollection), labelPFJet_.encode());
209  iEvent.put(std::move(miniHBHECollection), labelHBHE_.encode());
210  iEvent.put(std::move(miniHFCollection), labelHF_.encode());
211  iEvent.put(std::move(miniHOCollection), labelHO_.encode());
212  //iEvent.put(std::move(miniTriggerCollection), labelTrigger_.encode());
213  iEvent.put(std::move(miniPFCandCollection), labelPFCandidate_.encode());
214  iEvent.put(std::move(miniVtxCollection), labelVertex_.encode());
215  }
216  return;
217 }
edm::EDGetTokenT< edm::SortedCollection< HBHERecHit, edm::StrictWeakOrdering< HBHERecHit > > > tok_HBHE_
bool select(reco::PFJetCollection)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
edm::InputTag labelPFCandidate_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< edm::SortedCollection< HORecHit, edm::StrictWeakOrdering< HORecHit > > > tok_HO_
edm::InputTag labelHBHE_
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::EDGetTokenT< reco::PFJetCollection > tok_PFJet_
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
std::string encode() const
Definition: InputTag.cc:159
edm::EDGetTokenT< edm::SortedCollection< HFRecHit, edm::StrictWeakOrdering< HFRecHit > > > tok_HF_
edm::InputTag labelPFJet_
edm::EDGetTokenT< reco::VertexCollection > tok_Vertex_
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< reco::PFCandidateCollection > tok_PFCand_
const_iterator end() const
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
T const * product() const
Definition: Handle.h:74
std::vector< PFJet > PFJetCollection
collection of PFJet objects
edm::InputTag labelVertex_
def move(src, dest)
Definition: eostools.py:511
const_iterator begin() const
bool AlCaDiJetsProducer::select ( reco::PFJetCollection  jt)
private

Member Data Documentation

edm::InputTag AlCaDiJetsProducer::labelHBHE_
private

Definition at line 53 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().

edm::InputTag AlCaDiJetsProducer::labelHF_
private

Definition at line 53 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().

edm::InputTag AlCaDiJetsProducer::labelHO_
private

Definition at line 53 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().

edm::InputTag AlCaDiJetsProducer::labelPFCandidate_
private

Definition at line 53 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().

edm::InputTag AlCaDiJetsProducer::labelPFJet_
private

Definition at line 53 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().

edm::InputTag AlCaDiJetsProducer::labelVertex_
private

Definition at line 53 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().

double AlCaDiJetsProducer::minPtJet_
private

Definition at line 54 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and select().

int AlCaDiJetsProducer::nAll_
private

Definition at line 55 of file AlCaDiJetsProducer.cc.

Referenced by endJob(), and produce().

int AlCaDiJetsProducer::nSelect_
private

Definition at line 55 of file AlCaDiJetsProducer.cc.

Referenced by endJob(), and produce().

Definition at line 58 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().

Definition at line 59 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().

Definition at line 60 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().

edm::EDGetTokenT<reco::PFCandidateCollection> AlCaDiJetsProducer::tok_PFCand_
private

Definition at line 62 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().

edm::EDGetTokenT<reco::PFJetCollection> AlCaDiJetsProducer::tok_PFJet_
private

Definition at line 57 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().

edm::EDGetTokenT<reco::VertexCollection> AlCaDiJetsProducer::tok_Vertex_
private

Definition at line 63 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().