|
ATLAS Offline Software
|
#include <TrigOpMonitor.h>
|
ServiceHandle< IIncidentSvc > | m_incidentSvc { this, "IncidentSvc", "IncidentSvc", "Incident service"} |
|
ServiceHandle< ITHistSvc > | m_histSvc {this, "THistSvc", "THistSvc"} |
|
SmartIF< IIOVDbSvc > | m_IOVDbSvc |
|
TH2I * | m_magFieldHist {nullptr} |
|
TH2I * | m_iovChangeHist {nullptr} |
|
TH1I * | m_releaseHist {nullptr} |
|
TH2I * | m_mtConfigHist {nullptr} |
|
TH1I * | m_workersHist {nullptr} |
|
TH2I * | m_subdetHist {nullptr} |
|
TProfile * | m_lumiHist {nullptr} |
|
TProfile * | m_muHist {nullptr} |
|
EventIDBase::number_type | m_previousLB {0} |
| LB of previous event. More...
|
|
std::unordered_map< std::string, IOVRange > | m_currentIOVs |
| current IOVs managed by IOVDbSvc More...
|
|
std::unordered_map< std::string, FolderHist > | m_folderHist |
| histograms for COOL folders More...
|
|
std::string | m_histPath |
| histogram booking path More...
|
|
SG::ReadCondHandleKey< LuminosityCondData > | m_lumiDataKey {this, "LuminosityCondDataKey", ""} |
|
SG::ReadCondHandleKey< AtlasFieldMapCondObj > | m_fieldMapKey {this, "AtlasFieldMapCondDataKey", ""} |
|
Gaudi::Property< std::string > | m_releaseData |
|
Gaudi::Property< bool > | m_detailedHists |
|
Gaudi::Property< unsigned short int > | m_maxLB |
|
Definition at line 37 of file TrigOpMonitor.h.
◆ TrigOpMonitor()
TrigOpMonitor::TrigOpMonitor |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ bookHists()
StatusCode TrigOpMonitor::bookHists |
( |
| ) |
|
|
private |
Definition at line 115 of file TrigOpMonitor.cxx.
121 m_iovChangeHist =
new TH2I(
"CoolFolderUpdate_LB",
"COOL folder updates;Lumiblock;", 1, 0, 1, 1, 0, 1);
124 m_magFieldHist =
new TH2I(
"MagneticFieldSettings",
"Magnetic field settings", 2, 0, 2, 2, 0, 2);
130 m_releaseHist =
new TH1I(
"GeneralOpInfo",
"General operational info;;Applications", 1, 0, 1);
132 m_mtConfigHist =
new TH2I(
"MTConfig",
"Multi-threading configuration", 2, 0, 2, 10, 0, 10);
137 m_workersHist =
new TH1I(
"MPWorkers",
"Worker IDs;Worker ID;Number of workers", 10, 0, 10);
140 m_subdetHist =
new TH2I(
"Subdetectors",
"State of subdetectors", 1, 0, 1, 3, 0, 3);
146 m_lumiHist =
new TProfile(
"Luminosity",
"Luminosity;Lumiblock;Luminosity [10^{33} cm^{-2}s^{-1}]",
156 for (TH1*
h :
hist) {
160 return StatusCode::SUCCESS;
◆ cardinality()
virtual unsigned int TrigOpMonitor::cardinality |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ execute()
StatusCode TrigOpMonitor::execute |
( |
| ) |
|
|
overridevirtual |
Definition at line 92 of file TrigOpMonitor.cxx.
95 [[maybe_unused]]
const static bool once = [&]() {
101 const EventContext& ctx = getContext();
112 return StatusCode::SUCCESS;
◆ fillIOVDbChangeHist()
void TrigOpMonitor::fillIOVDbChangeHist |
( |
const EventContext & |
ctx | ) |
|
|
private |
Definition at line 254 of file TrigOpMonitor.cxx.
256 std::vector<std::string>
keys;
261 for (
const std::string&
k :
keys) {
264 if (not
info.retrieved)
continue;
273 if (
info.range != curIOV->second) {
274 ATH_MSG_INFO(
"IOV of " <<
k <<
" changed from " << curIOV->second <<
" to " <<
info.range
275 <<
" on event: " << ctx.eventID());
290 std::string
name(folder2HistName(
info.folderName));
293 fh->second.h_time =
new TH1F((
name +
"_ReadTime").c_str(),
294 (
"Update time for " +
info.folderName +
";Time [ms];Entries").c_str(),
297 fh->second.h_bytes =
new TH1F(
298 (
name +
"_BytesRead").c_str(),
299 (
"Bytes read for " +
info.folderName +
";Data [bytes];Entries").c_str(), 100, 0, 1000);
301 for (TH1*
h : {
fh->second.h_time,
fh->second.h_bytes}) {
308 fh->second.total_time +=
info.readTime * 1000;
311 fh->second.total_bytes +=
info.bytesRead;
◆ fillIOVDbHist()
void TrigOpMonitor::fillIOVDbHist |
( |
| ) |
|
|
private |
Definition at line 174 of file TrigOpMonitor.cxx.
177 std::vector<std::string> keyList;
181 TH2I* IOVDbRunHist =
new TH2I(
"IOVDbRunRange",
"IOVDb Run Range", 1, 0, 1, 1, 0, 1);
182 TH2I* IOVDbTimeHist =
new TH2I(
"IOVDbTimeRange",
"IOVDb Time Range", 1, 0, 1, 1, 0, 1);
183 TProfile* IOVDbBytesReadHist =
new TProfile(
"IOVDbBytesRead",
"Folder data read", 1, 0, 1);
184 IOVDbBytesReadHist->SetYTitle(
"Data read [bytes]");
185 TProfile* IOVDbReadTimeHist =
new TProfile(
"IOVDbReadTime",
"Folder update time", 1, 0, 1);
186 IOVDbReadTimeHist->SetYTitle(
"Update time [ms]");
190 for (
const std::string&
key : keyList) {
200 if (
start.isRunEvent()) {
205 if (
start.isTimestamp()) {
210 if (
stop.isRunEvent()) {
212 IOVDbRunHist->Fill(
"infinity",
info.folderName.c_str(), 1.0);
220 if (
stop.isTimestamp()) {
222 IOVDbTimeHist->Fill(
"infinity",
info.folderName.c_str(), 1.0);
230 IOVDbBytesReadHist->Fill(
info.folderName.c_str(),
info.bytesRead, 1.0);
231 IOVDbReadTimeHist->Fill(
info.folderName.c_str(),
info.readTime * 1000, 1.0);
236 IOVDbRunHist->LabelsDeflate(
"X");
237 IOVDbRunHist->LabelsDeflate(
"Y");
238 IOVDbRunHist->GetYaxis()->LabelsOption(
"a");
240 IOVDbTimeHist->LabelsDeflate(
"X");
241 IOVDbTimeHist->LabelsDeflate(
"Y");
242 IOVDbTimeHist->GetYaxis()->LabelsOption(
"a");
244 IOVDbBytesReadHist->LabelsDeflate(
"X");
245 IOVDbReadTimeHist->LabelsDeflate(
"X");
248 TH1*
hist[] = {IOVDbRunHist, IOVDbTimeHist, IOVDbBytesReadHist, IOVDbReadTimeHist};
249 for (TH1*
h :
hist) {
◆ fillLumiHist()
void TrigOpMonitor::fillLumiHist |
( |
const EventContext & |
ctx | ) |
|
|
private |
Definition at line 319 of file TrigOpMonitor.cxx.
323 m_lumiHist->Fill(ctx.eventID().lumi_block(), lumiData->lbAverageLuminosity());
324 m_muHist->Fill(ctx.eventID().lumi_block(), lumiData->lbAverageInteractionsPerCrossing());
◆ fillMagFieldHist()
void TrigOpMonitor::fillMagFieldHist |
( |
| ) |
|
|
private |
◆ fillProcThreadHist()
void TrigOpMonitor::fillProcThreadHist |
( |
int |
workerID | ) |
|
|
private |
Definition at line 366 of file TrigOpMonitor.cxx.
370 auto getIntProp = [
this](std::string_view
name,
const std::string& prop) -> std::optional<int> {
371 IProperty*
svc = serviceLocator()->service(
name).as<IProperty>();
372 if (
svc ==
nullptr)
return std::nullopt;
374 return std::stoi(
svc->getProperty(prop).toString());
381 const std::optional<int>
numThreads = getIntProp(
"AvalancheSchedulerSvc",
"ThreadPoolSize");
386 ATH_MSG_WARNING(
"Could not retrieve the number of threads to fill the monitoring histogram");
389 const std::optional<int> numSlots = getIntProp(
"EventDataSvc",
"NSlots");
390 if (numSlots.has_value()) {
394 ATH_MSG_WARNING(
"Could not retrieve the number of slots to fill the monitoring histogram");
◆ fillReleaseDataHist()
void TrigOpMonitor::fillReleaseDataHist |
( |
| ) |
|
|
private |
Definition at line 328 of file TrigOpMonitor.cxx.
330 const char* ld_lib_path =
getenv(
"LD_LIBRARY_PATH");
331 if (ld_lib_path ==
nullptr) {
332 ATH_MSG_WARNING(
"LD_LIBRARY_PATH is not defined. Will not fill release histogram.");
337 std::list<DirSearchPath::path>
file_list = DirSearchPath(ld_lib_path,
":").find_all(
m_releaseData.value());
341 <<
" in LD_LIBRARY_PATH");
348 std::map<std::string, std::string>
result;
349 if (readReleaseData(
f.string(),
result).isFailure()) {
◆ fillSubDetHist()
void TrigOpMonitor::fillSubDetHist |
( |
| ) |
|
|
private |
Definition at line 398 of file TrigOpMonitor.cxx.
402 auto jobOptionsSvc = service<Gaudi::Interfaces::IOptionsSvc>(
"JobOptionsSvc",
false);
403 if (!jobOptionsSvc.isValid()) {
404 ATH_MSG_WARNING(
"Could not retrieve JobOptionsSvc, will not fill SubDetectors histogram");
408 Gaudi::Property<std::vector<uint32_t>> enabledROBsProp(
"EnabledROBs",{});
409 std::set<uint32_t> enabledROBs;
410 if (enabledROBsProp.fromString(jobOptionsSvc->get(
"DataFlowConfig.DF_Enabled_ROB_IDs",
"[]")).isSuccess()) {
411 enabledROBs.insert(enabledROBsProp.value().begin(), enabledROBsProp.value().end());
413 <<
" ROBs from DataFlowConfig.DF_Enabled_ROB_IDs");
416 ATH_MSG_ERROR(
"Could not parse DataFlowConfig.DF_Enabled_ROB_IDs from JobOptionsSvc");
420 SmartIF<StoreGateSvc> inputMetaDataStore = service<StoreGateSvc>(
"InputMetaDataStore",
false);
421 if (!inputMetaDataStore.isValid()) {
422 ATH_MSG_WARNING(
"Could not retrieve InputMetaDataStore, will not fill SubDetectors histogram");
426 if (inputMetaDataStore->retrieve(metadatacont,
"ByteStreamMetadata").isFailure()) {
427 ATH_MSG_WARNING(
"Could not retrieve ByteStreamMetadata, will not fill SubDetectors histogram");
436 std::vector<eformat::SubDetector> subDetOn;
437 std::vector<eformat::SubDetector> subDetOff;
438 std::vector<eformat::SubDetector> subDetAll;
439 eformat::helper::DetectorMask(detMaskLeast, detMaskMost).sub_detectors(subDetOn);
440 eformat::helper::DetectorMask(~detMaskLeast, ~detMaskMost).sub_detectors(subDetOff);
441 eformat::helper::DetectorMask(~std::bitset<128>()).sub_detectors(subDetAll);
444 for (
const eformat::SubDetector
sd : subDetAll) {
445 m_subdetHist->GetXaxis()->FindBin(eformat::helper::SubDetectorDictionary.
string(
sd).
data());
450 for (
const eformat::SubDetector
sd : subDetOn) {
451 m_subdetHist->Fill(eformat::helper::SubDetectorDictionary.
string(
sd).
data(),
"on", 1.0);
455 for (
const eformat::SubDetector
sd : subDetOff) {
456 m_subdetHist->Fill(eformat::helper::SubDetectorDictionary.
string(
sd).
data(),
"off", 1.0);
460 for (
const uint32_t robid : enabledROBs) {
461 const std::string sdname = eformat::helper::SourceIdentifier(robid).human_detector();
◆ handle()
void TrigOpMonitor::handle |
( |
const Incident & |
incident | ) |
|
|
overridevirtual |
◆ initialize()
StatusCode TrigOpMonitor::initialize |
( |
| ) |
|
|
overridevirtual |
◆ start()
StatusCode TrigOpMonitor::start |
( |
| ) |
|
|
overridevirtual |
◆ m_currentIOVs
std::unordered_map<std::string, IOVRange> TrigOpMonitor::m_currentIOVs |
|
private |
◆ m_detailedHists
Gaudi::Property<bool> TrigOpMonitor::m_detailedHists |
|
private |
Initial value:{this, "DetailedFolderHists", true,
"Detailed histograms for COOL folder updates during run"}
Definition at line 97 of file TrigOpMonitor.h.
◆ m_fieldMapKey
◆ m_folderHist
std::unordered_map<std::string, FolderHist> TrigOpMonitor::m_folderHist |
|
private |
◆ m_histPath
std::string TrigOpMonitor::m_histPath |
|
private |
◆ m_histSvc
ServiceHandle<ITHistSvc> TrigOpMonitor::m_histSvc {this, "THistSvc", "THistSvc"} |
|
private |
◆ m_incidentSvc
ServiceHandle<IIncidentSvc> TrigOpMonitor::m_incidentSvc { this, "IncidentSvc", "IncidentSvc", "Incident service"} |
|
private |
◆ m_iovChangeHist
TH2I* TrigOpMonitor::m_iovChangeHist {nullptr} |
|
private |
◆ m_IOVDbSvc
◆ m_lumiDataKey
◆ m_lumiHist
TProfile* TrigOpMonitor::m_lumiHist {nullptr} |
|
private |
◆ m_magFieldHist
TH2I* TrigOpMonitor::m_magFieldHist {nullptr} |
|
private |
◆ m_maxLB
Gaudi::Property<unsigned short int> TrigOpMonitor::m_maxLB |
|
private |
Initial value:{this, "MaxLumiblocks", 3000,
"Number of lumiblocks for histograms"}
Definition at line 100 of file TrigOpMonitor.h.
◆ m_mtConfigHist
TH2I* TrigOpMonitor::m_mtConfigHist {nullptr} |
|
private |
◆ m_muHist
TProfile* TrigOpMonitor::m_muHist {nullptr} |
|
private |
◆ m_previousLB
EventIDBase::number_type TrigOpMonitor::m_previousLB {0} |
|
private |
◆ m_releaseData
Gaudi::Property<std::string> TrigOpMonitor::m_releaseData |
|
private |
Initial value:{
this, "ReleaseDataFile", "../ReleaseData",
"Path to ReleaseData file (relative to LD_LIBRARY_PATH entries"}
Definition at line 93 of file TrigOpMonitor.h.
◆ m_releaseHist
TH1I* TrigOpMonitor::m_releaseHist {nullptr} |
|
private |
◆ m_subdetHist
TH2I* TrigOpMonitor::m_subdetHist {nullptr} |
|
private |
◆ m_workersHist
TH1I* TrigOpMonitor::m_workersHist {nullptr} |
|
private |
The documentation for this class was generated from the following files:
Gaudi::Property< std::string > m_releaseData
char data[hepevt_bytes_allocation_ATLAS]
static constexpr uint32_t MAXRUN
ServiceHandle< ITHistSvc > m_histSvc
bool solenoidOn() const
status of the magnets
bool empty() const
Test if the key is blank.
int workerID() const
assigned worker ID from processing unit
void fillIOVDbChangeHist(const EventContext &ctx)
Scoped lock to be used for threaded histogram operations.
SG::ReadCondHandleKey< LuminosityCondData > m_lumiDataKey
Basic time unit for IOVSvc. Hold time as a combination of run and event numbers.
virtual StatusCode start() override
std::string m_histPath
histogram booking path
def TProfile(*args, **kwargs)
static constexpr uint64_t MAXTIMESTAMP
EventIDBase::number_type m_previousLB
LB of previous event.
AthROOTErrorHandlerSvc * svc
Gaudi::Property< unsigned short int > m_maxLB
SmartIF< IIOVDbSvc > m_IOVDbSvc
std::string to_string(const DetectorType &type)
std::unordered_map< std::string, IOVRange > m_currentIOVs
current IOVs managed by IOVDbSvc
SG::ReadCondHandleKey< AtlasFieldMapCondObj > m_fieldMapKey
StatusCode initialize(bool used=true)
std::unordered_map< std::string, FolderHist > m_folderHist
histograms for COOL folders
static const std::string & type()
Incident type.
void fillProcThreadHist(int workerID)
std::string getenv(const std::string &variableName)
get an environment variable
#define ATH_MSG_WARNING(x)
ServiceHandle< IIncidentSvc > m_incidentSvc
Gaudi::Property< bool > m_detailedHists
Filled by IIOVDbSvc::getKeyInfo.
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
void fillLumiHist(const EventContext &ctx)
void fillReleaseDataHist()