Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
WebdaqHistSvc Class Reference

HLT online histogram service. More...

#include <WebdaqHistSvc.h>

Inheritance diagram for WebdaqHistSvc:
Collaboration diagram for WebdaqHistSvc:

Classes

struct  THistID
 Helper struct that bundles the histogram, name and mutex. More...
 

Public Member Functions

 WebdaqHistSvc (const std::string &name, ISvcLocator *svc)
 
virtual ~WebdaqHistSvc () noexcept override
 
virtual StatusCode initialize ATLAS_NOT_THREAD_SAFE () override
 
virtual void handle (const Incident &incident) override
 
virtual StatusCode stop () override
 
virtual StatusCode finalize () override
 
virtual StatusCode regHist (const std::string &name) override
 
virtual StatusCode regHist (const std::string &name, std::unique_ptr< TH1 > hist) override
 
virtual StatusCode regHist (const std::string &name, TH1 *) override
 
virtual StatusCode getHist (const std::string &id, TH1 *&hist, size_t ind) const override
 
virtual StatusCode getHist (const std::string &id, TH2 *&hist, size_t ind) const override
 
virtual StatusCode getHist (const std::string &id, TH3 *&hist, size_t ind) const override
 
virtual StatusCode deReg (TObject *obj) override
 
virtual StatusCode deReg (const std::string &name) override
 
virtual std::vector< std::string > getHists () const override
 
std::set< std::string > getSet (boost::regex) const
 
virtual StatusCode regShared (const std::string &, std::unique_ptr< TH1 >, LockedHandle< TH1 > &) override
 
virtual StatusCode regShared (const std::string &, std::unique_ptr< TH2 >, LockedHandle< TH2 > &) override
 
virtual StatusCode regShared (const std::string &, std::unique_ptr< TH3 >, LockedHandle< TH3 > &) override
 
virtual StatusCode getShared (const std::string &, LockedHandle< TH1 > &) const override
 
virtual StatusCode getShared (const std::string &, LockedHandle< TH2 > &) const override
 
virtual StatusCode getShared (const std::string &, LockedHandle< TH3 > &) const override
 
virtual StatusCode getTHists (TDirectory *td, TList &, bool recurse=false) const override
 
virtual StatusCode getTHists (const std::string &name, TList &, bool recurse=false) const override
 
virtual StatusCode getTHists (TDirectory *td, TList &tl, bool recurse=false, bool reg=false) override
 
virtual StatusCode getTHists (const std::string &name, TList &tl, bool recurse=false, bool reg=false) override
 
virtual bool exists (const std::string &name) const override
 
virtual bool existsHist (const std::string &name) const override
 
virtual StatusCode regTree (const std::string &) override
 
virtual StatusCode regTree (const std::string &, std::unique_ptr< TTree >) override
 
virtual StatusCode regTree (const std::string &, TTree *) override
 
virtual StatusCode getTree (const std::string &, TTree *&) const override
 
virtual std::vector< std::string > getTrees () const override
 
virtual StatusCode getTTrees (TDirectory *, TList &, bool) const override
 
virtual StatusCode getTTrees (const std::string &, TList &, bool) const override
 
virtual StatusCode getTTrees (TDirectory *, TList &, bool, bool) override
 
virtual StatusCode getTTrees (const std::string &, TList &, bool, bool) override
 
virtual StatusCode regGraph (const std::string &) override
 
virtual StatusCode regGraph (const std::string &, std::unique_ptr< TGraph >) override
 
virtual StatusCode regGraph (const std::string &, TGraph *) override
 
virtual std::vector< std::string > getGraphs () const override
 
virtual StatusCode getGraph (const std::string &, TGraph *&) const override
 
virtual StatusCode regEfficiency (const std::string &) override
 
virtual StatusCode regEfficiency (const std::string &, std::unique_ptr< TEfficiency >) override
 
virtual StatusCode regEfficiency (const std::string &, TEfficiency *) override
 
virtual StatusCode getEfficiency (const std::string &, TEfficiency *&) const override
 
virtual std::vector< std::string > getEfficiencies () const override
 
virtual StatusCode getTEfficiencies (TDirectory *, TList &, bool) const override
 
virtual StatusCode getTEfficiencies (const std::string &, TList &, bool) const override
 
virtual StatusCode getTEfficiencies (TDirectory *, TList &, bool, bool) override
 
virtual StatusCode getTEfficiencies (const std::string &, TList &, bool, bool) override
 
virtual StatusCode regShared (const std::string &, std::unique_ptr< TGraph >, LockedHandle< TGraph > &) override
 
virtual StatusCode getShared (const std::string &, LockedHandle< TGraph > &) const override
 
virtual StatusCode regShared (const std::string &, std::unique_ptr< TEfficiency >, LockedHandle< TEfficiency > &) override
 
virtual StatusCode getShared (const std::string &, LockedHandle< TEfficiency > &) const override
 
virtual StatusCode merge (const std::string &) override
 
virtual StatusCode merge (TObject *) override
 
virtual bool existsTree (const std::string &) const override
 
virtual bool existsGraph (const std::string &) const override
 
virtual bool existsEfficiency (const std::string &) const override
 

Private Member Functions

void monitoringTask (int, int, std::atomic< bool > &, boost::regex)
 The actual publication Task. More...
 
void syncPublish (long int, boost::posix_time::ptime)
 Sync the publication to a multiple of the interval. More...
 
void conditionedSleep (std::chrono::milliseconds, const std::atomic< bool > &)
 Sleep for a duration or until the stop flag is set. More...
 
bool isObjectAllowed (const std::string &path, const TObject *o) const
 Does the histogram follow the naming rules ? More...
 
StatusCode getTHists_i (const std::string &name, TList &) const
 Get TList of registered histograms. More...
 
template<typename T >
StatusCode regHist_i (std::unique_ptr< T > hist, const std::string &name, bool shared, THistID *&phid)
 
template<typename T >
T * getHist_i (const std::string &id, const size_t &ind, bool quiet=false) const
 
template<typename T >
LockedHandle< T > regShared_i (const std::string &id, std::unique_ptr< T > hist)
 
template<typename T >
LockedHandle< T > getShared_i (const std::string &id) const
 

Private Attributes

std::atomic< bool > m_stopFlag {false}
 Flag to stop the monitoring task. More...
 
std::thread m_thread
 Publication thread. More...
 
std::thread m_threadFast
 
std::string m_partition
 The partition to publish to. More...
 
std::string m_tdaqWebdaqBase
 Webdaq configuration variable, see https://gitlab.cern.ch/atlas-tdaq-software/webdaq. More...
 
std::string m_tdaqOHServerName
 The OH server name (TDAQ_OH_SERVER if defined, m_OHServerName otherwise) More...
 
std::atomic< bool > m_histoMapUpdated {false}
 Flag to indicate when the histogram map is updated. More...
 
std::atomic< bool > m_histoMapUpdatedFast {false}
 Flag to indicate when the histogram map is updated for the fast publication
More...
 
ServiceHandle< Gaudi::Interfaces::IOptionsSvc > m_jobOptionsSvc {this, "JobOptionsSvc", "JobOptionsSvc"}
 joboptions service More...
 
tbb::concurrent_hash_map< std::string, THistIDm_hists
 Map of the registered histograms. More...
 
Gaudi::Property< std::string > m_excludeType {this, "ExcludeType", "()"}
 
Gaudi::Property< std::string > m_includeType {this, "IncludeType", ".+"}
 
Gaudi::Property< std::string > m_excludeName {this, "ExcludeName", ".*\\..*"}
 
Gaudi::Property< std::string > m_includeName
 
Gaudi::Property< int > m_numSlots {this, "NumSlots", 8, "Number of slots for the main monitoring task"}
 
Gaudi::Property< int > m_numSlotsFast {this, "NumSlotsFast", 1, "Number of slots for the fast monitoring task"}
 
