CMS 3D CMS Logo

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
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

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
 

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
ME0SegmentProducer::~ME0SegmentProducer ( )
inlineoverride

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:137
std::unique_ptr< ME0SegmentBuilder > segmentBuilder_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
edm::EDGetTokenT< ME0RecHitCollection > theME0RecHitToken
T const * product() const
Definition: Handle.h:81
T get() const
Definition: EventSetup.h:63
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().