CMS 3D CMS Logo

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
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

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
 

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
GEMSegmentProducer::~GEMSegmentProducer ( )
inlineoverride

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:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
std::unique_ptr< GEMSegmentBuilder > segmentBuilder_
edm::EDGetTokenT< GEMRecHitCollection > theGEMRecHitToken
T const * product() const
Definition: Handle.h:74
T get() const
Definition: EventSetup.h:71
def move(src, dest)
Definition: eostools.py:511

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