Gaudi::Property< int > m_intervalSeconds {this, "IntervalSeconds", 80, "Interval between histogram publications periods in seconds"}
 
Gaudi::Property< int > m_intervalSecondsFast {this, "IntervalSecondsFast", 10, "Interval between histogram publications periods in seconds for the fast publication"}
 
Gaudi::Property< std::string > m_OHServerName {this, "OHServerName", "Histogramming", "Name of the OH server to publish histograms into"}
 
Gaudi::Property< std::string > m_PublicationIncludeName {this, "PublicationIncludeName",".*","Regex to select histograms for publication"}
 
Gaudi::Property< std::string > m_fastPublicationIncludeName {this, "FastPublicationIncludeName","^.EXPERT.HLTFramework.TrigSignatureMoni.*","Regex to select histograms for fast publication"}
 
Gaudi::Property< int > m_autoSave {this, "AutoSave", 0, "Not supported by WebdaqHistSvc"}
 
Gaudi::Property< int > m_autoFlush {this, "AutoFlush", 0, "Not supported by WebdaqHistSvc"}
 
Gaudi::Property< bool > m_print {this, "PrintAll", false, "Not supported by WebdaqHistSvc"}
 
Gaudi::Property< int > m_maxFileSize {this, "MaxFileSize", 10240, "Not supported by WebdaqHistSvc"}
 
Gaudi::Property< std::vector< std::string > > m_outputfile {this, "Output", {}, "Not supported by WebdaqHistSvc"}
 
Gaudi::Property< std::vector< std::string > > m_inputfile {this, "Input", {}, "Not supported by WebdaqHistSvc"}
 
boost::regex m_excludeTypeRegex
 
boost::regex m_includeTypeRegex
 
boost::regex m_excludeNameRegex
 
boost::regex m_includeNameRegex
 
boost::regex m_PublicationIncludeNameRegex
 
boost::regex m_fastPublicationIncludeNameRegex
 

Detailed Description

HLT online histogram service.

The main difference to the offline THistSvc are:

Definition at line 52 of file WebdaqHistSvc.h.

Constructor & Destructor Documentation

◆ WebdaqHistSvc()

WebdaqHistSvc::WebdaqHistSvc ( const std::string &  name,
ISvcLocator *  svc 
)

Definition at line 34 of file WebdaqHistSvc.cxx.

34  : base_class(name, svc)
35 {}

◆ ~WebdaqHistSvc()

virtual WebdaqHistSvc::~WebdaqHistSvc ( )
inlineoverridevirtualnoexcept

Definition at line 56 of file WebdaqHistSvc.h.

56 {}

Member Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

virtual StatusCode initialize WebdaqHistSvc::ATLAS_NOT_THREAD_SAFE ( )
overridevirtual

◆ conditionedSleep()

void WebdaqHistSvc::conditionedSleep ( std::chrono::milliseconds  duration,
const std::atomic< bool > &  stopFlag 
)
private

Sleep for a duration or until the stop flag is set.

Definition at line 664 of file WebdaqHistSvc.cxx.

664  {
666  while (true) {
667  if (stopFlag.load()) {
668  return;
669  }
670  auto elapsed = std::chrono::steady_clock::now() - start;
671  if (elapsed >= duration) {
672  break;
673  }
674  auto remaining = duration - std::chrono::duration_cast<std::chrono::milliseconds>(elapsed);
675  std::this_thread::sleep_for(std::min(std::chrono::milliseconds(500), remaining));
676  }
677 }

◆ deReg() [1/2]

StatusCode WebdaqHistSvc::deReg ( const std::string &  name)
overridevirtual

Definition at line 313 of file WebdaqHistSvc.cxx.

314 {
316  if (m_hists.find(accessor, id)) {
317  //Delete the histogram
318  accessor->second.obj->Delete();
319  m_hists.erase(accessor);
320  m_histoMapUpdated = true;
321  m_histoMapUpdatedFast = true;
322  ATH_MSG_DEBUG("Deregistration of " << id << " done");
323  return StatusCode::SUCCESS;
324  }
325  ATH_MSG_ERROR("Deregistration failed: histogram with id \"" << id << "\" not found");
326  return StatusCode::FAILURE;
327 }

◆ deReg() [2/2]

StatusCode WebdaqHistSvc::deReg ( TObject *  obj)
overridevirtual

Definition at line 297 of file WebdaqHistSvc.cxx.

298 {
299  // Find the relevant histogram and deregister it
300  for (auto it = m_hists.begin(); it != m_hists.end(); ++it) {
301  if (it->second.obj == optr) {
302  ATH_MSG_DEBUG("Found histogram " << optr << " booked under " << it->first
303  << " and will deregister it");
304  return deReg(it->first);
305  }
306  }
307  ATH_MSG_ERROR("Histogram with pointer " << optr << " not found in the histogram map");
308  return StatusCode::FAILURE;
309 }

◆ exists()

virtual bool WebdaqHistSvc::exists ( const std::string &  name) const
inlineoverridevirtual

Definition at line 88 of file WebdaqHistSvc.h.

88 { return existsHist(name); }

◆ existsEfficiency()

virtual bool WebdaqHistSvc::existsEfficiency ( const std::string &  ) const
inlineoverridevirtual

Definition at line 130 of file WebdaqHistSvc.h.

130 { NOSUPPORT(WARNING, "TEfficiency"); }

◆ existsGraph()

virtual bool WebdaqHistSvc::existsGraph ( const std::string &  ) const
inlineoverridevirtual

Definition at line 129 of file WebdaqHistSvc.h.

129 { NOSUPPORT(WARNING, "TGraph"); }

◆ existsHist()

bool WebdaqHistSvc::existsHist ( const std::string &  name) const
overridevirtual

Definition at line 388 of file WebdaqHistSvc.cxx.

389 {
390  return (getHist_i<TH1>(name, 0, true) != nullptr);
391 }

◆ existsTree()

virtual bool WebdaqHistSvc::existsTree ( const std::string &  ) const
inlineoverridevirtual

Definition at line 128 of file WebdaqHistSvc.h.

128 { NOSUPPORT(DEBUG, "TTree"); }

◆ finalize()

StatusCode WebdaqHistSvc::finalize ( )
overridevirtual

Definition at line 143 of file WebdaqHistSvc.cxx.

144 {
145  ATH_MSG_INFO("finalize");
146  // Reset OH mutex
148 
149  return StatusCode::SUCCESS;
150 }

◆ getEfficiencies()

virtual std::vector<std::string> WebdaqHistSvc::getEfficiencies ( ) const
inlineoverridevirtual

Definition at line 113 of file WebdaqHistSvc.h.

113 { NOSUPPORT(WARNING, "TEfficiency"); }

◆ getEfficiency()

virtual StatusCode WebdaqHistSvc::getEfficiency ( const std::string &  ,
TEfficiency *&   
) const
inlineoverridevirtual

Definition at line 112 of file WebdaqHistSvc.h.

112 { NOSUPPORT(WARNING, "TEfficiency"); }

◆ getGraph()

virtual StatusCode WebdaqHistSvc::getGraph ( const std::string &  ,
TGraph *&   
) const
inlineoverridevirtual

Definition at line 107 of file WebdaqHistSvc.h.

107 { NOSUPPORT(DEBUG, "TGraph"); }

◆ getGraphs()

virtual std::vector<std::string> WebdaqHistSvc::getGraphs ( ) const
inlineoverridevirtual

Definition at line 106 of file WebdaqHistSvc.h.

106 { NOSUPPORT(DEBUG, "TGraph"); }

◆ getHist() [1/3]

StatusCode WebdaqHistSvc::getHist ( const std::string &  id,
TH1 *&  hist,
size_t  ind 
) const
overridevirtual

Definition at line 419 of file WebdaqHistSvc.cxx.

420 {
421  hist = getHist_i<TH1>(id, ind);
422  return (hist != nullptr ? StatusCode::SUCCESS : StatusCode::FAILURE);
423 }

◆ getHist() [2/3]

StatusCode WebdaqHistSvc::getHist ( const std::string &  id,
TH2 *&  hist,
size_t  ind 
) const
overridevirtual

Definition at line 425 of file WebdaqHistSvc.cxx.

426 {
427  hist = getHist_i<TH2>(id, ind);
428  return (hist != nullptr ? StatusCode::SUCCESS : StatusCode::FAILURE);
429 }

◆ getHist() [3/3]

StatusCode WebdaqHistSvc::getHist ( const std::string &  id,
TH3 *&  hist,
size_t  ind 
) const
overridevirtual

Definition at line 431 of file WebdaqHistSvc.cxx.

432 {
433  hist = getHist_i<TH3>(id, ind);
434  return (hist != nullptr ? StatusCode::SUCCESS : StatusCode::FAILURE);
435 }

◆ getHist_i()

template<typename T >
T * WebdaqHistSvc::getHist_i ( const std::string &  id,
const size_t &  ind,
bool  quiet = false 
) const
private

Definition at line 236 of file WebdaqHistSvc.cxx.

237 {
238  ATH_MSG_DEBUG("Getting histogram " << id);
239 
240  tbb::concurrent_hash_map<std::string, THistID>::const_accessor accessor;
241  if (!m_hists.find(accessor, id) or accessor.empty()) {
242  if (!quiet) ATH_MSG_ERROR("could not locate Hist with id \"" << id << "\"");
243  return nullptr;
244  }
245 
246  T* phist = dynamic_cast<T*>(accessor->second.obj);
247  if (phist == nullptr) {
248  ATH_MSG_ERROR("getHist: unable to dcast retrieved shared hist \""
249  << id << "\" of type " << accessor->second.obj->IsA()->GetName() << " to requested type "
250  << System::typeinfoName(typeid(T)));
251  return nullptr;
252  }
253  return phist;
254 }

◆ getHists()

std::vector< std::string > WebdaqHistSvc::getHists ( ) const
overridevirtual

Definition at line 331 of file WebdaqHistSvc.cxx.

332 {
333  std::vector<std::string> l;
334  l.reserve(m_hists.size());
335  for (auto it = m_hists.begin(); it != m_hists.end(); ++it) {
336  l.push_back(it->first);
337  }
338  return l;
339 }

◆ getSet()

std::set< std::string > WebdaqHistSvc::getSet ( boost::regex  nameSelect) const

Definition at line 343 of file WebdaqHistSvc.cxx.

344 {
345  std::vector<std::string> l;
346  l.reserve(m_hists.size());
347  for (auto it = m_hists.begin(); it != m_hists.end(); ++it) {
348  if (boost::regex_match(it->first, nameSelect)) {
349  l.push_back(it->first);
350  }
351  }
352  ATH_MSG_DEBUG("Number of histograms matched: " << l.size());
353  std::set<std::string> HistoSet(l.begin(), l.end());
354  return HistoSet;
355 }

◆ getShared() [1/5]

virtual StatusCode WebdaqHistSvc::getShared ( const std::string &  ,
LockedHandle< TEfficiency > &   
) const
inlineoverridevirtual

Definition at line 123 of file WebdaqHistSvc.h.

123 { NOSUPPORT(WARNING, "TEfficiency"); }

◆ getShared() [2/5]

virtual StatusCode WebdaqHistSvc::getShared ( const std::string &  ,
LockedHandle< TGraph > &   
) const
inlineoverridevirtual

Definition at line 121 of file WebdaqHistSvc.h.

121 { NOSUPPORT(WARNING, "TGraph"); }

◆ getShared() [3/5]

StatusCode WebdaqHistSvc::getShared ( const std::string &  id,
LockedHandle< TH1 > &  lh 
) const
overridevirtual

Definition at line 492 of file WebdaqHistSvc.cxx.

493 {
494  lh = getShared_i<TH1>(id);
495  return (lh ? StatusCode::SUCCESS : StatusCode::FAILURE);
496 }

◆ getShared() [4/5]

StatusCode WebdaqHistSvc::getShared ( const std::string &  id,
LockedHandle< TH2 > &  lh 
) const
overridevirtual

Definition at line 498 of file WebdaqHistSvc.cxx.

499 {
500  lh = getShared_i<TH2>(id);
501  return (lh ? StatusCode::SUCCESS : StatusCode::FAILURE);
502 }

◆ getShared() [5/5]

StatusCode WebdaqHistSvc::getShared ( const std::string &  id,
LockedHandle< TH3 > &  lh 
) const
overridevirtual

Definition at line 504 of file WebdaqHistSvc.cxx.

505 {
506  lh = getShared_i<TH3>(id);
507  return (lh ? StatusCode::SUCCESS : StatusCode::FAILURE);
508 }

◆ getShared_i()

template<typename T >
LockedHandle< T > WebdaqHistSvc::getShared_i ( const std::string &  id) const
private

Definition at line 273 of file WebdaqHistSvc.cxx.

274 {
275  tbb::concurrent_hash_map<std::string, THistID>::const_accessor accessor;
276  if (m_hists.find(accessor, id)) {
277  if (accessor->second.mutex == nullptr) {
278  ATH_MSG_ERROR("getShared: found Hist with id \"" << id
279  << "\", but it's not marked as shared");
280  return {};
281  }
282  T* phist = dynamic_cast<T*>(accessor->second.obj);
283  if (phist == nullptr) {
284  ATH_MSG_ERROR("getShared: unable to dcast retrieved shared hist \""
285  << id << "\" of type " << accessor->second.obj->IsA()->GetName()
286  << " to requested type " << System::typeinfoName(typeid(T)));
287  return {};
288  }
289  return LockedHandle<T>(phist, accessor->second.mutex);
290  }
291  ATH_MSG_ERROR("getShared: cannot find histogram with id \"" << id << "\"");
292  return {};
293 }

◆ getTEfficiencies() [1/4]

virtual StatusCode WebdaqHistSvc::getTEfficiencies ( const std::string &  ,
TList &  ,
bool   
) const
inlineoverridevirtual

Definition at line 116 of file WebdaqHistSvc.h.

116 { NOSUPPORT(WARNING, "TEfficiency"); }

◆ getTEfficiencies() [2/4]

virtual StatusCode WebdaqHistSvc::getTEfficiencies ( const std::string &  ,
TList &  ,
bool  ,
bool   
)
inlineoverridevirtual

Definition at line 118 of file WebdaqHistSvc.h.

118 { NOSUPPORT(WARNING, "TEfficiency"); }

◆ getTEfficiencies() [3/4]

virtual StatusCode WebdaqHistSvc::getTEfficiencies ( TDirectory *  ,
TList &  ,
bool   
) const
inlineoverridevirtual

Definition at line 115 of file WebdaqHistSvc.h.

115 { NOSUPPORT(WARNING, "TEfficiency"); }

◆ getTEfficiencies() [4/4]

virtual StatusCode WebdaqHistSvc::getTEfficiencies ( TDirectory *  ,
TList &  ,
bool  ,
bool   
)
inlineoverridevirtual

Definition at line 117 of file WebdaqHistSvc.h.

117 { NOSUPPORT(WARNING, "TEfficiency"); }

◆ getTHists() [1/4]

StatusCode WebdaqHistSvc::getTHists ( const std::string &  name,
TList &  tl,
bool  recurse = false 
) const
overridevirtual

Definition at line 445 of file WebdaqHistSvc.cxx.

446 {
447  if (recurse) ATH_MSG_DEBUG("Recursive flag is not supported in this implementation");
448  return getTHists_i(dir, tl);
449 }

◆ getTHists() [2/4]

StatusCode WebdaqHistSvc::getTHists ( const std::string &  name,
TList &  tl,
bool  recurse = false,
bool  reg = false 
)
overridevirtual

Definition at line 459 of file WebdaqHistSvc.cxx.

