-
Notifications
You must be signed in to change notification settings - Fork 0
/
Output.cxx
46 lines (38 loc) · 971 Bytes
/
Output.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Output definition module for simple analyzer
#include "Output.h"
#include "Variable.h"
using namespace std;
const string& PlainVariable::GetName() const
{
static const string nullstr;
if( !fVar ) return nullstr;
return fVar->GetName();
}
ostrm_t& PlainVariable::write( ostrm_t& os, bool headerinfo ) const
{
if( headerinfo ) {
os.write( GetName().c_str(), GetName().size()+1 );
} else {
double x = fVar->GetValue();
os.write( reinterpret_cast<const char*>(&x), sizeof(x) );
}
return os;
}
const string EventNumberVariable::fName = "Event";
ostrm_t& EventNumberVariable::write( ostrm_t& os, bool headerinfo ) const
{
if( headerinfo ) {
os.write( GetName().c_str(), GetName().size()+1 );
} else {
os.write( reinterpret_cast<const char*>(&fNev), sizeof(fNev) );
}
return os;
}
#if 0
void Output::Print() const
{
for( vvec_t::const_iterator it = vars.begin(); it != vars.end(); ++it ) {
(*it)->Print();
}
}
#endif