ATLAS Offline Software
Loading...
Searching...
No Matches
ManagedMonitorToolBase::OfflineStream Class Reference

#include <ManagedMonitorToolBase.h>

Inheritance diagram for ManagedMonitorToolBase::OfflineStream:
Collaboration diagram for ManagedMonitorToolBase::OfflineStream:

Public Member Functions

 OfflineStream (const std::string &fileKey, AthenaMonManager::DataType_t, AthenaMonManager::Environment_t)
virtual ~OfflineStream ()
virtual std::string getStreamName (const ManagedMonitorToolBase *tool, const MonGroup &group, const std::string &objName, bool usePreviousInterval=false)
 A function that converts a MonGroup of logical parameters into a physical output stream name.
virtual std::string getDirectoryName (const ManagedMonitorToolBase *tool, const MonGroup &group, const std::string &objName, const bool usePreviousInterval)
 A function that returns TDirectory path in a file that corresponds to a given MonGroup and object name.
void updateRunLB ()

Static Public Member Functions

static void parseString (const std::string &streamName, std::string &root, std::string &rem)
 A helper non-virtual function, parses id string.

Private Member Functions

 OfflineStream ()
void getLBrange (int *, int *, int, int)

Private Attributes

const std::string m_fileKey
uint32_t m_prev_run_number
uint32_t m_prev_lumi_block
std::set< std::string > m_ebNames

Detailed Description

Definition at line 753 of file ManagedMonitorToolBase.h.

Constructor & Destructor Documentation

◆ OfflineStream() [1/2]

ManagedMonitorToolBase::OfflineStream::OfflineStream ( const std::string & fileKey,
AthenaMonManager::DataType_t ,
AthenaMonManager::Environment_t  )
inline

◆ ~OfflineStream()

virtual ManagedMonitorToolBase::OfflineStream::~OfflineStream ( )
inlinevirtual

Definition at line 761 of file ManagedMonitorToolBase.h.

761{ }

◆ OfflineStream() [2/2]

ManagedMonitorToolBase::OfflineStream::OfflineStream ( )
inlineprivate

Definition at line 767 of file ManagedMonitorToolBase.h.

767{ }

Member Function Documentation

◆ getDirectoryName()

std::string ManagedMonitorToolBase::OfflineStream::getDirectoryName ( const ManagedMonitorToolBase * tool,
const MonGroup & group,
const std::string & objName,
const bool usePreviousInterval )
virtual

A function that returns TDirectory path in a file that corresponds to a given MonGroup and object name.

Implements ManagedMonitorToolBase::StreamNameFcn.

Definition at line 2073 of file ManagedMonitorToolBase.cxx.

2075{
2076 std::string streamName = getStreamName(tool, group, objName, usePreviousInterval);
2077 std::string root, rem;
2078 parseString(streamName, root, rem);
2079 // Remove object name at the end
2080 // to obtain directory path
2081 rem.erase(rem.rfind('/'), rem.length());
2082 return rem;
2083}
virtual std::string getStreamName(const ManagedMonitorToolBase *tool, const MonGroup &group, const std::string &objName, bool usePreviousInterval=false)
A function that converts a MonGroup of logical parameters into a physical output stream name.
static void parseString(const std::string &streamName, std::string &root, std::string &rem)
A helper non-virtual function, parses id string.

◆ getLBrange()

void ManagedMonitorToolBase::OfflineStream::getLBrange ( int * start,
int * end,
int LB,
int length )
private

◆ getStreamName()

std::string ManagedMonitorToolBase::OfflineStream::getStreamName ( const ManagedMonitorToolBase * tool,
const MonGroup & group,
const std::string & objName,
bool usePreviousInterval = false )
virtual

A function that converts a MonGroup of logical parameters into a physical output stream name.

Implements ManagedMonitorToolBase::StreamNameFcn.

Definition at line 1985 of file ManagedMonitorToolBase.cxx.

