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:
2008/02/13 13:53:54
Revision:
1.10
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/10/14 10:34:51
Revision:
1.19
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, metname, HcalObjRepresent::setup(), and AlCaHLTBitMon_QueryRunRegistry::string.

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

81  {
82  const std::string metname = "Muon|RecoMuon|MuonServiceProxy";
83 
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
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")

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