CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (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::MuonSegmentProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 64 of file MuonSegmentProducer.cc.

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 }

References edm::ParameterSet::getParameter().

◆ ~MuonSegmentProducer()

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

◆ beginJob()

void MuonSegmentProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 130 of file MuonSegmentProducer.cc.

130 {}

◆ endJob()

void MuonSegmentProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 133 of file MuonSegmentProducer.cc.

133 {}

◆ produce()

void MuonSegmentProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 84 of file MuonSegmentProducer.cc.

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++) {
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 
127 }

References HltBtagPostValidation_cff::c, dtChamberEfficiency_cfi::cscSegments, ztail::d, edm::EventSetup::get(), get, DTGeometry::idToDet(), CSCGeometry::idToDet(), iEvent, eostools::move(), point, susybsm::MuonSegment::setCSCSegmentRef(), susybsm::MuonSegment::setDTSegmentRef(), susybsm::MuonSegment::setGP(), and GeomDet::toGlobal().

Member Data Documentation

◆ m_cscSegmentToken

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

Definition at line 58 of file MuonSegmentProducer.cc.

◆ m_dtSegmentToken

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

Definition at line 59 of file MuonSegmentProducer.cc.

susybsm::MuonSegment::setDTSegmentRef
void setDTSegmentRef(const DTRecSegment4DRef segment)
Definition: MuonSegment.h:22
GeomDet
Definition: GeomDet.h:27
susybsm::MuonSegmentCollection
std::vector< MuonSegment > MuonSegmentCollection
Definition: MuonSegment.h:39
edm
HLT enums.
Definition: AlignableModifier.h:19
CSCGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: CSCGeometry.cc:91
susybsm
Definition: HSCParticle.h:16
dtChamberEfficiency_cfi.cscSegments
cscSegments
Definition: dtChamberEfficiency_cfi.py:15
susybsm::MuonSegment::setCSCSegmentRef
void setCSCSegmentRef(const CSCSegmentRef segment)
Definition: MuonSegment.h:23
edm::Handle< DTRecSegment4DCollection >
CSCSegmentRef
edm::Ref< CSCSegmentCollection > CSCSegmentRef
Definition: CSCSegmentCollection.h:21
edm::Ref< DTRecSegment4DCollection >
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
edm::ESHandle< DTGeometry >
Point3DBase< float, GlobalTag >
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
MuonSegmentProducer::m_dtSegmentToken
edm::EDGetTokenT< DTRecSegment4DCollection > m_dtSegmentToken
Definition: MuonSegmentProducer.cc:59
iEvent
int iEvent
Definition: GenABIO.cc:224
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
get
#define get
susybsm::MuonSegment::setGP
void setGP(const GlobalPoint point)
Definition: MuonSegment.h:25
MuonSegmentProducer::m_cscSegmentToken
edm::EDGetTokenT< CSCSegmentCollection > m_cscSegmentToken
Definition: MuonSegmentProducer.cc:58
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
susybsm::MuonSegment
Definition: MuonSegment.h:13
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
edm::OrphanHandle
Definition: EDProductfwd.h:39
DTRecSegment4DRef
edm::Ref< DTRecSegment4DCollection > DTRecSegment4DRef
Definition: DTRecSegment4DCollection.h:24
ztail.d
d
Definition: ztail.py:151
point
*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
DTGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: DTGeometry.cc:77
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
edm::InputTag
Definition: InputTag.h:15