CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
GEMCSCSegmentProducer Class Reference

#include <GEMCSCSegmentProducer.h>

Inheritance diagram for GEMCSCSegmentProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 GEMCSCSegmentProducer (const edm::ParameterSet &)
 Constructor. More...
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 Produce the GEM-CSCSegment collection. More...
 
 ~GEMCSCSegmentProducer ()
 Destructor. More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 
24  csc_token = consumes<CSCSegmentCollection>( pas.getParameter<edm::InputTag>("inputObjectsCSC"));
25  gem_token = consumes<GEMRecHitCollection> ( pas.getParameter<edm::InputTag>("inputObjectsGEM"));
26  segmentBuilder_ = new GEMCSCSegmentBuilder(pas); // pass on the parameterset
27 
28  // register what this produces
29  produces<GEMCSCSegmentCollection>();
30 }
T getParameter(std::string const &) const
GEMCSCSegmentBuilder * segmentBuilder_
edm::EDGetTokenT< GEMRecHitCollection > gem_token
edm::EDGetTokenT< CSCSegmentCollection > csc_token
GEMCSCSegmentProducer::~GEMCSCSegmentProducer ( )

Destructor.

Definition at line 33 of file GEMCSCSegmentProducer.cc.

References iev, LogDebug, and segmentBuilder_.

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

Member Function Documentation

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

Produce the GEM-CSCSegment collection.

Implements edm::stream::EDProducerBase.

Definition at line 40 of file GEMCSCSegmentProducer.cc.

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

40  {
41  LogDebug("GEMCSCSegment") << "start producing segments for " << ++iev << "th event w/ gem and csc data";
42 
43  // find the geometry (& conditions?) for this event & cache it in the builder
45  setup.get<MuonGeometryRecord>().get(cscg);
46  const CSCGeometry* cgeom = &*cscg;
47 
49  setup.get<MuonGeometryRecord>().get(gemg);
50  const GEMGeometry* ggeom = &*gemg;
51 
52  // cache the geometry in the builder
53  segmentBuilder_->setGeometry(ggeom,cgeom);
54 
55  // fill the map with matches between GEM and CSC chambers
57 
58  // get the collection of CSCSegment and GEMRecHits
60  ev.getByToken(csc_token, cscSegment);
62  ev.getByToken(gem_token, gemRecHits);
63 
64  // create empty collection of GEMCSC Segments
65  std::auto_ptr<GEMCSCSegmentCollection> oc( new GEMCSCSegmentCollection );
66 
67  // pass the empty collection of GEMCSC Segments and fill it
68  segmentBuilder_->build(gemRecHits.product(), cscSegment.product(), *oc); //@@ FILL oc
69 
70  // put the filled collection in event
71  ev.put(oc);
72 }
#define LogDebug(id)
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:464
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
void build(const GEMRecHitCollection *rechits, const CSCSegmentCollection *cscsegments, GEMCSCSegmentCollection &oc)
T const * product() const
Definition: Handle.h:81
const T & get() const
Definition: EventSetup.h:56
void setGeometry(const GEMGeometry *gemgeom, const CSCGeometry *cscgeom)

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