460 {
461  if (recurse || reg)
462  ATH_MSG_DEBUG("Recursive flag and automatic registration flag is not "
463  "supported in this implementation");
464  return getTHists_i(dir, tl);
465 }

◆ getTHists() [3/4]

StatusCode WebdaqHistSvc::getTHists ( TDirectory *  td,
TList &  tl,
bool  recurse = false 
) const
overridevirtual

Definition at line 439 of file WebdaqHistSvc.cxx.

440 {
441  if (recurse) ATH_MSG_DEBUG("Recursive flag is not supported in this implementation");
442  return getTHists_i(std::string(td->GetPath()), tl);
443 }

◆ getTHists() [4/4]

StatusCode WebdaqHistSvc::getTHists ( TDirectory *  td,
TList &  tl,
bool  recurse = false,
bool  reg = false 
)
overridevirtual

Definition at line 451 of file WebdaqHistSvc.cxx.

452 {
453  if (recurse || reg)
454  ATH_MSG_DEBUG("Recursive flag and automatic registration flag is not "
455  "supported in this implementation");
456  return getTHists_i(std::string(td->GetPath()), tl);
457 }

◆ getTHists_i()

StatusCode WebdaqHistSvc::getTHists_i ( const std::string &  name,
TList &  tl 
) const
private

Get TList of registered histograms.

Definition at line 258 of file WebdaqHistSvc.cxx.

259 {
260  for (auto it = m_hists.begin(); it != m_hists.end(); ++it) {
261  const std::string& id = it->first;
262  const THistID& h = it->second;
263  if (id.starts_with(dir)) { // histogram booking path starts from the dir
264  tl.Add(h.obj);
265  }
266  }
267  return StatusCode::SUCCESS;
268 }

◆ getTree()

virtual StatusCode WebdaqHistSvc::getTree ( const std::string &  ,
TTree *&   
) const
inlineoverridevirtual

Definition at line 95 of file WebdaqHistSvc.h.

95 { NOSUPPORT(WARNING, "TTree"); }

◆ getTrees()

virtual std::vector<std::string> WebdaqHistSvc::getTrees ( ) const
inlineoverridevirtual

Definition at line 97 of file WebdaqHistSvc.h.

97 { NOSUPPORT(DEBUG, "TTree"); }

◆ getTTrees() [1/4]

virtual StatusCode WebdaqHistSvc::getTTrees ( const std::string &  ,
TList &  ,
bool   
) const
inlineoverridevirtual

Definition at line 99 of file WebdaqHistSvc.h.

99 { NOSUPPORT(DEBUG, "TTree"); }

◆ getTTrees() [2/4]

virtual StatusCode WebdaqHistSvc::getTTrees ( const std::string &  ,
TList &  ,
bool  ,
bool   
)
inlineoverridevirtual

Definition at line 101 of file WebdaqHistSvc.h.

101 { NOSUPPORT(DEBUG, "TTree"); }

◆ getTTrees() [3/4]

virtual StatusCode WebdaqHistSvc::getTTrees ( TDirectory *  ,
TList &  ,
bool   
) const
inlineoverridevirtual

Definition at line 98 of file WebdaqHistSvc.h.

98 { NOSUPPORT(DEBUG, "TTree"); }

◆ getTTrees() [4/4]

virtual StatusCode WebdaqHistSvc::getTTrees ( TDirectory *  ,
TList &  ,
bool  ,
bool   
)
inlineoverridevirtual

Definition at line 100 of file WebdaqHistSvc.h.

100 { NOSUPPORT(DEBUG, "TTree"); }

◆ handle()

void WebdaqHistSvc::handle ( const Incident &  incident)
overridevirtual

Definition at line 97 of file WebdaqHistSvc.cxx.

◆ isObjectAllowed()

bool WebdaqHistSvc::isObjectAllowed ( const std::string &  path,
const TObject *  o 
) const
private

Does the histogram follow the naming rules ?

Definition at line 359 of file WebdaqHistSvc.cxx.

360 {
361  boost::cmatch what;
362 
363  if (not boost::regex_match(o->ClassName(), what, m_includeTypeRegex)) {
364  ATH_MSG_WARNING("Object " << path << " of type " << o->ClassName()
365  << " does NOT match IncludeType \"" << m_includeType << "\"");
366  return false;
367  }
368 
369  if (boost::regex_match(o->ClassName(), what, m_excludeTypeRegex)) {
370  ATH_MSG_WARNING("Object " << path << " of type " << o->ClassName() << " matches ExcludeType \""
371  << m_excludeType << "\"");
372  return false;
373  }
374 
375  if (not boost::regex_match(path.c_str(), what, m_includeNameRegex)) {
376  ATH_MSG_WARNING("Object " << path << " does NOT match IncludeName \"" << m_includeName << "\"");
377  return false;
378  }
379 
380  if (boost::regex_match(path.c_str(), what, m_excludeNameRegex)) {
381  ATH_MSG_WARNING("Object " << path << " matches ExcludeName \"" << m_excludeName << "\"");
382  return false;
383  }
384 
385  return true;
386 }

◆ merge() [1/2]

virtual StatusCode WebdaqHistSvc::merge ( const std::string &  )
inlineoverridevirtual

Definition at line 125 of file WebdaqHistSvc.h.

125 { NOSUPPORT(WARNING, "merge"); }

◆ merge() [2/2]

virtual StatusCode WebdaqHistSvc::merge ( TObject *  )
inlineoverridevirtual

Definition at line 126 of file WebdaqHistSvc.h.

126 { NOSUPPORT(WARNING, "merge"); }

◆ monitoringTask()

void WebdaqHistSvc::monitoringTask ( int  numSlots,
int  intervalSeconds,
std::atomic< bool > &  histoMapUpdated,
boost::regex  nameSelect 
)
private

The actual publication Task.

Histograms publication via WebDAQ.

It divides the histograms into batches and publishes them in slots. The method also handles synchronization to ensure that the publication happens at regular intervals.

Parameters
numSlotsNumber of slots to divide the histograms into for publication.
intervalSecondsInterval in seconds between each publication cycle.
histoMapUpdatedAtomic flag indicating if the histogram map has been updated.
nameSelectRegular expression to select histograms for publication.

Definition at line 522 of file WebdaqHistSvc.cxx.

