Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CalibEvtQual.cc
Go to the documentation of this file.
4 #include <phool/PHNodeIterator.h>
5 #include <phool/PHIODataNode.h>
6 #include <phool/getClass.h>
7 #include "CalibEvtQual.h"
8 using namespace std;
9 
10 CalibEvtQual::CalibEvtQual(const std::string& name) : SubsysReco(name)
11 {
12  ;
13 }
14 
16 {
18 }
19 
21 {
23 }
24 
26 {
27  SQEvent* event = findNode::getClass<SQEvent>(topNode, "SQEvent");
28  if (! event) return Fun4AllReturnCodes::ABORTEVENT;
29 
30  int run_id = event->get_run_id();
31  int qual = event->get_data_quality();
32 
33  int n_tdc; // expected number of tdc info
34  if (run_id >= 28664) n_tdc = 101; // seen in run 28700
35  else n_tdc = 108; // seen in run 28000
36  // This run range was confirmed by checking n_tdc in the following runs;
37  // * 101 in runs 28680, 28670, 28665, 28664
38  // * 108 in runs 28500, 28600, 28650, 28660, 28661
39  // Note that runs 28662 & 28663 contain no event.
40  // Is the change of n_tdc related to elog #17385??
41  // https://e906-gat6.fnal.gov:8080/SeaQuest/17385
42  if (event->get_n_board_taiwan() != n_tdc) qual |= ERR_N_TDC;
43  if (event->get_n_board_v1495 () < 2) qual |= ERR_N_V1495_0;
44  else if (event->get_n_board_v1495 () > 2) qual |= ERR_N_V1495_2;
45  if (event->get_n_board_trig_bit () < 1) qual |= ERR_N_TRIGB_0;
46  else if (event->get_n_board_trig_bit () > 1) qual |= ERR_N_TRIGB_2;
47  if (event->get_n_board_trig_count () < 1) qual |= ERR_N_TRIGC_0;
48  else if (event->get_n_board_trig_count () > 1) qual |= ERR_N_TRIGC_2;
49  if (event->get_n_board_qie () < 1) qual |= ERR_N_QIE_0;
50  else if (event->get_n_board_qie () > 1) qual |= ERR_N_QIE_2;
51 
52  event->set_data_quality(qual);
53  //if (qual != 0) {
54  // cout << " N! " << evt_id << " | " << ed->n_qie << " " << ed->n_v1495 << " " << ed->n_tdc << " " << ed->n_trig_b << " " << ed->n_trig_c << endl;
55  // }
56  //}
57 
59 }
60 
62 {
64 }
65 
66 void CalibEvtQual::PrintEvent(SQEvent* evt)
67 {
68  cout << "SQEvent: "
69  << " " << evt->get_run_id ()
70  << " " << evt->get_spill_id ()
71  << " " << evt->get_event_id ()
72  << " " << evt->get_coda_event_id()
73  << " " << evt->get_data_quality ()
74  << " " << evt->get_vme_time ()
75  << "\n";
76 }
CalibEvtQual(const std::string &name="CalibEvtQual")
Definition: CalibEvtQual.cc:10
virtual int get_run_id() const =0
Return the run ID.
virtual int get_data_quality() const =0
Return the data-quality bits.
virtual int get_event_id() const =0
Return the event ID, which is unique per run.
virtual int get_spill_id() const =0
Return the spill ID.
virtual int get_vme_time() const =0
Return the VME time.
int End(PHCompositeNode *topNode)
Called at the end of all processing.
Definition: CalibEvtQual.cc:61
An SQ interface class to hold one event header.
Definition: SQEvent.h:17
int InitRun(PHCompositeNode *topNode)
Definition: CalibEvtQual.cc:20
virtual int get_coda_event_id() const =0
Return the Coda-event ID, which is unique per run.
int Init(PHCompositeNode *topNode)
Definition: CalibEvtQual.cc:15
int process_event(PHCompositeNode *topNode)
Definition: CalibEvtQual.cc:25