-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathORBocTIC3TreeWriter.cc
48 lines (39 loc) · 1.25 KB
/
ORBocTIC3TreeWriter.cc
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
47
// ORBocTIC3TreeWriter.cc
#include "ORBocTIC3TreeWriter.hh"
#include "ORLogger.hh"
using namespace std;
ORBocTIC3TreeWriter::ORBocTIC3TreeWriter(string treeName) :
ORVTreeWriter(new ORBocTIC3Decoder, treeName)
{
fBocTIC3Decoder = dynamic_cast<ORBocTIC3Decoder*>(fDataDecoder);
Clear();
SetDoNotAutoFillTree();
}
ORBocTIC3TreeWriter::~ORBocTIC3TreeWriter()
{
delete fBocTIC3Decoder;
}
ORDataProcessor::EReturnCode ORBocTIC3TreeWriter::InitializeBranches()
{
fTree->Branch("pressure", &fPressure, "temp/F");
fTree->Branch("time", &fTime, "time/i");
fTree->Branch("channel", &fChannel, "channel/s");
fTree->Branch("deviceID", &fDeviceID, "deviceID/s");
return kSuccess;
}
ORDataProcessor::EReturnCode ORBocTIC3TreeWriter::ProcessMyDataRecord(UInt_t* record)
{
fDeviceID = fBocTIC3Decoder->GetDeviceID(record);
for (UInt_t i=0; i<fBocTIC3Decoder->GetNumberOfChannels();i++) {
fPressure = fBocTIC3Decoder->GetPressureOfChannel(record, i);
fTime = fBocTIC3Decoder->GetTimeOfChannel(record, i);
fChannel = i;
if(ORLogger::GetSeverity() >= ORLogger::kDebug) {
ORLog(kDebug) << "channel:pressure:time = "
<< fChannel << ":" << fPressure << ":"
<< ":" << fTime << endl;
}
fTree->Fill();
}
return kSuccess;
}