523 {
524  ATH_MSG_INFO("Started monitoring task for partition: " << m_partition << "and regex: " << nameSelect.str());
525  std::string appName = m_jobOptionsSvc->get("DataFlowConfig.DF_ApplicationName");
526  // OH doesn't allow multiple providers for a given server
527  // Need to modify the path for one of the threads to avoid the issue
528  if (nameSelect != boost::regex(".*"))
529  appName = appName + "_fast";
530 
531  // Set the publication period
532  boost::posix_time::time_duration interval{boost::posix_time::seconds(intervalSeconds)};
533  ATH_MSG_DEBUG("Interval set to " << interval.total_seconds() << " seconds");
534  int interval_ms = interval.total_milliseconds();
535  if(numSlots == 0) numSlots = 1;
536  boost::posix_time::ptime epoch(boost::gregorian::date(2024,1,1));
537  // Sleep duration between slots (plus an extra slot for allowing a last sleep cycle)
538  boost::posix_time::time_duration slotSleepDuration = interval / (numSlots + 1);
539 
540  // Create the Set of the histograms keys to order the histograms publication and reset the histoMapUpdated flag
541  std::set<std::string> HistoSet = getSet(nameSelect);
542  histoMapUpdated = false;
543 
544  // Sync the publication to the period
545  syncPublish(interval_ms, epoch);
546  ATH_MSG_DEBUG("Monitoring task synched");
547 
548  // Publication loop
549  while (!m_stopFlag)
550  {
551  // Check if the histograms map has been updated, and if so update the Set
552  if (histoMapUpdated)
553  {
554  ATH_MSG_DEBUG("Histo map updated, updating the Set");
555  HistoSet = getSet(nameSelect);
556  histoMapUpdated = false;
557  }
558  size_t totalHists = HistoSet.size();
559  ATH_MSG_DEBUG("Going to publish " << totalHists << " histograms");
560 
561  // Divide the histograms in batches
562  size_t batchSize = (totalHists + numSlots - 1) / numSlots; // Ceiling division
563  ATH_MSG_DEBUG("Num of slots:" << numSlots << ", Interval_ms " << interval_ms << " milliseconds, Batch size: " << batchSize);
564 
565  boost::posix_time::ptime start_time = boost::posix_time::microsec_clock::universal_time();
566  int counter = 0;
567  int BatchCounter = 0;
568  auto it = HistoSet.begin();
569  while(it != HistoSet.end())
570  {
571  boost::posix_time::ptime slot_start_time = boost::posix_time::microsec_clock::universal_time();
572  //Batch publication
573  ATH_MSG_DEBUG("Batch publication number " << BatchCounter << " starting.");
574  for(size_t j = 0; j < batchSize; ++j)
575  {
576  if(it == HistoSet.end())
577  {
578  break;
579  }
580  const std::string& id = *it;
581  std::string path = appName + '.' + id;
582  ATH_MSG_DEBUG("Publishing to " << m_partition << " Histogram " << path << " to the OH server " << m_tdaqOHServerName);
583  tbb::concurrent_hash_map<std::string, THistID>::const_accessor accessor;
584  if (!m_hists.find(accessor, id)) {
585  ATH_MSG_WARNING("Histogram with name " << id << " not found in histogram map (probably deregistered).");
586  it++;
587  continue;
588  }
589  else
590  {
591  ATH_MSG_DEBUG("Histogram found in map, going to lock mutex and then publish it");
592  //Here we clone the histogram to avoid locking the OH mutex during the whole publication
593  TObject* obj = nullptr;
594  {
595  //Locking the OH mutex before touching the Histogram
597  obj = accessor->second.obj->Clone();
598  }
599  if (obj == nullptr) {
600  ATH_MSG_ERROR("Failed to clone histogram " << id);
601  it++;
602  continue;
603  }
604  if (!webdaq::oh::put(m_partition, m_tdaqOHServerName, path, obj)) {
605  ATH_MSG_ERROR("Histogram publishing failed !");
606  }
607  //Delete the cloned histogram. This was creating a memory leak
608  ATH_MSG_DEBUG("Deleting cloned histogram");
609  delete obj;
610  }
611  it++;
612  counter++;
613  }
614  ATH_MSG_DEBUG("Batch publication completed, " << counter << " histograms published");
615  // Sleep for slotSleepDuration - slot publication time, unless it's the last slot
616  if (it != HistoSet.end()) {
617  boost::posix_time::ptime slot_end_time = boost::posix_time::microsec_clock::universal_time();
618  int slot_sleep_time = slotSleepDuration.total_milliseconds() - (slot_end_time-slot_start_time).total_milliseconds();
619  if (slot_sleep_time > 0) {
620  ATH_MSG_DEBUG("Sleeping for " << slot_sleep_time << " seconds before publishing the next batch");
621  conditionedSleep(std::chrono::milliseconds(slot_sleep_time), m_stopFlag);
622  }
623  }
624  BatchCounter++;
625  }
626 
627  //check if we exceeded the publication period
628  boost::posix_time::ptime end_time = boost::posix_time::microsec_clock::universal_time();
629  if (boost::posix_time::time_duration(end_time-start_time) > interval) {
630  ATH_MSG_WARNING("Publication deadline missed, cycle exceeded the interval.. Total publication time "
631  << boost::posix_time::to_simple_string(end_time-start_time));
632  }
633  ATH_MSG_DEBUG("Completed the publication of " << counter << " histograms. Publication time: " << boost::posix_time::to_simple_string(end_time-start_time));
634 
635  //sleep till the next cycle
636  boost::posix_time::ptime now = boost::posix_time::microsec_clock::universal_time();
637  int nowMs = (now-epoch).total_milliseconds();
638  boost::posix_time::time_duration next_cycle(boost::posix_time::milliseconds(interval_ms - (nowMs % interval_ms)));
639  ATH_MSG_DEBUG("epoch " << epoch);
640  ATH_MSG_DEBUG("interval_ms" << interval_ms);
641  ATH_MSG_DEBUG("now_ms " << nowMs);
642  ATH_MSG_DEBUG("Sleeping for " << next_cycle.total_milliseconds() << " milliseconds till the next cycle");
643  conditionedSleep(std::chrono::milliseconds(next_cycle.total_milliseconds()), m_stopFlag);
644  }
645  ATH_MSG_INFO("Monitoring task stopped");
646 }

◆ regEfficiency() [1/3]

virtual StatusCode WebdaqHistSvc::regEfficiency ( const std::string &  )
inlineoverridevirtual

Definition at line 109 of file WebdaqHistSvc.h.

109 { NOSUPPORT(WARNING, "TEfficiency"); }

◆ regEfficiency() [2/3]

virtual StatusCode WebdaqHistSvc::regEfficiency ( const std::string &  ,
std::unique_ptr< TEfficiency >   
)
inlineoverridevirtual

Definition at line 110 of file WebdaqHistSvc.h.

110 { NOSUPPORT(WARNING, "TEfficiency"); }

◆ regEfficiency() [3/3]

virtual StatusCode WebdaqHistSvc::regEfficiency ( const std::string &  ,
TEfficiency *   
)
inlineoverridevirtual

Definition at line 111 of file WebdaqHistSvc.h.

111 { NOSUPPORT(WARNING, "TEfficiency"); }

◆ regGraph() [1/3]

virtual StatusCode WebdaqHistSvc::regGraph ( const std::string &  )
inlineoverridevirtual

Definition at line 103 of file WebdaqHistSvc.h.

103 { NOSUPPORT(WARNING, "TGraph"); }

◆ regGraph() [2/3]

virtual StatusCode WebdaqHistSvc::regGraph ( const std::string &  ,
std::unique_ptr< TGraph >   
)
inlineoverridevirtual

Definition at line 104 of file WebdaqHistSvc.h.

104 { NOSUPPORT(WARNING, "TGraph"); }

◆ regGraph() [3/3]

virtual StatusCode WebdaqHistSvc::regGraph ( const std::string &  ,
TGraph *   
)
inlineoverridevirtual

Definition at line 105 of file WebdaqHistSvc.h.

105 { NOSUPPORT(WARNING, "TGraph"); }

◆ regHist() [1/3]

StatusCode WebdaqHistSvc::regHist ( const std::string &  name)
overridevirtual

Definition at line 397 of file WebdaqHistSvc.cxx.

398 {
399  std::unique_ptr<TH1> hist = nullptr;
400  THistID* hid = nullptr;
401  return regHist_i(std::move(hist), id, false, hid);
402 }

◆ regHist() [2/3]

StatusCode WebdaqHistSvc::regHist ( const std::string &  name,
std::unique_ptr< TH1 >  hist 
)
overridevirtual

Definition at line 404 of file WebdaqHistSvc.cxx.

405 {
406  THistID* hid = nullptr;
407  return regHist_i(std::move(hist), id, false, hid);
408 }

◆ regHist() [3/3]

StatusCode WebdaqHistSvc::regHist ( const std::string &  name,
TH1 *  hist_ptr 
)
overridevirtual

Definition at line 410 of file WebdaqHistSvc.cxx.

411 {
412  THistID* hid = nullptr;
413  std::unique_ptr<TH1> hist(hist_ptr);
414  return regHist_i(std::move(hist), id, false, hid);
415 }

◆ regHist_i()

template<typename T >
StatusCode WebdaqHistSvc::regHist_i ( std::unique_ptr< T >  hist,
const std::string &  name,
bool  shared,
THistID *&  phid 
)
private

Definition at line 155 of file WebdaqHistSvc.cxx.