1987{
1988 std::ostringstream streamName;
1989
1990 //bool isTemp = ( group.level() == ManagedMonitorToolBase::transient );
1991 bool isTemp = false;
1992
1993 bool useRunFolders = group.interval() != all;
1994
1995 bool useLBFolders = ( useRunFolders )
1996 && ( group.interval() == ManagedMonitorToolBase::lumiBlock );
1997
1998 bool useLowStatInterval = ( useRunFolders )
1999 && ( group.interval() == ManagedMonitorToolBase::lowStat );
2000
2001 bool useMedStatInterval = ( useRunFolders )
2002 && ( group.interval() == ManagedMonitorToolBase::medStat );
2003
2004 bool useHigStatInterval = ( useRunFolders )
2005 && ( group.interval() == ManagedMonitorToolBase::higStat );
2006
2007 bool useEBFolders = ( group.interval() == ManagedMonitorToolBase::eventsBlock );
2008
2009 if( !isTemp ) {
2010 streamName << "/" << m_fileKey << "/";
2011 }
2012
2013 if( useRunFolders ) {
2014 if (usePreviousInterval && (group.interval() == ManagedMonitorToolBase::run) )
2015 streamName << "run_" << m_prev_run_number << "/";
2016 else
2017 streamName << "run_" << AthenaMonManager::runNumber() << "/";
2018 }
2019
2020 int currentLB = AthenaMonManager::lumiBlockNumber();
2021 if( useLBFolders ) {
2022 if (usePreviousInterval && (group.interval() == ManagedMonitorToolBase::lumiBlock) )
2023 streamName << "lb_" << m_prev_lumi_block << "/";
2024 else
2025 streamName << "lb_" << currentLB << "/";
2026 }
2027 else if( useLowStatInterval ) {
2028 int start, end;
2029 if (usePreviousInterval && (group.interval() == ManagedMonitorToolBase::lowStat) )
2031 else
2032 getLBrange(&start, &end, currentLB, AthenaMonManager::getLBsLowStat());
2033 streamName << "lowStat_LB" << start << "-" << end << "/";
2034 }
2035 else if( useMedStatInterval ) {
2036 int start, end;
2037 getLBrange(&start, &end, currentLB, AthenaMonManager::getLBsMedStat());
2038 streamName << "medStat_LB" << start << "-" << end << "/";
2039 }
2040 else if( useHigStatInterval ) {
2041 int start, end;
2042 getLBrange(&start, &end, currentLB, AthenaMonManager::getLBsHigStat());
2043 streamName << "higStat_LB" << start << "-" << end << "/";
2044 }
2045 else if( useEBFolders ) {
2046 // The number of events in an EventsBlock can vary for each ManagedMonitorToolBase object,
2047 // so there is no global way to determine when an EventsBlock has rolled over.
2048
2049 // determine an eventsBlock number
2050 long eventsBlockNumber = 1; // assign some dafault value
2051 long procNEventsProp = tool->get_procNEventsProp();
2052 unsigned int nEvents = tool->get_nEvents();
2053 if (procNEventsProp > 0) {
2054 eventsBlockNumber = (long) nEvents / procNEventsProp;
2055 if ((nEvents % procNEventsProp) != 0)
2056 eventsBlockNumber++;
2057 }
2058
2059 // lower eventsBlock number by 1 if usePreviousInterval is true;
2060 if (usePreviousInterval) {
2061 eventsBlockNumber--;
2062 }
2063
2064 streamName << "eb_" << eventsBlockNumber << "/";
2065 }
2066
2067 streamName << group.system() << "/" << objName;
2068
2069 return streamName.str();
2070}
static unsigned int getLBsLowStat()
static unsigned int getLBsHigStat()
static unsigned int getLBsMedStat()
static unsigned int lumiBlockNumber()
static unsigned int runNumber()
const int nEvents

◆ parseString()

void ManagedMonitorToolBase::StreamNameFcn::parseString ( const std::string & streamName,
std::string & root,
std::string & rem )
staticinherited

A helper non-virtual function, parses id string.

String format: id = /root/rem The method is needed to separate root stream from the directory in a file. E.g. typical streamName is /TestMon/run_211670/lb_360/spacepointVsEvent_managed

  • TestMon is the stream from configuration file (svcMgr.THistSvc.Output += ["TestMon DATAFILE='TestMon.root' OPT='RECREATE'"])
  • run_211670/lb_360/ - directory path
  • spacepointVsEvent_managed - object name

in this case, root = TestMon rem = run_211670/lb_360/spacepointVsEvent_managed

Definition at line 2184 of file ManagedMonitorToolBase.cxx.

2185 {
2186 std::string::size_type pos = streamName.find('/');
2187
2188 if (pos == std::string::npos) {
2189 root = "";
2190 rem = streamName;
2191 return;
2192 }
2193
2194 if (pos == 0) {
2195 parseString(streamName.substr(1,streamName.length()),root,rem);
2196 } else {
2197 root = streamName.substr(0,pos);
2198 rem = streamName.substr(pos+1,streamName.length());
2199 }
2200
2201}

◆ updateRunLB()

void ManagedMonitorToolBase::OfflineStream::updateRunLB ( )

Member Data Documentation

◆ m_ebNames

std::set<std::string> ManagedMonitorToolBase::OfflineStream::m_ebNames
private

Definition at line 772 of file ManagedMonitorToolBase.h.

◆ m_fileKey

const std::string ManagedMonitorToolBase::OfflineStream::m_fileKey
private

Definition at line 768 of file ManagedMonitorToolBase.h.

◆ m_prev_lumi_block

uint32_t ManagedMonitorToolBase::OfflineStream::m_prev_lumi_block
private

Definition at line 771 of file ManagedMonitorToolBase.h.

◆ m_prev_run_number

uint32_t ManagedMonitorToolBase::OfflineStream::m_prev_run_number
private

Definition at line 771 of file ManagedMonitorToolBase.h.


The documentation for this class was generated from the following files: