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
GlobalMuonProducer Class Reference

#include <GlobalMuonProducer.h>

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

Public Member Functions

 GlobalMuonProducer (const edm::ParameterSet &)
 constructor with config More...
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 reconstruct muons More...
 
virtual ~GlobalMuonProducer ()
 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
 
MuonServiceProxytheService
 the event setup proxy, it takes care the services update More...
 
edm::InputTag theSTACollectionLabel
 STA Label. More...
 
MuonTrackFindertheTrackFinder
 

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

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

Date:
2009/07/29 12:12:45
Revision:
1.35
Author
R.Bellan - INFN TO

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

Date:
2007/03/20 15:58:13
Revision:
1.10
Author
R.Bellan - INFN TO

Definition at line 25 of file GlobalMuonProducer.h.

Constructor & Destructor Documentation

GlobalMuonProducer::GlobalMuonProducer ( const edm::ParameterSet parameterSet)

constructor with config

Definition at line 45 of file GlobalMuonProducer.cc.

References edm::ParameterSet::addParameter(), edm::ParameterSet::getParameter(), LogTrace, MuonServiceProxy_cff::MuonServiceProxy, and ExpressReco_HICollisions_FallBack::trackCollectionTag.

45  {
46 
47  LogTrace("Muon|RecoMuon|GlobalMuonProducer") << "constructor called" << endl;
48 
49  // Parameter set for the Builder
50  ParameterSet trajectoryBuilderParameters = parameterSet.getParameter<ParameterSet>("GLBTrajBuilderParameters");
51  InputTag trackCollectionTag = parameterSet.getParameter<InputTag>("TrackerCollectionLabel");
52  trajectoryBuilderParameters.addParameter<InputTag>("TrackerCollectionLabel",trackCollectionTag);
53 
54  // STA Muon Collection Label
55  theSTACollectionLabel = parameterSet.getParameter<InputTag>("MuonCollectionLabel");
56 
57  // service parameters
58  ParameterSet serviceParameters = parameterSet.getParameter<ParameterSet>("ServiceParameters");
59 
60  // TrackLoader parameters
61  ParameterSet trackLoaderParameters = parameterSet.getParameter<ParameterSet>("TrackLoaderParameters");
62 
63  // the services
64  theService = new MuonServiceProxy(serviceParameters);
65 
66  // instantiate the concrete trajectory builder in the Track Finder
67  MuonTrackLoader* mtl = new MuonTrackLoader(trackLoaderParameters,theService);
68  GlobalMuonTrajectoryBuilder* gmtb = new GlobalMuonTrajectoryBuilder(trajectoryBuilderParameters, theService);
69 
70  theTrackFinder = new MuonTrackFinder(gmtb, mtl);
71 
72  setAlias(parameterSet.getParameter<std::string>("@module_label"));
73  produces<reco::TrackCollection>().setBranchAlias(theAlias + "Tracks");
74  produces<TrackingRecHitCollection>().setBranchAlias(theAlias + "RecHits");
75  produces<reco::TrackExtraCollection>().setBranchAlias(theAlias + "TrackExtras");
76  produces<vector<Trajectory> >().setBranchAlias(theAlias + "Trajectories") ;
77  produces<TrajTrackAssociationCollection>().setBranchAlias(theAlias + "TrajTrackMap");
78  produces<reco::MuonTrackLinksCollection>().setBranchAlias(theAlias + "s");
79 }
T getParameter(std::string const &) const
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:138
#define LogTrace(id)
MuonTrackFinder * theTrackFinder
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
void setAlias(std::string alias)
edm::InputTag theSTACollectionLabel
STA Label.
GlobalMuonProducer::~GlobalMuonProducer ( )
virtual

destructor

Definition at line 85 of file GlobalMuonProducer.cc.

References LogTrace.

85  {
86 
87  LogTrace("Muon|RecoMuon|GlobalMuonProducer") << "destructor called" << endl;
88  if (theService) delete theService;
89  if (theTrackFinder) delete theTrackFinder;
90 
91 }
#define LogTrace(id)
MuonTrackFinder * theTrackFinder
MuonServiceProxy * theService
the event setup proxy, it takes care the services update

Member Function Documentation

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

reconstruct muons

Implements edm::EDProducer.

Definition at line 97 of file GlobalMuonProducer.cc.

