CMS 3D CMS Logo

Public Member Functions | Private Attributes

L2MuonCandidateProducer Class Reference

#include <L2MuonCandidateProducer.h>

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

List of all members.

Public Member Functions

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

Private Attributes

edm::InputTag theSACollectionLabel

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.

                                                                                {
  LogTrace("Muon|RecoMuon|L2MuonCandidateProducer")<<" constructor called";

  // StandAlone Collection Label
  theSACollectionLabel = parameterSet.getParameter<InputTag>("InputObjects");

  produces<RecoChargedCandidateCollection>();
}
L2MuonCandidateProducer::~L2MuonCandidateProducer ( ) [virtual]

destructor

Definition at line 51 of file L2MuonCandidateProducer.cc.

References LogTrace.

                                                 {
  LogTrace("Muon|RecoMuon|L2MuonCandidateProducer")<<" L2MuonCandidateProducer destructor called";
}

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.

                                                                               {
  const string metname = "Muon|RecoMuon|L2MuonCandidateProducer";
  
  // Take the SA container
  LogTrace(metname)<<" Taking the StandAlone muons: "<<theSACollectionLabel;
  Handle<TrackCollection> tracks; 
  event.getByLabel(theSACollectionLabel,tracks);

  // Create a RecoChargedCandidate collection
  LogTrace(metname)<<" Creating the RecoChargedCandidate collection";
  auto_ptr<RecoChargedCandidateCollection> candidates( new RecoChargedCandidateCollection());

  for (unsigned int i=0; i<tracks->size(); i++) {
      TrackRef tkref(tracks,i);
      Particle::Charge q = tkref->charge();
      Particle::LorentzVector p4(tkref->px(), tkref->py(), tkref->pz(), tkref->p());
      Particle::Point vtx(tkref->vx(),tkref->vy(), tkref->vz());
      int pid = 13;
      if(abs(q)==1) pid = q < 0 ? 13 : -13;
      else LogWarning(metname) << "L2MuonCandidate has charge = "<<q;
      RecoChargedCandidate cand(q, p4, vtx, pid);
      cand.setTrack(tkref);
      candidates->push_back(cand);
  }
  
  event.put(candidates);
 
  LogTrace(metname)<<" Event loaded"
                   <<"================================";
}

Member Data Documentation

Definition at line 42 of file L2MuonCandidateProducer.h.