ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
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. More...
 
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. More...
 
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. More...
 

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

Definition at line 754 of file ManagedMonitorToolBase.h.

756  : m_fileKey(fileKey),
758  m_prev_lumi_block(0) { }

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

2076 {
2077  std::string streamName = getStreamName(tool, group, objName, usePreviousInterval);
2078  std::string root, rem;
2079  parseString(streamName, root, rem);
2080  // Remove object name at the end
2081  // to obtain directory path
2082  rem.erase(rem.rfind('/'), rem.length());
2083  return rem;
2084 }

◆ getLBrange()

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

Definition at line 1977 of file ManagedMonitorToolBase.cxx.

1978  {
1979  if(start && end) {
1980  *start = ((LB-1)/length) * length + 1;
1981  *end = *start + length - 1;
1982  }
1983 }

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

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

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

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

◆ 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:
nEvents
const int nEvents
Definition: fbtTestBasics.cxx:77
ManagedMonitorToolBase::OfflineStream::m_prev_lumi_block
uint32_t m_prev_lumi_block
Definition: ManagedMonitorToolBase.h:770
CaloCellTimeCorrFiller.LB
LB
Definition: CaloCellTimeCorrFiller.py:37
ManagedMonitorToolBase::higStat
@ higStat
Definition: ManagedMonitorToolBase.h:114
ManagedMonitorToolBase::lumiBlock
@ lumiBlock
Definition: ManagedMonitorToolBase.h:113
AthenaMonManager::runNumber
static unsigned int runNumber()
Definition: AthenaMonManager.cxx:341
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
RunTileMonitoring.fileKey
fileKey
Definition: RunTileMonitoring.py:419
sendEI_SPB.root
root
Definition: sendEI_SPB.py:34
AthenaMonManager::getLBsLowStat
static unsigned int getLBsLowStat()
Definition: AthenaMonManager.cxx:303
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
ManagedMonitorToolBase::OfflineStream::getStreamName
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.
Definition: ManagedMonitorToolBase.cxx:1987
AthenaMonManager::getLBsMedStat
static unsigned int getLBsMedStat()
Definition: AthenaMonManager.cxx:306
ManagedMonitorToolBase::medStat
@ medStat
Definition: ManagedMonitorToolBase.h:114
AthenaMonManager::getLBsHigStat
static unsigned int getLBsHigStat()
Definition: AthenaMonManager.cxx:309
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
ManagedMonitorToolBase::OfflineStream::getLBrange
void getLBrange(int *, int *, int, int)
Definition: ManagedMonitorToolBase.cxx:1978
ManagedMonitorToolBase::lowStat
@ lowStat
Definition: ManagedMonitorToolBase.h:114
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
ManagedMonitorToolBase::run
@ run
Definition: ManagedMonitorToolBase.h:115
ManagedMonitorToolBase::OfflineStream::m_prev_run_number
uint32_t m_prev_run_number
Definition: ManagedMonitorToolBase.h:770
AthenaPoolExample_Copy.streamName
string streamName
Definition: AthenaPoolExample_Copy.py:39
ManagedMonitorToolBase::StreamNameFcn::parseString
static void parseString(const std::string &streamName, std::string &root, std::string &rem)
A helper non-virtual function, parses id string.
Definition: ManagedMonitorToolBase.cxx:2186
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
ManagedMonitorToolBase::eventsBlock
@ eventsBlock
Definition: ManagedMonitorToolBase.h:113
ManagedMonitorToolBase::all
@ all
Definition: ManagedMonitorToolBase.h:115
ManagedMonitorToolBase::OfflineStream::m_fileKey
const std::string m_fileKey
Definition: ManagedMonitorToolBase.h:767
AthenaMonManager::lumiBlockNumber
static unsigned int lumiBlockNumber()
Definition: AthenaMonManager.cxx:329
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26