Diana Software
MFilterValidity.cc
Go to the documentation of this file.
1 #include "MFilterValidity.hh"
2 #include "QEvent.hh"
3 #include "QEventList.hh"
4 
5 
7 
8 using namespace Diana;
9 
10 
12 {
13  fVariableLabel = GetString("EventLabel",Q_STRING_DEFAULT);
14  ev.RequireByLabel<QObject>(fVariableLabel);
15 }
16 
18 {
19  ReadHandle<QObject> handle(fVariableLabel.GetName().c_str());
20  ev.Get(fVariableLabel.GetOwner().c_str(),handle);
21  return handle.IsValid();
22 }
#define Q_STRING_DEFAULT
Definition: QDiana.hh:38
#define REGISTER_MODULE(clazz)
Definition: QDriver.hh:133
Select events by validity of a QObject.
void GetCuts(const Diana::QEvent &ev)
Get cuts from config file.
bool Filter(const Diana::QEvent &ev)
return true if ev passes the cuts
diana event
Definition: QEvent.hh:46
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
void Get(const char *owner, ReadHandle< Q > &handle) const
Get a QObject Handle in read mode.
Definition: QEvent.hh:74
virtual bool IsValid() const
Check object validity.
Definition: QHandle.hh:34
read handle to access QEvent QObject's.
Definition: QHandle.hh:126
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...