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 Attributes
pat::__class__Producer Class Reference

#include <EventHypothesisProducer.h>

Inheritance diagram for pat::__class__Producer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 __class__Producer (const edm::ParameterSet &iConfig)
 
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
 ~__class__Producer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::InputTag electronSrc_
 
edm::InputTag jetSrc_
 
edm::InputTag metSrc_
 
edm::InputTag muonSrc_
 
edm::OutputTag outputName_
 
edm::InputTag photonSrc_
 
edm::InputTag tauSrc_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 39 of file EventHypothesisProducer.h.

Constructor & Destructor Documentation

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

Definition at line 8 of file EventHypothesisProducer.cc.

References electronSrc_, edm::ParameterSet::getParameter(), jetSrc_, metSrc_, muonSrc_, outputName_, photonSrc_, and tauSrc_.

8  :
9  public edm::EDProducer(iConfig)
10 {
11 
12  // Here we get the list of common includes
13  muonSrc_ = iConfig.getParameter<edm::InputTag>( "muonSource" );
14  electronSrc_ = iConfig.getParameter<edm::InputTag>( "electronSource" );
15  tauSrc_ = iConfig.getParameter<edm::InputTag>( "tauSource" );
16  photonSrc_ = iConfig.getParameter<edm::InputTag>( "photonSource" );
17  jetSrc_ = iConfig.getParameter<edm::InputTag>( "jetSource" );
18  metSrc_ = iConfig.getParameter<edm::InputTag>( "metSource" );
19 
20  // Here we get the output tag name
21  outputName_ = iConfig.getParameter<edm::OutputTag>("outputName");
22 
23  // This declares the output to the event stream
24  string alias;
25  produces<std::vector<__class__> >(alias = outputName_).setBranchAddress(alias);
26 }
T getParameter(std::string const &) const
__class__Producer::~__class__Producer ( )

Definition at line 28 of file EventHypothesisProducer.cc.

29 {
30 }

Member Function Documentation

__class__Producer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 32 of file EventHypothesisProducer.cc.

References HI_PhotonSkim_cff::electrons, electronSrc_, edm::Event::getByLabel(), fwrapper::jets, jetSrc_, metSrc_, patZpeak::muons, muonSrc_, outputName_, interactiveExample::photons, photonSrc_, edm::Event::put(), and tauSrc_.

33 {
34 
35  // Here is the vector where you should put your hypotheses
36  std::vector<__class__ hyps;
37 
38 
39  // ------------------------------------------------------------------------
40  // Here is where you get the objects you need. The perl script will
41  // uncomment any that you need by reading the event hypothesis text file
42  // ------------------------------------------------------------------------
43 
45  iEvent.getByLabel(muonSrc_, muons);
46 
48  iEvent.getByLabel(electronSrc_, electrons);
49 
51  iEvent.getByLabel(tauSrc_, taus);
52 
54  iEvent.getByLabel(photonSrc_, photons);
55 
57  iEvent.getByLabel(jetSrc_, jets);
58 
60  iEvent.getByLabel(metSrc_, mets);
61 
62 
63  // ------------------------------------------------------------------------
64  // ****** Here is where you put your event hypothesis code ******
65  // ------------------------------------------------------------------------
66  // A: Define a combinatorics loop.
67  // Replace for ( ...;...;...) with your appropriate loop over objects, such as
68  // for ( vector<Muon>::iterator imuon = muons->begin(); imuon != muons->end(); imuon++ )
69  // for ( vector<Muon>::iterator jmuon = imuon + 1; jmuon != muons->end(); jmuon++ )
70  //
71  for ( ...; ...; ... ) {
72  __class__ hyp;
73 
74  // B: Fill "hyp" with your hypothesis information and push it back to the
75  // vector containing them.
76  // For instance,
77  // hyp.muon1() = *imuon;
78  // hyp.muon2() = *jmuon;
79  // hyp.jets() = *jets;
80 
81  hyps.push_back( hyp );
82  }
83 
84 
85  // Here is where we write the hypotheses to the event stream
86  std::auto_ptr<std::vector<__class__> > ap_hyps( hyps );
87  iEvent.put( ap_hyps, outputName_);
88 
89 }
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
vector< PseudoJet > jets
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
tuple muons
Definition: patZpeak.py:38

Member Data Documentation

edm::InputTag pat::__class__Producer::electronSrc_
private

Definition at line 52 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().

edm::InputTag pat::__class__Producer::jetSrc_
private

Definition at line 55 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().

edm::InputTag pat::__class__Producer::metSrc_
private

Definition at line 56 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().

edm::InputTag pat::__class__Producer::muonSrc_
private

Definition at line 51 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().

edm::OutputTag pat::__class__Producer::outputName_
private

Definition at line 58 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().

edm::InputTag pat::__class__Producer::photonSrc_
private

Definition at line 54 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().

edm::InputTag pat::__class__Producer::tauSrc_
private

Definition at line 53 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().