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 Types | Private Attributes
MuonServiceProxy Class Reference

#include <MuonServiceProxy.h>

Public Member Functions

edm::ESHandle
< MuonDetLayerGeometry
detLayerGeometry () const
 get the detLayer geometry More...
 
const edm::EventSetupeventSetup () const
 get the whole EventSetup More...
 
bool isTrackingComponentsRecordChanged () const
 check if the MuonReco Geometry has been changed More...
 
edm::ESHandle< MagneticFieldmagneticField () const
 get the magnetic field More...
 
const MuonNavigationSchoolmuonNavigationSchool () const
 
 MuonServiceProxy (const edm::ParameterSet &par)
 Constructor. More...
 
edm::ESHandle< Propagatorpropagator (std::string propagatorName) const
 get the propagator More...
 
edm::ESHandle
< GlobalTrackingGeometry
trackingGeometry () const
 get the tracking geometry More...
 
void update (const edm::EventSetup &setup)
 update the services each event More...
 
virtual ~MuonServiceProxy ()
 Destructor. More...
 

Private Types

typedef std::map< std::string,
edm::ESHandle< Propagator > > 
propagators
 

Private Attributes

unsigned long long theCacheId_DG
 
unsigned long long theCacheId_GTG
 
unsigned long long theCacheId_MG
 
unsigned long long theCacheId_P
 
bool theChangeInTrackingComponentsRecord
 
edm::ESHandle
< MuonDetLayerGeometry
theDetLayerGeometry
 
const edm::EventSetuptheEventSetup
 
edm::ESHandle< MagneticFieldtheMGField
 
bool theMuonNavigationFlag
 
propagators thePropagators
 
bool theRPCLayer
 
const MuonNavigationSchooltheSchool
 
edm::ESHandle
< GlobalTrackingGeometry
theTrackingGeometry
 

Detailed Description

Class to handle the services needed by the muon reconstruction This class avoid the EventSetup percolation. The update method is called each event in order to update the pointers.

Date:
2007/06/15 12:30:45
Revision:
1.9
Author
N. Amapane - CERN nicol.nosp@m.a.am.nosp@m.apane.nosp@m.@cer.nosp@m.n.ch
R. Bellan - INFN Torino ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch

Class to handle the services needed by the muon reconstruction This class avoid the EventSetup percolation. The update method is called each event in order to update the pointers.

Date:
2009/04/14 12:12:35
Revision:
1.18
Author
N. Amapane - CERN nicol.nosp@m.a.am.nosp@m.apane.nosp@m.@cer.nosp@m.n.ch
R. Bellan - INFN Torino ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch

Definition at line 26 of file MuonServiceProxy.h.

Member Typedef Documentation

typedef std::map<std::string, edm::ESHandle<Propagator> > MuonServiceProxy::propagators
private

Definition at line 64 of file MuonServiceProxy.h.

Constructor & Destructor Documentation

MuonServiceProxy::MuonServiceProxy ( const edm::ParameterSet par)

Constructor.

Definition at line 37 of file MuonServiceProxy.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), LogDebug, theCacheId_DG, theCacheId_GTG, theCacheId_MG, theCacheId_P, theChangeInTrackingComponentsRecord, theMuonNavigationFlag, thePropagators, and theRPCLayer.

38 
39  // load the propagators map
40  vector<string> noPropagators;
41  vector<string> propagatorNames;
42 
43  theMuonNavigationFlag = par.getUntrackedParameter<bool>("UseMuonNavigation",true);
44  if(theMuonNavigationFlag) theRPCLayer = par.getParameter<bool>("RPCLayers");
45  else theRPCLayer = true;
46 
47  propagatorNames = par.getUntrackedParameter<vector<string> >("Propagators", noPropagators);
48 
49  if(propagatorNames.empty())
50  LogDebug("Muon|RecoMuon|MuonServiceProxy") << "NO propagator(s) selected!";
51 
52  for(vector<string>::iterator propagatorName = propagatorNames.begin();
53  propagatorName != propagatorNames.end(); ++propagatorName)
54  thePropagators[ *propagatorName ] = ESHandle<Propagator>(0);
55 
56  theCacheId_GTG = 0;
57  theCacheId_MG = 0;
58  theCacheId_DG = 0;
59  theCacheId_P = 0;
61 
62 }
#define LogDebug(id)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
unsigned long long theCacheId_MG
unsigned long long theCacheId_P
edm::ESHandle< MagneticField > theMGField
bool theChangeInTrackingComponentsRecord
unsigned long long theCacheId_DG
const MuonNavigationSchool * theSchool
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
propagators thePropagators
const edm::EventSetup * theEventSetup
unsigned long long theCacheId_GTG
edm::ESHandle< MuonDetLayerGeometry > theDetLayerGeometry
MuonServiceProxy::~MuonServiceProxy ( )
virtual

