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 Member Functions | Private Attributes
TevMuonProducer Class Reference

#include <TevMuonProducer.h>

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

Public Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &)
 reconstruct muons More...
 
 TevMuonProducer (const edm::ParameterSet &)
 constructor with config More...
 
virtual ~TevMuonProducer ()
 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 Member Functions

void setAlias (std::string alias)
 

Private Attributes

std::string theAlias
 
edm::InputTag theGLBCollectionLabel
 STA Label. More...
 
std::vector< int > theRefitIndex
 
std::vector< std::string > theRefits
 
GlobalMuonRefittertheRefitter
 
MuonServiceProxytheService
 the event setup proxy, it takes care the services update More...
 
MuonTrackLoadertheTrackLoader
 

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

TeV muon reconstructor:

Date:
2009/10/20 04:32:09
Revision:
1.5
Author
Piotr Traczyk (SINS Warsaw)

Global muon reconstructor: reconstructs muons using DT, CSC, RPC and tracker information,
starting from a standalone reonstructed muon.

Date:
2008/05/13 03:31:44
Revision:
1.2
Author
R.Bellan - INFN TO

Definition at line 27 of file TevMuonProducer.h.

Constructor & Destructor Documentation

TevMuonProducer::TevMuonProducer ( const edm::ParameterSet parameterSet)

constructor with config

Definition at line 44 of file TevMuonProducer.cc.

References edm::ParameterSet::getParameter(), GlobalMuonRefitter_cff::GlobalMuonRefitter, LogDebug, and MuonServiceProxy_cff::MuonServiceProxy.

44  {
45 
46  LogDebug("Muon|RecoMuon|TevMuonProducer") << "constructor called" << endl;
47 
48  // GLB Muon Collection Label
49  theGLBCollectionLabel = parameterSet.getParameter<InputTag>("MuonCollectionLabel");
50 
51  // service parameters
52  ParameterSet serviceParameters = parameterSet.getParameter<ParameterSet>("ServiceParameters");
53 
54  // the services
55  theService = new MuonServiceProxy(serviceParameters);
56 
57  // TrackRefitter parameters
58  ParameterSet refitterParameters = parameterSet.getParameter<ParameterSet>("RefitterParameters");
59  theRefitter = new GlobalMuonRefitter(refitterParameters, theService);
60 
61  // TrackLoader parameters
62  ParameterSet trackLoaderParameters = parameterSet.getParameter<ParameterSet>("TrackLoaderParameters");
63  theTrackLoader = new MuonTrackLoader(trackLoaderParameters,theService);
64 
65  theRefits = parameterSet.getParameter< std::vector<std::string> >("Refits");
66  theRefitIndex = parameterSet.getParameter< std::vector<int> >("RefitIndex");
67 
68  for(unsigned int ww=0;ww<theRefits.size();ww++){
69  LogDebug("Muon|RecoMuon|TevMuonProducer") << "Refit " << theRefits[ww];
70  produces<reco::TrackCollection>(theRefits[ww]);
71  produces<TrackingRecHitCollection>(theRefits[ww]);
72  produces<reco::TrackExtraCollection>(theRefits[ww]);
73  produces<vector<Trajectory> >(theRefits[ww]) ;
74  produces<TrajTrackAssociationCollection>(theRefits[ww]);
75  produces<reco::TrackToTrackMap>(theRefits[ww]);
76  }
77 }
#define LogDebug(id)
T getParameter(std::string const &) const
std::vector< int > theRefitIndex
edm::InputTag theGLBCollectionLabel
STA Label.
std::vector< std::string > theRefits
GlobalMuonRefitter * theRefitter
MuonTrackLoader * theTrackLoader
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
TevMuonProducer::~TevMuonProducer ( )
virtual

destructor

Definition at line 83 of file TevMuonProducer.cc.

References LogTrace.

83  {
84 
85  LogTrace("Muon|RecoMuon|TevMuonProducer") << "destructor called" << endl;
86  if (theService) delete theService;
87  if (theRefitter) delete theRefitter;
88  if (theTrackLoader) delete theTrackLoader;
89 }
#define LogTrace(id)
GlobalMuonRefitter * theRefitter
MuonTrackLoader * theTrackLoader
MuonServiceProxy * theService
the event setup proxy, it takes care the services update

Member Function Documentation

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

reconstruct muons

Implements edm::EDProducer.

Definition at line 95 of file TevMuonProducer.cc.

References LogDebug, LogTrace, metname, and edm::Handle< T >::product().

