BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
OfflineRevise Class Reference

#include <OfflineRevise.h>

Public Member Functions

 OfflineRevise (const SniperJSON &json)
 
virtual ~OfflineRevise ()
 
void fixHeader (Event::EventHeader *header)
 
int timeRound (int run)
 

Detailed Description

Definition at line 11 of file OfflineRevise.h.

Constructor & Destructor Documentation

◆ OfflineRevise()

OfflineRevise::OfflineRevise ( const SniperJSON json)

Definition at line 6 of file OfflineRevise.cxx.

7 : m_lastRun(-1),
8 m_lastFlag(true)
9{
10 const SniperJSON& c1 = json["Ets1MissingSecond"];
11 for (SniperJSON::vec_iterator it = c1["RunRanges"].vec_begin();
12 it != c1["RunRanges"].vec_end();
13 ++it)
14 {
15 m_runRanges.push_back(std::make_pair(
16 (*it)["From"].get<int>(),
17 (*it)["To"].get<int>() ));
18 }
19
20 m_runs = c1["Runs"].get<std::vector<int> >();
21
22 //for ( std::vector<std::pair<int, int> >::iterator it = m_runRanges.begin();
23 // it != m_runRanges.end(); ++it) {
24 // std::cout << "RunRange: " << it->first << ", " << it->second << std::endl;
25 //}
26 //for (std::vector<int>::iterator it = m_runs.begin();
27 // it != m_runs.end(); ++it) {
28 // std::cout << "Run: " << *it << std::endl;
29 //}
30
31 m_tRoundSwitch = json["TimeRoundSwitch"].get<int>();
32}
T get() const
Definition: SniperJSON.h:142
std::vector< SniperJSON >::const_iterator vec_iterator
Definition: SniperJSON.h:11
vec_iterator vec_end() const
Definition: SniperJSON.h:52

◆ ~OfflineRevise()

OfflineRevise::~OfflineRevise ( )
virtual

Definition at line 34 of file OfflineRevise.cxx.

35{
36}

Member Function Documentation

◆ fixHeader()

void OfflineRevise::fixHeader ( Event::EventHeader header)

Definition at line 38 of file OfflineRevise.cxx.

39{
40 bool goodFlag = true;
41 int run = header->runNumber();
42
43 if ( run == m_lastRun ) {
44 goodFlag = m_lastFlag;
45 }
46 else {
47 for ( std::vector<std::pair<int, int> >::iterator it = m_runRanges.begin();
48 it != m_runRanges.end();
49 ++it)
50 {
51 if ( run >= it->first && run <= it->second ) {
52 goodFlag = false;
53 break;
54 }
55 }
56
57 if ( goodFlag && std::find(m_runs.begin(), m_runs.end(), run) != m_runs.end() ) {
58 goodFlag = false;
59 }
60
61 m_lastFlag = goodFlag;
62 m_lastRun = run;
63 m_lastEvent = header->eventNumber();
64 m_t0Sec = header->time();
65 m_t0NanoShift0 = -1;
66 m_t0NanoShift1 = -1;
67 m_lastEts1 = 0;
68 m_lastEts2Old = 0;
69 m_lastEts2New = 0;
70 }
71
72 if ( ! goodFlag ) {
73 fixEts1(header);
74 fixEts2(header);
75 }
76}
int eventNumber() const
Retrieve event number.
Definition: EventHeader.h:37
int runNumber() const
Retrieve run number.
Definition: EventHeader.h:42
unsigned int time() const
Definition: EventHeader.h:46

◆ timeRound()

int OfflineRevise::timeRound ( int  run)
inline

Definition at line 19 of file OfflineRevise.h.

19 {
20 return (run < m_tRoundSwitch) ? 61 : 60;
21 }

Referenced by RawDataEvtHeaderCnv::createObj().


The documentation for this class was generated from the following files: