1 |
pam-fi |
1.1 |
/* |
2 |
|
|
* LiveTimeRunEventHistoAction.cpp |
3 |
|
|
* |
4 |
|
|
* Created on: 18/jan/2010 |
5 |
|
|
* Author: Sergio Ricciarini, Nicola Mori |
6 |
|
|
*/ |
7 |
|
|
|
8 |
|
|
/*! @file LiveTimeRunEventHistoAction.cpp The LiveTimeRunEventHistoAction class implementation file. */ |
9 |
|
|
|
10 |
|
|
#include "LiveTimeRunEventHistoAction.h" |
11 |
|
|
|
12 |
|
|
LiveTimeRunEventHistoAction::LiveTimeRunEventHistoAction(const char *actionName, TString outFileBase, UInt_t eventID, |
13 |
|
|
TString mode) : |
14 |
|
|
Histo1DAction<Float_t> (actionName, "Live Time", outFileBase, mode, true), _eventID(eventID) { |
15 |
|
|
|
16 |
|
|
SetXAxis("LT (s)", 100, 0., 4.5); // Default axis |
17 |
|
|
} |
18 |
|
|
|
19 |
|
|
void LiveTimeRunEventHistoAction::OnGood(PamLevel2 *event) { |
20 |
|
|
|
21 |
|
|
if (event->GetRunInfo()) { |
22 |
|
|
|
23 |
|
|
UInt_t eventPN = event->GetRunInfo()->RUNHEADER_PKT + 2 + _eventID; // RUNHEADER_PKT is UInt_t |
24 |
|
|
|
25 |
|
|
// cout << "expected " << eventPN << "\t"; |
26 |
|
|
|
27 |
|
|
// cout << "actual " << event->GetOrbitalInfo()->pkt_num << endl; |
28 |
|
|
|
29 |
|
|
if (event->GetOrbitalInfo()->pkt_num == eventPN) { |
30 |
|
|
Float_t _LT = 0.16 * (float) (event->GetTrigLevel2()->dltime[0]) / 1000.; // in seconds |
31 |
|
|
Fill(_LT); |
32 |
|
|
|
33 |
|
|
// cout << "ok : " << _LT << endl; |
34 |
|
|
|
35 |
|
|
} |
36 |
|
|
|
37 |
|
|
} |
38 |
|
|
|
39 |
|
|
} |
40 |
|
|
|
41 |
|
|
|