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
GEMSegmentProducer Class Reference
Inheritance diagram for GEMSegmentProducer:
edm::stream::EDProducer<>

Public Member Functions

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

edm::ESGetToken< GEMGeometry,
MuonGeometryRecord
gemGeomToken_
 
int iev
 
std::unique_ptr
< GEMSegmentBuilder
segmentBuilder_
 
edm::EDGetTokenT
< GEMRecHitCollection
theGEMRecHitToken
 

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

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

Author
Piet Verwilligen

Definition at line 24 of file GEMSegmentProducer.cc.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 40 of file GEMSegmentProducer.cc.

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

40  : iev(0) {
41  theGEMRecHitToken = consumes<GEMRecHitCollection>(ps.getParameter<edm::InputTag>("gemRecHitLabel"));
42  segmentBuilder_ = std::make_unique<GEMSegmentBuilder>(ps); // pass on the Parameter Set
43  gemGeomToken_ = esConsumes<GEMGeometry, MuonGeometryRecord>();
44  // register what this produces
45  produces<GEMSegmentCollection>();
46 }
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > gemGeomToken_
std::unique_ptr< GEMSegmentBuilder > segmentBuilder_
edm::EDGetTokenT< GEMRecHitCollection > theGEMRecHitToken
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
GEMSegmentProducer::~GEMSegmentProducer ( )
inlineoverride

Destructor.

Definition at line 29 of file GEMSegmentProducer.cc.

29 {}

Member Function Documentation

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

Produce the GEMSegment collection.

Definition at line 48 of file GEMSegmentProducer.cc.

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

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  const GEMGeometry* mgeom = &*gemg;
54  segmentBuilder_->setGeometry(mgeom);
55 
56  // get the collection of GEMRecHit
58  ev.getByToken(theGEMRecHitToken, gemRecHits);
59 
60  // create empty collection of Segments
61  auto oc = std::make_unique<GEMSegmentCollection>();
62 
63  // fill the collection
64  segmentBuilder_->build(gemRecHits.product(), *oc); //@@ FILL oc
65 
66  // put collection in event
67  ev.put(std::move(oc));
68 }
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::ESGetToken< GEMGeometry, MuonGeometryRecord > gemGeomToken_
std::unique_ptr< GEMSegmentBuilder > segmentBuilder_
def move
Definition: eostools.py:511
edm::EDGetTokenT< GEMRecHitCollection > theGEMRecHitToken
T const * product() const
Definition: Handle.h:70
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
#define LogDebug(id)

Member Data Documentation

edm::ESGetToken<GEMGeometry, MuonGeometryRecord> GEMSegmentProducer::gemGeomToken_
private

Definition at line 37 of file GEMSegmentProducer.cc.

Referenced by GEMSegmentProducer(), and produce().

int GEMSegmentProducer::iev
private

Definition at line 34 of file GEMSegmentProducer.cc.

Referenced by produce().

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

Definition at line 36 of file GEMSegmentProducer.cc.

Referenced by GEMSegmentProducer(), and produce().

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

Definition at line 35 of file GEMSegmentProducer.cc.

Referenced by GEMSegmentProducer(), and produce().