Diana Software
MFilterResultAND.cc
Go to the documentation of this file.
1 #include "MFilterResultAND.hh"
2 #include "QEvent.hh"
3 #include "QBool.hh"
4 
6 
7 using namespace Diana;
8 
10 {
11  // Get parameters from cfg
12  fFilterLabels = GetVectorString("BoolLabel", std::vector<std::string>() );
13 
14  //fNegate = GetBool("Negate",false,false);
15  for(size_t i=0; i<fFilterLabels.size(); i++) {
16  fFilterLabel = GetString("BoolLabel",fFilterLabels[i]);
17  ev.RequireByLabel<QBool>(fFilterLabel);
18  }
19 
20  bool warn = (GetLogicFlag() != CASE);
21  GetBool("Save",false, warn);
22 }
23 
25 {
26  //if(fNegate) return !ev.GetByLabel<QBool>(fFilterLabel);
27  for(size_t i=0; i<fFilterLabels.size(); i++) {
28  fFilterLabel = GetString("BoolLabel",fFilterLabels[i]);
29  if(!ev.GetByLabel<QBool>(fFilterLabel)) {
30  // Use AND logic
31  return false;
32  }
33  }
34  return true;
35 }
#define REGISTER_MODULE(clazz)
Definition: QDriver.hh:133
bool Filter(const Diana::QEvent &ev)
void GetCuts(const Diana::QEvent &ev)
bool wrapped into a QObject
Definition: QBool.hh:17
diana event
Definition: QEvent.hh:46
const Q & GetByLabel(const QEventLabel &label) const
Get a QObject in read mode by label.
Definition: QEvent.hh:135
void RequireByLabel(const QEventLabel &label) const
notify the QEvent that we need a QObject, if not found an exception is thrown
Definition: QEvent.hh:242
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...