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
ME0MuonConverter Class Reference
Inheritance diagram for ME0MuonConverter:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ME0MuonConverter (const edm::ParameterSet &)
 Constructor. More...
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 Produce the converted collection. More...
 
 ~ME0MuonConverter ()
 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 (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 Attributes

edm::EDGetTokenT
< ME0MuonCollection
OurMuonsToken_
 

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 ME0Segment's in endcap muon ME0s.

Author
David Nash

Definition at line 66 of file ME0MuonConverter.cc.

Constructor & Destructor Documentation

ME0MuonConverter::ME0MuonConverter ( const edm::ParameterSet pas)
explicit

Constructor.

Definition at line 84 of file ME0MuonConverter.cc.

References OurMuonsToken_.

84  {
85 
86  produces<std::vector<reco::RecoChargedCandidate> >();
87  edm::InputTag OurMuonsTag ("me0SegmentMatching");
88  OurMuonsToken_ = consumes<ME0MuonCollection>(OurMuonsTag);
89 
90 }
edm::EDGetTokenT< ME0MuonCollection > OurMuonsToken_
ME0MuonConverter::~ME0MuonConverter ( )

Destructor.

Definition at line 92 of file ME0MuonConverter.cc.

92 {}

Member Function Documentation

void ME0MuonConverter::produce ( edm::Event ev,
const edm::EventSetup setup 
)
overridevirtual

Produce the converted collection.

Implements edm::stream::EDProducerBase.

Definition at line 94 of file ME0MuonConverter.cc.

References funct::abs(), edm::Event::getByToken(), OurMuonsToken_, p4, sysUtil::pid, edm::Event::put(), lumiQueryAPI::q, dt_dqm_sourceclient_common_cff::reco, and reco::RecoChargedCandidate::setTrack().

94  {
95 
96  using namespace edm;
97 
98  using namespace reco;
99 
100  // Handle <std::vector<ME0Muon> > OurMuons;
101  // ev.getByToken <std::vector<ME0Muon> > (OurMuonsToken_, OurMuons);
102 
103 
105  ev.getByToken(OurMuonsToken_, OurMuons);
106 
107  std::auto_ptr<RecoChargedCandidateCollection> oc( new RecoChargedCandidateCollection());
108 
109  for (std::vector<ME0Muon>::const_iterator thisMuon = OurMuons->begin();
110  thisMuon != OurMuons->end(); ++thisMuon){
111  TrackRef tkRef = thisMuon->innerTrack();
112 
113  Particle::Charge q = tkRef->charge();
114  Particle::LorentzVector p4(tkRef->px(), tkRef->py(), tkRef->pz(), tkRef->p());
115  Particle::Point vtx(tkRef->vx(),tkRef->vy(), tkRef->vz());
116 
117  int pid = 0;
118  if(abs(q)==1) pid = q < 0 ? 13 : -13;
119  reco::RecoChargedCandidate cand(q, p4, vtx, pid);
120  cand.setTrack(thisMuon->innerTrack());
121  oc->push_back(cand);
122  }
123 
124  ev.put(oc);
125 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
std::pair< double, double > Point
Definition: CaloEllipse.h:18
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
double p4[4]
Definition: TauolaWrapper.h:92
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
edm::EDGetTokenT< ME0MuonCollection > OurMuonsToken_
tuple pid
Definition: sysUtil.py:22
math::PtEtaPhiELorentzVectorF LorentzVector

Member Data Documentation

edm::EDGetTokenT<ME0MuonCollection> ME0MuonConverter::OurMuonsToken_
private

Definition at line 80 of file ME0MuonConverter.cc.

Referenced by ME0MuonConverter(), and produce().