CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CSCSegmentProducer Class Reference

#include <CSCSegmentProducer.h>

Inheritance diagram for CSCSegmentProducer:
edm::stream::EDProducer<>

Public Member Functions

 CSCSegmentProducer (const edm::ParameterSet &)
 Constructor. More...
 
void produce (edm::Event &, const edm::EventSetup &) override
 Produce the CSCSegment collection. More...
 
 ~CSCSegmentProducer () 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
 
edm::EDGetTokenT< CSCRecHit2DCollectionm_token
 
CSCSegmentBuildersegmentBuilder_
 

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

Produces a collection of CSCSegment's in endcap muon CSCs.

Definition at line 19 of file CSCSegmentProducer.h.

Constructor & Destructor Documentation

CSCSegmentProducer::CSCSegmentProducer ( const edm::ParameterSet pas)
explicit

Constructor.

Definition at line 18 of file CSCSegmentProducer.cc.

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

18  : iev(0) {
19 
20  m_token = consumes<CSCRecHit2DCollection>( pas.getParameter<edm::InputTag>("inputObjects") );
21  segmentBuilder_ = new CSCSegmentBuilder(pas); // pass on the PS
22 
23  // register what this produces
24  produces<CSCSegmentCollection>();
25 }
T getParameter(std::string const &) const
edm::EDGetTokenT< CSCRecHit2DCollection > m_token
CSCSegmentBuilder * segmentBuilder_
CSCSegmentProducer::~CSCSegmentProducer ( )
override

Destructor.

Definition at line 27 of file CSCSegmentProducer.cc.

References iev, LogDebug, and segmentBuilder_.

27  {
28 
29  LogDebug("CSCSegment|CSC") << "deleting CSCSegmentBuilder after " << iev << " events w/csc data.";
30  delete segmentBuilder_;
31 }
#define LogDebug(id)
CSCSegmentBuilder * segmentBuilder_

Member Function Documentation

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

Produce the CSCSegment collection.

Definition at line 33 of file CSCSegmentProducer.cc.

References CSCSegmentBuilder::build(), edm::EventSetup::get(), edm::Event::getByToken(), h, iev, LogDebug, m_token, eostools::move(), edm::Handle< T >::product(), edm::Event::put(), segmentBuilder_, and CSCSegmentBuilder::setGeometry().

33  {
34 
35  LogDebug("CSCSegment|CSC") << "start producing segments for " << ++iev << "th event with csc data";
36 
37  // find the geometry (& conditions?) for this event & cache it in the builder
38 
40  setup.get<MuonGeometryRecord>().get(h);
41  const CSCGeometry* pgeom = &*h;
43 
44  // get the collection of CSCRecHit2D
46  ev.getByToken( m_token, cscRecHits);
47 
48  // create empty collection of Segments
49  auto oc = std::make_unique<CSCSegmentCollection>();
50 
51  // fill the collection
52  segmentBuilder_->build(cscRecHits.product(), *oc); //@@ FILL oc
53 
54  // put collection in event
55  ev.put(std::move(oc));
56 }
#define LogDebug(id)
void build(const CSCRecHit2DCollection *rechits, CSCSegmentCollection &oc)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
edm::EDGetTokenT< CSCRecHit2DCollection > m_token
CSCSegmentBuilder * segmentBuilder_
T const * product() const
Definition: Handle.h:81
T get() const
Definition: EventSetup.h:68
void setGeometry(const CSCGeometry *geom)
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

int CSCSegmentProducer::iev
private

Definition at line 29 of file CSCSegmentProducer.h.

Referenced by produce(), and ~CSCSegmentProducer().

edm::EDGetTokenT<CSCRecHit2DCollection> CSCSegmentProducer::m_token
private

Definition at line 31 of file CSCSegmentProducer.h.

Referenced by CSCSegmentProducer(), and produce().

CSCSegmentBuilder* CSCSegmentProducer::segmentBuilder_
private

Definition at line 30 of file CSCSegmentProducer.h.

Referenced by CSCSegmentProducer(), produce(), and ~CSCSegmentProducer().