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 814 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 816 of file ManagedMonitorToolBase.h.

818  : m_fileKey(fileKey),
820  m_prev_lumi_block(0) { }

◆ ~OfflineStream()

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

Definition at line 822 of file ManagedMonitorToolBase.h.

822 { }

◆ OfflineStream() [2/2]

ManagedMonitorToolBase::OfflineStream::OfflineStream ( )
inlineprivate

Definition at line 828 of file ManagedMonitorToolBase.h.

828 { }

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

2306 {
2307  std::string streamName = getStreamName(tool, group, objName, usePreviousInterval);
2308  std::string root, rem;
2309  parseString(streamName, root, rem);
2310  // Remove object name at the end
2311  // to obtain directory path
2312  rem.erase(rem.rfind('/'), rem.length());
2313  return rem;
2314 }

◆ getLBrange()

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

Definition at line 2207 of file ManagedMonitorToolBase.cxx.

2208  {
2209  if(start && end) {
2210  *start = ((LB-1)/length) * length + 1;
2211  *end = *start + length - 1;
2212  }
2213 }

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

2218 {
2219  std::ostringstream streamName;
2220 
2221  //bool isTemp = ( group.level() == ManagedMonitorToolBase::transient );
2222  bool isTemp = false;
2223 
2224  bool useRunFolders = group.interval() != all;
2225 
2226  bool useLBFolders = ( useRunFolders )
2227  && ( group.interval() == ManagedMonitorToolBase::lumiBlock );
2228 
2229  bool useLowStatInterval = ( useRunFolders )
2230  && ( group.interval() == ManagedMonitorToolBase::lowStat );
2231 
2232  bool useMedStatInterval = ( useRunFolders )
2233  && ( group.interval() == ManagedMonitorToolBase::medStat );
2234 
2235  bool useHigStatInterval = ( useRunFolders )
2236  && ( group.interval() == ManagedMonitorToolBase::higStat );
2237 
2238  bool useEBFolders = ( group.interval() == ManagedMonitorToolBase::eventsBlock );
2239 
2240  if( !isTemp ) {
2241  streamName << "/" << m_fileKey << "/";
2242  }
2243 
2244  if( useRunFolders ) {
2245  if (usePreviousInterval && (group.interval() == ManagedMonitorToolBase::run) )
2246  streamName << "run_" << m_prev_run_number << "/";
2247  else
2248  streamName << "run_" << AthenaMonManager::runNumber() << "/";
2249  }
2250 
2251  int currentLB = AthenaMonManager::lumiBlockNumber();
2252  if( useLBFolders ) {
2253  if (usePreviousInterval && (group.interval() == ManagedMonitorToolBase::lumiBlock) )
2254  streamName << "lb_" << m_prev_lumi_block << "/";
2255  else
2256  streamName << "lb_" << currentLB << "/";
2257  }
2258  else if( useLowStatInterval ) {
2259  int start, end;
2260  if (usePreviousInterval && (group.interval() == ManagedMonitorToolBase::lowStat) )
2262  else
2264  streamName << "lowStat_LB" << start << "-" << end << "/";
2265  }
2266  else if( useMedStatInterval ) {
2267  int start, end;
2269  streamName << "medStat_LB" << start << "-" << end << "/";
2270  }
2271  else if( useHigStatInterval ) {
2272  int start, end;
2274  streamName << "higStat_LB" << start << "-" << end << "/";
2275  }
2276  else if( useEBFolders ) {
2277  // The number of events in an EventsBlock can vary for each ManagedMonitorToolBase object,
2278  // so there is no global way to determine when an EventsBlock has rolled over.
2279 
2280  // determine an eventsBlock number
2281  long eventsBlockNumber = 1; // assign some dafault value
2282  long procNEventsProp = tool->get_procNEventsProp();
2283  unsigned int nEvents = tool->get_nEvents();
2284  if (procNEventsProp > 0) {
2285  eventsBlockNumber = (long) nEvents / procNEventsProp;
2286  if ((nEvents % procNEventsProp) != 0)
2287  eventsBlockNumber++;
2288  }
2289 
2290  // lower eventsBlock number by 1 if usePreviousInterval is true;
2291  if (usePreviousInterval) {
2292  eventsBlockNumber--;
2293  }
2294 
2295  streamName << "eb_" << eventsBlockNumber << "/";
2296  }
2297 
2298  streamName << group.system() << "/" << objName;
2299 
2300  return streamName.str();
2301 }

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

