CMS 3D CMS Logo

List of all members | Public Member Functions | Static 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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::ESGetToken< GEMGeometry, MuonGeometryRecordgemGeomToken_
 
int iev
 
std::unique_ptr< GEMSegmentBuildersegmentBuilder_
 
edm::EDGetTokenT< GEMRecHitCollectiontheGEMRecHitToken
 

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 26 of file GEMSegmentProducer.cc.

Constructor & Destructor Documentation

◆ GEMSegmentProducer()

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

Constructor.

Definition at line 44 of file GEMSegmentProducer.cc.

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

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

◆ ~GEMSegmentProducer()

GEMSegmentProducer::~GEMSegmentProducer ( )
inlineoverride

Destructor.

Definition at line 31 of file GEMSegmentProducer.cc.

31 {}

Member Function Documentation

◆ fillDescriptions()

void GEMSegmentProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 52 of file GEMSegmentProducer.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, GEMSegmentBuilder::fillDescription(), and ProducerED_cfi::InputTag.

52  {
54  desc.add<edm::InputTag>("gemRecHitLabel", edm::InputTag("gemRecHits"));
56  descriptions.add("gemSegments", desc);
57 }
static void fillDescription(edm::ParameterSetDescription &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Produce the GEMSegment collection.

Definition at line 59 of file GEMSegmentProducer.cc.

References makeMEIFBenchmarkPlots::ev, gemGeomToken_, gemRecHits_cfi::gemRecHits, iev, LogDebug, eostools::move(), segmentBuilder_, singleTopDQM_cfi::setup, and theGEMRecHitToken.

59  {
60  LogDebug("GEMSegmentProducer") << "start producing segments for " << ++iev << "th event with GEM data";
61 
62  // find the geometry (& conditions?) for this event & cache it in the builder
64  const GEMGeometry* mgeom = &*gemg;
65  segmentBuilder_->setGeometry(mgeom);
66 
67  // get the collection of GEMRecHit
69  ev.getByToken(theGEMRecHitToken, gemRecHits);
70 
71  // create empty collection of Segments
72  auto oc = std::make_unique<GEMSegmentCollection>();
73 
74  // fill the collection
75  segmentBuilder_->build(gemRecHits.product(), *oc); //@@ FILL oc
76 
77  // put collection in event
78  ev.put(std::move(oc));
79 }
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > gemGeomToken_
std::unique_ptr< GEMSegmentBuilder > segmentBuilder_
edm::EDGetTokenT< GEMRecHitCollection > theGEMRecHitToken
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)

Member Data Documentation

◆ gemGeomToken_

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

Definition at line 41 of file GEMSegmentProducer.cc.

Referenced by GEMSegmentProducer(), and produce().

◆ iev

int GEMSegmentProducer::iev
private

Definition at line 38 of file GEMSegmentProducer.cc.

Referenced by produce().

◆ segmentBuilder_

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

Definition at line 40 of file GEMSegmentProducer.cc.

Referenced by GEMSegmentProducer(), and produce().

◆ theGEMRecHitToken

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

Definition at line 39 of file GEMSegmentProducer.cc.

Referenced by GEMSegmentProducer(), and produce().