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
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
 
 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< CSCGeometry,
MuonGeometryRecord
m_cscGeometryToken
 
edm::EDGetTokenT
< CSCRecHit2DCollection
m_token
 
CSCSegmentBuildersegmentBuilder_
 

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

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

Definition at line 22 of file CSCSegmentProducer.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 16 of file CSCSegmentProducer.cc.

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

16  : iev(0) {
17  m_token = consumes<CSCRecHit2DCollection>(pas.getParameter<edm::InputTag>("inputObjects"));
18  m_cscGeometryToken = esConsumes<CSCGeometry, MuonGeometryRecord>();
19  segmentBuilder_ = new CSCSegmentBuilder(pas); // pass on the PS
20 
21  // register what this produces
22  produces<CSCSegmentCollection>();
23 }
edm::EDGetTokenT< CSCRecHit2DCollection > m_token
CSCSegmentBuilder * segmentBuilder_
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > m_cscGeometryToken
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
CSCSegmentProducer::~CSCSegmentProducer ( )
override

Destructor.

Definition at line 25 of file CSCSegmentProducer.cc.

References iev, LogDebug, and segmentBuilder_.

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

Member Function Documentation

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

Produce the CSCSegment collection.

Definition at line 30 of file CSCSegmentProducer.cc.

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

30  {
31  LogDebug("CSCSegment|CSC") << "start producing segments for " << ++iev << "th event with csc data";
32 
33  // find the geometry (& conditions?) for this event & cache it in the builder
34 
36  const CSCGeometry* pgeom = &*h;
38 
39  // get the collection of CSCRecHit2D
41  ev.getByToken(m_token, cscRecHits);
42 
43  // create empty collection of Segments
44  auto oc = std::make_unique<CSCSegmentCollection>();
45 
46  // fill the collection
47  segmentBuilder_->build(cscRecHits.product(), *oc); //@@ FILL oc
48 
49  // put collection in event
50  ev.put(std::move(oc));
51 }
void build(const CSCRecHit2DCollection *rechits, CSCSegmentCollection &oc)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::EDGetTokenT< CSCRecHit2DCollection > m_token
def move
Definition: eostools.py:511
CSCSegmentBuilder * segmentBuilder_
edm::ESGetToken< CSCGeometry, MuonGeometryRecord > m_cscGeometryToken
T const * product() const
Definition: Handle.h:70
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:157
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void setGeometry(const CSCGeometry *geom)
#define LogDebug(id)

Member Data Documentation

int CSCSegmentProducer::iev
private

Definition at line 32 of file CSCSegmentProducer.h.

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

edm::ESGetToken<CSCGeometry, MuonGeometryRecord> CSCSegmentProducer::m_cscGeometryToken
private

Definition at line 35 of file CSCSegmentProducer.h.

Referenced by CSCSegmentProducer(), and produce().

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

Definition at line 34 of file CSCSegmentProducer.h.

Referenced by CSCSegmentProducer(), and produce().

CSCSegmentBuilder* CSCSegmentProducer::segmentBuilder_
private

Definition at line 33 of file CSCSegmentProducer.h.

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