2416  {
2417  std::string::size_type pos = streamName.find('/');
2418 
2419  if (pos == std::string::npos) {
2420  root = "";
2421  rem = streamName;
2422  return;
2423  }
2424 
2425  if (pos == 0) {
2426  parseString(streamName.substr(1,streamName.length()),root,rem);
2427  } else {
2428  root = streamName.substr(0,pos);
2429  rem = streamName.substr(pos+1,streamName.length());
2430  }
2431 
2432 }

◆ updateRunLB()

void ManagedMonitorToolBase::OfflineStream::updateRunLB ( )

Member Data Documentation

◆ m_ebNames

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

Definition at line 833 of file ManagedMonitorToolBase.h.

◆ m_fileKey

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

Definition at line 829 of file ManagedMonitorToolBase.h.

◆ m_prev_lumi_block

uint32_t ManagedMonitorToolBase::OfflineStream::m_prev_lumi_block
private

Definition at line 832 of file ManagedMonitorToolBase.h.

◆ m_prev_run_number

uint32_t ManagedMonitorToolBase::OfflineStream::m_prev_run_number
private

Definition at line 832 of file ManagedMonitorToolBase.h.


The documentation for this class was generated from the following files:
ManagedMonitorToolBase::OfflineStream::m_prev_lumi_block
uint32_t m_prev_lumi_block
Definition: ManagedMonitorToolBase.h:832
CaloCellTimeCorrFiller.LB
LB
Definition: CaloCellTimeCorrFiller.py:37
ManagedMonitorToolBase::higStat
@ higStat
Definition: ManagedMonitorToolBase.h:115
ManagedMonitorToolBase::lumiBlock
@ lumiBlock
Definition: ManagedMonitorToolBase.h:114
AthenaMonManager::runNumber
static unsigned int runNumber()
Definition: AthenaMonManager.cxx:364
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:326
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:2217
AthenaMonManager::getLBsMedStat
static unsigned int getLBsMedStat()
Definition: AthenaMonManager.cxx:329
nEvents
int nEvents
Definition: fbtTestBasics.cxx:77
ManagedMonitorToolBase::medStat
@ medStat
Definition: ManagedMonitorToolBase.h:115
AthenaMonManager::getLBsHigStat
static unsigned int getLBsHigStat()
Definition: AthenaMonManager.cxx:332
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
ManagedMonitorToolBase::OfflineStream::getLBrange
void getLBrange(int *, int *, int, int)
Definition: ManagedMonitorToolBase.cxx:2208
ManagedMonitorToolBase::lowStat
@ lowStat
Definition: ManagedMonitorToolBase.h:115
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
ManagedMonitorToolBase::run
@ run
Definition: ManagedMonitorToolBase.h:116
ManagedMonitorToolBase::OfflineStream::m_prev_run_number
uint32_t m_prev_run_number
Definition: ManagedMonitorToolBase.h:832
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:2416
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
ManagedMonitorToolBase::eventsBlock
@ eventsBlock
Definition: ManagedMonitorToolBase.h:114
ManagedMonitorToolBase::all
@ all
Definition: ManagedMonitorToolBase.h:116
ManagedMonitorToolBase::OfflineStream::m_fileKey
const std::string m_fileKey
Definition: ManagedMonitorToolBase.h:829
AthenaMonManager::lumiBlockNumber
static unsigned int lumiBlockNumber()
Definition: AthenaMonManager.cxx:352
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26