157 {
158  ATH_MSG_DEBUG("Registering histogram " << id);
159 
160  phid = nullptr;
161  if (not isObjectAllowed(id, hist_unique.get())) {
162  return StatusCode::FAILURE;
163  }
164 
165  if (hist_unique->Class()->InheritsFrom(TH1::Class())) {
166 
168  if (m_hists.find(accessor, id)) {
169  ATH_MSG_ERROR("Histogram with name " << id << " already registered");
170  return StatusCode::FAILURE;
171  }
172  // Element not found, attempt to insert
173  if (!m_hists.insert(accessor, id)) {
174  ATH_MSG_ERROR("Failed to insert histogram with name " << id);
175  return StatusCode::FAILURE;
176  }
177  T* hist = hist_unique.release();
178  m_histoMapUpdated = true;
179  m_histoMapUpdatedFast = true;
180  accessor->second = THistID(id, hist);
181  //finished
182  if (shared) accessor->second.mutex = new std::mutex;
183  phid = &accessor->second;
184  ATH_MSG_DEBUG((shared ? "Shared histogram " : "Histogram ")
185  << hist->GetName() << " registered under " << id << " " << name());
186  } else {
187  ATH_MSG_ERROR("Cannot register " << hist_unique->ClassName()
188  << " because it does not inherit from TH1");
189  return StatusCode::FAILURE;
190  }
191  return StatusCode::SUCCESS;
192 }

◆ regShared() [1/5]

virtual StatusCode WebdaqHistSvc::regShared ( const std::string &  ,
std::unique_ptr< TEfficiency >  ,
LockedHandle< TEfficiency > &   
)
inlineoverridevirtual

Definition at line 122 of file WebdaqHistSvc.h.

122 { NOSUPPORT(WARNING, "TEfficiency"); }

◆ regShared() [2/5]

virtual StatusCode WebdaqHistSvc::regShared ( const std::string &  ,
std::unique_ptr< TGraph >  ,
LockedHandle< TGraph > &   
)
inlineoverridevirtual

Definition at line 120 of file WebdaqHistSvc.h.

120 { NOSUPPORT(WARNING, "TGraph"); }

◆ regShared() [3/5]

StatusCode WebdaqHistSvc::regShared ( const std::string &  id,
std::unique_ptr< TH1 >  hist,
LockedHandle< TH1 > &  lh 
)
overridevirtual

Definition at line 469 of file WebdaqHistSvc.cxx.

471 {
472  lh = regShared_i<TH1>(id, std::move(hist));
473  return (lh ? StatusCode::SUCCESS : StatusCode::FAILURE);
474 }

◆ regShared() [4/5]

StatusCode WebdaqHistSvc::regShared ( const std::string &  id,
std::unique_ptr< TH2 >  hist,
LockedHandle< TH2 > &  lh 
)
overridevirtual

Definition at line 476 of file WebdaqHistSvc.cxx.

478 {
479  lh = regShared_i<TH2>(id, std::move(hist));
480  return (lh ? StatusCode::SUCCESS : StatusCode::FAILURE);
481 }

◆ regShared() [5/5]

StatusCode WebdaqHistSvc::regShared ( const std::string &  id,
std::unique_ptr< TH3 >  hist,
LockedHandle< TH3 > &  lh 
)
overridevirtual

Definition at line 483 of file WebdaqHistSvc.cxx.

485 {
486  lh = regShared_i<TH3>(id, std::move(hist));
487  return (lh ? StatusCode::SUCCESS : StatusCode::FAILURE);
488 }

◆ regShared_i()

template<typename T >
LockedHandle< T > WebdaqHistSvc::regShared_i ( const std::string &  id,
std::unique_ptr< T >  hist 
)
private

Definition at line 197 of file WebdaqHistSvc.cxx.

198 {
199  LockedHandle<T> lh(nullptr, nullptr);
200 
202  // Check if the histogram is already registered
203  if (!m_hists.find(accessor, id)) {
204  // No histogram under that id yet
205  T* phist = hist.get();
206  THistID* phid = nullptr;
207  if (regHist_i(std::move(hist), id, true, phid).isSuccess()) {
208  if (phid) lh.set(phist, phid->mutex);
209  }
210  }
211  else
212  {
213  // Histogram already registered under that id
214  if (accessor->second.mutex == nullptr) {
215  ATH_MSG_ERROR("regShared: previously registered histogram \"" << id
216  << "\" was not marked shared");
217  }
218  T* phist = dynamic_cast<T*>(accessor->second.obj);
219  if (phist == nullptr) {
220  ATH_MSG_ERROR("regShared: unable to dcast retrieved shared hist \""
221  << id << "\" of type " << accessor->second.obj->IsA()->GetName()
222  << " to requested type " << System::typeinfoName(typeid(T)));
223  }
224  else {
225  lh.set(phist, accessor->second.mutex);
226  //hist is automatically deleted at end of method
227  }
228  }
229  return lh;
230 }

◆ regTree() [1/3]

virtual StatusCode WebdaqHistSvc::regTree ( const std::string &  )
inlineoverridevirtual

Definition at line 92 of file WebdaqHistSvc.h.

92 { NOSUPPORT(WARNING, "TTree"); }

◆ regTree() [2/3]

virtual StatusCode WebdaqHistSvc::regTree ( const std::string &  ,
std::unique_ptr< TTree >   
)
inlineoverridevirtual

Definition at line 93 of file WebdaqHistSvc.h.

93 { NOSUPPORT(WARNING, "TTree"); }

◆ regTree() [3/3]

virtual StatusCode WebdaqHistSvc::regTree ( const std::string &  ,
TTree *   
)
inlineoverridevirtual

Definition at line 94 of file WebdaqHistSvc.h.

94 { NOSUPPORT(WARNING, "TTree"); }

◆ stop()

StatusCode WebdaqHistSvc::stop ( )
overridevirtual

Set the stop flag for the task thread to true

Definition at line 108 of file WebdaqHistSvc.cxx.

109 {
111  ATH_MSG_DEBUG("Stopping monitoring task");
112  m_stopFlag = true;
113  // Wait for the task to finish
114  if (m_thread.joinable()) {
115  ATH_MSG_DEBUG("Going to join the monitoring thread");
116  try {
117  m_thread.join();
118  }
119  catch (const std::exception& e) {
120  ATH_MSG_ERROR("Failed to join the monitoring thread: " << e.what());
121  return StatusCode::FAILURE;
122  }
123  }
124  if (m_threadFast.joinable()) {
125  ATH_MSG_DEBUG("Going to join the fast monitoring thread");
126  try {
127  m_threadFast.join();
128  }
129  catch (const std::exception& e) {
130  ATH_MSG_ERROR("Failed to join the fast monitoring thread: " << e.what());
131  return StatusCode::FAILURE;
132  }
133  }
134  ATH_MSG_DEBUG("Clearing list of histograms");
135  m_hists.clear();
136  m_histoMapUpdated = true;
137  m_histoMapUpdatedFast = true;
138  return StatusCode::SUCCESS;
139 }

◆ syncPublish()

void WebdaqHistSvc::syncPublish ( long int  interval_ms,
boost::posix_time::ptime  epoch 
)
private

Sync the publication to a multiple of the interval.

Definition at line 650 of file WebdaqHistSvc.cxx.

651 {
652  //Sync the publication to a multple of the interval
653  //Code taken from TDAQ monsvc https://gitlab.cern.ch/atlas-tdaq-software/monsvc/-/blob/master/src/PeriodicScheduler.cxx?ref_type=heads#L163
654  boost::posix_time::ptime now = boost::posix_time::microsec_clock::universal_time();
655  int now_ms = (now-epoch).total_milliseconds();
656  //If now_ms % interval_ms == 0 we skip a cycle. Too bad.
657  boost::posix_time::time_duration sync(boost::posix_time::milliseconds(interval_ms - (now_ms % interval_ms)));
658  //Do not sync if we are below 50 ms
659  if (sync.total_milliseconds() > 50){
660  std::this_thread::sleep_for(std::chrono::milliseconds(sync.total_milliseconds()));
661  }
662 }

