ATLAS Offline Software
AthenaRootStreamer.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ATHENAPOOLSERVICES_ATHENAROOTSTREAMER_H
6 #define ATHENAPOOLSERVICES_ATHENAROOTSTREAMER_H
7 
14 #include "GaudiKernel/StatusCode.h"
15 
16 #include "TClassStreamer.h"
17 
18 #include <string>
19 #include <map>
20 #include <set>
21 #include <memory>
22 
23 class TFile;
24 class Service;
26 
32 class AthenaRootStreamer : public TClassStreamer
33 {
34 public:
40  AthenaRootStreamer(const std::string& class_name, ::Service* service=0);
41 
43  virtual ~AthenaRootStreamer();
44 
47  StatusCode AddConverter(std::unique_ptr<AthenaRootConverterHandle> converter);
48 
50  StatusCode Adopt();
51 
53  virtual void operator()(TBuffer& b, void* obj);
54 
55 protected:
56  static Version_t R__FindStreamerInfoVersion(const TClass* cl, UInt_t checksum);
57  void FindVersion(TBuffer* buf, UInt_t* startpos, UInt_t* bcnt);
58 
59 private:
60  std::string m_className;
61  TClass* m_class;
62  UInt_t m_streamerChecksum; // retrieved by FindVersion from the file
63  Version_t m_streamerVersion; // retrieved by FindVersion from the file
64  TFile* m_lastFile;
65 
66  typedef std::map<UInt_t, std::unique_ptr<AthenaRootConverterHandle> > ConverterMap;
67  ConverterMap m_converterMap; // set of converters for this class
68 
69  typedef std::set<UInt_t> ChecksumSet;
70  ChecksumSet m_seenChecksums; // unknown streamer checksums seen in files
71 
72  Service* m_service; //AthenaRootStreamerMgrSvc
73 };
74 
75 #endif
76 
77 
78 
79 
80 
81 
82 
AthenaRootStreamer::FindVersion
void FindVersion(TBuffer *buf, UInt_t *startpos, UInt_t *bcnt)
Definition: AthenaRootStreamer.cxx:82
AthenaRootStreamer::m_class
TClass * m_class
Definition: AthenaRootStreamer.h:61
AthenaRootStreamer::m_converterMap
ConverterMap m_converterMap
Definition: AthenaRootStreamer.h:67
AthenaRootStreamer::m_className
std::string m_className
Definition: AthenaRootStreamer.h:60
AthenaRootStreamer::m_service
Service * m_service
Definition: AthenaRootStreamer.h:72
AthenaRootStreamer::m_streamerVersion
Version_t m_streamerVersion
Definition: AthenaRootStreamer.h:63
AthenaRootStreamer::AddConverter
StatusCode AddConverter(std::unique_ptr< AthenaRootConverterHandle > converter)
Add a converter to this streamer.
Definition: AthenaRootStreamer.cxx:36
AthenaRootStreamer::m_lastFile
TFile * m_lastFile
Definition: AthenaRootStreamer.h:64
AthenaRootStreamer::m_seenChecksums
ChecksumSet m_seenChecksums
Definition: AthenaRootStreamer.h:70
AthenaRootStreamer::Adopt
StatusCode Adopt()
Adopt (enable) this ROOT custom streamer.
Definition: AthenaRootStreamer.cxx:45
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthenaRootStreamer
This class enhances ROOT custom streamer base TClassStreamer and can choose a converter function base...
Definition: AthenaRootStreamer.h:33
AthenaRootStreamer::m_streamerChecksum
UInt_t m_streamerChecksum
Definition: AthenaRootStreamer.h:62
AthenaRootStreamer::ConverterMap
std::map< UInt_t, std::unique_ptr< AthenaRootConverterHandle > > ConverterMap
Definition: AthenaRootStreamer.h:66
AthenaRootStreamer::AthenaRootStreamer
AthenaRootStreamer(const std::string &class_name, ::Service *service=0)
Constructor.
Definition: AthenaRootStreamer.cxx:21
AthenaRootStreamer::~AthenaRootStreamer
virtual ~AthenaRootStreamer()
Destructor.
Definition: AthenaRootStreamer.cxx:31
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
AthenaRootStreamer::R__FindStreamerInfoVersion
static Version_t R__FindStreamerInfoVersion(const TClass *cl, UInt_t checksum)
Definition: AthenaRootStreamer.cxx:163
AthenaRootStreamer::operator()
virtual void operator()(TBuffer &b, void *obj)
this operator is colled by ROOT to ready and write objects
Definition: AthenaRootStreamer.cxx:54
AthenaRootConverterHandle
Definition: AthenaRootConverterHandle.h:21
python.DetectStreamerInfoChanges.class_name
class_name
Definition: DetectStreamerInfoChanges.py:57
python.PyAthena.obj
obj
Definition: PyAthena.py:132
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:26
AthenaRootStreamer::ChecksumSet
std::set< UInt_t > ChecksumSet
Definition: AthenaRootStreamer.h:69