The Gaudi Framework  master (37c0b60a)
THistSvc.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 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 #ifndef GAUDISVC_THISTSVC_H
12 #define GAUDISVC_THISTSVC_H
13 
14 // system includes:
15 #include <map>
16 #include <set>
17 #include <string>
18 #include <vector>
19 
20 // Gaudi includes:
21 #include <GaudiKernel/IFileMgr.h>
25 #include <GaudiKernel/ITHistSvc.h>
26 #include <GaudiKernel/MsgStream.h>
27 #include <GaudiKernel/Service.h>
28 
29 //  ROOT includes:
30 #include <TEfficiency.h>
31 #include <TGraph.h>
32 #include <TH1.h>
33 #include <TH2.h>
34 #include <TH3.h>
35 #include <TList.h>
36 #include <TObject.h>
37 #include <TTree.h>
38 
39 class TClass;
40 
41 class THistSvc : public extends<Service, ITHistSvc, IIncidentListener, IIoComponent> {
42 public:
43  THistSvc( const std::string& name, ISvcLocator* svcloc );
44 
45  StatusCode initialize() override;
46  StatusCode reinitialize() override;
47  StatusCode finalize() override;
48 
49 public:
50  // Methods from ITHistSvc
53 
55  StatusCode regHist( const std::string& name ) override;
59  StatusCode regHist( const std::string& name, std::unique_ptr<TH1> hist ) override;
62  StatusCode regHist( const std::string& name, TH1* ) override;
63 
65  StatusCode getHist( const std::string& name, TH1*&, size_t index = 0 ) const override;
67  StatusCode getHist( const std::string& name, TH2*&, size_t index = 0 ) const override;
69  StatusCode getHist( const std::string& name, TH3*&, size_t index = 0 ) const override;
70 
72 
75 
77  StatusCode regTree( const std::string& name ) override;
82  StatusCode regTree( const std::string& name, TTree* ) override;
84  StatusCode getTree( const std::string& name, TTree*& ) const override;
85 
87 
90 
92  StatusCode regGraph( const std::string& name ) override;
97  virtual StatusCode regGraph( const std::string& name, TGraph* ) override;
99  StatusCode getGraph( const std::string& name, TGraph*& ) const override;
100 
102  StatusCode regEfficiency( const std::string& name ) override;
107  virtual StatusCode regEfficiency( const std::string& name, TEfficiency* ) override;
109  StatusCode getEfficiency( const std::string& name, TEfficiency*& ) const override;
110 
112 
115 
127  StatusCode getShared( const std::string& name, LockedHandle<TH1>& ) const override;
129  StatusCode getShared( const std::string& name, LockedHandle<TH2>& ) const override;
131  StatusCode getShared( const std::string& name, LockedHandle<TH3>& ) const override;
133  StatusCode getShared( const std::string& name, LockedHandle<TGraph>& ) const override;
136 
138 
141 
143  StatusCode deReg( const std::string& name ) override;
145  StatusCode deReg( TObject* obj ) override;
146 
148  StatusCode merge( const std::string& id ) override;
150  StatusCode merge( TObject* ) override;
151 
154  bool exists( const std::string& name ) const override;
156  bool existsHist( const std::string& name ) const override;
158  bool existsTree( const std::string& name ) const override;
160  bool existsGraph( const std::string& name ) const override;
162  bool existsEfficiency( const std::string& name ) const override;
163 
165 
168 
169  std::vector<std::string> getHists() const override;
170  std::vector<std::string> getTrees() const override;
171  std::vector<std::string> getGraphs() const override;
172  std::vector<std::string> getEfficiencies() const override;
173 
174  StatusCode getTHists( TDirectory* td, TList&, bool recurse = false ) const override;
175  StatusCode getTHists( const std::string& name, TList&, bool recurse = false ) const override;
176  StatusCode getTHists( TDirectory* td, TList& tl, bool recurse = false, bool reg = false ) override;
177  StatusCode getTHists( const std::string& name, TList& tl, bool recurse = false, bool reg = false ) override;
178 
179  StatusCode getTTrees( TDirectory* td, TList&, bool recurse = false ) const override;
180  StatusCode getTTrees( const std::string& name, TList&, bool recurse = false ) const override;
181  StatusCode getTTrees( TDirectory* td, TList& tl, bool recurse = false, bool reg = false ) override;
182  StatusCode getTTrees( const std::string& name, TList& tl, bool recurse = false, bool reg = false ) override;
183 
184  StatusCode getTEfficiencies( TDirectory* td, TList&, bool recurse = false ) const override;
185  StatusCode getTEfficiencies( const std::string& name, TList&, bool recurse = false ) const override;
186  StatusCode getTEfficiencies( TDirectory* td, TList& tl, bool recurse = false, bool reg = false ) override;
187  StatusCode getTEfficiencies( const std::string& name, TList& tl, bool recurse = false, bool reg = false ) override;
188 
190 
191 public:
192  // Methods from other interfaces
193  // From IIncidentListener
194  void handle( const Incident& ) override;
195 
196  // From IIoComponent
197  StatusCode io_reinit() override;
198 
199 private:
202 
205  public:
208 
209  private:
210  TDirectory* m_gDirectory;
211  TFile* m_gFile;
214  };
215 
218 
221 
223  static Mode charToMode( const char typ ) {
224  switch ( typ ) {
225  case 'O':
226  return READ;
227  case 'A':
228  return APPEND;
229  case 'R':
230  return UPDATE;
231  case 'S':
232  return SHARE;
233  default:
234  return INVALID;
235  }
236  }
237 
239  struct THistID {
241  TObject* obj{ nullptr };
242  TFile* file{ nullptr };
243  histMut_t* mutex{ nullptr };
246  bool temp{ true };
247  bool shared{ false };
248 
249  THistID() = default;
250  THistID( const THistID& rhs ) = default;
251  THistID& operator=( const THistID& rhs ) = default;
252  THistID( std::string& i, bool& t, TObject* o, TFile* f ) : id( i ), obj( o ), file( f ), temp( t ) {}
253  THistID( std::string& i, bool& t, TObject* o, TFile* f, Mode m )
254  : id( i ), obj( o ), file( f ), mode( m ), temp( t ) {}
255 
256  bool operator<( THistID const& rhs ) const { return ( obj < rhs.obj ); }
257 
258  friend std::ostream& operator<<( std::ostream& ost, const THistID& hid ) {
259  ost << "id: " << hid.id << " t: " << hid.temp << " s: " << hid.shared << " M: " << hid.mode << " m: " << hid.mutex
260  << " o: " << hid.obj << " T: " << static_cast<int>( hid.type ) << " " << hid.obj->IsA()->GetName();
261  return ost;
262  }
263  };
264 
267 
269 
273 
277 
278  // containers for fast lookups
279  // same uid for all elements in vec
281  // all THistIDs
283  // uid: /stream/name -> vhid
285  // name -> vhid
288 
292 
293  // Container holding all TObjects and vhid*s
295 
298  streamMap m_fileStreams; // fileName->streams
299 
300  // stream->filename of shared files
302 
304 
307 
308  template <typename T>
309  StatusCode regHist_i( std::unique_ptr<T> hist, const std::string& name, bool shared );
310  template <typename T>
311  StatusCode regHist_i( std::unique_ptr<T> hist, const std::string& name, bool shared, THistID*& hid );
312  template <typename T>
313  T* getHist_i( const std::string& name, const size_t& ind = 0, bool quiet = false ) const;
314  template <typename T>
315  T* readHist_i( const std::string& name ) const;
316 
317  template <typename T>
319  template <typename T>
321 
323 
326 
327  template <typename T>
328  T* readHist( const std::string& name ) const;
329  TTree* readTree( const std::string& name ) const;
330 
332  void updateFiles();
334  StatusCode connect( const std::string& );
335  TDirectory* changeDir( const THistSvc::THistID& hid ) const;
337  void removeDoubleSlash( std::string& ) const;
338 
339  void MergeRootFile( TDirectory*, TDirectory* );
340 
341  bool findStream( const std::string& name, std::string& root, std::string& rem, TFile*& file ) const;
342  void parseString( const std::string& id, std::string& root, std::string& rem ) const;
343 
345  void setupInputFile();
346 
348  void setupOutputFile();
349 
351  void copyFileLayout( TDirectory*, TDirectory* );
352 
353  size_t findHistID( const std::string& id, const THistID*& hid, const size_t& index = 0 ) const;
354 
355  void dump() const;
356 
358  StatusCode merge( const THistID& );
360  StatusCode merge( vhid_t* );
361 
364 
366 
369 
370  Gaudi::Property<int> m_autoSave{ this, "AutoSave", 0 };
371  Gaudi::Property<int> m_autoFlush{ this, "AutoFlush", 0 };
372  Gaudi::Property<bool> m_print{ this, "PrintAll", false };
373  Gaudi::Property<int> m_maxFileSize{ this, "MaxFileSize", 10240,
374  "maximum file size in MB. if exceeded,"
375  " will cause an abort. -1 to never check." };
376  Gaudi::Property<int> m_compressionLevel{ this, "CompressionLevel", 1, [this]( auto& ) {
377  this->warning()
378  << "\"CompressionLevel\" Property has been deprecated. "
379  << "Set it via the \"CL=\" parameter in the \"Output\" Property"
380  << endmsg;
381  } };
383  this, "Output", {}, &THistSvc::setupOutputFile, "", "OrderedSet<std::string>" };
385  this, "Input", {}, &THistSvc::setupInputFile, "", "OrderedSet<std::string>" };
386 
388 
391 
392  bool m_delayConnect = false;
393  bool m_okToConnect = false;
394  bool m_hasTTrees = false;
395 
397 
399 };
400 
401 // Include template implementation
402 #include "THistSvc.icc"
403 
404 #endif // GAUDISVC_THISTSVC_H
THistSvc::THistID::id
std::string id
Definition: THistSvc.h:240
THistSvc::readHist_i
T * readHist_i(const std::string &name) const
Definition: THistSvc.icc:231
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:371
IIoComponent.h
THistSvc::regShared_i
LockedHandle< T > regShared_i(const std::string &id, std::unique_ptr< T > hist)
Definition: THistSvc.icc:285
THistSvc::INVALID
@ INVALID
Definition: THistSvc.h:217
THistSvc::UPDATE
@ UPDATE
Definition: THistSvc.h:217
std::string
STL class.
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:392
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:201
THistSvc
Definition: THistSvc.h:41
std::list< vhid_t * >
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:213
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:396
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
std::vector< std::string >
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:46
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
std::recursive_mutex
STL class.
std::lock_guard
STL class.
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:289
THistSvc::m_autoSave
Gaudi::Property< int > m_autoSave
Definition: THistSvc.h:370
IFileMgr.h
THistSvc::THistID::THistID
THistID(std::string &i, bool &t, TObject *o, TFile *f)
Definition: THistSvc.h:252
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:253
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:384
THistSvc::readHist
T * readHist(const std::string &name) const
Definition: THistSvc.cpp:1451
THistSvc::rootOpenAction
StatusCode rootOpenAction(FILEMGR_CALLBACK_ARGS)
Definition: THistSvc.cpp:2068
std::unordered_multimap< std::string, vhid_t * >
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:372
THistSvc::objMap_t
std::unordered_map< TObject *, std::pair< vhid_t *, size_t > > objMap_t
Definition: THistSvc.h:287
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:280
THistSvc::getHists
std::vector< std::string > getHists() const override
Definition: THistSvc.cpp:681
THistSvc::GlobalDirectoryRestore::m_gFile
TFile * m_gFile
Definition: THistSvc.h:211
bug_34121.t
t
Definition: bug_34121.py:31
THistSvc::getShared_i
LockedHandle< T > getShared_i(const std::string &name) const
Definition: THistSvc.icc:319
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:332
StatusCode
Definition: StatusCode.h:65
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:268
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:217
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:108
std::ostream
STL class.
THistSvc::m_maxFileSize
Gaudi::Property< int > m_maxFileSize
Definition: THistSvc.h:373
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:246
THistSvc::THistSvcMutex_t
std::recursive_mutex THistSvcMutex_t
Definition: THistSvc.h:200
THistSvc::Mode
Mode
Enumerating all possible file access modes.
Definition: THistSvc.h:217
THistSvc::m_tobjs
objMap_t m_tobjs
Definition: THistSvc.h:294
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:223
THistSvc::m_outputfile
Gaudi::Property< std::vector< std::string > > m_outputfile
Definition: THistSvc.h:382
THistSvc::THistID::file
TFile * file
Definition: THistSvc.h:242
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:286
THistSvc::ObjectType::TTREE
@ TTREE
THistSvc::m_Wstream
std::vector< std::string > m_Wstream
Definition: THistSvc.h:268
THistSvc.icc
THistSvc::APPEND
@ APPEND
Definition: THistSvc.h:217
THistSvc::m_ids
idMap_t m_ids
Definition: THistSvc.h:291
THistSvc::m_okToConnect
bool m_okToConnect
Definition: THistSvc.h:393
THistSvc::streamMap
std::multimap< std::string, std::string > streamMap
Definition: THistSvc.h:297
THistSvc::THistID::operator<<
friend std::ostream & operator<<(std::ostream &ost, const THistID &hid)
Definition: THistSvc.h:258
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:202
THistSvc::THistID::obj
TObject * obj
Definition: THistSvc.h:241
std::map
STL class.
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:20
THistSvc::ObjectType
ObjectType
Possible TObject types.
Definition: THistSvc.h:220
THistSvc::THistID::mutex
histMut_t * mutex
Definition: THistSvc.h:243
THistSvc::GlobalDirectoryRestore
Helper class that manages ROOts global directory and file.
Definition: THistSvc.h:204
THistSvc::GlobalDirectoryRestore::~GlobalDirectoryRestore
~GlobalDirectoryRestore()
Definition: THistSvc.cpp:1442
THistSvc::READ
@ READ
Definition: THistSvc.h:217
THistSvc::getHist_i
T * getHist_i(const std::string &name, const size_t &ind=0, bool quiet=false) const
Definition: THistSvc.icc:189
THistSvc::m_compressionLevel
Gaudi::Property< int > m_compressionLevel
Definition: THistSvc.h:376
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:276
Service.h
ITHistSvc.h
THistSvc::p_incSvc
ServiceHandle< IIncidentSvc > p_incSvc
Definition: THistSvc.h:389
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:27
THistSvc::WRITE
@ WRITE
Definition: THistSvc.h:217
THistSvc::m_files
std::map< std::string, std::pair< TFile *, Mode > > m_files
Definition: THistSvc.h:296
THistSvc::p_fileMgr
ServiceHandle< IFileMgr > p_fileMgr
Definition: THistSvc.h:390
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:287
THistSvc::THistID::operator<
bool operator<(THistID const &rhs) const
Definition: THistSvc.h:256
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:244
THistSvc::hlist_t
std::list< vhid_t * > hlist_t
Definition: THistSvc.h:282
THistSvc::m_hasTTrees
bool m_hasTTrees
Definition: THistSvc.h:394
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
std::multimap< std::string, std::string >
THistSvc::GlobalDirectoryRestore::m_gErrorIgnoreLevel
int m_gErrorIgnoreLevel
Definition: THistSvc.h:212
THistSvc::GlobalDirectoryRestore::m_gDirectory
TDirectory * m_gDirectory
Definition: THistSvc.h:210
THistSvc::ObjectType::UNKNOWN
@ UNKNOWN
std::mutex
STL class.
THistSvc::m_uids
uidMap_t m_uids
Definition: THistSvc.h:290
THistSvc::m_alreadyConnectedInFiles
std::set< std::string > m_alreadyConnectedInFiles
list of already connected files.
Definition: THistSvc.h:272
THistSvc::updateFiles
void updateFiles()
Handle case where TTree grows beyond TTree::fgMaxTreeSize.
Definition: THistSvc.cpp:1457
LockedHandle
Definition: LockedHandle.h:38
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:398
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:298
Incident
Definition: Incident.h:27
std::unique_ptr
STL class.
THistSvc::THistID::type
ObjectType type
Definition: THistSvc.h:245
std::unordered_map< std::string, vhid_t * >
THistSvc::THistID::shared
bool shared
Definition: THistSvc.h:247
THistSvc::regGraph
StatusCode regGraph(const std::string &name) override
Register a new TGraph with a given name.
Definition: THistSvc.cpp:406
std::set< std::string >
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:239
Gaudi::Property< int >
THistSvc::uidMap_t
std::unordered_map< std::string, vhid_t * > uidMap_t
Definition: THistSvc.h:284
THistSvc::THistID::THistID
THistID()=default
THistSvc::m_sharedFiles
std::map< std::string, std::string > m_sharedFiles
Definition: THistSvc.h:301
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