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.

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 24 of file MuonServiceProxy.h.

Member Typedef Documentation

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

Definition at line 62 of file MuonServiceProxy.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 35 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.

36 
37  // load the propagators map
38  vector<string> noPropagators;
39  vector<string> propagatorNames;
40 
41  theMuonNavigationFlag = par.getUntrackedParameter<bool>("UseMuonNavigation",true);
42  if(theMuonNavigationFlag) theRPCLayer = par.getParameter<bool>("RPCLayers");
43  else theRPCLayer = true;
44 
45  propagatorNames = par.getUntrackedParameter<vector<string> >("Propagators", noPropagators);
46 
47  if(propagatorNames.empty())
48  LogDebug("Muon|RecoMuon|MuonServiceProxy") << "NO propagator(s) selected!";
49 
50  for(vector<string>::iterator propagatorName = propagatorNames.begin();
51  propagatorName != propagatorNames.end(); ++propagatorName)
52  thePropagators[ *propagatorName ] = ESHandle<Propagator>(0);
53 
54  theCacheId_GTG = 0;
55  theCacheId_MG = 0;
56  theCacheId_DG = 0;
57  theCacheId_P = 0;
59 
60 }
#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 64 of file MuonServiceProxy.cc.

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

Member Function Documentation

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

get the detLayer geometry

Definition at line 44 of file MuonServiceProxy.h.

References theDetLayerGeometry.

Referenced by MuonSimHitProducer::produce().

44 {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 53 of file MuonServiceProxy.h.

References theChangeInTrackingComponentsRecord.

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

Definition at line 55 of file MuonServiceProxy.h.

References theSchool.

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

get the propagator

Definition at line 130 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().

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

update the services each event

Definition at line 79 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(), FastTSGFromL2Muon::beginRun(), TSGFromL2Muon::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(), GlobalCosmicMuonProducer::produce(), FastTSGFromL2Muon::produce(), GlobalTrackQualityProducer::produce(), TSGFromL2Muon::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().

79  {
80  const std::string metname = "Muon|RecoMuon|MuonServiceProxy";
81 
83 
84  // Global Tracking Geometry
85  unsigned long long newCacheId_GTG = setup.get<GlobalTrackingGeometryRecord>().cacheIdentifier();
86  if ( newCacheId_GTG != theCacheId_GTG ) {
87  LogTrace(metname) << "GlobalTrackingGeometry changed!";
88  theCacheId_GTG = newCacheId_GTG;
90  }
91 
92  // Magfield Field
93  unsigned long long newCacheId_MG = setup.get<IdealMagneticFieldRecord>().cacheIdentifier();
94  if ( newCacheId_MG != theCacheId_MG ) {
95  LogTrace(metname) << "Magnetic Field changed!";
96  theCacheId_MG = newCacheId_MG;
98  }
99 
100  // DetLayer Geometry
101  unsigned long long newCacheId_DG = setup.get<MuonRecoGeometryRecord>().cacheIdentifier();
102  if ( newCacheId_DG != theCacheId_DG ) {
103  LogTrace(metname) << "Muon Reco Geometry changed!";
104  theCacheId_DG = newCacheId_DG;
106  // MuonNavigationSchool should live until its validity expires, and then DELETE
107  // the NavigableLayers (this is implemented in MuonNavigationSchool's dtor)
108  if ( theMuonNavigationFlag ) {
109  if(theSchool) delete theSchool;
111  }
112  }
113 
114  // Propagators
115  unsigned long long newCacheId_P = setup.get<TrackingComponentsRecord>().cacheIdentifier();
116  if ( newCacheId_P != theCacheId_P ) {
117  LogTrace(metname) << "Tracking Component changed!";
119  theCacheId_P = newCacheId_P;
120  for(propagators::iterator prop = thePropagators.begin(); prop != thePropagators.end();
121  ++prop)
122  setup.get<TrackingComponentsRecord>().get( prop->first , prop->second );
123  }
124  else
126 
127 }
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 76 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

unsigned long long MuonServiceProxy::theCacheId_GTG
private

Definition at line 74 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

unsigned long long MuonServiceProxy::theCacheId_MG
private

Definition at line 75 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

unsigned long long MuonServiceProxy::theCacheId_P
private

Definition at line 77 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

bool MuonServiceProxy::theChangeInTrackingComponentsRecord
private

Definition at line 79 of file MuonServiceProxy.h.

Referenced by isTrackingComponentsRecordChanged(), and MuonServiceProxy().

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

Definition at line 66 of file MuonServiceProxy.h.

Referenced by detLayerGeometry().

const edm::EventSetup* MuonServiceProxy::theEventSetup
private

Definition at line 67 of file MuonServiceProxy.h.

Referenced by eventSetup().

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

Definition at line 65 of file MuonServiceProxy.h.

Referenced by magneticField().

bool MuonServiceProxy::theMuonNavigationFlag
private

Definition at line 68 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

propagators MuonServiceProxy::thePropagators
private

Definition at line 72 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

bool MuonServiceProxy::theRPCLayer
private

Definition at line 69 of file MuonServiceProxy.h.

Referenced by MuonServiceProxy().

const MuonNavigationSchool* MuonServiceProxy::theSchool
private

Definition at line 70 of file MuonServiceProxy.h.

Referenced by muonNavigationSchool().

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