CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GEMCSCSegmentProducer Class Reference

#include <GEMCSCSegmentProducer.h>

Inheritance diagram for GEMCSCSegmentProducer:
edm::stream::EDProducer<>

Public Member Functions

 GEMCSCSegmentProducer (const edm::ParameterSet &)
 Constructor. More...
 
void produce (edm::Event &, const edm::EventSetup &) override
 Produce the GEM-CSCSegment collection. More...
 
 ~GEMCSCSegmentProducer () override
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

edm::EDGetTokenT< CSCSegmentCollectioncsc_token
 
edm::EDGetTokenT< GEMRecHitCollectiongem_token
 
int iev
 
GEMCSCSegmentBuildersegmentBuilder_
 

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

Produces a collection of GEM-CSCSegments

Date
2014/02/06 12:19:20
Author
Raffaella Radogna

Definition at line 23 of file GEMCSCSegmentProducer.h.

Constructor & Destructor Documentation

◆ GEMCSCSegmentProducer()

GEMCSCSegmentProducer::GEMCSCSegmentProducer ( const edm::ParameterSet pas)
explicit

Constructor.

Definition at line 22 of file GEMCSCSegmentProducer.cc.

22  : iev(0) {
23  csc_token = consumes<CSCSegmentCollection>(pas.getParameter<edm::InputTag>("inputObjectsCSC"));
24  gem_token = consumes<GEMRecHitCollection>(pas.getParameter<edm::InputTag>("inputObjectsGEM"));
25  segmentBuilder_ = new GEMCSCSegmentBuilder(pas); // pass on the parameterset
26 
27  // register what this produces
28  produces<GEMCSCSegmentCollection>();
29 }

References csc_token, gem_token, edm::ParameterSet::getParameter(), and segmentBuilder_.

◆ ~GEMCSCSegmentProducer()

GEMCSCSegmentProducer::~GEMCSCSegmentProducer ( )
override

Destructor.

Definition at line 31 of file GEMCSCSegmentProducer.cc.

31  {
32  LogDebug("GEMCSCSegment") << "deleting GEMCSCSegmentBuilder after " << iev << " events w/ gem and csc data.";
33  delete segmentBuilder_;
34 }

References iev, LogDebug, and segmentBuilder_.

Member Function Documentation

◆ produce()

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

Produce the GEM-CSCSegment collection.

Definition at line 36 of file GEMCSCSegmentProducer.cc.

36  {
37  LogDebug("GEMCSCSegment") << "start producing segments for " << ++iev << "th event w/ gem and csc data";
38 
39  // find the geometry (& conditions?) for this event & cache it in the builder
41  setup.get<MuonGeometryRecord>().get(cscg);
42  const CSCGeometry* cgeom = &*cscg;
43 
45  setup.get<MuonGeometryRecord>().get(gemg);
46  const GEMGeometry* ggeom = &*gemg;
47 
48  // cache the geometry in the builder
49  segmentBuilder_->setGeometry(ggeom, cgeom);
50 
51  // fill the map with matches between GEM and CSC chambers
53 
54  // get the collection of CSCSegment and GEMRecHits
56  ev.getByToken(csc_token, cscSegment);
58  ev.getByToken(gem_token, gemRecHits);
59 
60  // create empty collection of GEMCSC Segments
61  auto oc = std::make_unique<GEMCSCSegmentCollection>();
62 
63  // pass the empty collection of GEMCSC Segments and fill it
64  segmentBuilder_->build(gemRecHits.product(), cscSegment.product(), *oc); //@@ FILL oc
65 
66  // put the filled collection in event
67  ev.put(std::move(oc));
68 }

References GEMCSCSegmentBuilder::build(), csc_token, ev, gem_token, gemRecHits_cfi::gemRecHits, get, iev, GEMCSCSegmentBuilder::LinkGEMRollsToCSCChamberIndex(), LogDebug, eostools::move(), edm::Handle< T >::product(), segmentBuilder_, GEMCSCSegmentBuilder::setGeometry(), and singleTopDQM_cfi::setup.

Member Data Documentation

◆ csc_token

edm::EDGetTokenT<CSCSegmentCollection> GEMCSCSegmentProducer::csc_token
private

Definition at line 35 of file GEMCSCSegmentProducer.h.

Referenced by GEMCSCSegmentProducer(), and produce().

◆ gem_token

edm::EDGetTokenT<GEMRecHitCollection> GEMCSCSegmentProducer::gem_token
private

Definition at line 36 of file GEMCSCSegmentProducer.h.

Referenced by GEMCSCSegmentProducer(), and produce().

◆ iev

int GEMCSCSegmentProducer::iev
private

Definition at line 33 of file GEMCSCSegmentProducer.h.

Referenced by produce(), and ~GEMCSCSegmentProducer().

◆ segmentBuilder_

GEMCSCSegmentBuilder* GEMCSCSegmentProducer::segmentBuilder_
private

Definition at line 34 of file GEMCSCSegmentProducer.h.

Referenced by GEMCSCSegmentProducer(), produce(), and ~GEMCSCSegmentProducer().

GEMCSCSegmentProducer::iev
int iev
Definition: GEMCSCSegmentProducer.h:33
edm::Handle::product
T const * product() const
Definition: Handle.h:70
GEMCSCSegmentBuilder::LinkGEMRollsToCSCChamberIndex
void LinkGEMRollsToCSCChamberIndex(const GEMGeometry *gemgeom, const CSCGeometry *cscgeom)
Definition: GEMCSCSegmentBuilder.cc:45
GEMCSCSegmentProducer::gem_token
edm::EDGetTokenT< GEMRecHitCollection > gem_token
Definition: GEMCSCSegmentProducer.h:36
edm::Handle< CSCSegmentCollection >
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
CSCGeometry
Definition: CSCGeometry.h:24
edm::ESHandle< CSCGeometry >
GEMCSCSegmentBuilder::build
void build(const GEMRecHitCollection *rechits, const CSCSegmentCollection *cscsegments, GEMCSCSegmentCollection &oc)
Definition: GEMCSCSegmentBuilder.cc:92
GEMCSCSegmentProducer::segmentBuilder_
GEMCSCSegmentBuilder * segmentBuilder_
Definition: GEMCSCSegmentProducer.h:34
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
GEMCSCSegmentProducer::csc_token
edm::EDGetTokenT< CSCSegmentCollection > csc_token
Definition: GEMCSCSegmentProducer.h:35
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
GEMGeometry
Definition: GEMGeometry.h:24
gemRecHits_cfi.gemRecHits
gemRecHits
Definition: gemRecHits_cfi.py:7
GEMCSCSegmentBuilder
Definition: GEMCSCSegmentBuilder.h:69
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
GEMCSCSegmentBuilder::setGeometry
void setGeometry(const GEMGeometry *gemgeom, const CSCGeometry *cscgeom)
Definition: GEMCSCSegmentBuilder.cc:363
edm::InputTag
Definition: InputTag.h:15