ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Private Member Functions | Static Private Attributes | List of all members
PerfMonServices Class Reference

#include <PerfMonServices.h>

Collaboration diagram for PerfMonServices:

Public Types

enum  CONTAINERS {
  MUON_START = 0, MUID_COLLECTION = MUON_START, STACO_COLLECTION, MUON_COLLECTION,
  MUON_END, ELEC_START = MUON_END, ELECTRON_COLLECTION = ELEC_START, ELEC_END,
  PHOT_START = ELEC_END, PHOTON_COLLECTION = PHOT_START, PHOT_END, MET_START = PHOT_END,
  MET_COLLECTION = MET_START, MET_END, TRK_START = MET_END, TRK_COLLECTION = TRK_START,
  TRK_END, VTX_START = TRK_END, VTX_COLLECTION = VTX_START, VTX_END,
  NUM_CONTAINERS = VTX_END
}
 

Public Member Functions

 PerfMonServices ()
 
 ~PerfMonServices ()
 

Static Public Member Functions

static StatusCode InitialiseServices (ISvcLocator *pxSvcLocator)
 
static StoreGateSvcgetStoreGateSvc ()
 
static IMessageSvc * getMessagingService ()
 
static INTupleSvc * getRootTupleService ()
 
static ITHistSvc * getHistogramService ()
 
static const std::string & getContainerName (CONTAINERS eContainer)
 
static const std::string & getAtlfastContainerName (CONTAINERS eContainer)
 
template<class T >
static const T * getContainer (CONTAINERS eContainer)
 
template<class T >
static T const GetMax (T a, T b)
 

Static Public Attributes

static ISvcLocator *s_pxSvcLocator ATLAS_THREAD_SAFE
 
static IMessageSvc *s_pxMessageSvc ATLAS_THREAD_SAFE
 
static StoreGateSvc *s_pxStoreGateSvc ATLAS_THREAD_SAFE
 
static INTupleSvc *s_pxNtupleSvc ATLAS_THREAD_SAFE
 
static ITHistSvc *s_pxTHistSvc ATLAS_THREAD_SAFE
 

Static Private Member Functions

static bool InitialiseMessaging ()
 
static bool InitialiseStoreGate ()
 
static bool InitialiseRootTuple ()
 
static bool InitialiseHistograms ()
 
static bool CheckServiceInit (const StatusCode &xSC, bool bNullPointer)
 

Static Private Attributes

static const std::string s_sContainerNames [NUM_CONTAINERS]
 
static const std::string s_sAtlfastContainerNames [NUM_CONTAINERS]
 

Detailed Description

Definition at line 14 of file PerfMonServices.h.

Member Enumeration Documentation

◆ CONTAINERS

Enumerator
MUON_START 
MUID_COLLECTION 
STACO_COLLECTION 
MUON_COLLECTION 
MUON_END 
ELEC_START 
ELECTRON_COLLECTION 
ELEC_END 
PHOT_START 
PHOTON_COLLECTION 
PHOT_END 
MET_START 
MET_COLLECTION 
MET_END 
TRK_START 
TRK_COLLECTION 
TRK_END 
VTX_START 
VTX_COLLECTION 
VTX_END 
NUM_CONTAINERS 

Definition at line 40 of file PerfMonServices.h.

41  {
42  MUON_START = 0,
46  MUON_END,
47 
50  ELEC_END,
51 
54  PHOT_END,
55 
58  MET_END,
59 
62  TRK_END,
63 
66  VTX_END,
67 
69  };

Constructor & Destructor Documentation

◆ PerfMonServices()

PerfMonServices::PerfMonServices ( )

Definition at line 38 of file PerfMonServices.cxx.

39 {
40 }

◆ ~PerfMonServices()

PerfMonServices::~PerfMonServices ( )

Definition at line 42 of file PerfMonServices.cxx.

43 {
44 }

Member Function Documentation

◆ CheckServiceInit()

bool PerfMonServices::CheckServiceInit ( const StatusCode &  xSC,
bool  bNullPointer 
)
staticprivate

Definition at line 103 of file PerfMonServices.cxx.

104 {
105  //MsgStream log( s_pxMessageSvc, "Services" );
106  if ( !xSC.isSuccess() )
107  {
108  //log << MSG::WARNING
109  //<< "Problem starting " << sType << " service : Error Code."
110  //<< endreq;
111  }
112  if ( bNullPointer )
113  {
114  //log << MSG::WARNING
115  //<< "Problem starting " << sType << " service : NULL pointer."
116  //<< endreq;
117  }
118  return ( xSC.isSuccess() && !bNullPointer ) ? true : false;
119 }

◆ getAtlfastContainerName()

static const std::string& PerfMonServices::getAtlfastContainerName ( CONTAINERS  eContainer)
inlinestatic

Definition at line 72 of file PerfMonServices.h.

72 { return s_sAtlfastContainerNames[eContainer]; }

◆ getContainer()

template<class T >
static const T* PerfMonServices::getContainer ( CONTAINERS  eContainer)
inlinestatic

