CMS 3D CMS Logo

L3MuonCandidateProducer Class Reference

Intermediate step in the L3 muons selection. More...

#include <RecoMuon/L3MuonProducer/src/L3MuonCandidateProducer.h>

Inheritance diagram for L3MuonCandidateProducer:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 L3MuonCandidateProducer (const edm::ParameterSet &)
 constructor with config
virtual void produce (edm::Event &, const edm::EventSetup &)
 produce candidates
virtual ~L3MuonCandidateProducer ()
 destructor

Private Attributes

edm::InputTag theL3CollectionLabel


Detailed Description

Intermediate step in the L3 muons selection.

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

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

Author:
J.Alcaraz
This class takes the L3 muons (which are reco::Tracks) and creates the correspondent reco::RecoChargedCandidate.

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

Author:
J.Alcaraz

Definition at line 26 of file L3MuonCandidateProducer.h.


Constructor & Destructor Documentation

L3MuonCandidateProducer::L3MuonCandidateProducer ( const edm::ParameterSet parameterSet  ) 

constructor with config

Definition at line 41 of file L3MuonCandidateProducer.cc.

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

00041                                                                                 {
00042   LogTrace("Muon|RecoMuon|L3MuonCandidateProducer")<<" constructor called";
00043 
00044   // StandAlone Collection Label
00045   theL3CollectionLabel = parameterSet.getParameter<InputTag>("InputObjects");
00046 
00047   produces<RecoChargedCandidateCollection>();
00048 }

L3MuonCandidateProducer::~L3MuonCandidateProducer (  )  [virtual]

destructor

Definition at line 51 of file L3MuonCandidateProducer.cc.

References LogTrace.

00051                                                  {
00052   LogTrace("Muon|RecoMuon|L3MuonCandidateProducer")<<" L3MuonCandidateProducer destructor called";
00053 }


Member Function Documentation

void L3MuonCandidateProducer::produce ( edm::Event event,
const edm::EventSetup eventSetup 
) [virtual]

produce candidates

reconstruct muons

Implements edm::EDProducer.

Definition at line 57 of file L3MuonCandidateProducer.cc.

References funct::abs(), i, edm::InputTag::label(), LogTrace, p4, reco::RecoChargedCandidate::setTrack(), theL3CollectionLabel, and tracks.

00057                                                                                {
00058   const string metname = "Muon|RecoMuon|L3MuonCandidateProducer";
00059   
00060   // Take the L3 container
00061   LogTrace(metname)<<" Taking the L3/GLB muons: "<<theL3CollectionLabel.label();
00062   Handle<TrackCollection> tracks; 
00063   event.getByLabel(theL3CollectionLabel,tracks);
00064 
00065   // Create a RecoChargedCandidate collection
00066   LogTrace(metname)<<" Creating the RecoChargedCandidate collection";
00067   auto_ptr<RecoChargedCandidateCollection> candidates( new RecoChargedCandidateCollection());
00068 
00069   for (unsigned int i=0; i<tracks->size(); i++) {
00070       TrackRef tkref(tracks,i);
00071       Particle::Charge q = tkref->charge();
00072       Particle::LorentzVector p4(tkref->px(), tkref->py(), tkref->pz(), tkref->p());
00073       Particle::Point vtx(tkref->vx(),tkref->vy(), tkref->vz());
00074 
00075       int pid = 13;
00076       if(abs(q)==1) pid = q < 0 ? 13 : -13;
00077       else LogWarning(metname) << "L3MuonCandidate has charge = "<<q;
00078       RecoChargedCandidate cand(q, p4, vtx, pid); 
00079 
00080       cand.setTrack(tkref);
00081       candidates->push_back(cand);
00082   }
00083   
00084   event.put(candidates);
00085  
00086   LogTrace(metname)<<" Event loaded"
00087                    <<"================================";
00088 }


Member Data Documentation

edm::InputTag L3MuonCandidateProducer::theL3CollectionLabel [private]

Definition at line 42 of file L3MuonCandidateProducer.h.

Referenced by L3MuonCandidateProducer(), and produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:27:11 2009 for CMSSW by  doxygen 1.5.4