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 752 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 760 of file ManagedMonitorToolBase.h.

760{ }

◆ OfflineStream() [2/2]

ManagedMonitorToolBase::OfflineStream::OfflineStream ( )
inlineprivate

Definition at line 766 of file ManagedMonitorToolBase.h.

766{ }

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 2072 of file ManagedMonitorToolBase.cxx.

2074{
2075 std::string streamName = getStreamName(tool, group, objName, usePreviousInterval);
2076 std::string root, rem;
2077 parseString(streamName, root, rem);
2078 // Remove object name at the end
2079 // to obtain directory path
2080 rem.erase(rem.rfind('/'), rem.length());
2081 return rem;
2082}
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

Definition at line 1975 of file ManagedMonitorToolBase.cxx.

◆ 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 1984 of file ManagedMonitorToolBase.cxx.

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

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

◆ updateRunLB()

void ManagedMonitorToolBase::OfflineStream::updateRunLB ( )

Member Data Documentation

◆ m_ebNames

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

Definition at line 771 of file ManagedMonitorToolBase.h.

◆ m_fileKey

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

Definition at line 767 of file ManagedMonitorToolBase.h.

◆ m_prev_lumi_block

uint32_t ManagedMonitorToolBase::OfflineStream::m_prev_lumi_block
private

Definition at line 770 of file ManagedMonitorToolBase.h.

◆ m_prev_run_number

uint32_t ManagedMonitorToolBase::OfflineStream::m_prev_run_number
private

Definition at line 770 of file ManagedMonitorToolBase.h.


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