CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 &)
 
virtual void beginJob ()
 
virtual void endJob ()
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~AlCaDiJetsProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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 & 
itemsToGetFromEvent () 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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::PFCandidateCollection
tok_PFCand_
 
edm::EDGetTokenT
< reco::PFJetCollection
tok_PFJet_
 
edm::EDGetTokenT
< reco::VertexCollection
tok_Vertex_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
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)
 
- 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 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 65 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_.

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

Definition at line 94 of file AlCaDiJetsProducer.cc.

94 { }

Member Function Documentation

void AlCaDiJetsProducer::beginJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 96 of file AlCaDiJetsProducer.cc.

96 { }
void AlCaDiJetsProducer::endJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 98 of file AlCaDiJetsProducer.cc.

References nAll_, and nSelect_.

Referenced by o2o.O2ORunMgr::executeJob().

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

Implements edm::EDProducer.

Definition at line 108 of file AlCaDiJetsProducer.cc.

References accept(), edm::SortedCollection< T, SORT >::begin(), edm::InputTag::encode(), edm::SortedCollection< T, SORT >::end(), edm::Event::getByToken(), hcalSimParameters_cfi::ho, edm::HandleBase::isValid(), labelHBHE_, labelHF_, labelHO_, labelPFCandidate_, labelPFJet_, labelVertex_, eostools::move(), nAll_, nSelect_, edm::Handle< T >::product(), edm::Event::put(), reco::return(), select(), tok_HBHE_, tok_HF_, tok_HO_, tok_PFCand_, tok_PFJet_, and tok_Vertex_.

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

108  {
109  nAll_++;
110 
111  // Access the collections from iEvent
113  iEvent.getByToken(tok_PFJet_,pfjet);
114  if (!pfjet.isValid()) {
115  edm::LogWarning("AlCaDiJets") << "AlCaDiJetsProducer: Error! can't get product " << labelPFJet_;
116  return ;
117  }
118  const reco::PFJetCollection pfjets = *(pfjet.product());
119 
121  iEvent.getByToken(tok_PFCand_,pfc);
122  if (!pfc.isValid()) {
123  edm::LogWarning("AlCaDiJets") << "AlCaDiJetsProducer: Error! can't get product " << labelPFCandidate_;
124  return ;
125  }
126  const reco::PFCandidateCollection pfcand = *(pfc.product());
127 
129  iEvent.getByToken(tok_Vertex_,vt);
130  if (!vt.isValid()) {
131  edm::LogWarning("AlCaDiJets") << "AlCaDiJetsProducer: Error! can't get product " << labelVertex_;
132  return ;
133  }
134  const reco::VertexCollection vtx = *(vt.product());
135 
137  iEvent.getByToken(tok_HBHE_,hbhe);
138  if (!hbhe.isValid()) {
139  edm::LogWarning("AlCaDiJets") << "AlCaDiJetsProducer: Error! can't get product " << labelHBHE_;
140  return ;
141  }
143 
145  iEvent.getByToken(tok_HO_,ho);
146  if(!ho.isValid()) {
147  edm::LogWarning("AlCaDiJets") << "AlCaDiJetsProducer: Error! can't get product " << labelHO_;
148  return ;
149  }
151 
153  iEvent.getByToken(tok_HF_,hf);
154  if(!hf.isValid()) {
155  edm::LogWarning("AlCaDiJets") << "AlCaDiJetsProducer: Error! can't get product " << labelHF_;
156  return ;
157  }
159 
160  // See if this event is useful
161  bool accept = select(pfjets);
162  if (accept) {
163  nSelect_++;
164 
165  //Copy from standard place
166  auto miniPFjetCollection = std::make_unique<reco::PFJetCollection>();
167  for(reco::PFJetCollection::const_iterator pfjetItr=pfjets.begin();
168  pfjetItr!=pfjets.end(); pfjetItr++) {
169  miniPFjetCollection->push_back(*pfjetItr);
170  }
171 
172  auto miniPFCandCollection = std::make_unique<reco::PFCandidateCollection>();
173  for(reco::PFCandidateCollection::const_iterator pfcItr=pfcand.begin();
174  pfcItr!=pfcand.end(); pfcItr++) {
175  miniPFCandCollection->push_back(*pfcItr);
176  }
177 
178  auto miniVtxCollection = std::make_unique<reco::VertexCollection>();
179  for(reco::VertexCollection::const_iterator vtxItr=vtx.begin();
180  vtxItr!=vtx.end(); vtxItr++) {
181  miniVtxCollection->push_back(*vtxItr);
182  }
183 
184  auto miniHBHECollection = std::make_unique<edm::SortedCollection<HBHERecHit,edm::StrictWeakOrdering<HBHERecHit>>>();
185  for(edm::SortedCollection<HBHERecHit,edm::StrictWeakOrdering<HBHERecHit> >::const_iterator hbheItr=Hithbhe.begin();
186  hbheItr!=Hithbhe.end(); hbheItr++) {
187  miniHBHECollection->push_back(*hbheItr);
188  }
189 
190  auto miniHOCollection = std::make_unique<edm::SortedCollection<HORecHit,edm::StrictWeakOrdering<HORecHit>>>();
191  for(edm::SortedCollection<HORecHit,edm::StrictWeakOrdering<HORecHit> >::const_iterator hoItr=Hitho.begin();
192  hoItr!=Hitho.end(); hoItr++) {
193  miniHOCollection->push_back(*hoItr);
194  }
195 
196  auto miniHFCollection = std::make_unique<edm::SortedCollection<HFRecHit,edm::StrictWeakOrdering<HFRecHit>>>();
197  for(edm::SortedCollection<HFRecHit,edm::StrictWeakOrdering<HFRecHit> >::const_iterator hfItr=Hithf.begin();
198  hfItr!=Hithf.end(); hfItr++) {
199  miniHFCollection->push_back(*hfItr);
200  }
201 
202  //Put them in the event
203  iEvent.put(std::move(miniPFjetCollection), labelPFJet_.encode());
204  iEvent.put(std::move(miniHBHECollection), labelHBHE_.encode());
205  iEvent.put(std::move(miniHFCollection), labelHF_.encode());
206  iEvent.put(std::move(miniHOCollection), labelHO_.encode());
207  //iEvent.put(std::move(miniTriggerCollection), labelTrigger_.encode());
208  iEvent.put(std::move(miniPFCandCollection), labelPFCandidate_.encode());
209  iEvent.put(std::move(miniVtxCollection), labelVertex_.encode());
210  }
211  return;
212 
213 }
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:122
edm::InputTag labelPFCandidate_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
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
edm::EDGetTokenT< edm::SortedCollection< HFRecHit, edm::StrictWeakOrdering< HFRecHit > > > tok_HF_
std::string encode() const
Definition: InputTag.cc:165
def move
Definition: eostools.py:510
edm::InputTag labelPFJet_
edm::EDGetTokenT< reco::VertexCollection > tok_Vertex_
bool isValid() const
Definition: HandleBase.h:75
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:81
return(e1-e2)*(e1-e2)+dp *dp
std::vector< PFJet > PFJetCollection
collection of PFJet objects
edm::InputTag labelVertex_
const_iterator begin() const
bool AlCaDiJetsProducer::select ( reco::PFJetCollection  jt)
private

Member Data Documentation

edm::InputTag AlCaDiJetsProducer::labelHBHE_
private

Definition at line 52 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().

edm::InputTag AlCaDiJetsProducer::labelHF_
private

Definition at line 52 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().

edm::InputTag AlCaDiJetsProducer::labelHO_
private

Definition at line 52 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().

edm::InputTag AlCaDiJetsProducer::labelPFCandidate_
private

Definition at line 52 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().

edm::InputTag AlCaDiJetsProducer::labelPFJet_
private

Definition at line 52 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().

edm::InputTag AlCaDiJetsProducer::labelVertex_
private

Definition at line 52 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().

double AlCaDiJetsProducer::minPtJet_
private

Definition at line 53 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and select().

int AlCaDiJetsProducer::nAll_
private

Definition at line 54 of file AlCaDiJetsProducer.cc.

Referenced by endJob(), and produce().

int AlCaDiJetsProducer::nSelect_
private

Definition at line 54 of file AlCaDiJetsProducer.cc.

Referenced by endJob(), and produce().

Definition at line 57 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), 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().

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

Definition at line 61 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().

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

Definition at line 56 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().

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

Definition at line 62 of file AlCaDiJetsProducer.cc.

Referenced by AlCaDiJetsProducer(), and produce().