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

int iev
 
const edm::ESGetToken
< CSCGeometry,
MuonGeometryRecord
kCSCGeometryToken_
 
const edm::EDGetTokenT
< CSCSegmentCollection
kCSCSegmentCollectionToken_
 
const edm::ESGetToken
< GEMGeometry,
MuonGeometryRecord
kGEMGeometryToken_
 
const edm::EDGetTokenT
< GEMRecHitCollection
kGEMRecHitCollectionToken_
 
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 28 of file GEMCSCSegmentProducer.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 20 of file GEMCSCSegmentProducer.cc.

References segmentBuilder_.

21  : kCSCGeometryToken_(esConsumes<CSCGeometry, MuonGeometryRecord>()),
22  kGEMGeometryToken_(esConsumes<GEMGeometry, MuonGeometryRecord>()),
23  kCSCSegmentCollectionToken_(consumes<CSCSegmentCollection>(pas.getParameter<edm::InputTag>("inputObjectsCSC"))),
24  kGEMRecHitCollectionToken_(consumes<GEMRecHitCollection>(pas.getParameter<edm::InputTag>("inputObjectsGEM"))),
25  iev(0) {
26  segmentBuilder_ = new GEMCSCSegmentBuilder(pas); // pass on the parameterset
27 
28  // register what this produces
29  produces<GEMCSCSegmentCollection>();
30 }
GEMCSCSegmentBuilder * segmentBuilder_
const edm::ESGetToken< GEMGeometry, MuonGeometryRecord > kGEMGeometryToken_
const edm::EDGetTokenT< GEMRecHitCollection > kGEMRecHitCollectionToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::EDGetTokenT< CSCSegmentCollection > kCSCSegmentCollectionToken_
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > kCSCGeometryToken_
GEMCSCSegmentProducer::~GEMCSCSegmentProducer ( )
override

Destructor.

Definition at line 32 of file GEMCSCSegmentProducer.cc.

References iev, LogDebug, and segmentBuilder_.

32  {
33  LogDebug("GEMCSCSegment") << "deleting GEMCSCSegmentBuilder after " << iev << " events w/ gem and csc data.";
34  delete segmentBuilder_;
35 }
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 37 of file GEMCSCSegmentProducer.cc.

References GEMCSCSegmentBuilder::build(), gemRecHits_cfi::gemRecHits, edm::EventSetup::getHandle(), edm::Event::getHandle(), iev, kCSCGeometryToken_, kCSCSegmentCollectionToken_, kGEMGeometryToken_, kGEMRecHitCollectionToken_, GEMCSCSegmentBuilder::LinkGEMRollsToCSCChamberIndex(), LogDebug, eostools::move(), edm::Event::put(), segmentBuilder_, and GEMCSCSegmentBuilder::setGeometry().

37  {
38  LogDebug("GEMCSCSegment") << "start producing segments for " << ++iev << "th event w/ gem and csc data";
39 
40  // find the geometry (& conditions?) for this event & cache it in the builder
41  const auto cscg = setup.getHandle(kCSCGeometryToken_);
42  if (not cscg.isValid()) {
43  edm::LogError("GEMCSCSegment") << "invalid CSCGeometry";
44  return;
45  }
46  const CSCGeometry* cgeom = &*cscg;
47 
48  const auto gemg = setup.getHandle(kGEMGeometryToken_);
49  if (not gemg.isValid()) {
50  edm::LogError("GEMCSCSegment") << "invalid GEMGeometry";
51  return;
52  }
53  const GEMGeometry* ggeom = &*gemg;
54 
55  // cache the geometry in the builder
56  segmentBuilder_->setGeometry(ggeom, cgeom);
57 
58  // fill the map with matches between GEM and CSC chambers
60 
61  // get the collection of CSCSegment and GEMRecHits
62  const auto cscSegment = ev.getHandle(kCSCSegmentCollectionToken_);
63  if (not cscSegment.isValid()) {
64  edm::LogError("GEMCSCSegment") << "invalid CSCSegmentCollection";
65  return;
66  }
67 
69  if (not gemRecHits.isValid()) {
70  edm::LogError("GEMCSCSegment") << "invalid GEMRecHitCollection";
71  return;
72  }
73 
74  // create empty collection of GEMCSC Segments
75  auto oc = std::make_unique<GEMCSCSegmentCollection>();
76 
77  // pass the empty collection of GEMCSC Segments and fill it
78  segmentBuilder_->build(gemRecHits.product(), cscSegment.product(), *oc); //@@ FILL oc
79 
80  // put the filled collection in event
81  ev.put(std::move(oc));
82 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
GEMCSCSegmentBuilder * segmentBuilder_
const edm::ESGetToken< GEMGeometry, MuonGeometryRecord > kGEMGeometryToken_
void LinkGEMRollsToCSCChamberIndex(const GEMGeometry *gemgeom, const CSCGeometry *cscgeom)
const edm::EDGetTokenT< GEMRecHitCollection > kGEMRecHitCollectionToken_
Log< level::Error, false > LogError
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: Event.h:563
def move
Definition: eostools.py:511
void build(const GEMRecHitCollection *rechits, const CSCSegmentCollection *cscsegments, GEMCSCSegmentCollection &oc)
const edm::EDGetTokenT< CSCSegmentCollection > kCSCSegmentCollectionToken_
void setGeometry(const GEMGeometry *gemgeom, const CSCGeometry *cscgeom)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > kCSCGeometryToken_
#define LogDebug(id)

Member Data Documentation

int GEMCSCSegmentProducer::iev
private

Definition at line 43 of file GEMCSCSegmentProducer.h.

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

const edm::ESGetToken<CSCGeometry, MuonGeometryRecord> GEMCSCSegmentProducer::kCSCGeometryToken_
private

Definition at line 38 of file GEMCSCSegmentProducer.h.

Referenced by produce().

const edm::EDGetTokenT<CSCSegmentCollection> GEMCSCSegmentProducer::kCSCSegmentCollectionToken_
private

Definition at line 40 of file GEMCSCSegmentProducer.h.

Referenced by produce().

const edm::ESGetToken<GEMGeometry, MuonGeometryRecord> GEMCSCSegmentProducer::kGEMGeometryToken_
private

Definition at line 39 of file GEMCSCSegmentProducer.h.

Referenced by produce().

const edm::EDGetTokenT<GEMRecHitCollection> GEMCSCSegmentProducer::kGEMRecHitCollectionToken_
private

Definition at line 41 of file GEMCSCSegmentProducer.h.

Referenced by produce().

GEMCSCSegmentBuilder* GEMCSCSegmentProducer::segmentBuilder_
private

Definition at line 44 of file GEMCSCSegmentProducer.h.

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