test
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 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)
 
 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &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 Member Functions

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

Private Attributes

edm::EDGetTokenT
< CSCSegmentCollection
m_cscSegmentToken
 
edm::EDGetTokenT
< DTRecSegment4DCollection
m_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().

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

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

Implements edm::EDProducer.

Definition at line 86 of file MuonSegmentProducer.cc.

References EnergyCorrector::c, HLT_25ns10e33_v2_cff::cscSegments, ztail::d, edm::EventSetup::get(), edm::Event::getByToken(), 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::auto_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 
117 
118  for (unsigned int c=0; c<cscSegments->size(); 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(resultSeg);
130 }
std::vector< MuonSegment > MuonSegmentCollection
Definition: MuonSegment.h:40
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
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
tuple d
Definition: ztail.py:151
edm::EDGetTokenT< CSCSegmentCollection > m_cscSegmentToken
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
edm::Ref< DTRecSegment4DCollection > DTRecSegment4DRef
void setGP(const GlobalPoint point)
Definition: MuonSegment.h:26
const T & get() const
Definition: EventSetup.h:56
*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.

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

Definition at line 59 of file MuonSegmentProducer.cc.