The Gaudi Framework  master (d98a2936)
THistSvc.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #pragma once
12 
13 // system includes:
14 #include <map>
15 #include <set>
16 #include <string>
17 #include <vector>
18 
19 // Gaudi includes:
20 #include <GaudiKernel/IFileMgr.h>
24 #include <GaudiKernel/ITHistSvc.h>
25 #include <GaudiKernel/MsgStream.h>
26 #include <GaudiKernel/Service.h>
27 
28 //  ROOT includes:
29 #include <TEfficiency.h>
30 #include <TGraph.h>
31 #include <TH1.h>
32 #include <TH2.h>
33 #include <TH3.h>
34 #include <TList.h>
35 #include <TObject.h>
36 #include <TTree.h>
37 
38 class TClass;
39 
40 class THistSvc : public extends<Service, ITHistSvc, IIncidentListener, IIoComponent> {
41 public:
42  THistSvc( const std::string& name, ISvcLocator* svcloc );
43 
44  StatusCode initialize() override;
45  StatusCode reinitialize() override;
46  StatusCode finalize() override;
47 
48 public:
49  // Methods from ITHistSvc
52 
54  StatusCode regHist( const std::string& name ) override;
58  StatusCode regHist( const std::string& name, std::unique_ptr<TH1> hist ) override;
61  StatusCode regHist( const std::string& name, TH1* ) override;
62 
64  StatusCode getHist( const std::string& name, TH1*&, size_t index = 0 ) const override;
66  StatusCode getHist( const std::string& name, TH2*&, size_t index = 0 ) const override;
68  StatusCode getHist( const std::string& name, TH3*&, size_t index = 0 ) const override;
69 
71 
74 
76  StatusCode regTree( const std::string& name ) override;
78  StatusCode regTree( const std::string& name, std::unique_ptr<TTree> ) override;
81  StatusCode regTree( const std::string& name, TTree* ) override;
83  StatusCode getTree( const std::string& name, TTree*& ) const override;
84 
86 
89 
91  StatusCode regGraph( const std::string& name ) override;
93  StatusCode regGraph( const std::string& name, std::unique_ptr<TGraph> ) override;
96  virtual StatusCode regGraph( const std::string& name, TGraph* ) override;
98  StatusCode getGraph( const std::string& name, TGraph*& ) const override;
99 
101  StatusCode regEfficiency( const std::string& name ) override;
103  StatusCode regEfficiency( const std::string& name, std::unique_ptr<TEfficiency> ) override;
106  virtual StatusCode regEfficiency( const std::string& name, TEfficiency* ) override;
108  StatusCode getEfficiency( const std::string& name, TEfficiency*& ) const override;
109 
111 
114 
116  StatusCode regShared( const std::string& name, std::unique_ptr<TH1>, LockedHandle<TH1>& ) override;
118  StatusCode regShared( const std::string& name, std::unique_ptr<TH2>, LockedHandle<TH2>& ) override;
120  StatusCode regShared( const std::string& name, std::unique_ptr<TH3>, LockedHandle<TH3>& ) override;
122  StatusCode regShared( const std::string& name, std::unique_ptr<TGraph>, LockedHandle<TGraph>& ) override;
124  StatusCode regShared( const std::string& name, std::unique_ptr<TEfficiency>, LockedHandle<TEfficiency>& ) override;
126  StatusCode getShared( const std::string& name, LockedHandle<TH1>& ) const override;
128  StatusCode getShared( const std::string& name, LockedHandle<TH2>& ) const override;
130  StatusCode getShared( const std::string& name, LockedHandle<TH3>& ) const override;
132  StatusCode getShared( const std::string& name, LockedHandle<TGraph>& ) const override;
134  StatusCode getShared( const std::string& name, LockedHandle<TEfficiency>& ) const override;
135 
137 
140 
142  StatusCode deReg( const std::string& name ) override;
144  StatusCode deReg( TObject* obj ) override;
145 
147  StatusCode merge( const std::string& id ) override;
149  StatusCode merge( TObject* ) override;
150 
153  bool exists( const std::string& name ) const override;
155  bool existsHist( const std::string& name ) const override;
157  bool existsTree( const std::string& name ) const override;
159  bool existsGraph( const std::string& name ) const override;
161  bool existsEfficiency( const std::string& name ) const override;
162 
164 
167 
168  std::vector<std::string> getHists() const override;
169  std::vector<std::string> getTrees() const override;
170  std::vector<std::string> getGraphs() const override;
171  std::vector<std::string> getEfficiencies() const override;
172 
173  StatusCode getTHists( TDirectory* td, TList&, bool recurse = false ) const override;
174  StatusCode getTHists( const std::string& name, TList&, bool recurse = false ) const override;
175  StatusCode getTHists( TDirectory* td, TList& tl, bool recurse = false, bool reg = false ) override;
176  StatusCode getTHists( const std::string& name, TList& tl, bool recurse = false, bool reg = false ) override;
177 
178  StatusCode getTTrees( TDirectory* td, TList&, bool recurse = false ) const override;
179  StatusCode getTTrees( const std::string& name, TList&, bool recurse = false ) const override;
180  StatusCode getTTrees( TDirectory* td, TList& tl, bool recurse = false, bool reg = false ) override;
181  StatusCode getTTrees( const std::string& name, TList& tl, bool recurse = false, bool reg = false ) override;
182 
183  StatusCode getTEfficiencies( TDirectory* td, TList&, bool recurse = false ) const override;
184  StatusCode getTEfficiencies( const std::string& name, TList&, bool recurse = false ) const override;
185  StatusCode getTEfficiencies( TDirectory* td, TList& tl, bool recurse = false, bool reg = false ) override;
186  StatusCode getTEfficiencies( const std::string& name, TList& tl, bool recurse = false, bool reg = false ) override;
187 
189 
190 public:
191  // Methods from other interfaces
192  // From IIncidentListener
193  void handle( const Incident& ) override;
194 
195  // From IIoComponent
196  StatusCode io_reinit() override;
197 
198 private:
199  typedef std::recursive_mutex THistSvcMutex_t;
200  typedef std::mutex histMut_t;
201 
204  public:
207 
208  private:
209  TDirectory* m_gDirectory;
210  TFile* m_gFile;
212  std::lock_guard<THistSvcMutex_t> m_lock;
213  };
214 
217 
220 
222  static Mode charToMode( const char typ ) {
223  switch ( typ ) {
224  case 'O':
225  return READ;
226  case 'A':
227  return APPEND;
228  case 'R':
229  return UPDATE;
230  case 'S':
231  return SHARE;
232  default:
233  return INVALID;
234  }
235  }
236 
238  struct THistID {
239  std::string id{};
240  TObject* obj{ nullptr };
241  TFile* file{ nullptr };
242  histMut_t* mutex{ nullptr };
245  bool temp{ true };
246  bool shared{ false };
247 
248  THistID() = default;
249  THistID( const THistID& rhs ) = default;
250  THistID& operator=( const THistID& rhs ) = default;
251  THistID( std::string& i, bool& t, TObject* o, TFile* f ) : id( i ), obj( o ), file( f ), temp( t ) {}
252  THistID( std::string& i, bool& t, TObject* o, TFile* f, Mode m )
253  : id( i ), obj( o ), file( f ), mode( m ), temp( t ) {}
254 
255  bool operator<( THistID const& rhs ) const { return ( obj < rhs.obj ); }
256 
257  friend std::ostream& operator<<( std::ostream& ost, const THistID& hid ) {
258  ost << "id: " << hid.id << " t: " << hid.temp << " s: " << hid.shared << " M: " << hid.mode << " m: " << hid.mutex
259  << " o: " << hid.obj << " T: " << static_cast<int>( hid.type ) << " " << hid.obj->IsA()->GetName();
260  return ost;
261  }
262  };
263 
266 
267  std::vector<std::string> m_Rstream, m_Wstream;
268 
271  std::set<std::string> m_alreadyConnectedInFiles;
272 
275  std::set<std::string> m_alreadyConnectedOutFiles;
276 
277  // containers for fast lookups
278  // same uid for all elements in vec
279  typedef std::vector<THistID> vhid_t;
280  // all THistIDs
281  typedef std::list<vhid_t*> hlist_t;
282  // uid: /stream/name -> vhid
283  typedef std::unordered_map<std::string, vhid_t*> uidMap_t;
284  // name -> vhid
285  typedef std::unordered_multimap<std::string, vhid_t*> idMap_t;
286  typedef std::unordered_map<TObject*, std::pair<vhid_t*, size_t>> objMap_t;
287 
291 
292  // Container holding all TObjects and vhid*s
294 
295  std::map<std::string, std::pair<TFile*, Mode>> m_files; // stream->file
296  typedef std::multimap<std::string, std::string> streamMap;
297  streamMap m_fileStreams; // fileName->streams
298 
299  // stream->filename of shared files
300  std::map<std::string, std::string> m_sharedFiles;
301 
303 
306 
307  template <typename T>
308  StatusCode regHist_i( std::unique_ptr<T> hist, const std::string& name, bool shared );
309  template <typename T>
310  StatusCode regHist_i( std::unique_ptr<T> hist, const std::string& name, bool shared, THistID*& hid );
311  template <typename T>
312  T* getHist_i( const std::string& name, const size_t& ind = 0, bool quiet = false ) const;
313  template <typename T>
314  T* readHist_i( const std::string& name ) const;
315 
316  template <typename T>
317  LockedHandle<T> regShared_i( const std::string& id, std::unique_ptr<T> hist );
318  template <typename T>
319  LockedHandle<T> getShared_i( const std::string& name ) const;
320 
322 
325 
326  template <typename T>
327  T* readHist( const std::string& name ) const;
328  TTree* readTree( const std::string& name ) const;
329 
331  void updateFiles();
333  StatusCode connect( const std::string& );
334  TDirectory* changeDir( const THistSvc::THistID& hid ) const;
335  std::string stripDirectoryName( std::string& dir ) const;
336  void removeDoubleSlash( std::string& ) const;
337 
338  void MergeRootFile( TDirectory*, TDirectory* );
339 
340  bool findStream( const std::string& name, std::string& root, std::string& rem, TFile*& file ) const;
341  void parseString( const std::string& id, std::string& root, std::string& rem ) const;
342 
344  void setupInputFile();
345 
347  void setupOutputFile();
348 
350  void copyFileLayout( TDirectory*, TDirectory* );
351 
352  size_t findHistID( const std::string& id, const THistID*& hid, const size_t& index = 0 ) const;
353 
354  void dump() const;
355 
357  StatusCode merge( const THistID& );
359  StatusCode merge( vhid_t* );
360 
363 
365 
368 
369  Gaudi::Property<int> m_autoSave{ this, "AutoSave", 0 };
370  Gaudi::Property<int> m_autoFlush{ this, "AutoFlush", 0 };
371  Gaudi::Property<bool> m_print{ this, "PrintAll", false };
372  Gaudi::Property<int> m_maxFileSize{ this, "MaxFileSize", 10240,
373  "maximum file size in MB. if exceeded,"
374  " will cause an abort. -1 to never check." };
375  Gaudi::Property<int> m_compressionLevel{ this, "CompressionLevel", 1, [this]( auto& ) {
376  this->warning()
377  << "\"CompressionLevel\" Property has been deprecated. "
378  << "Set it via the \"CL=\" parameter in the \"Output\" Property"
379  << endmsg;
380  } };
382  this, "Output", {}, &THistSvc::setupOutputFile, "", "OrderedSet<std::string>" };
384  this, "Input", {}, &THistSvc::setupInputFile, "", "OrderedSet<std::string>" };
385 
387 
390 
391  bool m_delayConnect = false;
392  bool m_okToConnect = false;
393  bool m_hasTTrees = false;
394 
395  mutable std::string m_curstream;
396 
398 };
399 
400 // Include template implementation
401 #include "THistSvc.icc"
THistSvc::THistID::id
std::string id
Definition: THistSvc.h:239
THistSvc::readHist_i
T * readHist_i(const std::string &name) const
Definition: THistSvc.icc:225
THistSvc::getEfficiency
StatusCode getEfficiency(const std::string &name, TEfficiency *&) const override
Return TEfficiency with given name.
Definition: THistSvc.cpp:461
THistSvc::m_autoFlush
Gaudi::Property< int > m_autoFlush
Definition: THistSvc.h:370
IIoComponent.h
THistSvc::regShared_i
LockedHandle< T > regShared_i(const std::string &id, std::unique_ptr< T > hist)
Definition: THistSvc.icc:279
THistSvc::INVALID
@ INVALID
Definition: THistSvc.h:216
THistSvc::UPDATE
@ UPDATE
Definition: THistSvc.h:216
THistSvc::merge
StatusCode merge(const std::string &id) override
Merge all clones for object with a given id.
Definition: THistSvc.cpp:647
THistSvc::m_delayConnect
bool m_delayConnect
Definition: THistSvc.h:391
THistSvc::getEfficiencies
std::vector< std::string > getEfficiencies() const override
Definition: THistSvc.cpp:705
THistSvc::regShared
StatusCode regShared(const std::string &name, std::unique_ptr< TH1 >, LockedHandle< TH1 > &) override
Register shared object of type TH1 and return LockedHandle for that object.
Definition: THistSvc.cpp:470
THistSvc::histMut_t
std::mutex histMut_t
Definition: THistSvc.h:200
THistSvc
Definition: THistSvc.h:40
THistSvc::getTrees
std::vector< std::string > getTrees() const override
Definition: THistSvc.cpp:689
THistSvc::GlobalDirectoryRestore::m_lock
std::lock_guard< THistSvcMutex_t > m_lock
Definition: THistSvc.h:212
THistSvc::copyFileLayout
void copyFileLayout(TDirectory *, TDirectory *)
helper function to recursively copy the layout of a TFile into a new TFile
Definition: THistSvc.cpp:1911
ServiceHandle< IIncidentSvc >
THistSvc::m_curstream
std::string m_curstream
Definition: THistSvc.h:395
THistSvc::getTEfficiencies
StatusCode getTEfficiencies(TDirectory *td, TList &, bool recurse=false) const override
Definition: THistSvc.cpp:1093
THistSvc::getTTrees
StatusCode getTTrees(TDirectory *td, TList &, bool recurse=false) const override
Definition: THistSvc.cpp:912
THistSvc::GlobalDirectoryRestore::GlobalDirectoryRestore
GlobalDirectoryRestore(THistSvcMutex_t &mut)
Definition: THistSvc.cpp:1436
THistSvc::writeObjectsToFile
StatusCode writeObjectsToFile()
Definition: THistSvc.cpp:1527
THistSvc::existsEfficiency
bool existsEfficiency(const std::string &name) const override
Check if TEfficiency with given name is managed by THistSvcMT.
Definition: THistSvc.cpp:671
ISvcLocator
Definition: ISvcLocator.h:42
THistSvc::getGraph
StatusCode getGraph(const std::string &name, TGraph *&) const override
Return TGraph with given name.
Definition: THistSvc.cpp:438
THistSvc::existsGraph
bool existsGraph(const std::string &name) const override
Check if graph with given name is managed by THistSvcMT.
Definition: THistSvc.cpp:675
THistSvc::initialize
StatusCode initialize() override
Definition: THistSvc.cpp:82
THistSvc::deReg
StatusCode deReg(const std::string &name) override
Deregister object with given name and give up ownership (without deletion!)
Definition: THistSvc.cpp:561
gaudiComponentHelp.root
root
Definition: gaudiComponentHelp.py:42
THistSvc::setupInputFile
void setupInputFile()
call-back method to handle input stream property
Definition: THistSvc.cpp:1867
THistSvc::m_hlist
hlist_t m_hlist
Definition: THistSvc.h:288
THistSvc::m_autoSave
Gaudi::Property< int > m_autoSave
Definition: THistSvc.h:369
IFileMgr.h
THistSvc::THistID::THistID
THistID(std::string &i, bool &t, TObject *o, TFile *f)
Definition: THistSvc.h:251
THistSvc::getTHists
StatusCode getTHists(TDirectory *td, TList &, bool recurse=false) const override
Definition: THistSvc.cpp:713
THistSvc::THistID::THistID
THistID(std::string &i, bool &t, TObject *o, TFile *f, Mode m)
Definition: THistSvc.h:252
THistSvc::getShared
StatusCode getShared(const std::string &name, LockedHandle< TH1 > &) const override
Retrieve shared object with given name as TH1 through LockedHandle.
Definition: THistSvc.cpp:516
THistSvc::m_inputfile
Gaudi::Property< std::vector< std::string > > m_inputfile
Definition: THistSvc.h:383
THistSvc::readHist
T * readHist(const std::string &name) const
Definition: THistSvc.cpp:1451
THistSvc::rootOpenAction
StatusCode rootOpenAction(FILEMGR_CALLBACK_ARGS)
Definition: THistSvc.cpp:2068
THistSvc::setupOutputFile
void setupOutputFile()
call-back method to handle output stream property
Definition: THistSvc.cpp:1891
THistSvc::m_print
Gaudi::Property< bool > m_print
Definition: THistSvc.h:371
THistSvc::objMap_t
std::unordered_map< TObject *, std::pair< vhid_t *, size_t > > objMap_t
Definition: THistSvc.h:286
THistSvc::stripDirectoryName
std::string stripDirectoryName(std::string &dir) const
Definition: THistSvc.cpp:1750
IIncidentSvc.h
THistSvc::vhid_t
std::vector< THistID > vhid_t
Definition: THistSvc.h:279
THistSvc::getHists
std::vector< std::string > getHists() const override
Definition: THistSvc.cpp:681
THistSvc::GlobalDirectoryRestore::m_gFile
TFile * m_gFile
Definition: THistSvc.h:210
bug_34121.t
t
Definition: bug_34121.py:31
THistSvc::getShared_i
LockedHandle< T > getShared_i(const std::string &name) const
Definition: THistSvc.icc:313
THistSvc::ObjectType::TEFFICIENCY
@ TEFFICIENCY
THistSvc::THistSvc
THistSvc(const std::string &name, ISvcLocator *svcloc)
Definition: THistSvc.cpp:79
THistSvc::rootOpenErrAction
StatusCode rootOpenErrAction(FILEMGR_CALLBACK_ARGS)
Definition: THistSvc.cpp:2090
Service::name
const std::string & name() const override
Retrieve name of the service
Definition: Service.cpp:333
StatusCode
Definition: StatusCode.h:64
THistSvc::parseString
void parseString(const std::string &id, std::string &root, std::string &rem) const
Definition: THistSvc.cpp:1853
THistSvc::m_Rstream
std::vector< std::string > m_Rstream
Definition: THistSvc.h:267
THistSvc::THistID::operator=
THistID & operator=(const THistID &rhs)=default
THistSvc::existsTree
bool existsTree(const std::string &name) const override
Check if tree with given name is managed by THistSvcMT.
Definition: THistSvc.cpp:679
THistSvc::SHARE
@ SHARE
Definition: THistSvc.h:216
THistSvc::handle
void handle(const Incident &) override
Definition: THistSvc.cpp:1296
THistSvc::finalize
StatusCode finalize() override
Definition: THistSvc.cpp:193
Gaudi::Units::m
constexpr double m
Definition: SystemOfUnits.h:107
THistSvc::m_maxFileSize
Gaudi::Property< int > m_maxFileSize
Definition: THistSvc.h:372
THistSvc::findStream
bool findStream(const std::string &name, std::string &root, std::string &rem, TFile *&file) const
Definition: THistSvc.cpp:1817
THistSvc::THistID::temp
bool temp
Definition: THistSvc.h:245
THistSvc::THistSvcMutex_t
std::recursive_mutex THistSvcMutex_t
Definition: THistSvc.h:199
THistSvc::Mode
Mode
Enumerating all possible file access modes.
Definition: THistSvc.h:216
THistSvc::m_tobjs
objMap_t m_tobjs
Definition: THistSvc.h:293
THistSvc::getHist
StatusCode getHist(const std::string &name, TH1 *&, size_t index=0) const override
Return histogram with given name as TH1*, THistSvcMT still owns object.
Definition: THistSvc.cpp:344
THistSvc::charToMode
static Mode charToMode(const char typ)
Convert a char to a Mode enum.
Definition: THistSvc.h:222
THistSvc::m_outputfile
Gaudi::Property< std::vector< std::string > > m_outputfile
Definition: THistSvc.h:381
THistSvc::THistID::file
TFile * file
Definition: THistSvc.h:241
THistSvc::regEfficiency
StatusCode regEfficiency(const std::string &name) override
Register a new TEfficiency with a given name.
Definition: THistSvc.cpp:447
THistSvc::changeDir
TDirectory * changeDir(const THistSvc::THistID &hid) const
Definition: THistSvc.cpp:1728
THistSvc::idMap_t
std::unordered_multimap< std::string, vhid_t * > idMap_t
Definition: THistSvc.h:285
THistSvc::ObjectType::TTREE
@ TTREE
THistSvc::m_Wstream
std::vector< std::string > m_Wstream
Definition: THistSvc.h:267
THistSvc.icc
THistSvc::APPEND
@ APPEND
Definition: THistSvc.h:216
THistSvc::m_ids
idMap_t m_ids
Definition: THistSvc.h:290
THistSvc::m_okToConnect
bool m_okToConnect
Definition: THistSvc.h:392
THistSvc::streamMap
std::multimap< std::string, std::string > streamMap
Definition: THistSvc.h:296
THistSvc::THistID::operator<<
friend std::ostream & operator<<(std::ostream &ost, const THistID &hid)
Definition: THistSvc.h:257
THistSvc::regHist
StatusCode regHist(const std::string &name) override
Register a new ROOT histogram TH*X with a name.
Definition: THistSvc.cpp:330
THistSvc::removeDoubleSlash
void removeDoubleSlash(std::string &) const
Definition: THistSvc.cpp:1766
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:198
THistSvc::THistID::obj
TObject * obj
Definition: THistSvc.h:240
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:19
THistSvc::ObjectType
ObjectType
Possible TObject types.
Definition: THistSvc.h:219
THistSvc::THistID::mutex
histMut_t * mutex
Definition: THistSvc.h:242
THistSvc::GlobalDirectoryRestore
Helper class that manages ROOts global directory and file.
Definition: THistSvc.h:203
THistSvc::GlobalDirectoryRestore::~GlobalDirectoryRestore
~GlobalDirectoryRestore()
Definition: THistSvc.cpp:1442
THistSvc::READ
@ READ
Definition: THistSvc.h:216
THistSvc::getHist_i
T * getHist_i(const std::string &name, const size_t &ind=0, bool quiet=false) const
Definition: THistSvc.icc:183
THistSvc::m_compressionLevel
Gaudi::Property< int > m_compressionLevel
Definition: THistSvc.h:375
THistSvc::reinitialize
StatusCode reinitialize() override
Definition: THistSvc.cpp:187
THistSvc::getTree
StatusCode getTree(const std::string &name, TTree *&) const override
Return TTree with given name.
Definition: THistSvc.cpp:397
THistSvc::m_alreadyConnectedOutFiles
std::set< std::string > m_alreadyConnectedOutFiles
list of already connected files.
Definition: THistSvc.h:275
Service.h
ITHistSvc.h
THistSvc::p_incSvc
ServiceHandle< IIncidentSvc > p_incSvc
Definition: THistSvc.h:388
THistSvc::regTree
StatusCode regTree(const std::string &name) override
Register a new TTree with a given name.
Definition: THistSvc.cpp:371
THistSvc::regHist_i
StatusCode regHist_i(std::unique_ptr< T > hist, const std::string &name, bool shared)
Definition: THistSvc.icc:21
THistSvc::WRITE
@ WRITE
Definition: THistSvc.h:216
THistSvc::m_files
std::map< std::string, std::pair< TFile *, Mode > > m_files
Definition: THistSvc.h:295
THistSvc::p_fileMgr
ServiceHandle< IFileMgr > p_fileMgr
Definition: THistSvc.h:389
THistSvc::connect
StatusCode connect(const std::string &)
Definition: THistSvc.cpp:1552
IIncidentListener.h
THistSvc::existsHist
bool existsHist(const std::string &name) const override
Check if histogram with given name is managed by THistSvcMT.
Definition: THistSvc.cpp:669
FILEMGR_CALLBACK_ARGS
#define FILEMGR_CALLBACK_ARGS
Definition: IFileMgr.h:272
THistSvc::THistID::operator<
bool operator<(THistID const &rhs) const
Definition: THistSvc.h:255
THistSvc::exists
bool exists(const std::string &name) const override
Check if object with given name is managed by THistSvcMT exists calls existsHist and only works for T...
Definition: THistSvc.cpp:667
THistSvc::THistID::mode
Mode mode
Definition: THistSvc.h:243
THistSvc::hlist_t
std::list< vhid_t * > hlist_t
Definition: THistSvc.h:281
THistSvc::m_hasTTrees
bool m_hasTTrees
Definition: THistSvc.h:393
THistSvc::readTree
TTree * readTree(const std::string &name) const
Definition: THistSvc.cpp:1455
THistSvc::ObjectType::TGRAPH
@ TGRAPH
THistSvc::THistID::THistID
THistID(const THistID &rhs)=default
THistSvc::GlobalDirectoryRestore::m_gErrorIgnoreLevel
int m_gErrorIgnoreLevel
Definition: THistSvc.h:211
THistSvc::GlobalDirectoryRestore::m_gDirectory
TDirectory * m_gDirectory
Definition: THistSvc.h:209
THistSvc::ObjectType::UNKNOWN
@ UNKNOWN
THistSvc::m_uids
uidMap_t m_uids
Definition: THistSvc.h:289
THistSvc::m_alreadyConnectedInFiles
std::set< std::string > m_alreadyConnectedInFiles
list of already connected files.
Definition: THistSvc.h:271
THistSvc::updateFiles
void updateFiles()
Handle case where TTree grows beyond TTree::fgMaxTreeSize.
Definition: THistSvc.cpp:1457
LockedHandle
Definition: LockedHandle.h:36
THistSvc::io_reinit
StatusCode io_reinit() override
callback method to reinitialize the internal state of the component for I/O purposes (e....
Definition: THistSvc.cpp:1334
THistSvc::m_svcMut
THistSvcMutex_t m_svcMut
Definition: THistSvc.h:397
THistSvc::findHistID
size_t findHistID(const std::string &id, const THistID *&hid, const size_t &index=0) const
Definition: THistSvc.cpp:1943
THistSvc::ObjectType::TH1
@ TH1
THistSvc::m_fileStreams
streamMap m_fileStreams
Definition: THistSvc.h:297
Incident
Definition: Incident.h:24
THistSvc::THistID::type
ObjectType type
Definition: THistSvc.h:244
THistSvc::THistID::shared
bool shared
Definition: THistSvc.h:246
THistSvc::regGraph
StatusCode regGraph(const std::string &name) override
Register a new TGraph with a given name.
Definition: THistSvc.cpp:406
THistSvc::getGraphs
std::vector< std::string > getGraphs() const override
Definition: THistSvc.cpp:697
THistSvc::THistID
Helper struct that bundles the histogram ID with a mutex, TFile and TObject*.
Definition: THistSvc.h:238
Gaudi::Property< int >
THistSvc::uidMap_t
std::unordered_map< std::string, vhid_t * > uidMap_t
Definition: THistSvc.h:283
THistSvc::THistID::THistID
THistID()=default
THistSvc::m_sharedFiles
std::map< std::string, std::string > m_sharedFiles
Definition: THistSvc.h:300
MsgStream.h
THistSvc::dump
void dump() const
Definition: THistSvc.cpp:1988
Gaudi::ParticleProperties::index
size_t index(const Gaudi::ParticleProperty *property, const Gaudi::Interfaces::IParticlePropertySvc *service)
helper utility for mapping of Gaudi::ParticleProperty object into non-negative integral sequential id...
Definition: IParticlePropertySvc.cpp:39
THistSvc::MergeRootFile
void MergeRootFile(TDirectory *, TDirectory *)
Definition: THistSvc.cpp:1770