ATLAS Offline Software
PerfMonServices.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef IDPERFMON_SERVICES_H
6 #define IDPERFMON_SERVICES_H
7 
8 #include "GaudiKernel/INTupleSvc.h"
9 #include "GaudiKernel/ITHistSvc.h"
10 #include "GaudiKernel/Algorithm.h"
11 
12 #include "StoreGate/StoreGateSvc.h"
13 
15 {
16  public:
17  // Constructors and Destructors.
20 
22  {
28 
32 
36 
40 
44 
48 
50  };
51 
52  static const std::string& getContainerName( CONTAINERS eContainer ) { return s_sContainerNames[eContainer]; }
53  static const std::string& getAtlfastContainerName( CONTAINERS eContainer ) { return s_sAtlfastContainerNames[eContainer]; }
54 
55  template <class T> static const T* getContainer ( CONTAINERS eContainer ) {
56  const T* pxContainer = nullptr;
57  const std::string& sContainerName = PerfMonServices::getContainerName( eContainer );
58  SmartIF<StoreGateSvc> storeGate{Gaudi::svcLocator()->service("StoreGateSvc")};
59  if ( storeGate ) {
60  storeGate->retrieve( pxContainer , sContainerName ).ignore();
61  }
62  return pxContainer;
63  }
64 
65  template <class T> T static const GetMax (T a, T b) {
66  T result;
67  result = a>b? a : b;
68  return result;
69  }
70 
71  protected:
72 
73  private:
74  // Names of the various object containers.
75  static const std::string s_sContainerNames[NUM_CONTAINERS];
76  static const std::string s_sAtlfastContainerNames[NUM_CONTAINERS];
77 };
78 
79 #endif
PerfMonServices::PerfMonServices
PerfMonServices()
Definition: PerfMonServices.cxx:29
get_generator_info.result
result
Definition: get_generator_info.py:21
PerfMonServices::getContainerName
static const std::string & getContainerName(CONTAINERS eContainer)
Definition: PerfMonServices.h:52
PerfMonServices::GetMax
static T const GetMax(T a, T b)
Definition: PerfMonServices.h:65
PerfMonServices::MET_END
@ MET_END
Definition: PerfMonServices.h:39
PerfMonServices::VTX_START
@ VTX_START
Definition: PerfMonServices.h:45
PerfMonServices::MUID_COLLECTION
@ MUID_COLLECTION
Definition: PerfMonServices.h:24
PerfMonServices::NUM_CONTAINERS
@ NUM_CONTAINERS
Definition: PerfMonServices.h:49
PerfMonServices::TRK_START
@ TRK_START
Definition: PerfMonServices.h:41
PerfMonServices::MET_COLLECTION
@ MET_COLLECTION
Definition: PerfMonServices.h:38
PerfMonServices::~PerfMonServices
~PerfMonServices()
Definition: PerfMonServices.cxx:33
PerfMonServices::s_sAtlfastContainerNames
static const std::string s_sAtlfastContainerNames[NUM_CONTAINERS]
Definition: PerfMonServices.h:76
PerfMonServices::TRK_END
@ TRK_END
Definition: PerfMonServices.h:43
PerfMonServices::ELECTRON_COLLECTION
@ ELECTRON_COLLECTION
Definition: PerfMonServices.h:30
PerfMonServices::getAtlfastContainerName
static const std::string & getAtlfastContainerName(CONTAINERS eContainer)
Definition: PerfMonServices.h:53
PerfMonServices::CONTAINERS
CONTAINERS
Definition: PerfMonServices.h:22
PerfMonServices::PHOT_END
@ PHOT_END
Definition: PerfMonServices.h:35
PerfMonServices::VTX_COLLECTION
@ VTX_COLLECTION
Definition: PerfMonServices.h:46
PerfMonServices::TRK_COLLECTION
@ TRK_COLLECTION
Definition: PerfMonServices.h:42
PerfMonServices
Definition: PerfMonServices.h:15
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
PerfMonServices::ELEC_END
@ ELEC_END
Definition: PerfMonServices.h:31
PerfMonServices::MUON_END
@ MUON_END
Definition: PerfMonServices.h:27
PerfMonServices::s_sContainerNames
static const std::string s_sContainerNames[NUM_CONTAINERS]
Definition: PerfMonServices.h:75
a
TList * a
Definition: liststreamerinfos.cxx:10
PerfMonServices::VTX_END
@ VTX_END
Definition: PerfMonServices.h:47
PerfMonServices::PHOT_START
@ PHOT_START
Definition: PerfMonServices.h:33
PerfMonServices::ELEC_START
@ ELEC_START
Definition: PerfMonServices.h:29
PerfMonServices::MET_START
@ MET_START
Definition: PerfMonServices.h:37
PerfMonServices::MUON_START
@ MUON_START
Definition: PerfMonServices.h:23
PerfMonServices::PHOTON_COLLECTION
@ PHOTON_COLLECTION
Definition: PerfMonServices.h:34
PerfMonServices::STACO_COLLECTION
@ STACO_COLLECTION
Definition: PerfMonServices.h:25
StoreGateSvc.h
PerfMonServices::MUON_COLLECTION
@ MUON_COLLECTION
Definition: PerfMonServices.h:26
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
python.PyKernel.storeGate
storeGate
Definition: PyKernel.py:40
PerfMonServices::getContainer
static const T * getContainer(CONTAINERS eContainer)
Definition: PerfMonServices.h:55