CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ME0SegmentProducer Class Reference
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...
 
void produce (edm::Event &, const edm::EventSetup &) override
 Produce the ME0Segment collection. More...
 
virtual ~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)
 
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
 
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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

int iev
 
std::unique_ptr< ME0SegmentBuildersegmentBuilder_
 
edm::EDGetTokenT< ME0RecHitCollectiontheME0RecHitToken
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
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 24 of file ME0SegmentProducer.cc.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 39 of file ME0SegmentProducer.cc.

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

39  : iev(0) {
40 
41  theME0RecHitToken = consumes<ME0RecHitCollection>(ps.getParameter<edm::InputTag>("me0RecHitLabel"));
42  segmentBuilder_ = std::make_unique<ME0SegmentBuilder>(ps); // pass on the Parameter Set
43 
44  // register what this produces
45  produces<ME0SegmentCollection>();
46 }
T getParameter(std::string const &) const
std::unique_ptr< ME0SegmentBuilder > segmentBuilder_
edm::EDGetTokenT< ME0RecHitCollection > theME0RecHitToken
virtual ME0SegmentProducer::~ME0SegmentProducer ( )
inlinevirtual

Destructor.

Definition at line 29 of file ME0SegmentProducer.cc.

References produce().

29 {}

Member Function Documentation

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

Produce the ME0Segment collection.

Definition at line 48 of file ME0SegmentProducer.cc.

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

Referenced by ~ME0SegmentProducer().

48  {
49 
50  LogDebug("ME0SegmentProducer") << "start producing segments for " << ++iev << "th event with ME0 data";
51 
52  // find the geometry (& conditions?) for this event & cache it in the builder
54  setup.get<MuonGeometryRecord>().get(me0g);
55  const ME0Geometry* mgeom = &*me0g;
56  segmentBuilder_->setGeometry(mgeom);
57 
58 
59  // get the collection of ME0RecHit
61  ev.getByToken(theME0RecHitToken,me0RecHits);
62 
63  // create empty collection of Segments
64  auto oc = std::make_unique<ME0SegmentCollection>();
65 
66  // fill the collection
67  segmentBuilder_->build(me0RecHits.product(), *oc); //@@ FILL oc
68 
69  // put collection in event
70  ev.put(std::move(oc));
71 }
#define LogDebug(id)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
std::unique_ptr< ME0SegmentBuilder > segmentBuilder_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
edm::EDGetTokenT< ME0RecHitCollection > theME0RecHitToken
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:55
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

int ME0SegmentProducer::iev
private

Definition at line 34 of file ME0SegmentProducer.cc.

Referenced by produce().

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

Definition at line 36 of file ME0SegmentProducer.cc.

Referenced by ME0SegmentProducer(), and produce().

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

Definition at line 35 of file ME0SegmentProducer.cc.

Referenced by ME0SegmentProducer(), and produce().