CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
ME0SegmentProducer Class Reference
Inheritance diagram for ME0SegmentProducer:
edm::stream::EDProducer<>

Public Member Functions

 ME0SegmentProducer (const edm::ParameterSet &)
 Constructor. More...
 
void produce (edm::Event &, const edm::EventSetup &) override
 Produce the ME0Segment collection. More...
 
 ~ME0SegmentProducer () override
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

int iev
 
edm::ESGetToken< ME0Geometry,
MuonGeometryRecord
me0GeomToken_
 
std::unique_ptr
< ME0SegmentBuilder
segmentBuilder_
 
edm::EDGetTokenT
< ME0RecHitCollection
theME0RecHitToken
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

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 40 of file ME0SegmentProducer.cc.

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

40  : iev(0) {
41  theME0RecHitToken = consumes<ME0RecHitCollection>(ps.getParameter<edm::InputTag>("me0RecHitLabel"));
42  segmentBuilder_ = std::make_unique<ME0SegmentBuilder>(ps); // pass on the Parameter Set
43  me0GeomToken_ = esConsumes<ME0Geometry, MuonGeometryRecord>();
44  // register what this produces
45  produces<ME0SegmentCollection>();
46 }
std::unique_ptr< ME0SegmentBuilder > segmentBuilder_
edm::EDGetTokenT< ME0RecHitCollection > theME0RecHitToken
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< ME0Geometry, MuonGeometryRecord > me0GeomToken_
ME0SegmentProducer::~ME0SegmentProducer ( )
inlineoverride

Destructor.

Definition at line 29 of file ME0SegmentProducer.cc.

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 edm::Event::getByToken(), edm::EventSetup::getHandle(), iev, LogDebug, me0GeomToken_, me0RecHits_cfi::me0RecHits, eostools::move(), edm::Handle< T >::product(), edm::Event::put(), segmentBuilder_, and theME0RecHitToken.

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

Member Data Documentation

int ME0SegmentProducer::iev
private

Definition at line 34 of file ME0SegmentProducer.cc.

Referenced by produce().

edm::ESGetToken<ME0Geometry, MuonGeometryRecord> ME0SegmentProducer::me0GeomToken_
private

Definition at line 37 of file ME0SegmentProducer.cc.

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