CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CSCSegmentProducer Class Reference

#include <CSCSegmentProducer.h>

Inheritance diagram for CSCSegmentProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CSCSegmentProducer (const edm::ParameterSet &)
 Constructor. More...
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 Produce the CSCSegment collection. More...
 
 ~CSCSegmentProducer ()
 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)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

int iev
 
edm::EDGetTokenT
< CSCRecHit2DCollection
m_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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
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

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 ( )

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 
)
overridevirtual

Produce the CSCSegment collection.

Implements edm::stream::EDProducerBase.

Definition at line 33 of file CSCSegmentProducer.cc.

References CSCSegmentBuilder::build(), edm::EventSetup::get(), edm::Event::getByToken(), h, iev, LogDebug, m_token, 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  std::auto_ptr<CSCSegmentCollection> oc( new CSCSegmentCollection );
50 
51  // fill the collection
52  segmentBuilder_->build(cscRecHits.product(), *oc); //@@ FILL oc
53 
54  // put collection in event
55  ev.put(oc);
56 }
#define LogDebug(id)
void build(const CSCRecHit2DCollection *rechits, CSCSegmentCollection &oc)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
edm::EDGetTokenT< CSCRecHit2DCollection > m_token
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
CSCSegmentBuilder * segmentBuilder_
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:56
void setGeometry(const CSCGeometry *geom)

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().