Definition at line 75 of file PerfMonServices.h.

75  {
76  const T* pxContainer = NULL;
77  const std::string sContainerName = PerfMonServices::getContainerName( eContainer );
78  if ( s_pxStoreGateSvc != NULL ) {
79  StatusCode xStatus = PerfMonServices::s_pxStoreGateSvc->retrieve( pxContainer , sContainerName );
80  if ( CheckServiceInit( xStatus, !pxContainer) ) {
81  return pxContainer;
82  }
83  }
84  return NULL;
85  }

◆ getContainerName()

static const std::string& PerfMonServices::getContainerName ( CONTAINERS  eContainer)
inlinestatic

Definition at line 71 of file PerfMonServices.h.

71 { return s_sContainerNames[eContainer]; }

◆ getHistogramService()

static ITHistSvc* PerfMonServices::getHistogramService ( )
inlinestatic

Definition at line 38 of file PerfMonServices.h.

38 { return s_pxTHistSvc; }

◆ GetMax()

template<class T >
static T const PerfMonServices::GetMax ( a,
b 
)
inlinestatic

Definition at line 87 of file PerfMonServices.h.

87  {
88  T result;
89  result = a>b? a : b;
90  return result;
91  }

◆ getMessagingService()

static IMessageSvc* PerfMonServices::getMessagingService ( )
inlinestatic

Definition at line 36 of file PerfMonServices.h.

36 { return s_pxMessageSvc; }

◆ getRootTupleService()

static INTupleSvc* PerfMonServices::getRootTupleService ( )
inlinestatic

Definition at line 37 of file PerfMonServices.h.

37 { return s_pxNtupleSvc; }

◆ getStoreGateSvc()

static StoreGateSvc* PerfMonServices::getStoreGateSvc ( )
inlinestatic

Definition at line 35 of file PerfMonServices.h.

35 { return s_pxStoreGateSvc; }

◆ InitialiseHistograms()

bool PerfMonServices::InitialiseHistograms ( )
staticprivate

Definition at line 96 of file PerfMonServices.cxx.

97 {
98  StatusCode xStatus = s_pxSvcLocator->service( "THistSvc", s_pxTHistSvc);
99  return CheckServiceInit( xStatus, !s_pxTHistSvc /* , "Histogram" */ );
100 }

◆ InitialiseMessaging()

bool PerfMonServices::InitialiseMessaging ( )
staticprivate

Definition at line 78 of file PerfMonServices.cxx.

79 {
80  StatusCode xStatus = s_pxSvcLocator->service( "MessageSvc", s_pxMessageSvc );
81  return CheckServiceInit( xStatus, !s_pxMessageSvc /* , "messaging" */ );
82 }

◆ InitialiseRootTuple()

bool PerfMonServices::InitialiseRootTuple ( )
staticprivate

Definition at line 90 of file PerfMonServices.cxx.

91 {
92  StatusCode xStatus = s_pxSvcLocator->service( "NTupleSvc", s_pxNtupleSvc );
93  return CheckServiceInit( xStatus, !s_pxNtupleSvc /* , "NTuple" */ );
94 }

◆ InitialiseServices()

StatusCode PerfMonServices::InitialiseServices ( ISvcLocator *  pxSvcLocator)
static

Definition at line 50 of file PerfMonServices.cxx.

51 {
52  s_pxSvcLocator = pxSvcLocator;
53 
54  // Init. the Athena services that will be used in PhysAna.
55  // Init. Messaging first (the others use it for output).
56  bool bRegisterSuccess = true;
57  bRegisterSuccess &= InitialiseMessaging();
58  bRegisterSuccess &= InitialiseStoreGate();
59  bRegisterSuccess &= InitialiseRootTuple();
60  bRegisterSuccess &= InitialiseHistograms();
61 
62  //MsgStream log( s_pxMessageSvc, "Services" );
63  if ( !bRegisterSuccess )
64  {
65  //log << MSG::WARNING
66  //<< "Problem starting at least one of the Athena services : this may be cause problems downstream"
67  //<< endreq;
68  }
69 
70  return StatusCode::SUCCESS;
71 }

◆ InitialiseStoreGate()

bool PerfMonServices::InitialiseStoreGate ( )
staticprivate

Definition at line 84 of file PerfMonServices.cxx.

85 {
86  StatusCode xStatus = s_pxSvcLocator->service( "StoreGateSvc", s_pxStoreGateSvc );
87  return CheckServiceInit( xStatus, !s_pxStoreGateSvc /* , "StoreGateSvc" */ );
88 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/5]

ISvcLocator* s_pxSvcLocator PerfMonServices::ATLAS_THREAD_SAFE
static

Definition at line 23 of file PerfMonServices.h.

◆ ATLAS_THREAD_SAFE [2/5]

IMessageSvc* s_pxMessageSvc PerfMonServices::ATLAS_THREAD_SAFE
static

Definition at line 26 of file PerfMonServices.h.

◆ ATLAS_THREAD_SAFE [3/5]

