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
L3MuonCandidateProducerFromMuons Class Reference

#include <L3MuonCandidateProducerFromMuons.h>

Inheritance diagram for L3MuonCandidateProducerFromMuons:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L3MuonCandidateProducerFromMuons (const edm::ParameterSet &)
 constructor with config More...
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 produce candidates More...
 
virtual ~L3MuonCandidateProducerFromMuons ()
 destructor More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 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 (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::InputTag m_L3CollectionLabel
 
edm::EDGetTokenT
< reco::MuonCollection
muonToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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

This class takes the tracker muons (which are reco::Muons) and creates the correspondent reco::RecoChargedCandidate.

Intermediate step in the L3 muons selection. This class takes the tracker muons (which are reco::Muons) and creates the correspondent reco::RecoChargedCandidate.

Definition at line 20 of file L3MuonCandidateProducerFromMuons.h.

Constructor & Destructor Documentation

L3MuonCandidateProducerFromMuons::L3MuonCandidateProducerFromMuons ( const edm::ParameterSet parameterSet)

constructor with config

Definition at line 35 of file L3MuonCandidateProducerFromMuons.cc.

References category(), LogTrace, m_L3CollectionLabel, and muonToken_.

35  :
36  m_L3CollectionLabel( parameterSet.getParameter<InputTag>("InputObjects") ) // standAlone Collection Label
37 {
38  muonToken_ = consumes<reco::MuonCollection>(m_L3CollectionLabel);
39  LogTrace(category)<<" constructor called";
40  produces<RecoChargedCandidateCollection>();
41 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::MuonCollection > muonToken_
#define LogTrace(id)
static const std::string category("Muon|RecoMuon|L3MuonCandidateProducerFromMuons")
L3MuonCandidateProducerFromMuons::~L3MuonCandidateProducerFromMuons ( )
virtual

destructor

Definition at line 44 of file L3MuonCandidateProducerFromMuons.cc.

References category(), and LogTrace.

44  {
45  LogTrace(category)<<" L3MuonCandidateProducerFromMuons destructor called";
46 }
#define LogTrace(id)
static const std::string category("Muon|RecoMuon|L3MuonCandidateProducerFromMuons")

Member Function Documentation

void L3MuonCandidateProducerFromMuons::produce ( edm::Event event,
const edm::EventSetup eventSetup 
)
virtual

produce candidates

reconstruct muons

Implements edm::EDProducer.

Definition at line 50 of file L3MuonCandidateProducerFromMuons.cc.

References funct::abs(), objects.IsoTrackAnalyzer::candidates, category(), i, edm::HandleBase::isValid(), edm::InputTag::label(), LogTrace, m_L3CollectionLabel, patZpeak::muons, muonToken_, p4, sysUtil::pid, lumiQueryAPI::q, reco::RecoChargedCandidate::setTrack(), and edm::HandleBase::whyFailed().

50  {
51  // Create a RecoChargedCandidate collection
52  LogTrace(category)<<" Creating the RecoChargedCandidate collection";
53  auto_ptr<RecoChargedCandidateCollection> candidates( new RecoChargedCandidateCollection());
54 
55  // Take the L3 container
56  LogTrace(category)<<" Taking the L3/GLB muons: "<<m_L3CollectionLabel.label();
58  event.getByToken(muonToken_,muons);
59 
60  if (not muons.isValid()) {
61  LogError(category) << muons.whyFailed()->what();
62  } else {
63  for (unsigned int i=0; i<muons->size(); i++) {
64  TrackRef tkref = (*muons)[i].innerTrack();
65 
66  Particle::Charge q = tkref->charge();
67  Particle::LorentzVector p4(tkref->px(), tkref->py(), tkref->pz(), tkref->p());
68  Particle::Point vtx(tkref->vx(),tkref->vy(), tkref->vz());
69 
70  int pid = 13;
71  if (abs(q)==1)
72  pid = q < 0 ? 13 : -13;
73  else
74  LogWarning(category) << "L3MuonCandidate has charge = " << q;
75  RecoChargedCandidate cand(q, p4, vtx, pid);
76 
77  cand.setTrack(tkref);
78  candidates->push_back(cand);
79  }
80  }
81  event.put(candidates);
82 }
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< reco::MuonCollection > muonToken_
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
bool isValid() const
Definition: HandleBase.h:76
#define LogTrace(id)
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
tuple pid
Definition: sysUtil.py:22
std::string const & label() const
Definition: InputTag.h:42
tuple muons
Definition: patZpeak.py:38
static const std::string category("Muon|RecoMuon|L3MuonCandidateProducerFromMuons")
std::shared_ptr< cms::Exception > whyFailed() const
Definition: HandleBase.h:111
math::PtEtaPhiELorentzVectorF LorentzVector

Member Data Documentation

edm::InputTag L3MuonCandidateProducerFromMuons::m_L3CollectionLabel
private

Definition at line 36 of file L3MuonCandidateProducerFromMuons.h.

Referenced by L3MuonCandidateProducerFromMuons(), and produce().

edm::EDGetTokenT<reco::MuonCollection> L3MuonCandidateProducerFromMuons::muonToken_
private

Definition at line 37 of file L3MuonCandidateProducerFromMuons.h.

Referenced by L3MuonCandidateProducerFromMuons(), and produce().