Member Data Documentation

◆ m_autoFlush

Gaudi::Property<int> WebdaqHistSvc::m_autoFlush {this, "AutoFlush", 0, "Not supported by WebdaqHistSvc"}
private

Definition at line 201 of file WebdaqHistSvc.h.

◆ m_autoSave

Gaudi::Property<int> WebdaqHistSvc::m_autoSave {this, "AutoSave", 0, "Not supported by WebdaqHistSvc"}
private

Definition at line 200 of file WebdaqHistSvc.h.

◆ m_excludeName

Gaudi::Property<std::string> WebdaqHistSvc::m_excludeName {this, "ExcludeName", ".*\\..*"}
private

Definition at line 186 of file WebdaqHistSvc.h.

◆ m_excludeNameRegex

boost::regex WebdaqHistSvc::m_excludeNameRegex
private

Definition at line 210 of file WebdaqHistSvc.h.

◆ m_excludeType

Gaudi::Property<std::string> WebdaqHistSvc::m_excludeType {this, "ExcludeType", "()"}
private

Definition at line 184 of file WebdaqHistSvc.h.

◆ m_excludeTypeRegex

boost::regex WebdaqHistSvc::m_excludeTypeRegex
private

Definition at line 208 of file WebdaqHistSvc.h.

◆ m_fastPublicationIncludeName

Gaudi::Property<std::string> WebdaqHistSvc::m_fastPublicationIncludeName {this, "FastPublicationIncludeName","^.EXPERT.HLTFramework.TrigSignatureMoni.*","Regex to select histograms for fast publication"}
private

Definition at line 197 of file WebdaqHistSvc.h.

◆ m_fastPublicationIncludeNameRegex

boost::regex WebdaqHistSvc::m_fastPublicationIncludeNameRegex
private

Definition at line 213 of file WebdaqHistSvc.h.

◆ m_histoMapUpdated

std::atomic<bool> WebdaqHistSvc::m_histoMapUpdated {false}
private

Flag to indicate when the histogram map is updated.

Definition at line 161 of file WebdaqHistSvc.h.

◆ m_histoMapUpdatedFast

std::atomic<bool> WebdaqHistSvc::m_histoMapUpdatedFast {false}
private

Flag to indicate when the histogram map is updated for the fast publication

Definition at line 163 of file WebdaqHistSvc.h.

◆ m_hists

tbb::concurrent_hash_map<std::string, THistID> WebdaqHistSvc::m_hists
private

Map of the registered histograms.

Definition at line 169 of file WebdaqHistSvc.h.

◆ m_includeName

Gaudi::Property<std::string> WebdaqHistSvc::m_includeName
private
Initial value:
{this, "IncludeName",
"^/((run_[0-9]+/lb_[0-9]+/LB)|(SHIFT)|(EXPERT)|(DEBUG)|(EXPRESS)|(RUNSTAT))/.+/.+"}

Definition at line 187 of file WebdaqHistSvc.h.

◆ m_includeNameRegex

boost::regex WebdaqHistSvc::m_includeNameRegex
private

Definition at line 211 of file WebdaqHistSvc.h.

◆ m_includeType

Gaudi::Property<std::string> WebdaqHistSvc::m_includeType {this, "IncludeType", ".+"}
private

Definition at line 185 of file WebdaqHistSvc.h.

◆ m_includeTypeRegex

boost::regex WebdaqHistSvc::m_includeTypeRegex
private

Definition at line 209 of file WebdaqHistSvc.h.

◆ m_inputfile

Gaudi::Property<std::vector<std::string> > WebdaqHistSvc::m_inputfile {this, "Input", {}, "Not supported by WebdaqHistSvc"}
private

Definition at line 205 of file WebdaqHistSvc.h.

◆ m_intervalSeconds

Gaudi::Property<int> WebdaqHistSvc::m_intervalSeconds {this, "IntervalSeconds", 80, "Interval between histogram publications periods in seconds"}
private

Definition at line 193 of file WebdaqHistSvc.h.

◆ m_intervalSecondsFast

Gaudi::Property<int> WebdaqHistSvc::m_intervalSecondsFast {this, "IntervalSecondsFast", 10, "Interval between histogram publications periods in seconds for the fast publication"}
private

Definition at line 194 of file WebdaqHistSvc.h.

◆ m_jobOptionsSvc

ServiceHandle<Gaudi::Interfaces::IOptionsSvc> WebdaqHistSvc::m_jobOptionsSvc {this, "JobOptionsSvc", "JobOptionsSvc"}
private

joboptions service

Definition at line 166 of file WebdaqHistSvc.h.

◆ m_maxFileSize

Gaudi::Property<int> WebdaqHistSvc::m_maxFileSize {this, "MaxFileSize", 10240, "Not supported by WebdaqHistSvc"}
private

Definition at line 203 of file WebdaqHistSvc.h.

◆ m_numSlots

Gaudi::Property<int> WebdaqHistSvc::m_numSlots {this, "NumSlots", 8, "Number of slots for the main monitoring task"}
private

Definition at line 191 of file WebdaqHistSvc.h.

◆ m_numSlotsFast

Gaudi::Property<int> WebdaqHistSvc::m_numSlotsFast {this, "NumSlotsFast", 1, "Number of slots for the fast monitoring task"}
private

Definition at line 192 of file WebdaqHistSvc.h.

◆ m_OHServerName

Gaudi::Property<std::string> WebdaqHistSvc::m_OHServerName {this, "OHServerName", "Histogramming", "Name of the OH server to publish histograms into"}
private

Definition at line 195 of file WebdaqHistSvc.h.

◆ m_outputfile

Gaudi::Property<std::vector<std::string> > WebdaqHistSvc::m_outputfile {this, "Output", {}, "Not supported by WebdaqHistSvc"}
private

Definition at line 204 of file WebdaqHistSvc.h.

◆ m_partition

std::string WebdaqHistSvc::m_partition
private

The partition to publish to.

Definition at line 155 of file WebdaqHistSvc.h.

◆ m_print

Gaudi::Property<bool> WebdaqHistSvc::m_print {this, "PrintAll", false, "Not supported by WebdaqHistSvc"}
private

Definition at line 202 of file WebdaqHistSvc.h.

◆ m_PublicationIncludeName

Gaudi::Property<std::string> WebdaqHistSvc::m_PublicationIncludeName {this, "PublicationIncludeName",".*","Regex to select histograms for publication"}
private

Definition at line 196 of file WebdaqHistSvc.h.

◆ m_PublicationIncludeNameRegex

boost::regex WebdaqHistSvc::m_PublicationIncludeNameRegex
private

Definition at line 212 of file WebdaqHistSvc.h.

◆ m_stopFlag

std::atomic<bool> WebdaqHistSvc::m_stopFlag {false}
private

Flag to stop the monitoring task.

Definition at line 144 of file WebdaqHistSvc.h.

◆ m_tdaqOHServerName

std::string WebdaqHistSvc::m_tdaqOHServerName
private

The OH server name (TDAQ_OH_SERVER if defined, m_OHServerName otherwise)

Definition at line 159 of file WebdaqHistSvc.h.

◆ m_tdaqWebdaqBase

std::string WebdaqHistSvc::m_tdaqWebdaqBase
private

Webdaq configuration variable, see https://gitlab.cern.ch/atlas-tdaq-software/webdaq.

Definition at line 157 of file WebdaqHistSvc.h.

◆ m_thread

std::thread WebdaqHistSvc::m_thread
private

Publication thread.

Definition at line 152 of file WebdaqHistSvc.h.

◆ m_threadFast

std::thread WebdaqHistSvc::m_threadFast
private

Definition at line 153 of file WebdaqHistSvc.h.


