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

Private Member Functions

void setAlias (std::string alias)
 

Private Attributes

edm::EDGetTokenT
< reco::TrackCollection
glbMuonsToken
 
edm::EDGetTokenT< std::vector
< Trajectory > > 
glbMuonsTrajToken
 
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
 
- 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::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:

Author
Piotr Traczyk (SINS Warsaw)

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

Author
R.Bellan - INFN TO

Definition at line 36 of file TevMuonProducer.h.

Constructor & Destructor Documentation

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

constructor with config

Definition at line 34 of file TevMuonProducer.cc.

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

34  {
35 
36  LogDebug("Muon|RecoMuon|TevMuonProducer") << "constructor called" << endl;
37 
38  // GLB Muon Collection Label
39  theGLBCollectionLabel = parameterSet.getParameter<InputTag>("MuonCollectionLabel");
40  glbMuonsToken=consumes<reco::TrackCollection>(theGLBCollectionLabel);
41  glbMuonsTrajToken=consumes<std::vector<Trajectory> >(theGLBCollectionLabel.label());
42 
43  // service parameters
44  ParameterSet serviceParameters = parameterSet.getParameter<ParameterSet>("ServiceParameters");
45 
46  // the services
47  theService = new MuonServiceProxy(serviceParameters);
48 
49  // TrackRefitter parameters
50  ParameterSet refitterParameters = parameterSet.getParameter<ParameterSet>("RefitterParameters");
51  theRefitter = new GlobalMuonRefitter(refitterParameters, theService);
52 
53  // TrackLoader parameters
54  ParameterSet trackLoaderParameters = parameterSet.getParameter<ParameterSet>("TrackLoaderParameters");
56  theTrackLoader = new MuonTrackLoader(trackLoaderParameters,iC,theService);
57 
58  theRefits = parameterSet.getParameter< std::vector<std::string> >("Refits");
59  theRefitIndex = parameterSet.getParameter< std::vector<int> >("RefitIndex");
60 
61  for(unsigned int ww=0;ww<theRefits.size();ww++){
62  LogDebug("Muon|RecoMuon|TevMuonProducer") << "Refit " << theRefits[ww];
63  produces<reco::TrackCollection>(theRefits[ww]);
64  produces<TrackingRecHitCollection>(theRefits[ww]);
65  produces<reco::TrackExtraCollection>(theRefits[ww]);
66  produces<vector<Trajectory> >(theRefits[ww]) ;
67  produces<TrajTrackAssociationCollection>(theRefits[ww]);
68  produces<reco::TrackToTrackMap>(theRefits[ww]);
69  }
70 }
#define LogDebug(id)
T getParameter(std::string const &) const
std::vector< int > theRefitIndex
edm::EDGetTokenT< std::vector< Trajectory > > glbMuonsTrajToken
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::InputTag theGLBCollectionLabel
STA Label.
std::vector< std::string > theRefits
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
edm::EDGetTokenT< reco::TrackCollection > glbMuonsToken
TevMuonProducer::~TevMuonProducer ( )
virtual

destructor

Definition at line 76 of file TevMuonProducer.cc.

References LogTrace.

76  {
77 
78  LogTrace("Muon|RecoMuon|TevMuonProducer") << "destructor called" << endl;
79  if (theService) delete theService;
80  if (theRefitter) delete theRefitter;
81  if (theTrackLoader) delete theTrackLoader;
82 }
#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 88 of file TevMuonProducer.cc.

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

88  {
89 
90  const string metname = "Muon|RecoMuon|TevMuonProducer";
91  LogTrace(metname)<< endl << endl;
92  LogTrace(metname)<< "TeV Muon Reconstruction started" << endl;
93 
94  // Update the services
95  theService->update(eventSetup);
96 
97  theRefitter->setEvent(event);
98 
99  theRefitter->setServices(theService->eventSetup());
100 
101  //Retrieve tracker topology from geometry
103  eventSetup.get<IdealGeometryRecord>().get(tTopoHand);
104  const TrackerTopology *tTopo=tTopoHand.product();
105 
106 
107  // Take the GLB muon container(s)
109  event.getByToken(glbMuonsToken,glbMuons);
110 
111  Handle<vector<Trajectory> > glbMuonsTraj;
112 
113  LogTrace(metname)<< "Taking " << glbMuons->size() << " Global Muons "<<theGLBCollectionLabel<<endl;
114 
115  vector<MuonTrajectoryBuilder::TrackCand> glbTrackCands;
116 
117  event.getByToken(glbMuonsTrajToken, glbMuonsTraj);
118 
119  const reco::TrackCollection *glbTracks = glbMuons.product();
120 
121  for(unsigned int ww=0;ww<theRefits.size();ww++) {
122  LogDebug(metname)<<"TeVRefit for Refit: " <<theRefitIndex[ww];
123  std::vector<std::pair<Trajectory*,reco::TrackRef> > miniMap;
124  vector<Trajectory*> trajectories;
125  reco::TrackRef::key_type trackIndex = 0;
126  for (reco::TrackCollection::const_iterator track = glbTracks->begin(); track!=glbTracks->end(); track++ , ++trackIndex) {
127  reco::TrackRef glbRef(glbMuons,trackIndex);
128 
129  vector<Trajectory> refitted=theRefitter->refit(*track,theRefitIndex[ww],tTopo);
130 
131  if (refitted.size()>0) {
132  Trajectory *refit = new Trajectory(refitted.front());
133  LogDebug(metname)<<"TeVTrackLoader for Refit: " <<theRefits[ww];
134  trajectories.push_back(refit);
135  std::pair<Trajectory*,reco::TrackRef> thisPair(refit,glbRef);
136  miniMap.push_back(thisPair);
137  }
138  }
139  theTrackLoader->loadTracks(trajectories,event,miniMap,theRefits[ww]);
140  }
141 
142  LogTrace(metname) << "Done." << endl;
143 
144 }
#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::EDGetTokenT< std::vector< Trajectory > > glbMuonsTrajToken
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:81
GlobalMuonRefitter * theRefitter
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
edm::EDGetTokenT< reco::TrackCollection > glbMuonsToken
void TevMuonProducer::setAlias ( std::string  alias)
inlineprivate

Definition at line 69 of file TevMuonProducer.h.

References theAlias.

69  {
70  alias.erase( alias.size() - 1, alias.size() );
71  theAlias=alias;
72  }
std::string theAlias

Member Data Documentation

edm::EDGetTokenT<reco::TrackCollection> TevMuonProducer::glbMuonsToken
private

Definition at line 53 of file TevMuonProducer.h.

edm::EDGetTokenT<std::vector<Trajectory> > TevMuonProducer::glbMuonsTrajToken
private

Definition at line 54 of file TevMuonProducer.h.

std::string TevMuonProducer::theAlias
private

Definition at line 65 of file TevMuonProducer.h.

Referenced by setAlias().

edm::InputTag TevMuonProducer::theGLBCollectionLabel
private

STA Label.

Definition at line 52 of file TevMuonProducer.h.

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

Definition at line 67 of file TevMuonProducer.h.

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

Definition at line 66 of file TevMuonProducer.h.

GlobalMuonRefitter* TevMuonProducer::theRefitter
private

Definition at line 61 of file TevMuonProducer.h.

MuonServiceProxy* TevMuonProducer::theService
private

the event setup proxy, it takes care the services update

Definition at line 59 of file TevMuonProducer.h.

MuonTrackLoader* TevMuonProducer::theTrackLoader
private

Definition at line 63 of file TevMuonProducer.h.