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::EDConsumerBase 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 &)
 
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 ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
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

TeV muon reconstructor:

Date:
2013/01/06 19:17:48
Revision:
1.6
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 46 of file TevMuonProducer.cc.

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

46  {
47 
48  LogDebug("Muon|RecoMuon|TevMuonProducer") << "constructor called" << endl;
49 
50  // GLB Muon Collection Label
51  theGLBCollectionLabel = parameterSet.getParameter<InputTag>("MuonCollectionLabel");
52 
53  // service parameters
54  ParameterSet serviceParameters = parameterSet.getParameter<ParameterSet>("ServiceParameters");
55 
56  // the services
57  theService = new MuonServiceProxy(serviceParameters);
58 
59  // TrackRefitter parameters
60  ParameterSet refitterParameters = parameterSet.getParameter<ParameterSet>("RefitterParameters");
61  theRefitter = new GlobalMuonRefitter(refitterParameters, theService);
62 
63  // TrackLoader parameters
64  ParameterSet trackLoaderParameters = parameterSet.getParameter<ParameterSet>("TrackLoaderParameters");
65  theTrackLoader = new MuonTrackLoader(trackLoaderParameters,theService);
66 
67  theRefits = parameterSet.getParameter< std::vector<std::string> >("Refits");
68  theRefitIndex = parameterSet.getParameter< std::vector<int> >("RefitIndex");
69 
70  for(unsigned int ww=0;ww<theRefits.size();ww++){
71  LogDebug("Muon|RecoMuon|TevMuonProducer") << "Refit " << theRefits[ww];
72  produces<reco::TrackCollection>(theRefits[ww]);
73  produces<TrackingRecHitCollection>(theRefits[ww]);
74  produces<reco::TrackExtraCollection>(theRefits[ww]);
75  produces<vector<Trajectory> >(theRefits[ww]) ;
76  produces<TrajTrackAssociationCollection>(theRefits[ww]);
77  produces<reco::TrackToTrackMap>(theRefits[ww]);
78  }
79 }
#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 85 of file TevMuonProducer.cc.

References LogTrace.

85  {
86 
87  LogTrace("Muon|RecoMuon|TevMuonProducer") << "destructor called" << endl;
88  if (theService) delete theService;
89  if (theRefitter) delete theRefitter;
90  if (theTrackLoader) delete theTrackLoader;
91 }
#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 97 of file TevMuonProducer.cc.

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

97  {
98 
99  const string metname = "Muon|RecoMuon|TevMuonProducer";
100  LogTrace(metname)<< endl << endl;
101  LogTrace(metname)<< "TeV Muon Reconstruction started" << endl;
102 
103  // Update the services
104  theService->update(eventSetup);
105 
106  theRefitter->setEvent(event);
107 
108  theRefitter->setServices(theService->eventSetup());
109 
110  //Retrieve tracker topology from geometry
112  eventSetup.get<IdealGeometryRecord>().get(tTopoHand);
113  const TrackerTopology *tTopo=tTopoHand.product();
114 
115 
116  // Take the GLB muon container(s)
118  event.getByLabel(theGLBCollectionLabel,glbMuons);
119 
120  Handle<vector<Trajectory> > glbMuonsTraj;
121 
122  LogTrace(metname)<< "Taking " << glbMuons->size() << " Global Muons "<<theGLBCollectionLabel<<endl;
123 
124  vector<MuonTrajectoryBuilder::TrackCand> glbTrackCands;
125 
126  event.getByLabel(theGLBCollectionLabel.label(), glbMuonsTraj);
127 
128  const reco::TrackCollection *glbTracks = glbMuons.product();
129 
130  for(unsigned int ww=0;ww<theRefits.size();ww++) {
131  LogDebug(metname)<<"TeVRefit for Refit: " <<theRefitIndex[ww];
132  std::vector<std::pair<Trajectory*,reco::TrackRef> > miniMap;
133  vector<Trajectory*> trajectories;
134  reco::TrackRef::key_type trackIndex = 0;
135  for (reco::TrackCollection::const_iterator track = glbTracks->begin(); track!=glbTracks->end(); track++ , ++trackIndex) {
136  reco::TrackRef glbRef(glbMuons,trackIndex);
137 
138  vector<Trajectory> refitted=theRefitter->refit(*track,theRefitIndex[ww],tTopo);
139 
140  if (refitted.size()>0) {
141  Trajectory *refit = new Trajectory(refitted.front());
142  LogDebug(metname)<<"TeVTrackLoader for Refit: " <<theRefits[ww];
143  trajectories.push_back(refit);
144  std::pair<Trajectory*,reco::TrackRef> thisPair(refit,glbRef);
145  miniMap.push_back(thisPair);
146  }
147  }
148  theTrackLoader->loadTracks(trajectories,event,miniMap,theRefits[ww]);
149  }
150 
151  LogTrace(metname) << "Done." << endl;
152 
153 }
#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
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
T const * product() const
Definition: Handle.h:74
GlobalMuonRefitter * theRefitter
std::string const & label() const
Definition: InputTag.h:42
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
std::vector< Trajectory > refit(const reco::Track &globalTrack, const int theMuonHitsOption, const TrackerTopology *tTopo) const
build combined trajectory from sta Track and tracker RecHits
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.