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 679 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 687 of file ManagedMonitorToolBase.h.

687{ }

◆ OfflineStream() [2/2]

ManagedMonitorToolBase::OfflineStream::OfflineStream ( )
inlineprivate

Definition at line 693 of file ManagedMonitorToolBase.h.

693{ }

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

1948{
1949 std::string streamName = getStreamName(tool, group, objName, usePreviousInterval);
1950 std::string root, rem;
1951 parseString(streamName, root, rem);
1952 // Remove object name at the end
1953 // to obtain directory path
1954 rem.erase(rem.rfind('/'), rem.length());
1955 return rem;
1956}
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 1859 of file ManagedMonitorToolBase.cxx.

1861{
1862 std::ostringstream streamName;
1863
1864 bool isTemp = false;
1865
1866 bool useRunFolders = group.interval() != all;
1867
1868 bool useLBFolders = ( useRunFolders )
1869 && ( group.interval() == ManagedMonitorToolBase::lumiBlock );
1870
1871 bool useLowStatInterval = ( useRunFolders )
1872 && ( group.interval() == ManagedMonitorToolBase::lowStat );
1873
1874 bool useMedStatInterval = ( useRunFolders )
1875 && ( group.interval() == ManagedMonitorToolBase::medStat );
1876
1877 bool useHigStatInterval = ( useRunFolders )
1878 && ( group.interval() == ManagedMonitorToolBase::higStat );
1879
1880 bool useEBFolders = ( group.interval() == ManagedMonitorToolBase::eventsBlock );
1881
1882 if( !isTemp ) {
1883 streamName << "/" << m_fileKey << "/";
1884 }
1885
1886 if( useRunFolders ) {
1887 if (usePreviousInterval && (group.interval() == ManagedMonitorToolBase::run) )
1888 streamName << "run_" << m_prev_run_number << "/";
1889 else
1890 streamName << "run_" << AthenaMonManager::runNumber() << "/";
1891 }
1892
1893 int currentLB = AthenaMonManager::lumiBlockNumber();
1894 if( useLBFolders ) {
1895 if (usePreviousInterval && (group.interval() == ManagedMonitorToolBase::lumiBlock) )
1896 streamName << "lb_" << m_prev_lumi_block << "/";
1897 else
1898 streamName << "lb_" << currentLB << "/";
1899 }
1900 else if( useLowStatInterval ) {
1901 int start, end;
1902 if (usePreviousInterval && (group.interval() == ManagedMonitorToolBase::lowStat) )
1904 else
1905 getLBrange(&start, &end, currentLB, AthenaMonManager::getLBsLowStat());
1906 streamName << "lowStat_LB" << start << "-" << end << "/";
1907 }
1908 else if( useMedStatInterval ) {
1909 int start, end;
1910 getLBrange(&start, &end, currentLB, AthenaMonManager::getLBsMedStat());
1911 streamName << "medStat_LB" << start << "-" << end << "/";
1912 }
1913 else if( useHigStatInterval ) {
1914 int start, end;
1915 getLBrange(&start, &end, currentLB, AthenaMonManager::getLBsHigStat());
1916 streamName << "higStat_LB" << start << "-" << end << "/";
1917 }
1918 else if( useEBFolders ) {
1919 // The number of events in an EventsBlock can vary for each ManagedMonitorToolBase object,
1920 // so there is no global way to determine when an EventsBlock has rolled over.
1921
1922 // determine an eventsBlock number
1923 long eventsBlockNumber = 1; // assign some dafault value
1924 long procNEventsProp = tool->get_procNEventsProp();
1925 unsigned int nEvents = tool->get_nEvents();
1926 if (procNEventsProp > 0) {
1927 eventsBlockNumber = (long) nEvents / procNEventsProp;
1928 if ((nEvents % procNEventsProp) != 0)
1929 eventsBlockNumber++;
1930 }
1931
1932 // lower eventsBlock number by 1 if usePreviousInterval is true;
1933 if (usePreviousInterval) {
1934 eventsBlockNumber--;
1935 }
1936
1937 streamName << "eb_" << eventsBlockNumber << "/";
1938 }
1939
1940 streamName << group.system() << "/" << objName;
1941
1942 return streamName.str();
1943}
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 2057 of file ManagedMonitorToolBase.cxx.

2058 {
2059 std::string::size_type pos = streamName.find('/');
2060
2061 if (pos == std::string::npos) {
2062 root = "";
2063 rem = streamName;
2064 return;
2065 }
2066
2067 if (pos == 0) {
2068 parseString(streamName.substr(1,streamName.length()),root,rem);
2069 } else {
2070 root = streamName.substr(0,pos);
2071 rem = streamName.substr(pos+1,streamName.length());
2072 }
2073
2074}

◆ updateRunLB()

void ManagedMonitorToolBase::OfflineStream::updateRunLB ( )

Member Data Documentation

◆ m_ebNames

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

Definition at line 698 of file ManagedMonitorToolBase.h.

◆ m_fileKey

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

Definition at line 694 of file ManagedMonitorToolBase.h.

◆ m_prev_lumi_block

uint32_t ManagedMonitorToolBase::OfflineStream::m_prev_lumi_block
private

Definition at line 697 of file ManagedMonitorToolBase.h.

◆ m_prev_run_number

uint32_t ManagedMonitorToolBase::OfflineStream::m_prev_run_number
private

Definition at line 697 of file ManagedMonitorToolBase.h.


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