-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathORIpeV4SLTEventTreeWriter.cc
64 lines (52 loc) · 1.96 KB
/
ORIpeV4SLTEventTreeWriter.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// ORIpeV4SLTEventTreeWriter.cc
#include "ORIpeV4SLTEventTreeWriter.hh"
#include "ORLogger.hh"
using namespace std;
ORIpeV4SLTEventTreeWriter::ORIpeV4SLTEventTreeWriter(string treeName) :
ORVTreeWriter(new ORIpeV4SLTEventDecoder, treeName)
{
fEventDecoder = dynamic_cast<ORIpeV4SLTEventDecoder*>(fDataDecoder);
Clear();
}
ORIpeV4SLTEventTreeWriter::~ORIpeV4SLTEventTreeWriter()
{
delete fEventDecoder;
}
ORDataProcessor::EReturnCode ORIpeV4SLTEventTreeWriter::InitializeBranches()
{
fTree->Branch("crate", &fCrate, "crate/s");
fTree->Branch("card", &fCard, "card/s");
fTree->Branch("counterType", &fCounterType, "counterType/s");
fTree->Branch("counterSubType", &fCounterSubType, "counterSubType/s");
fTree->Branch("eventCounter", &fEventCounter, "eventCounter/i");
fTree->Branch("timestampHigh", &fTimestampHigh, "timestampHigh/i");
fTree->Branch("timestampLow", &fTimestampLow, "timestampLow/i");
return kSuccess;
}
ORDataProcessor::EReturnCode ORIpeV4SLTEventTreeWriter::ProcessMyDataRecord(UInt_t* record)
{
// the event decoder could run into a problem, but this might not
// ruin the rest of the run.
// check severity to improve speed:
fCrate = fEventDecoder->CrateOf(record);
fCard = fEventDecoder->CardOf(record);
fCounterType = fEventDecoder->CounterTypeOf(record);
fCounterSubType = fEventDecoder->CounterSubTypeOf(record);
fEventCounter = fEventDecoder->EventCounterOf(record);
fTimestampHigh = fEventDecoder->TimestampHighOf(record);
fTimestampLow = fEventDecoder->TimestampLowOf(record);
if (ORLogger::GetSeverity() >= ORLogger::kDebug)
{
ORLog(kDebug) << "ProcessMyDataRecord(): "
<< "sec-subsec-ID-crate-card-counterType-counterSubType-eventCounter-timestampHigh-timestampLow = "
<< fCrate << "-"
<< fCard << "-"
<< fCounterType << "-"
<< fCounterSubType << "-"
<< fEventCounter << "-"
<< fTimestampHigh << "-"
<< fTimestampHigh
<< endl;
}
return kSuccess;
}