test
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
ME0SegmentProducer Class Reference

#include <ME0SegmentProducer.h>

Inheritance diagram for ME0SegmentProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ME0SegmentProducer (const edm::ParameterSet &)
 Constructor. More...
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 Produce the ME0Segment collection. More...
 
 ~ME0SegmentProducer ()
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

int iev
 
std::unique_ptr
< ME0SegmentBuilder
segmentBuilder_
 
edm::EDGetTokenT
< ME0RecHitCollection
theME0RecHitToken
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase 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::stream::EDProducerBase
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

CSCSegmentProducer Produces a collection of ME0Segment's in endcap muon ME0s.

Author
Marcello Maggi

Definition at line 19 of file ME0SegmentProducer.h.

Constructor & Destructor Documentation

ME0SegmentProducer::ME0SegmentProducer ( const edm::ParameterSet ps)
explicit

Constructor.

Definition at line 18 of file ME0SegmentProducer.cc.

References edm::ParameterSet::getParameter(), segmentBuilder_, and theME0RecHitToken.

18  : iev(0) {
19 
20  theME0RecHitToken = consumes<ME0RecHitCollection>(ps.getParameter<edm::InputTag>("me0RecHitLabel"));
21  segmentBuilder_ = std::unique_ptr<ME0SegmentBuilder>(new ME0SegmentBuilder(ps)); // pass on the Parameter Set
22 
23  // register what this produces
24  produces<ME0SegmentCollection>();
25 }
T getParameter(std::string const &) const
std::unique_ptr< ME0SegmentBuilder > segmentBuilder_
edm::EDGetTokenT< ME0RecHitCollection > theME0RecHitToken
ME0SegmentProducer::~ME0SegmentProducer ( )

Destructor.

Definition at line 27 of file ME0SegmentProducer.cc.

27 {}

Member Function Documentation

void ME0SegmentProducer::produce ( edm::Event ev,
const edm::EventSetup setup 
)
virtual

Produce the ME0Segment collection.

Implements edm::stream::EDProducerBase.

Definition at line 29 of file ME0SegmentProducer.cc.

References edm::EventSetup::get(), edm::Event::getByToken(), iev, LogDebug, me0RecHits_cfi::me0RecHits, edm::Handle< T >::product(), edm::Event::put(), segmentBuilder_, and theME0RecHitToken.

29  {
30 
31  LogDebug("ME0SegmentProducer") << "start producing segments for " << ++iev << "th event with csc data";
32 
33  // find the geometry (& conditions?) for this event & cache it in the builder
35  setup.get<MuonGeometryRecord>().get(me0g);
36  const ME0Geometry* mgeom = &*me0g;
37  segmentBuilder_->setGeometry(mgeom);
38 
39 
40  // get the collection of ME0RecHit
42  ev.getByToken(theME0RecHitToken,me0RecHits);
43 
44  // create empty collection of Segments
45  std::auto_ptr<ME0SegmentCollection> oc( new ME0SegmentCollection );
46 
47  // fill the collection
48  segmentBuilder_->build(me0RecHits.product(), *oc); //@@ FILL oc
49 
50  // put collection in event
51  ev.put(oc);
52 }
#define LogDebug(id)
std::unique_ptr< ME0SegmentBuilder > segmentBuilder_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
edm::EDGetTokenT< ME0RecHitCollection > theME0RecHitToken
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:56

Member Data Documentation

int ME0SegmentProducer::iev
private

Definition at line 29 of file ME0SegmentProducer.h.

Referenced by produce().

std::unique_ptr<ME0SegmentBuilder> ME0SegmentProducer::segmentBuilder_
private

Definition at line 31 of file ME0SegmentProducer.h.

Referenced by ME0SegmentProducer(), and produce().

edm::EDGetTokenT<ME0RecHitCollection> ME0SegmentProducer::theME0RecHitToken
private

Definition at line 30 of file ME0SegmentProducer.h.

Referenced by ME0SegmentProducer(), and produce().