CMS 3D CMS Logo

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)
 
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
 
 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 Attributes

edm::EDGetTokenT< ME0MuonCollectionOurMuonsToken_
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
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.

Definition at line 94 of file ME0MuonConverter.cc.

References funct::abs(), DEFINE_FWK_MODULE, edm::Event::getByToken(), eostools::move(), OurMuonsToken_, p4, sysUtil::pid, edm::Event::put(), lumiQueryAPI::q, reco::RecoChargedCandidate::setTrack(), and badGlobalMuonTaggersAOD_cff::vtx.

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  auto oc = std::make_unique<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;
120  cand.setTrack(thisMuon->innerTrack());
121  oc->push_back(cand);
122  }
123 
124  ev.put(std::move(oc));
125 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
std::pair< double, double > Point
Definition: CaloEllipse.h:18
double p4[4]
Definition: TauolaWrapper.h:92
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDGetTokenT< ME0MuonCollection > OurMuonsToken_
fixed size matrix
HLT enums.
def move(src, dest)
Definition: eostools.py:510
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().