27{
28 void SampleHist ::
29 testInvariant () const
30 {
32 }
33
34
35
36 SampleHist ::
37 SampleHist ()
38 : Sample ("unnamed")
39 {
41 }
42
43
44
45 SampleHist ::
46 SampleHist (
const std::string& name,
const std::string&
file)
48 {
50 }
51
52
53
54 std::size_t SampleHist ::
55 getNumFiles () const
56 {
58 return 1;
59 }
60
61
62
63 std::string SampleHist ::
64 getFileName (const std::size_t
65#ifndef NDEBUG
67#endif
68 ) const
69 {
71
73 return m_file;
74 }
75
76
77
78 std::unique_ptr<SampleLocal> SampleHist ::
79 doMakeLocal () const
80 {
82 throw std::runtime_error ("Sample::makeLocal not supported for SampleHist");
83 }
84
85
86
87 std::vector<std::string> SampleHist ::
88 doMakeFileList () const
89 {
91
92 std::vector<std::string>
result;
95 }
96
97
98
99 void SampleHist ::
100 doUpdateLocation (const std::string& from, const std::string& to)
101 {
103 if (strncmp (m_file.c_str(), from.c_str(), from.size()) == 0)
104 m_file =
to +
"/" + m_file.substr (from.size());
105 }
106
107
108
109 TObject *SampleHist ::
110 doReadHist (const std::string& name) const
111 {
113
114 std::unique_ptr<TFile>
file (TFile::Open (m_file.c_str(),
"READ"));
116 throw std::runtime_error ("could not open file " + m_file);
117 TObject *
object =
file->Get (
name.c_str());
118 if (object != 0)
121 }
122}
#define RCU_NEW_INVARIANT(x)
#define RCU_READ_INVARIANT(x)
bool SetDirectory(TObject *object, TDirectory *directory)
effects: set the directory this object is associated with returns: whether the object type actively k...