References edm::Event::getByLabel(), edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::key(), LogTrace, metname, and position.

97  {
98  const string metname = "Muon|RecoMuon|GlobalMuonProducer";
99  LogTrace(metname)<<endl<<endl<<endl;
100  LogTrace(metname)<<"Global Muon Reconstruction started"<<endl;
101 
102  // Update the services
103  theService->update(eventSetup);
104 
105  // Take the STA muon container(s)
107  event.getByLabel(theSTACollectionLabel,staMuons);
108 
109  Handle<vector<Trajectory> > staMuonsTraj;
110 
111  LogTrace(metname) << "Taking " << staMuons->size() << " Stand Alone Muons "<<theSTACollectionLabel<<endl;
112 
113  vector<MuonTrajectoryBuilder::TrackCand> staTrackCands;
114 
116 
117  edm::Handle<reco::TrackToTrackMap> updatedStaAssoMap;
118 
119  if( event.getByLabel(theSTACollectionLabel.label(), staMuonsTraj) && event.getByLabel(theSTACollectionLabel.label(),staAssoMap) && event.getByLabel(theSTACollectionLabel.label(),updatedStaAssoMap) ) {
120 
121  for(TrajTrackAssociationCollection::const_iterator it = staAssoMap->begin(); it != staAssoMap->end(); ++it){
122  const Ref<vector<Trajectory> > traj = it->key;
123  const reco::TrackRef tkRegular = it->val;
124  reco::TrackRef tkUpdated;
127  if ( theSTACollectionLabel.instance() == "UpdatedAtVtx") {
128  iEnd = updatedStaAssoMap->end();
129  iii = updatedStaAssoMap->find(it->val);
130  if (iii != iEnd ) tkUpdated = (*updatedStaAssoMap)[it->val] ;
131  }
132 
133  int etaFlip1 = ((tkUpdated.isNonnull() && tkRegular.isNonnull()) && ( (tkUpdated->eta() * tkRegular->eta() ) < 0)) ? -1 : 1;
134 
135  const reco::TrackRef tk = ( tkUpdated.isNonnull() && etaFlip1==1 ) ? tkUpdated : tkRegular ;
136 
138  if( traj->isValid() ) tkCand.first = &*traj ;
139  staTrackCands.push_back(tkCand);
140  }
141  } else {
142  for ( unsigned int position = 0; position != staMuons->size(); ++position ) {
143  reco::TrackRef staTrackRef(staMuons,position);
145  staTrackCands.push_back(staCand);
146  }
147  }
148 
149  theTrackFinder->reconstruct(staTrackCands, event);
150 
151 
152  LogTrace(metname)<<"Event loaded"
153  <<"================================"
154  <<endl<<endl;
155 
156 }
std::pair< const Trajectory *, reco::TrackRef > TrackCand
const std::string metname
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:248
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
#define LogTrace(id)
key_type key() const
Accessor for product key.
Definition: Ref.h:264
std::string const & label() const
Definition: InputTag.h:25
MuonTrackFinder * theTrackFinder
MuonServiceProxy * theService
the event setup proxy, it takes care the services update
std::string const & instance() const
Definition: InputTag.h:26
edm::InputTag theSTACollectionLabel
STA Label.
edm::OrphanHandle< reco::TrackCollection > reconstruct(const edm::Handle< edm::View< TrajectorySeed > > &, edm::Event &)
reconstruct standalone tracks starting from a collection of seeds
void GlobalMuonProducer::setAlias ( std::string  alias)
inlineprivate

Definition at line 50 of file GlobalMuonProducer.h.

References ExpressReco_HICollisions_FallBack::alias, and theAlias.

50  {
51  alias.erase( alias.size() - 1, alias.size() );
53  }

Member Data Documentation

std::string GlobalMuonProducer::theAlias
private

Definition at line 48 of file GlobalMuonProducer.h.

Referenced by setAlias().

MuonServiceProxy* GlobalMuonProducer::theService
private

the event setup proxy, it takes care the services update

Definition at line 46 of file GlobalMuonProducer.h.

edm::InputTag GlobalMuonProducer::theSTACollectionLabel
private

STA Label.

Definition at line 41 of file GlobalMuonProducer.h.

MuonTrackFinder* GlobalMuonProducer::theTrackFinder
private

Definition at line 43 of file GlobalMuonProducer.h.