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 () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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

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
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
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)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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  m_cscSegmentToken = consumes<CSCSegmentCollection>(iConfig.getParameter<edm::InputTag>("CSCSegments"));
69  m_dtSegmentToken = consumes<DTRecSegment4DCollection>(iConfig.getParameter<edm::InputTag>("DTSegments"));
70 
71  produces<susybsm::MuonSegmentCollection>();
72 }
T getParameter(std::string const &) const
edm::EDGetTokenT< CSCSegmentCollection > m_cscSegmentToken
HLT enums.
edm::EDGetTokenT< DTRecSegment4DCollection > m_dtSegmentToken
MuonSegmentProducer::~MuonSegmentProducer ( )
override

Definition at line 74 of file MuonSegmentProducer.cc.

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

Member Function Documentation

void MuonSegmentProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 130 of file MuonSegmentProducer.cc.

130 {}
void MuonSegmentProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 133 of file MuonSegmentProducer.cc.

References DEFINE_FWK_MODULE.

133 {}
void MuonSegmentProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 84 of file MuonSegmentProducer.cc.

References HltBtagPostValidation_cff::c, dtChamberEfficiency_cfi::cscSegments, ztail::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().

84  {
85  using namespace edm;
86  using namespace std;
87  using namespace susybsm;
88 
90  std::unique_ptr<susybsm::MuonSegmentCollection> resultSeg(segments);
91 
93  iSetup.get<MuonGeometryRecord>().get(dtGeom);
94 
96  iSetup.get<MuonGeometryRecord>().get(cscGeom);
97 
99  iEvent.getByToken(m_dtSegmentToken, dtSegments);
100 
101  for (unsigned int d = 0; d < dtSegments->size(); d++) {
102  DTRecSegment4DRef SegRef = DTRecSegment4DRef(dtSegments, d);
103  MuonSegment muonSegment;
104  muonSegment.setDTSegmentRef(SegRef);
105 
106  const GeomDet* dtDet = dtGeom->idToDet(SegRef->geographicalId());
107  GlobalPoint point = dtDet->toGlobal(SegRef->localPosition());
108  muonSegment.setGP(point);
109  segments->push_back(muonSegment);
110  }
111 
113  iEvent.getByToken(m_cscSegmentToken, cscSegments);
114 
115  for (unsigned int c = 0; c < cscSegments->size(); c++) {
116  CSCSegmentRef SegRef = CSCSegmentRef(cscSegments, c);
117  MuonSegment muonSegment;
118  muonSegment.setCSCSegmentRef(SegRef);
119 
120  const GeomDet* cscDet = cscGeom->idToDet(SegRef->geographicalId());
121  GlobalPoint point = cscDet->toGlobal(SegRef->localPosition());
122  muonSegment.setGP(point);
123  segments->push_back(muonSegment);
124  }
125 
126  edm::OrphanHandle<susybsm::MuonSegmentCollection> putHandleSeg = iEvent.put(std::move(resultSeg));
127 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
std::vector< MuonSegment > MuonSegmentCollection
Definition: MuonSegment.h:39
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
const GeomDet * idToDet(DetId) const override
Definition: CSCGeometry.cc:91
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:49
void setDTSegmentRef(const DTRecSegment4DRef segment)
Definition: MuonSegment.h:22
void setCSCSegmentRef(const CSCSegmentRef segment)
Definition: MuonSegment.h:23
edm::EDGetTokenT< CSCSegmentCollection > m_cscSegmentToken
d
Definition: ztail.py:151
edm::Ref< DTRecSegment4DCollection > DTRecSegment4DRef
void setGP(const GlobalPoint point)
Definition: MuonSegment.h:25
HLT enums.
T get() const
Definition: EventSetup.h:73
const GeomDet * idToDet(DetId) const override
Definition: DTGeometry.cc:77
edm::EDGetTokenT< DTRecSegment4DCollection > m_dtSegmentToken
def move(src, dest)
Definition: eostools.py:511
*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

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