CMS 3D CMS Logo

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

#include <SUSYBSMAnalysis/MuonSegmentProducer/src/MuonSegmentProducer.cc>

Inheritance diagram for MuonSegmentProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 MuonSegmentProducer (const edm::ParameterSet &)
 
 ~MuonSegmentProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

virtual void beginJob ()
 
virtual void endJob ()
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 

Private Attributes

edm::EDGetTokenT< CSCSegmentCollectionm_cscSegmentToken
 
edm::EDGetTokenT< DTRecSegment4DCollectionm_dtSegmentToken
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer 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::EDProducer
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

Description: Producer muon segments with global position info to be used in FWLite

Implementation: <Notes on="" implementation>="">

Definition at line 48 of file MuonSegmentProducer.cc.

Constructor & Destructor Documentation

MuonSegmentProducer::MuonSegmentProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 64 of file MuonSegmentProducer.cc.

References edm::ParameterSet::getParameter(), m_cscSegmentToken, and m_dtSegmentToken.

64  {
65  using namespace edm;
66  using namespace std;
67 
68 
69  m_cscSegmentToken = consumes< CSCSegmentCollection >( iConfig.getParameter<edm::InputTag>("CSCSegments" ) );
70  m_dtSegmentToken = consumes< DTRecSegment4DCollection >(iConfig.getParameter<edm::InputTag>("DTSegments" ) );
71 
72  produces<susybsm::MuonSegmentCollection >();
73 }
T getParameter(std::string const &) const
edm::EDGetTokenT< CSCSegmentCollection > m_cscSegmentToken
HLT enums.
edm::EDGetTokenT< DTRecSegment4DCollection > m_dtSegmentToken
MuonSegmentProducer::~MuonSegmentProducer ( )

Definition at line 75 of file MuonSegmentProducer.cc.

75  {
76  // do anything here that needs to be done at desctruction time
77  // (e.g. close files, deallocate resources etc.)
78 }

Member Function Documentation

void MuonSegmentProducer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 134 of file MuonSegmentProducer.cc.

134  {
135 }
void MuonSegmentProducer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 139 of file MuonSegmentProducer.cc.

References DEFINE_FWK_MODULE.

139  {
140 }
void MuonSegmentProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Definition at line 86 of file MuonSegmentProducer.cc.

References EnergyCorrector::c, cscSegments_cfi::cscSegments, edmIntegrityCheck::d, edm::EventSetup::get(), edm::Event::getByToken(), DTGeometry::idToDet(), CSCGeometry::idToDet(), m_cscSegmentToken, m_dtSegmentToken, eostools::move(), point, edm::Event::put(), susybsm::MuonSegment::setCSCSegmentRef(), susybsm::MuonSegment::setDTSegmentRef(), susybsm::MuonSegment::setGP(), and GeomDet::toGlobal().

86  {
87 
88  using namespace edm;
89  using namespace std;
90  using namespace susybsm;
91 
93  std::unique_ptr<susybsm::MuonSegmentCollection> resultSeg(segments);
94 
96  iSetup.get<MuonGeometryRecord>().get(dtGeom);
97 
99  iSetup.get<MuonGeometryRecord>().get(cscGeom);
100 
102  iEvent.getByToken(m_dtSegmentToken, dtSegments);
103 
104  for (unsigned int d=0; d<dtSegments->size(); d++) {
105  DTRecSegment4DRef SegRef = DTRecSegment4DRef( dtSegments, d );
106  MuonSegment muonSegment;
107  muonSegment.setDTSegmentRef(SegRef);
108 
109  const GeomDet* dtDet = dtGeom->idToDet(SegRef->geographicalId());
110  GlobalPoint point = dtDet->toGlobal(SegRef->localPosition());
111  muonSegment.setGP(point);
112  segments->push_back(muonSegment);
113  }
114 
116  iEvent.getByToken(m_cscSegmentToken, cscSegments);
117 
118  for (unsigned int c=0; c<cscSegments->size(); c++) {
119  CSCSegmentRef SegRef = CSCSegmentRef( cscSegments, c );
120  MuonSegment muonSegment;
121  muonSegment.setCSCSegmentRef(SegRef);
122 
123  const GeomDet* cscDet = cscGeom->idToDet(SegRef->geographicalId());
124  GlobalPoint point = cscDet->toGlobal(SegRef->localPosition());
125  muonSegment.setGP(point);
126  segments->push_back(muonSegment);
127  }
128 
129  edm::OrphanHandle<susybsm::MuonSegmentCollection> putHandleSeg = iEvent.put(std::move(resultSeg));
130 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
std::vector< MuonSegment > MuonSegmentCollection
Definition: MuonSegment.h:40
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
virtual const GeomDet * idToDet(DetId) const override
Definition: CSCGeometry.cc:99
edm::Ref< CSCSegmentCollection > CSCSegmentRef
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
void setDTSegmentRef(const DTRecSegment4DRef segment)
Definition: MuonSegment.h:23
void setCSCSegmentRef(const CSCSegmentRef segment)
Definition: MuonSegment.h:24
edm::EDGetTokenT< CSCSegmentCollection > m_cscSegmentToken
edm::Ref< DTRecSegment4DCollection > DTRecSegment4DRef
void setGP(const GlobalPoint point)
Definition: MuonSegment.h:26
const T & get() const
Definition: EventSetup.h:56
HLT enums.
virtual const GeomDet * idToDet(DetId) const override
Definition: DTGeometry.cc:76
def move(src, dest)
Definition: eostools.py:510
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
edm::EDGetTokenT< DTRecSegment4DCollection > m_dtSegmentToken

Member Data Documentation

edm::EDGetTokenT< CSCSegmentCollection > MuonSegmentProducer::m_cscSegmentToken
private

Definition at line 58 of file MuonSegmentProducer.cc.

Referenced by MuonSegmentProducer(), and produce().

edm::EDGetTokenT< DTRecSegment4DCollection > MuonSegmentProducer::m_dtSegmentToken
private

Definition at line 59 of file MuonSegmentProducer.cc.

Referenced by MuonSegmentProducer(), and produce().