Belle II Software development
|
Software Trigger Cut to be used in the Software Trigger Modules. More...
#include <SoftwareTriggerCut.h>
Public Member Functions | |
std::string | decompile () const |
Decompile the internal General Cut back into a string. | |
SoftwareTriggerCutResult | checkPreScaled (const SoftwareTriggerVariableManager::Object &prefilledObject) const |
Main function of the SoftwareTriggerCut: check the cut condition. | |
std::pair< SoftwareTriggerCutResult, SoftwareTriggerCutResult > | check (const SoftwareTriggerVariableManager::Object &prefilledObject, uint32_t *counter=nullptr) const |
Return both the prescaled and the non-prescaled result. | |
unsigned int | getPreScaleFactor () const |
Return the list of pre scale factors. | |
bool | isRejectCut () const |
Returns true, if the cut is a reject cut and false otherwise. | |
Static Public Member Functions | |
static std::unique_ptr< SoftwareTriggerCut > | compile (const std::string &cut_string, const unsigned int prescaleFactor, const bool rejectCut=false) |
Compile a new SoftwareTriggerCut from a cut string (by using the GeneralCut::compile function) and an optional prescale factor. | |
Private Member Functions | |
SoftwareTriggerCut (std::unique_ptr< GeneralCut< SoftwareTriggerVariableManager > > &&cut, unsigned int prescaleFactor, const bool rejectCut) | |
Make constructor private. | |
Private Attributes | |
std::unique_ptr< GeneralCut< SoftwareTriggerVariableManager > > | m_cut = nullptr |
Internal representation of the cut condition as a general cut. | |
std::vector< unsigned int > | m_preScaleFactor = {1} |
The internal storage of the prescale factor of the cut. In former times, this was a vector but is not used anymore (only single entry) | |
bool | m_isRejectCut = false |
The internal storage if it is a reject cut. | |
Software Trigger Cut to be used in the Software Trigger Modules.
This cut can be down- and uploaded from the database or compiled from a string. It is basically a GeneralCut using the SoftwareTriggerVariableManager with a prescale factor.
For database interactions, use the SoftwareTriggerDBHandler.
Definition at line 30 of file SoftwareTriggerCut.h.
|
inlineprivate |
Make constructor private.
You should only download a SoftwareCut from the database or compile a new one from a string.
Definition at line 114 of file SoftwareTriggerCut.h.
std::pair< SoftwareTriggerCutResult, SoftwareTriggerCutResult > check | ( | const SoftwareTriggerVariableManager::Object & | prefilledObject, |
uint32_t * | counter = nullptr |
||
) | const |
Return both the prescaled and the non-prescaled result.
This function should only be use experts, you basically always want to use the checkPreScaled function. Returns a pair [prescaled, non-prescaled]
Definition at line 32 of file SoftwareTriggerCut.cc.
SoftwareTriggerCutResult checkPreScaled | ( | const SoftwareTriggerVariableManager::Object & | prefilledObject | ) | const |
Main function of the SoftwareTriggerCut: check the cut condition.
See the constructor of this class for more information on when which result is returned.
Definition at line 64 of file SoftwareTriggerCut.cc.
|
static |
Compile a new SoftwareTriggerCut from a cut string (by using the GeneralCut::compile function) and an optional prescale factor.
This together with the downloadFromDatabase function is the only possibility to create a new SoftwareTriggerCut.
cut_string | The string from which the cut should be compiled. Must be in a format, the GeneralCut::compile function understands. |
prescaleFactor | An optional prescale factor which will be used whenever the cut is checked. The prescale factor is a integer value. If the prescale is e.g. 10, the cut will only result in a "accept" result (although the cut condition itself is true) in 1 of 10 cases on average for accept cuts (for reject cuts, the prescale is not used). Defaults to 1, which means that the prescale has no impact on the cut check. |
rejectCut | Turn this cut into a reject cut and not a accept cut. The result of the SoftwareTriggerModules is defined by these two cut types. See the SoftwareTriggerModule for more information. Please note that the condition is turned the other way round if it is a reject cut. See the example below. |
To summarize: the cut has the following result:
Let us look into two examples. The first is an accept cut for gg events. It may have the following parameters:
cut condition = something which is only true for gg events prescaleFactor = 100 rejectCut = false
If the event is a gg event (and the cut conditions is then true), the cut will return "accept" in 1% of the cases, and "noResult" in all other cases. If the event is not a gg event, the cut will always return "noResult". The SoftwareTriggerModule will keep the event if this trigger results in "accept", in all other cases it depends on the other loaded cuts.
The second cut is an reject cut for ee events. It may have the following parameters:
cut condition = something which is only true for ee events rejectCut = true prescaleFactor will not be used
If the event is an ee event (and the cut condition is true), the cut will result in "dismiss". In all other cases it returns "noResult". The SoftwareTriggerModule will not pass this event if the result is "dismiss", in all other cases it depends on the other loaded cuts.
Definition at line 21 of file SoftwareTriggerCut.cc.
|
inline |
Decompile the internal General Cut back into a string.
This function is needed for streaming the SoftwareTriggerCut into the database.
Definition at line 87 of file SoftwareTriggerCut.h.
|
inlineinherited |
Return the list of pre scale factors.
Definition at line 34 of file SoftwareTriggerCutBase.h.
|
inlineinherited |
Returns true, if the cut is a reject cut and false otherwise.
Definition at line 41 of file SoftwareTriggerCutBase.h.
|
private |
Internal representation of the cut condition as a general cut.
Definition at line 109 of file SoftwareTriggerCut.h.
|
privateinherited |
The internal storage if it is a reject cut.
Definition at line 55 of file SoftwareTriggerCutBase.h.
|
privateinherited |
The internal storage of the prescale factor of the cut. In former times, this was a vector but is not used anymore (only single entry)
Definition at line 53 of file SoftwareTriggerCutBase.h.