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
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
 
 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::EDGetTokenT
< CSCSegmentCollection
csc_token
 
edm::EDGetTokenT
< GEMRecHitCollection
gem_token
 
int iev
 
GEMCSCSegmentBuildersegmentBuilder_
 

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

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 ( const edm::ParameterSet pas)
explicit

Constructor.

Definition at line 22 of file GEMCSCSegmentProducer.cc.

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

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 }
GEMCSCSegmentBuilder * segmentBuilder_
edm::EDGetTokenT< GEMRecHitCollection > gem_token
edm::EDGetTokenT< CSCSegmentCollection > csc_token
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
GEMCSCSegmentProducer::~GEMCSCSegmentProducer ( )
override

Destructor.

Definition at line 31 of file GEMCSCSegmentProducer.cc.

References iev, LogDebug, and segmentBuilder_.

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

Member Function Documentation

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

Produce the GEM-CSCSegment collection.

Definition at line 36 of file GEMCSCSegmentProducer.cc.

References GEMCSCSegmentBuilder::build(), csc_token, gem_token, gemRecHits_cfi::gemRecHits, edm::EventSetup::get(), edm::Event::getByToken(), iev, GEMCSCSegmentBuilder::LinkGEMRollsToCSCChamberIndex(), LogDebug, eostools::move(), edm::Handle< T >::product(), edm::Event::put(), segmentBuilder_, and GEMCSCSegmentBuilder::setGeometry().

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 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
GEMCSCSegmentBuilder * segmentBuilder_
edm::EDGetTokenT< GEMRecHitCollection > gem_token
edm::EDGetTokenT< CSCSegmentCollection > csc_token
void LinkGEMRollsToCSCChamberIndex(const GEMGeometry *gemgeom, const CSCGeometry *cscgeom)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
def move
Definition: eostools.py:511
void build(const GEMRecHitCollection *rechits, const CSCSegmentCollection *cscsegments, GEMCSCSegmentCollection &oc)
T const * product() const
Definition: Handle.h:70
T get() const
Definition: EventSetup.h:88
void setGeometry(const GEMGeometry *gemgeom, const CSCGeometry *cscgeom)
#define LogDebug(id)

Member Data Documentation

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

Definition at line 35 of file GEMCSCSegmentProducer.h.

Referenced by GEMCSCSegmentProducer(), and produce().

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

Definition at line 36 of file GEMCSCSegmentProducer.h.

Referenced by GEMCSCSegmentProducer(), and produce().

int GEMCSCSegmentProducer::iev
private

Definition at line 33 of file GEMCSCSegmentProducer.h.

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

GEMCSCSegmentBuilder* GEMCSCSegmentProducer::segmentBuilder_
private

Definition at line 34 of file GEMCSCSegmentProducer.h.

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