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::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 ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

edm::InputTag theSACollectionLabel
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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 26 of file L2MuonCandidateProducer.h.

Constructor & Destructor Documentation

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

constructor with config

Definition at line 41 of file L2MuonCandidateProducer.cc.

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

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

destructor

Definition at line 51 of file L2MuonCandidateProducer.cc.

References LogTrace.

51  {
52  LogTrace("Muon|RecoMuon|L2MuonCandidateProducer")<<" L2MuonCandidateProducer destructor called";
53 }
#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 57 of file L2MuonCandidateProducer.cc.

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

57  {
58  const string metname = "Muon|RecoMuon|L2MuonCandidateProducer";
59 
60  // Take the SA container
61  LogTrace(metname)<<" Taking the StandAlone muons: "<<theSACollectionLabel;
63  event.getByLabel(theSACollectionLabel,tracks);
64 
65  // Create a RecoChargedCandidate collection
66  LogTrace(metname)<<" Creating the RecoChargedCandidate collection";
67  auto_ptr<RecoChargedCandidateCollection> candidates( new RecoChargedCandidateCollection());
68 
69  for (unsigned int i=0; i<tracks->size(); i++) {
70  TrackRef tkref(tracks,i);
71  Particle::Charge q = tkref->charge();
72  Particle::LorentzVector p4(tkref->px(), tkref->py(), tkref->pz(), tkref->p());
73  Particle::Point vtx(tkref->vx(),tkref->vy(), tkref->vz());
74  int pid = 13;
75  if(abs(q)==1) pid = q < 0 ? 13 : -13;
76  else LogWarning(metname) << "L2MuonCandidate has charge = "<<q;
77  RecoChargedCandidate cand(q, p4, vtx, pid);
78  cand.setTrack(tkref);
79  candidates->push_back(cand);
80  }
81 
82  event.put(candidates);
83 
84  LogTrace(metname)<<" Event loaded"
85  <<"================================";
86 }
int i
Definition: DBlmapReader.cc:9
const std::string metname
#define abs(x)
Definition: mlp_lapack.h:159
int Charge
electric charge type
Definition: Particle.h:23
double p4[4]
Definition: TauolaWrapper.h:92
math::XYZPoint Point
point in the space
Definition: Particle.h:29
#define LogTrace(id)
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects
tuple tracks
Definition: testEve_cfg.py:39
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:25

Member Data Documentation

edm::InputTag L2MuonCandidateProducer::theSACollectionLabel
private

Definition at line 42 of file L2MuonCandidateProducer.h.