Class Reference for E1039 Core & Analysis Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EvtFilter.cxx
Go to the documentation of this file.
1 #include "EvtFilter.h"
2 
3 
4 #include <interface_main/SQHit.h>
12 
13 #include <fun4all/Fun4AllBase.h>
15 #include <phool/PHNodeIterator.h>
16 #include <phool/PHCompositeNode.h>
17 #include <phool/PHIODataNode.h>
18 #include <phool/getClass.h>
19 
20 #include <iomanip>
21 #include <cmath>
22 #include <fstream>
23 #include <sstream>
24 #include <string>
25 
26 #define LogInfo(message) std::cout << "DEBUG: " << __FILE__ << " " << __LINE__ << " " << __FUNCTION__ << " ::: " << message << std::endl
27 
28 using namespace std;
29 
31 {
33 }
34 
35 EvtFilter::EvtFilter(const std::string& name) :
36  SubsysReco(name),
37  _event(0),
38  _trigger_req(0),
39  _event_id_req(-1),
40  _event_header(nullptr)
41 {
42 }
43 
45 {
46 }
47 
49 
51 }
52 
54 
56  std::cout << "Entering EvtFilter::process_event: " << _event << std::endl;
57 
58  int ret = GetNodes(topNode);
60  return ret;
61 
62  if(_event_header) {
64  _event_header->identify();
65  }
66 
67  unsigned short trig = _event_header->get_trigger();
68 
70  LogInfo("_trigger_req: " << _trigger_req << ", trig" << trig);
71 
72  if(_trigger_req!=0) {
73  if((_trigger_req & trig) == 0) {
74  if(Verbosity() >= Fun4AllBase::VERBOSITY_A_LOT) LogInfo("_trigger_req & trig == 0");
76  }
77  }
78 
79  if(_event_id_req > -1) {
80 
81  if(_event_id_req != _event_header->get_event_id()) {
82  if(Verbosity() >= Fun4AllBase::VERBOSITY_A_LOT) LogInfo("_trigger_req & trig == 0");
84  }
85  }
86  }
87 
89  std::cout << "Leaving EvtFilter::process_event: " << _event++ << std::endl;
90 
92 
93 }
94 
97 }
98 
99 int EvtFilter::GetNodes(PHCompositeNode* topNode) {
100 
101  _event_header = findNode::getClass<SQEvent>(topNode, "SQEvent");
102  if (!_event_header) {
103  LogInfo("!_event_header");
105  }
106 
108 }
109 
#define LogInfo(message)
Definition: EvtFilter.cxx:26
int Init(PHCompositeNode *topNode)
Definition: EvtFilter.cxx:30
int process_event(PHCompositeNode *topNode)
event processing
Definition: EvtFilter.cxx:53
int End(PHCompositeNode *topNode)
Called at the end of all processing.
Definition: EvtFilter.cxx:95
int InitRun(PHCompositeNode *topNode)
module initialization
Definition: EvtFilter.cxx:48
EvtFilter(const std::string &name="EvtFilter")
Definition: EvtFilter.cxx:35
virtual ~EvtFilter()
Definition: EvtFilter.cxx:44
@ VERBOSITY_A_LOT
Output a lot of messages.
Definition: Fun4AllBase.h:48
@ VERBOSITY_EVEN_MORE
Output even more messages.
Definition: Fun4AllBase.h:45
virtual int Verbosity() const
Gets the verbosity of this module.
Definition: Fun4AllBase.h:64
virtual void identify(std::ostream &os=std::cout) const
Definition: SQEvent.h:38
virtual bool get_trigger(const SQEvent::TriggerMask i) const =0
Return the trigger bit (fired or not) of the selected trigger channel.
virtual int get_event_id() const =0
Return the event ID, which is unique per run.