Destructor.

Definition at line 66 of file MuonServiceProxy.cc.

66  {
67 
68  // FIXME: how do that?
69  // delete theTrackingGeometry;
70  // delete theMGField;
71  // delete theDetLayerGeometry;
72 
73  // FIXME: is it enough?
74  thePropagators.clear();
75  if(theSchool) delete theSchool;
76 }
const MuonNavigationSchool * theSchool
propagators thePropagators

Member Function Documentation

edm::ESHandle<MuonDetLayerGeometry> MuonServiceProxy::detLayerGeometry ( ) const
inline

get the detLayer geometry

Definition at line 46 of file MuonServiceProxy.h.

References theDetLayerGeometry.

Referenced by MuonSimHitProducer::produce().

46 {return theDetLayerGeometry;}
edm::ESHandle< MuonDetLayerGeometry > theDetLayerGeometry
const edm::EventSetup& MuonServiceProxy::eventSetup ( ) const
inline
bool MuonServiceProxy::isTrackingComponentsRecordChanged ( ) const
inline

check if the MuonReco Geometry has been changed

Definition at line 55 of file MuonServiceProxy.h.

References theChangeInTrackingComponentsRecord.

edm::ESHandle<MagneticField> MuonServiceProxy::magneticField ( ) const
inline
const MuonNavigationSchool* MuonServiceProxy::muonNavigationSchool ( ) const
inline

Definition at line 57 of file MuonServiceProxy.h.

References theSchool.

57  {
58  return theSchool;
59  }
const MuonNavigationSchool * theSchool
ESHandle< Propagator > MuonServiceProxy::propagator ( std::string  propagatorName) const

get the propagator

Definition at line 132 of file MuonServiceProxy.cc.

Referenced by MuonSimHitProducer::beginRun(), TSGForRoadSearch::makeSeeds_0(), TSGForRoadSearch::makeSeeds_3(), TSGForRoadSearch::makeSeeds_4(), TSGFromPropagation::outerTkState(), GlobalCosmicMuonTrajectoryBuilder::propagator(), CosmicMuonTrajectoryBuilder::propagator(), TSGFromPropagation::propagator(), FastTSGFromPropagation::propagator(), CosmicMuonSmoother::propagatorAlong(), CosmicMuonTrajectoryBuilder::propagatorAlong(), CosmicMuonSmoother::propagatorOpposite(), CosmicMuonTrajectoryBuilder::propagatorOpposite(), and TSGForRoadSearch::pushTrajectorySeed().

132  {
133 
134  propagators::const_iterator prop = thePropagators.find(propagatorName);
135 
136  if (prop == thePropagators.end()){
137  LogError("Muon|RecoMuon|MuonServiceProxy")
138  << "MuonServiceProxy: propagator with name: "<< propagatorName <<" not found! Please load it in the MuonServiceProxy.cff";
139  return ESHandle<Propagator>(0);
140  }
141 
142  return prop->second;
143 }
propagators thePropagators
edm::ESHandle<GlobalTrackingGeometry> MuonServiceProxy::trackingGeometry ( ) const
inline
void MuonServiceProxy::update ( const edm::EventSetup setup)

update the services each event

Definition at line 81 of file MuonServiceProxy.cc.

References edm::EventSetup::get(), edm::eventsetup::EventSetupRecord::get(), LogTrace, and metname.

Referenced by ResidualRefitting::analyze(), python.Vispa.Gui.VispaWidget.VispaWidget::autosize(), TSGFromL2Muon::beginRun(), FastTSGFromL2Muon::beginRun(), MuonSimHitProducer::beginRun(), python.Vispa.Views.LineDecayView.LineDecayContainer::createObject(), python.Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), python.Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), AlignmentMonitorTracksFromTrajectories::event(), CSCTimingExtractor::fillTiming(), DTTimingExtractor::fillTiming(), python.Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), python.Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), TSGFromL2Muon::produce(), GlobalCosmicMuonProducer::produce(), FastTSGFromL2Muon::produce(), GlobalTrackQualityProducer::produce(), FastL3MuonProducer::produce(), HIMuonTrackingRegionProducer::regions(), python.Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), python.Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), python.Vispa.Gui.FindDialog.FindDialog::reset(), MuonSeedCleaner::seedCleaner(), python.Vispa.Gui.PortConnection.PointToPointConnection::select(), python.Vispa.Gui.VispaWidget.VispaWidget::select(), python.Vispa.Views.LineDecayView.LineDecayContainer::select(), python.Vispa.Gui.VispaWidget.VispaWidget::setText(), python.Vispa.Gui.VispaWidget.VispaWidget::setTitle(), python.Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), python.Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and python.Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