StoreGateSvc* s_pxStoreGateSvc PerfMonServices::ATLAS_THREAD_SAFE
static

Definition at line 27 of file PerfMonServices.h.

◆ ATLAS_THREAD_SAFE [4/5]

INTupleSvc* s_pxNtupleSvc PerfMonServices::ATLAS_THREAD_SAFE
static

Definition at line 28 of file PerfMonServices.h.

◆ ATLAS_THREAD_SAFE [5/5]

ITHistSvc* s_pxTHistSvc PerfMonServices::ATLAS_THREAD_SAFE
static

Definition at line 29 of file PerfMonServices.h.

◆ s_sAtlfastContainerNames

const std::string PerfMonServices::s_sAtlfastContainerNames
staticprivate
Initial value:
= { "AtlfastMuonCollection",
"AtlfastMuonCollection",
"AtlfastMuons",
"AtlfastElectronCollection",
"AtlfastPhotonCollection",
"AtlfastMissingEt",
"Placeholder" }

Definition at line 116 of file PerfMonServices.h.

◆ s_sContainerNames

const std::string PerfMonServices::s_sContainerNames
staticprivate
Initial value:
= { "MuidMuonCollection",
"StacoMuonCollection",
"Muons",
"Electrons",
"PhotonCollection",
"MET_Final",
"TrackParticleCandidate",
"PrimaryVertices"}

Definition at line 115 of file PerfMonServices.h.


The documentation for this class was generated from the following files:
get_generator_info.result
result
Definition: get_generator_info.py:21
PerfMonServices::getContainerName
static const std::string & getContainerName(CONTAINERS eContainer)
Definition: PerfMonServices.h:71
PerfMonServices::InitialiseRootTuple
static bool InitialiseRootTuple()
Definition: PerfMonServices.cxx:90
PerfMonServices::MET_END
@ MET_END
Definition: PerfMonServices.h:58
PerfMonServices::VTX_START
@ VTX_START
Definition: PerfMonServices.h:64
PerfMonServices::MUID_COLLECTION
@ MUID_COLLECTION
Definition: PerfMonServices.h:43
PerfMonServices::InitialiseMessaging
static bool InitialiseMessaging()
Definition: PerfMonServices.cxx:78
PerfMonServices::NUM_CONTAINERS
@ NUM_CONTAINERS
Definition: PerfMonServices.h:68
PerfMonServices::TRK_START
@ TRK_START
Definition: PerfMonServices.h:60
PerfMonServices::MET_COLLECTION
@ MET_COLLECTION
Definition: PerfMonServices.h:57
PerfMonServices::s_sAtlfastContainerNames
static const std::string s_sAtlfastContainerNames[NUM_CONTAINERS]
Definition: PerfMonServices.h:116
PerfMonServices::TRK_END
@ TRK_END
Definition: PerfMonServices.h:62
PerfMonServices::ELECTRON_COLLECTION
@ ELECTRON_COLLECTION
Definition: PerfMonServices.h:49
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PerfMonServices::CheckServiceInit
static bool CheckServiceInit(const StatusCode &xSC, bool bNullPointer)
Definition: PerfMonServices.cxx:103
PerfMonServices::PHOT_END
@ PHOT_END
Definition: PerfMonServices.h:54
PerfMonServices::VTX_COLLECTION
@ VTX_COLLECTION
Definition: PerfMonServices.h:65
PerfMonServices::TRK_COLLECTION
@ TRK_COLLECTION
Definition: PerfMonServices.h:61
PerfMonServices::InitialiseHistograms
static bool InitialiseHistograms()
Definition: PerfMonServices.cxx:96
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
PerfMonServices::ELEC_END
@ ELEC_END
Definition: PerfMonServices.h:50
PerfMonServices::MUON_END
@ MUON_END
Definition: PerfMonServices.h:46
PerfMonServices::s_sContainerNames
static const std::string s_sContainerNames[NUM_CONTAINERS]
Definition: PerfMonServices.h:115
a
TList * a
Definition: liststreamerinfos.cxx:10
PerfMonServices::VTX_END
@ VTX_END
Definition: PerfMonServices.h:66
PerfMonServices::PHOT_START
@ PHOT_START
Definition: PerfMonServices.h:52
PerfMonServices::ELEC_START
@ ELEC_START
Definition: PerfMonServices.h:48
PerfMonServices::MET_START
@ MET_START
Definition: PerfMonServices.h:56
PerfMonServices::MUON_START
@ MUON_START
Definition: PerfMonServices.h:42
PerfMonServices::PHOTON_COLLECTION
@ PHOTON_COLLECTION
Definition: PerfMonServices.h:53
PerfMonServices::STACO_COLLECTION
@ STACO_COLLECTION
Definition: PerfMonServices.h:44
PerfMonServices::MUON_COLLECTION
@ MUON_COLLECTION
Definition: PerfMonServices.h:45
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
PerfMonServices::InitialiseStoreGate
static bool InitialiseStoreGate()
Definition: PerfMonServices.cxx:84