Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AnaWait.cc
Go to the documentation of this file.
3 #include <phool/getClass.h>
4 #include "AnaWait.h"
5 using namespace std;
6 
7 AnaWait::AnaWait(const int sec_spill, const int sec_event)
8  : m_wait_spill(sec_spill), m_wait_event(sec_event)
9 {
10  ;
11 }
12 
14 {
15  ;
16 }
17 
19 {
21 }
22 
24 {
26 }
27 
29 {
30  SQEvent* event = findNode::getClass<SQEvent>(topNode, "SQEvent");
31  if (!event) return Fun4AllReturnCodes::ABORTEVENT;
32 
33  static int id_pre = -1;
34  int id = event->get_spill_id();
35  if (id_pre < 0) {
36  id_pre = id;
37  } else if (id != id_pre) {
38  id_pre = id;
39  cout << " AnaWait: " << m_wait_spill << " sec." << endl;
40  DoWait(m_wait_spill);
41  } else {
42  DoWait(m_wait_event);
43  }
44 
46 }
47 
49 {
51 }
52 
53 void AnaWait::DoWait(int sec)
54 {
55  while (sec-- > 0) sleep(1);
56 }
int End(PHCompositeNode *topNode)
Called at the end of all processing.
Definition: AnaWait.cc:48
int InitRun(PHCompositeNode *topNode)
Definition: AnaWait.cc:23
int Init(PHCompositeNode *topNode)
Definition: AnaWait.cc:18
virtual ~AnaWait()
Definition: AnaWait.cc:13
An SQ interface class to hold one event header.
Definition: SQEvent.h:17
void DoWait(int sec)
Definition: AnaWait.cc:53
AnaWait(const int sec_spill=30, const int sec_event=0)
Definition: AnaWait.cc:7
int process_event(PHCompositeNode *topNode)
Definition: AnaWait.cc:28