34{
35 void SampleHist ::
36 testInvariant () const
37 {
39 }
40
41
42
43 SampleHist ::
44 SampleHist ()
45 : Sample ("unnamed")
46 {
48 }
49
50
51
52 SampleHist ::
53 SampleHist (
const std::string& name,
const std::string&
file)
55 {
57 }
58
59
60
61 std::size_t SampleHist ::
62 getNumFiles () const
63 {
65 return 1;
66 }
67
68
69
70 std::string SampleHist ::
71 getFileName (const std::size_t
72#ifndef NDEBUG
74#endif
75 ) const
76 {
78
80 return m_file;
81 }
82
83
84
85 SamplePtr SampleHist ::
86 doMakeLocal () const
87 {
89 RCU_THROW_MSG (
"Sample::makeLocal not supported for SampleHist");
90 return SamplePtr ();
91 }
92
93
94
95 std::vector<std::string> SampleHist ::
96 doMakeFileList () const
97 {
99
100 std::vector<std::string>
result;
101 result.push_back (m_file);
103 }
104
105
106
107 void SampleHist ::
108 doUpdateLocation (const std::string& from, const std::string& to)
109 {
111 if (strncmp (m_file.c_str(), from.c_str(), from.size()) == 0)
112 m_file =
to +
"/" + m_file.substr (from.size());
113 }
114
115
116
117 TObject *SampleHist ::
118 doReadHist (const std::string& name) const
119 {
121
122 std::unique_ptr<TFile>
file (TFile::Open (m_file.c_str(),
"READ"));
125 TObject *
object =
file->Get (
name.c_str());
126 if (object != 0)
129 }
130}
#define RCU_NEW_INVARIANT(x)
#define RCU_READ_INVARIANT(x)
#define RCU_THROW_MSG(message)
bool SetDirectory(TObject *object, TDirectory *directory)
effects: set the directory this object is associated with returns: whether the object type actively k...