95  {
96 
97  const string metname = "Muon|RecoMuon|TevMuonProducer";
98  LogTrace(metname)<< endl << endl;
99  LogTrace(metname)<< "TeV Muon Reconstruction started" << endl;
100 
101  // Update the services
102  theService->update(eventSetup);
103 
104  theRefitter->setEvent(event);
105 
106  theRefitter->setServices(theService->eventSetup());
107 
108  // Take the GLB muon container(s)
110  event.getByLabel(theGLBCollectionLabel,glbMuons);
111 
112  Handle<vector<Trajectory> > glbMuonsTraj;
113 
114  LogTrace(metname)<< "Taking " << glbMuons->size() << " Global Muons "<<theGLBCollectionLabel<<endl;
115 
116  vector<MuonTrajectoryBuilder::TrackCand> glbTrackCands;
117 
118  event.getByLabel(theGLBCollectionLabel.label(), glbMuonsTraj);
119 
120  const reco::TrackCollection *glbTracks = glbMuons.product();
121 
122  for(unsigned int ww=0;ww<theRefits.size();ww++) {
123  LogDebug(metname)<<"TeVRefit for Refit: " <<theRefitIndex[ww];
124  std::vector<std::pair<Trajectory*,reco::TrackRef> > miniMap;
125  vector<Trajectory*> trajectories;
126  reco::TrackRef::key_type trackIndex = 0;
127  for (reco::TrackCollection::const_iterator track = glbTracks->begin(); track!=glbTracks->end(); track++ , ++trackIndex) {
128  reco::TrackRef glbRef(glbMuons,trackIndex);
129 
130  vector<Trajectory> refitted=theRefitter->refit(*track,theRefitIndex[ww]);
131 
132  if (refitted.size()>0) {
133  Trajectory *refit = new Trajectory(refitted.front());
134  LogDebug(metname)<<"TeVTrackLoader for Refit: " <<theRefits[ww];
135  trajectories.push_back(refit);
136  std::pair<Trajectory*,reco::TrackRef> thisPair(refit,glbRef);
137  miniMap.push_back(thisPair);
138  }
139  }
140  theTrackLoader->loadTracks(trajectories,event,miniMap,theRefits[ww]);
141  }
142 
143  LogTrace(metname) << "Done." << endl;
144 
145 }
#define LogDebug(id)
const std::string metname
std::vector< int > theRefitIndex
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
void setServices(const edm::EventSetup &)
set the services needed by the TrackTransformer
edm::InputTag theGLBCollectionLabel
STA Label.
#define LogTrace(id)
virtual void setEvent(const edm::Event &)
pass the Event to the algo at each event
edm::OrphanHandle< reco::TrackCollection > loadTracks(const TrajectoryContainer &, edm::Event &, const std::string &="", bool=true)
Convert the trajectories into tracks and load the tracks in the event.
std::vector< std::string > theRefits
T const * product() const
Definition: Handle.h:74
std::vector< Trajectory > refit(const reco::Track &globalTrack, const int theMuonHitsOption) const
build combined trajectory from sta Track and tracker RecHits
GlobalMuonRefitter * theRefitter
std::string const & label() const
Definition: InputTag.h:25
MuonTrackLoader * theTrackLoader
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
boost::remove_cv< typename boost::remove_reference< argument_type >::type >::type key_type
Definition: Ref.h:170
void TevMuonProducer::setAlias ( std::string  alias)
inlineprivate

Definition at line 56 of file TevMuonProducer.h.

References theAlias.

56  {
57  alias.erase( alias.size() - 1, alias.size() );
58  theAlias=alias;
59  }
std::string theAlias

Member Data Documentation

std::string TevMuonProducer::theAlias
private

Definition at line 52 of file TevMuonProducer.h.

Referenced by setAlias().

edm::InputTag TevMuonProducer::theGLBCollectionLabel
private

STA Label.

Definition at line 43 of file TevMuonProducer.h.

std::vector<int> TevMuonProducer::theRefitIndex
private

Definition at line 54 of file TevMuonProducer.h.

std::vector<std::string> TevMuonProducer::theRefits
private

Definition at line 53 of file TevMuonProducer.h.

GlobalMuonRefitter* TevMuonProducer::theRefitter
private

Definition at line 48 of file TevMuonProducer.h.

MuonServiceProxy* TevMuonProducer::theService
private

the event setup proxy, it takes care the services update

Definition at line 46 of file TevMuonProducer.h.

MuonTrackLoader* TevMuonProducer::theTrackLoader
private

Definition at line 50 of file TevMuonProducer.h.