CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GEMSegmentProducer Class Reference
Inheritance diagram for GEMSegmentProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 GEMSegmentProducer (const edm::ParameterSet &)
 Constructor. More...
 
void produce (edm::Event &, const edm::EventSetup &) override
 Produce the GEMSegment collection. More...
 
virtual ~GEMSegmentProducer ()
 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)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

int iev
 
std::unique_ptr< GEMSegmentBuildersegmentBuilder_
 
edm::EDGetTokenT< GEMRecHitCollectiontheGEMRecHitToken
 

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

CSCSegmentProducer Produces a collection of GEMSegment's in endcap muon GEMs.

Author
Piet Verwilligen

Definition at line 23 of file GEMSegmentProducer.cc.

Constructor & Destructor Documentation

GEMSegmentProducer::GEMSegmentProducer ( const edm::ParameterSet ps)
explicit

Constructor.

Definition at line 38 of file GEMSegmentProducer.cc.

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

38  : iev(0) {
39 
40  theGEMRecHitToken = consumes<GEMRecHitCollection>(ps.getParameter<edm::InputTag>("gemRecHitLabel"));
41  segmentBuilder_ = std::make_unique<GEMSegmentBuilder>(ps); // pass on the Parameter Set
42 
43  // register what this produces
44  produces<GEMSegmentCollection>();
45 }
T getParameter(std::string const &) const
std::unique_ptr< GEMSegmentBuilder > segmentBuilder_
edm::EDGetTokenT< GEMRecHitCollection > theGEMRecHitToken
virtual GEMSegmentProducer::~GEMSegmentProducer ( )
inlinevirtual

Destructor.

Definition at line 28 of file GEMSegmentProducer.cc.

References produce().

28 {}

Member Function Documentation

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

Produce the GEMSegment collection.

Definition at line 47 of file GEMSegmentProducer.cc.

References DEFINE_FWK_MODULE, gemRecHits_cfi::gemRecHits, edm::EventSetup::get(), edm::Event::getByToken(), iev, LogDebug, eostools::move(), edm::Handle< T >::product(), edm::Event::put(), segmentBuilder_, and theGEMRecHitToken.

Referenced by ~GEMSegmentProducer().

47  {
48 
49  LogDebug("GEMSegmentProducer") << "start producing segments for " << ++iev << "th event with GEM data";
50 
51  // find the geometry (& conditions?) for this event & cache it in the builder
53  setup.get<MuonGeometryRecord>().get(gemg);
54  const GEMGeometry* mgeom = &*gemg;
55  segmentBuilder_->setGeometry(mgeom);
56 
57 
58  // get the collection of GEMRecHit
60  ev.getByToken(theGEMRecHitToken,gemRecHits);
61 
62  // create empty collection of Segments
63  auto oc = std::make_unique<GEMSegmentCollection>();
64 
65  // fill the collection
66  segmentBuilder_->build(gemRecHits.product(), *oc); //@@ FILL oc
67 
68  // put collection in event
69  ev.put(std::move(oc));
70 }
#define LogDebug(id)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
std::unique_ptr< GEMSegmentBuilder > segmentBuilder_
edm::EDGetTokenT< GEMRecHitCollection > theGEMRecHitToken
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:56
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

int GEMSegmentProducer::iev
private

Definition at line 33 of file GEMSegmentProducer.cc.

Referenced by produce().

std::unique_ptr<GEMSegmentBuilder> GEMSegmentProducer::segmentBuilder_
private

Definition at line 35 of file GEMSegmentProducer.cc.

Referenced by GEMSegmentProducer(), and produce().

edm::EDGetTokenT<GEMRecHitCollection> GEMSegmentProducer::theGEMRecHitToken
private

Definition at line 34 of file GEMSegmentProducer.cc.

Referenced by GEMSegmentProducer(), and produce().