The documentation for this class was generated from the following files:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
DiTauMassTools::TauTypes::lh
@ lh
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:53
NOSUPPORT
#define NOSUPPORT(lvl, what)
Definition: WebdaqHistSvc.h:32
WebdaqHistSvc::m_includeType
Gaudi::Property< std::string > m_includeType
Definition: WebdaqHistSvc.h:185
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:128
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
quiet
bool quiet
Definition: TrigGlobEffCorrValidation.cxx:190
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
WebdaqHistSvc::getSet
std::set< std::string > getSet(boost::regex) const
Definition: WebdaqHistSvc.cxx:343
plotmaker.hist
hist
Definition: plotmaker.py:148
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
WebdaqHistSvc::existsHist
virtual bool existsHist(const std::string &name) const override
Definition: WebdaqHistSvc.cxx:388
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
WebdaqHistSvc::m_intervalSeconds
Gaudi::Property< int > m_intervalSeconds
Definition: WebdaqHistSvc.h:193
skel.it
it
Definition: skel.GENtoEVGEN.py:407
WebdaqHistSvc::m_jobOptionsSvc
ServiceHandle< Gaudi::Interfaces::IOptionsSvc > m_jobOptionsSvc
joboptions service
Definition: WebdaqHistSvc.h:166
WebdaqHistSvc::m_includeName
Gaudi::Property< std::string > m_includeName
Definition: WebdaqHistSvc.h:187
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
WebdaqHistSvc::m_stopFlag
std::atomic< bool > m_stopFlag
Flag to stop the monitoring task.
Definition: WebdaqHistSvc.h:144
dq_make_web_display.recurse
def recurse(rdir, dqregion, ignorepath, reffile=None)
Definition: dq_make_web_display.py:23
WebdaqHistSvc::m_thread
std::thread m_thread
Publication thread.
Definition: WebdaqHistSvc.h:152
oh_scoped_lock_histogram
Scoped lock to be used for threaded histogram operations.
Definition: OHLockedHist.h:108
PrepareReferenceFile.regex
regex
Definition: PrepareReferenceFile.py:43
WebdaqHistSvc::m_tdaqOHServerName
std::string m_tdaqOHServerName
The OH server name (TDAQ_OH_SERVER if defined, m_OHServerName otherwise)
Definition: WebdaqHistSvc.h:159
WebdaqHistSvc::m_includeTypeRegex
boost::regex m_includeTypeRegex
Definition: WebdaqHistSvc.h:209
python.handimod.now
now
Definition: handimod.py:675
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
WebdaqHistSvc::getTHists_i
StatusCode getTHists_i(const std::string &name, TList &) const
Get TList of registered histograms.
Definition: WebdaqHistSvc.cxx:258
Athena::typeinfoName
std::string typeinfoName(const std::type_info &ti)
Convert a type_info to a demangled string.
Definition: AthenaKernel/src/ClassName.cxx:23
WebdaqHistSvc::m_fastPublicationIncludeNameRegex
boost::regex m_fastPublicationIncludeNameRegex
Definition: WebdaqHistSvc.h:213
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
getLatestRuns.interval
interval
Definition: getLatestRuns.py:24
calibdata.exception
exception
Definition: calibdata.py:496
oh_lock_histogram_mutex::reset_histogram_mutex
static void reset_histogram_mutex()
Reset (disable) histogram mutex.
Definition: OHLockedHist.h:39
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
WebdaqHistSvc::m_threadFast
std::thread m_threadFast
Definition: WebdaqHistSvc.h:153
python.LArCalib_HVCorrConfig.seconds
seconds
Definition: LArCalib_HVCorrConfig.py:98
python.Constants.WARNING
int WARNING
Definition: Control/AthenaCommon/python/Constants.py:16
PixelAthHitMonAlgCfg.duration
duration
Definition: PixelAthHitMonAlgCfg.py:152
WebdaqHistSvc::regHist_i
StatusCode regHist_i(std::unique_ptr< T > hist, const std::string &name, bool shared, THistID *&phid)
Definition: WebdaqHistSvc.cxx:155
beamspotman.dir
string dir
Definition: beamspotman.py:623
WebdaqHistSvc::monitoringTask
void monitoringTask(int, int, std::atomic< bool > &, boost::regex)
The actual publication Task.
Definition: WebdaqHistSvc.cxx:522
WebdaqHistSvc::m_PublicationIncludeNameRegex
boost::regex m_PublicationIncludeNameRegex
Definition: WebdaqHistSvc.h:212
WebdaqHistSvc::m_excludeName
Gaudi::Property< std::string > m_excludeName
Definition: WebdaqHistSvc.h:186
python.ExitCodes.what
def what(code)
Definition: ExitCodes.py:73
WebdaqHistSvc::m_excludeNameRegex
boost::regex m_excludeNameRegex
Definition: WebdaqHistSvc.h:210
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:239
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
fillHVMap_fromASCII.date
string date
Definition: fillHVMap_fromASCII.py:8
WebdaqHistSvc::m_excludeTypeRegex
boost::regex m_excludeTypeRegex
Definition: WebdaqHistSvc.h:208
AthenaInterprocess::UpdateAfterFork::type
static const std::string & type()
Incident type.
Definition: Incidents.h:49
WebdaqHistSvc::deReg
virtual StatusCode deReg(TObject *obj) override
Definition: WebdaqHistSvc.cxx:297
xAOD::JetAttributeAccessor::accessor
const AccessorWrapper< T > * accessor(xAOD::JetAttribute::AttributeID id)
Returns an attribute accessor corresponding to an AttributeID.
Definition: JetAccessorMap.h:26
WebdaqHistSvc::m_histoMapUpdated
std::atomic< bool > m_histoMapUpdated
Flag to indicate when the histogram map is updated.
Definition: WebdaqHistSvc.h:161
WebdaqHistSvc::m_hists
tbb::concurrent_hash_map< std::string, THistID > m_hists
Map of the registered histograms.
Definition: WebdaqHistSvc.h:169
WebdaqHistSvc::m_excludeType
Gaudi::Property< std::string > m_excludeType
Definition: WebdaqHistSvc.h:184
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
ref
const boost::regex ref(r_ef)
WebdaqHistSvc::m_histoMapUpdatedFast
std::atomic< bool > m_histoMapUpdatedFast
Flag to indicate when the histogram map is updated for the fast publication
Definition: WebdaqHistSvc.h:163
WebdaqHistSvc::m_intervalSecondsFast
Gaudi::Property< int > m_intervalSecondsFast
Definition: WebdaqHistSvc.h:194
DEBUG
#define DEBUG
Definition: page_access.h:11
WebdaqHistSvc::syncPublish
void syncPublish(long int, boost::posix_time::ptime)
Sync the publication to a multiple of the interval.
Definition: WebdaqHistSvc.cxx:650
WebdaqHistSvc::m_includeNameRegex
boost::regex m_includeNameRegex
Definition: WebdaqHistSvc.h:211
dqt_zlumi_alleff_HIST.tl
tl
Definition: dqt_zlumi_alleff_HIST.py:73
test_pyathena.counter
counter
Definition: test_pyathena.py:15
WebdaqHistSvc::m_numSlots
Gaudi::Property< int > m_numSlots
Definition: WebdaqHistSvc.h:191
python.PyAthena.obj
obj
Definition: PyAthena.py:132
WebdaqHistSvc::conditionedSleep
void conditionedSleep(std::chrono::milliseconds, const std::atomic< bool > &)
Sleep for a duration or until the stop flag is set.
Definition: WebdaqHistSvc.cxx:664
WebdaqHistSvc::m_numSlotsFast
Gaudi::Property< int > m_numSlotsFast
Definition: WebdaqHistSvc.h:192
WebdaqHistSvc::m_partition
std::string m_partition
The partition to publish to.
Definition: WebdaqHistSvc.h:155
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
WebdaqHistSvc::isObjectAllowed
bool isObjectAllowed(const std::string &path, const TObject *o) const
Does the histogram follow the naming rules ?
Definition: WebdaqHistSvc.cxx:359