Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Functions
WebdaqHistSvc.cxx File Reference
#include "WebdaqHistSvc.h"
#include "GaudiKernel/ISvcLocator.h"
#include "GaudiKernel/IIncidentSvc.h"
#include "AthenaInterprocess/Incidents.h"
#include "CxxUtils/checker_macros.h"
#include "AthenaMonitoringKernel/OHLockedHist.h"
#include "hltinterface/IInfoRegister.h"
#include "webdaq/webdaq-root.hpp"
#include "webdaq/webdaq.hpp"
#include "TError.h"
#include "TGraph.h"
#include "TH1.h"
#include "TH2.h"
#include "TH3.h"
#include "TObject.h"
#include "TROOT.h"
#include "TTree.h"
#include <TBufferJSON.h>
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/date_time/gregorian/gregorian_types.hpp>
#include <cstdlib>

Go to the source code of this file.

Functions

StatusCode WebdaqHistSvc::initialize ATLAS_NOT_THREAD_SAFE ()
 Install fatal handler with default options. More...
 

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

StatusCode WebdaqHistSvc::initialize ATLAS_NOT_THREAD_SAFE ( )
inline

Install fatal handler with default options.

This is meant to be easy to call from python via ctypes.

Definition at line 39 of file WebdaqHistSvc.cxx.

40 {
41  // Protect against multiple instances of TROOT
42  if (0 == gROOT) {
43  static TROOT root("root", "ROOT I/O");
44  }
45  else {
46  ATH_MSG_VERBOSE("ROOT already initialized, debug = " << gDebug);
47  }
48 
49  gErrorIgnoreLevel = kBreak; // ignore warnings see TError.h in ROOT base src
50 
51  // compile regexes
52  m_excludeTypeRegex = boost::regex(m_excludeType.value());
53  m_includeTypeRegex = boost::regex(m_includeType.value());
54  m_excludeNameRegex = boost::regex(m_excludeName.value());
55  m_includeNameRegex = boost::regex(m_includeName.value());
56  m_PublicationIncludeNameRegex = boost::regex(m_PublicationIncludeName.value());
57  m_fastPublicationIncludeNameRegex = boost::regex(m_fastPublicationIncludeName.value());
58 
59  // Retrieve and set OH mutex
60  ATH_MSG_INFO("Enabling use of OH histogram mutex");
61  static std::mutex mutex;
63  ATH_CHECK( m_jobOptionsSvc.retrieve() );
64 
65  //Retireve enviroment variables
66  const char* tdaq_partition_cstr = std::getenv("TDAQ_PARTITION");
67  if (tdaq_partition_cstr != nullptr) {
68  m_partition = std::string(tdaq_partition_cstr);
69  ATH_MSG_INFO("Partition: " << m_partition);
70  } else {
71  ATH_MSG_ERROR("TDAQ_PARTITION environment variable not set");
72  return StatusCode::FAILURE;
73  }
74  const char* tdaqWebdaqBase_cstr = std::getenv("TDAQ_WEBDAQ_BASE");
75  if (tdaqWebdaqBase_cstr != nullptr) {
76  m_tdaqWebdaqBase = std::string(tdaqWebdaqBase_cstr);
77  ATH_MSG_INFO("TDAQ_WEBDAQ_BASE value: " << m_tdaqWebdaqBase);
78  } else {
79  ATH_MSG_ERROR("TDAQ_WEBDAQ_BASE environment variable not set! Is needed for the OH publication through webdaq");
80  return StatusCode::FAILURE;
81  }
82  const char* tdaq_oh_server = std::getenv("TDAQ_OH_SERVER");
83  if (tdaq_oh_server != nullptr) {
84  m_tdaqOHServerName = std::string(tdaq_oh_server);
85  } else {
86  m_tdaqOHServerName = m_OHServerName.value();
87  }
88  ATH_MSG_INFO("TDAQ_OH_SERVER value: " << m_tdaqOHServerName);
89  ServiceHandle<IIncidentSvc> incSvc("IncidentSvc", name());
90  ATH_CHECK( incSvc.retrieve() );
91  incSvc->addListener(this, AthenaInterprocess::UpdateAfterFork::type());
92  return StatusCode::SUCCESS;
93 }
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
covarianceToolsLibrary.gErrorIgnoreLevel
gErrorIgnoreLevel
Definition: covarianceToolsLibrary.py:21
sendEI_SPB.root
root
Definition: sendEI_SPB.py:34
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
PrepareReferenceFile.regex
regex
Definition: PrepareReferenceFile.py:43
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
AthenaInterprocess::UpdateAfterFork::type
static const std::string & type()
Incident type.
Definition: Incidents.h:49
SCT_ConditionsAlgorithms::CoveritySafe::getenv
std::string getenv(const std::string &variableName)
get an environment variable
Definition: SCT_ConditionsUtilities.cxx:17
oh_lock_histogram_mutex::set_histogram_mutex
static void set_histogram_mutex(std::mutex &mutex)
Set mutex to be used in oh_lock_histogram.
Definition: OHLockedHist.h:36
ServiceHandle< IIncidentSvc >