81  {
82  const std::string metname = "Muon|RecoMuon|MuonServiceProxy";
83 
84  theEventSetup = &setup;
85 
86  // Global Tracking Geometry
87  unsigned long long newCacheId_GTG = setup.get<GlobalTrackingGeometryRecord>().cacheIdentifier();
88  if ( newCacheId_GTG != theCacheId_GTG ) {
89  LogTrace(metname) << "GlobalTrackingGeometry changed!";
90  theCacheId_GTG = newCacheId_GTG;
92  }
93 
94  // Magfield Field
95  unsigned long long newCacheId_MG = setup.get<IdealMagneticFieldRecord>().cacheIdentifier();
96  if ( newCacheId_MG != theCacheId_MG ) {
97  LogTrace(metname) << "Magnetic Field changed!";
98  theCacheId_MG = newCacheId_MG;
100  }
101 
102  // DetLayer Geometry
103  unsigned long long newCacheId_DG = setup.get<MuonRecoGeometryRecord>().cacheIdentifier();
104  if ( newCacheId_DG != theCacheId_DG ) {
105  LogTrace(metname) << "Muon Reco Geometry changed!";
106  theCacheId_DG = newCacheId_DG;
108  // MuonNavigationSchool should live until its validity expires, and then DELETE
109  // the NavigableLayers (this is implemented in MuonNavigationSchool's dtor)
110  if ( theMuonNavigationFlag ) {
111  if(theSchool) delete theSchool;
113  }
114  }
115 
116  // Propagators
117  unsigned long long newCacheId_P = setup.get<TrackingComponentsRecord>().cacheIdentifier();
118  if ( newCacheId_P != theCacheId_P ) {
119  LogTrace(metname) << "Tracking Component changed!";
121  theCacheId_P = newCacheId_P;
122  for(propagators::iterator prop = thePropagators.begin(); prop != thePropagators.end();
123  ++prop)
124  setup.get<TrackingComponentsRecord>().get( prop->first , prop->second );
125  }
126  else
128 
129 }
unsigned long long theCacheId_MG
unsigned long long theCacheId_P
const std::string metname
edm::ESHandle< MagneticField > theMGField
bool theChangeInTrackingComponentsRecord
unsigned long long theCacheId_DG
void get(HolderT &iHolder) const
const MuonNavigationSchool * theSchool
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
propagators thePropagators
#define LogTrace(id)
const edm::EventSetup * theEventSetup
const T & get() const
Definition: EventSetup.h:55
unsigned long long theCacheId_GTG
edm::ESHandle< MuonDetLayerGeometry > theDetLayerGeometry

Member Data Documentation

unsigned long long MuonServiceProxy::theCacheId_DG
private

Definition at line 78 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

unsigned long long MuonServiceProxy::theCacheId_GTG
private

Definition at line 76 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

unsigned long long MuonServiceProxy::theCacheId_MG
private

Definition at line 77 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

unsigned long long MuonServiceProxy::theCacheId_P
private

Definition at line 79 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

bool MuonServiceProxy::theChangeInTrackingComponentsRecord
private

Definition at line 81 of file MuonServiceProxy.h.

Referenced by isTrackingComponentsRecordChanged(), and MuonServiceProxy().

edm::ESHandle<MuonDetLayerGeometry> MuonServiceProxy::theDetLayerGeometry
private

Definition at line 68 of file MuonServiceProxy.h.

Referenced by detLayerGeometry().

const edm::EventSetup* MuonServiceProxy::theEventSetup
private

Definition at line 69 of file MuonServiceProxy.h.

Referenced by eventSetup().

edm::ESHandle<MagneticField> MuonServiceProxy::theMGField
private

Definition at line 67 of file MuonServiceProxy.h.

Referenced by magneticField().

bool MuonServiceProxy::theMuonNavigationFlag
private

Definition at line 70 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

propagators MuonServiceProxy::thePropagators
private

Definition at line 74 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

bool MuonServiceProxy::theRPCLayer
private

Definition at line 71 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

const MuonNavigationSchool* MuonServiceProxy::theSchool
private

Definition at line 72 of file MuonServiceProxy.h.

Referenced by muonNavigationSchool().

edm::ESHandle<GlobalTrackingGeometry> MuonServiceProxy::theTrackingGeometry
private