#include <GatedEventFilter.h> class CGatedEventFilter : public CEventFilter { public: CGatedEventFilter(CGateContainer* pGate=(CGateContainer*)kpNULL); CGatedEventFilter(std::string&, CGateContainer* pGate=(CGateContainer*)kpNULL); CGateContainer* getGateContainer(); void setGateContainer(CGateContainer& container); std::string getGateName(); Int_t getGateID(); protected: Bool_t CheckCondition(CEvent& event); };
The concrete filter class provided by SpecTcl is
CGatedEventFilter
. This class contains
a gate container and an implementation of
CheckCondition
that returns the
evaluation of the gate represented by that container on the
event.
CGatedEventFilter(CGateContainer* pGate = (CGateContainer*)kpNULL);
Constructs a filter given the gate container
pGate
. The filter is
constructed without an output file spefication or, for
that matter, an output streamer.
pGate
can be omitted in which case,
the filter will not output any events, if enabled.
CGatedEventFilter(std::string& outputFile, CGateContainer* pGate = =(CGateContainer*)kpNULL);
This constructor supplies outputFile
as the file associated with the filter. Note, however,
no output streamer has been defined. The pGate
parameter, as before, is the pointer to the gate container
whose gate must be satisfied for events to be written
to the output.
CGateContainer* getGateContainer();
Returns the gate container pointer. Note that this
can be nullptr if, for example,
the constructor defaulted the gate container parameter
and setGateContainer
was
never called.
void setGateContainer(CGateContainer& container);
Sets a new gate for the filter to be the one
encapsulated by container.
.
The old gate is unmodified.
std::string getGateName();
Returns the name of the current gate container. If no gate container has been set, the method returns: -not yet defined- .
Int_t getGateID();
Returns the id of the current gate container. If none have been established, returns -1.
proteced virtual Bool_t CheckCondition(CEvent& event);
Returns the value of the gate container evaluated on the
event event
. If no gate container
is associated with the filter; false
is returned.