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

#include <OfflineRevise.h>

Public Member Functions

 OfflineRevise (const std::string &conf)
 
virtual ~OfflineRevise ()
 
void fixHeader (Event::EventHeader *header)
 
int timeRound (int run)
 

Detailed Description

Definition at line 9 of file OfflineRevise.h.

Constructor & Destructor Documentation

◆ OfflineRevise()

OfflineRevise::OfflineRevise ( const std::string &  conf)

Definition at line 487 of file OfflineRevise.cxx.

488 : m_lastRun(-1),
489 m_lastFlag(true)
490{
491 std::ifstream f(conf.c_str());
493
494 {
495 SniperJSON& c1 = json["Ets1MissingSecond"];
496 for (SniperJSON::vec_iterator it = c1["RunRanges"].vec_begin();
497 it != c1["RunRanges"].vec_end();
498 ++it)
499 {
500 m_runRanges.push_back(std::make_pair(
501 (*it)["From"].get<int>(),
502 (*it)["To"].get<int>() ));
503 }
504
505 m_runs = c1["Runs"].get<std::vector<int> >();
506
507 //for ( std::vector<std::pair<int, int> >::iterator it = m_runRanges.begin();
508 // it != m_runRanges.end(); ++it) {
509 // std::cout << "RunRange: " << it->first << ", " << it->second << std::endl;
510 //}
511 //for (std::vector<int>::iterator it = m_runs.begin();
512 // it != m_runs.end(); ++it) {
513 // std::cout << "Run: " << *it << std::endl;
514 //}
515
516 m_tRoundSwitch = json["TimeRoundSwitch"].get<int>();
517 }
518}
T get() const
std::vector< SniperJSON >::const_iterator vec_iterator
static SniperJSON load(std::istream &is)
vec_iterator vec_end() const
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")

◆ ~OfflineRevise()

OfflineRevise::~OfflineRevise ( )
virtual

Definition at line 520 of file OfflineRevise.cxx.

521{
522}

Member Function Documentation

◆ fixHeader()

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

Definition at line 524 of file OfflineRevise.cxx.

525{
526 bool goodFlag = true;
527 int run = header->runNumber();
528
529 if ( run == m_lastRun ) {
530 goodFlag = m_lastFlag;
531 }
532 else {
533 for ( std::vector<std::pair<int, int> >::iterator it = m_runRanges.begin();
534 it != m_runRanges.end();
535 ++it)
536 {
537 if ( run >= it->first && run <= it->second ) {
538 goodFlag = false;
539 break;
540 }
541 }
542
543 if ( goodFlag && std::find(m_runs.begin(), m_runs.end(), run) != m_runs.end() ) {
544 goodFlag = false;
545 }
546
547 m_lastFlag = goodFlag;
548 m_lastRun = run;
549 m_lastEvent = header->eventNumber();
550 m_t0Sec = header->time();
551 m_t0NanoShift0 = -1;
552 m_t0NanoShift1 = -1;
553 m_lastEts1 = 0;
554 m_lastEts2Old = 0;
555 m_lastEts2New = 0;
556 }
557
558 if ( ! goodFlag ) {
559 fixEts1(header);
560 fixEts2(header);
561 }
562}
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 17 of file OfflineRevise.h.

17 {
18 return (run < m_tRoundSwitch) ? 61 : 60;
19 }

Referenced by RawDataEvtHeaderCnv::createObj().


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