CMS 3D CMS Logo

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 ()
 
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
 
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)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
 
- 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 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 38 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 egammaCTFFinalFitWithMaterial_cff::alias, 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

Definition at line 32 of file EventHypothesisProducer.cc.

References nano_cff::electrons, electronSrc_, edm::Event::getByLabel(), fwrapper::jets, jetSrc_, TtSemiLepSignalSelMVAComputer_cfi::mets, metSrc_, eostools::move(), extraflags_cff::muons, muonSrc_, outputName_, muons_cff::photons, photonSrc_, edm::Event::put(), nano_cff::taus, 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::unique_ptr<std::vector<__class__> > ap_hyps( hyps );
87  iEvent.put( std::move(ap_hyps), outputName_);
88 
89 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
vector< PseudoJet > jets
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:535
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

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

Definition at line 51 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().

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

Definition at line 54 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().

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

Definition at line 55 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().

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

Definition at line 50 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().

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

Definition at line 57 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().

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

Definition at line 53 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().

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

Definition at line 52 of file EventHypothesisProducer.h.

Referenced by __class__Producer(), and produce().