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

#include <L2MuonCandidateProducer.h>

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

Public Member Functions

 L2MuonCandidateProducer (const edm::ParameterSet &)
 constructor with config More...
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 produce candidates More...
 
virtual ~L2MuonCandidateProducer ()
 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 theSACollectionLabel
 
edm::EDGetTokenT
< reco::TrackCollection
tracksToken
 

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

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

Riccardo's comment: The separation between the L2MuonProducer and this class allows the interchangeability of the L2MuonProducer and the StandAloneMuonProducer This class is supposed to be removed once the L2/STA comparison will be done, then the RecoChargedCandidate production will be put into the L2MuonProducer class.

Author
J.Alcaraz

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

Riccardo's comment: The separation between the L2MuonProducer and this class allows the interchangeability of the L2MuonProducer and the StandAloneMuonProducer This class is supposed to be removed once the L2/STA comparison will be done, then the RecoChargedCandidate production will be done into the L2MuonProducer class.

Author
J.Alcaraz

Definition at line 28 of file L2MuonCandidateProducer.h.

Constructor & Destructor Documentation

L2MuonCandidateProducer::L2MuonCandidateProducer ( const edm::ParameterSet parameterSet)

constructor with config

Definition at line 39 of file L2MuonCandidateProducer.cc.

References edm::ParameterSet::getParameter(), and LogTrace.

39  {
40  LogTrace("Muon|RecoMuon|L2MuonCandidateProducer")<<" constructor called";
41 
42  // StandAlone Collection Label
43  theSACollectionLabel = parameterSet.getParameter<InputTag>("InputObjects");
44  tracksToken = consumes<reco::TrackCollection>(theSACollectionLabel);
45  produces<RecoChargedCandidateCollection>();
46 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::TrackCollection > tracksToken
#define LogTrace(id)
L2MuonCandidateProducer::~L2MuonCandidateProducer ( )
virtual

destructor

Definition at line 49 of file L2MuonCandidateProducer.cc.

References LogTrace.

49  {
50  LogTrace("Muon|RecoMuon|L2MuonCandidateProducer")<<" L2MuonCandidateProducer destructor called";
51 }
#define LogTrace(id)

Member Function Documentation

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

produce candidates

reconstruct muons

Implements edm::EDProducer.

Definition at line 55 of file L2MuonCandidateProducer.cc.

References funct::abs(), i, LogTrace, metname, p4, sysUtil::pid, lumiQueryAPI::q, reco::RecoChargedCandidate::setTrack(), and testEve_cfg::tracks.

55  {
56  const string metname = "Muon|RecoMuon|L2MuonCandidateProducer";
57 
58  // Take the SA container
59  LogTrace(metname)<<" Taking the StandAlone muons: "<<theSACollectionLabel;
61  event.getByToken(tracksToken,tracks);
62 
63  // Create a RecoChargedCandidate collection
64  LogTrace(metname)<<" Creating the RecoChargedCandidate collection";
65  auto_ptr<RecoChargedCandidateCollection> candidates( new RecoChargedCandidateCollection());
66 
67  for (unsigned int i=0; i<tracks->size(); i++) {
68  TrackRef tkref(tracks,i);
69  Particle::Charge q = tkref->charge();
70  Particle::LorentzVector p4(tkref->px(), tkref->py(), tkref->pz(), tkref->p());
71  Particle::Point vtx(tkref->vx(),tkref->vy(), tkref->vz());
72  int pid = 13;
73  if(abs(q)==1) pid = q < 0 ? 13 : -13;
74  else LogWarning(metname) << "L2MuonCandidate has charge = "<<q;
75  RecoChargedCandidate cand(q, p4, vtx, pid);
76  cand.setTrack(tkref);
77  candidates->push_back(cand);
78  }
79 
80  event.put(candidates);
81 
82  LogTrace(metname)<<" Event loaded"
83  <<"================================";
84 }
int i
Definition: DBlmapReader.cc:9
const std::string metname
edm::EDGetTokenT< reco::TrackCollection > tracksToken
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
#define LogTrace(id)
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
tuple tracks
Definition: testEve_cfg.py:39
tuple pid
Definition: sysUtil.py:22
math::PtEtaPhiELorentzVectorF LorentzVector

Member Data Documentation

edm::InputTag L2MuonCandidateProducer::theSACollectionLabel
private

Definition at line 44 of file L2MuonCandidateProducer.h.

edm::EDGetTokenT<reco::TrackCollection> L2MuonCandidateProducer::tracksToken
private

Definition at line 45 of file L2MuonCandidateProducer.h.