![]() |
PandaRoot
|
Primary generator with added event filtering capabilities. More...
#include <FairFilteredPrimaryGenerator.h>
Public Member Functions | |
FairFilteredPrimaryGenerator () | |
Default constructor. More... | |
FairFilteredPrimaryGenerator (const char *name, const char *title="Filtered Generator") | |
Constructor with name and title. More... | |
virtual | ~FairFilteredPrimaryGenerator () |
Destructor. More... | |
virtual Bool_t | Init () |
Initialize the event generator(s) and the event (veto) filter(s). More... | |
void | AndFilter (FairEvtFilter *filter) |
Register a non-veto event filter using a logical AND to connect with previously defined non-veto event filters. More... | |
void | AndNotFilter (FairEvtFilter *filter) |
Register a non-veto event filter using a logical AND NOT to connect with previously defined non-veto event filters. More... | |
void | OrFilter (FairEvtFilter *filter) |
Register a non-veto event filter using a logical OR to connect with previously defined non-veto event filters. More... | |
void | OrNotFilter (FairEvtFilter *filter) |
Register a non-veto event filter using a logical OR NOT to connect with previously defined non-veto event filters. More... | |
void | AddVetoFilter (FairEvtFilter *filter) |
Register an event veto filter. Veto filters have higher priority than regular event filters. If the event matches any veto filter, it will be skipped. More... | |
virtual Bool_t | GenerateEvent (FairGenericStack *pStack) |
Calls event generators and the event filters. More... | |
TObjArray * | GetListOfFilters () |
TObjArray * | GetListOfVetoFilters () |
void | SetFilterMaxTries (Int_t maxTries=99999) |
Define the maximum number of times that this object should try to find an event which suits all event filters. More... | |
Int_t | GetNumberOfFilterMaxTries () |
returns the maximum number of times that this object should try to find an event which suits all event filters. More... | |
Int_t | GetNumberOfGeneratedEvents () |
returns the total (accepted + rejected) number of events generated by the event generators. If no event filters are used this number is equal to the number of simulated events. More... | |
void | SetEventPrintFrequency (int freq) |
Sets the frequency (accepted events) for printout (verbose>0) of accepted and generated events. More... | |
Int_t | GetNumberOfFilterFailedEvents () |
Returns the number of cases in which no matching event was found within the set max. tries. More... | |
void | WriteEvtFilterStatsToRootFile (TFile *outputFile=nullptr) |
Writes all relevant event filter information to the output root file. More... | |
void | SetVerbose (Int_t verbose=12) |
Set the level of commenting output. More... | |
Protected Member Functions | |
void | AddFilter (FairEvtFilter *filter, FairEvtFilter::LogicOp op, Bool_t negateFilter) |
Registers a regular (non-veto) filter. This method is not supposed to be directly used by the user. See public methods for user interfaces to this method. More... | |
Protected Attributes | |
TObjArray * | fVetoFilterList |
List of registered veto filters. More... | |
TIterator * | fVetoFilterIter |
Iterator over veto filter list. More... | |
TObjArray * | fFilterList |
List of registered filters. More... | |
TIterator * | fFilterIter |
Iterator over filter list. More... | |
FairEvtFilterParams | fEvtFilterStat |
Contains the statistics of the event filtering process. More... | |
Int_t | fVerbose |
Level of commenting output, 0 means no output, higher gives more output. More... | |
Bool_t | fEventVetoFilterActive |
returns kTRUE if any event veto filter is registered. More... | |
Bool_t | fEventFilterActive |
returns kTRUE if any non-veto event filter is registerd. More... | |
std::vector< Bool_t > | filterAcceptEvent |
Vector containing the results of the EventMatches methods for every registered non-veto event filter in the corresponding order. More... | |
std::vector< UInt_t > | fLogicalFilterOperation |
vector containing the logical operations with which the outputs of the non-veto event filters should be combined. More... | |
std::vector< Bool_t > | fFilterNegation |
vector determining whether the output of a non-veto event filter should be negated or not. More... | |
Int_t | fEventNrFiltered |
Event number (Set by the filtered primary generator. More... | |
Int_t | fEventPrintFreq |
Print frequency for filtered events. More... | |
Primary generator with added event filtering capabilities.
This class adds event filtering capabilities to FairPrimaryGenerator which is used internally for handling the event generators and so on. The event filtering is performed after the event generation and before the particle transport through the detector model.
From the description of FairPrimaryGenerator:
The FairFilteredPrimaryGenerator is responsible for the handling of the MC input. Several input generators can be registered to it; these have to be derived from the FairGenerator class. The FairFilteredPrimaryGenerator defines position and (optionally) smearing of the primary vertex. This class should be instantiated only once.
Definition at line 60 of file FairFilteredPrimaryGenerator.h.
FairFilteredPrimaryGenerator::FairFilteredPrimaryGenerator | ( | ) |
Default constructor.
Referenced by AddFilter().
FairFilteredPrimaryGenerator::FairFilteredPrimaryGenerator | ( | const char * | name, |
const char * | title = "Filtered Generator" |
||
) |
Constructor with name and title.
|
virtual |
Destructor.
|
inlineprotected |
Registers a regular (non-veto) filter. This method is not supposed to be directly used by the user. See public methods for user interfaces to this method.
Definition at line 219 of file FairFilteredPrimaryGenerator.h.
References FairFilteredPrimaryGenerator().
Referenced by AndFilter(), AndNotFilter(), OrFilter(), and OrNotFilter().
|
inline |
Register an event veto filter. Veto filters have higher priority than regular event filters. If the event matches any veto filter, it will be skipped.
Definition at line 88 of file FairFilteredPrimaryGenerator.h.
References fEventVetoFilterActive, fVetoFilterList, and GenerateEvent().
|
inline |
Register a non-veto event filter using a logical AND to connect with previously defined non-veto event filters.
Definition at line 76 of file FairFilteredPrimaryGenerator.h.
References AddFilter(), and FairEvtFilter::kAnd.
|
inline |
Register a non-veto event filter using a logical AND NOT to connect with previously defined non-veto event filters.
Definition at line 79 of file FairFilteredPrimaryGenerator.h.
References AddFilter(), and FairEvtFilter::kAnd.
|
virtual |
Calls event generators and the event filters.
To be called at the beginning of each event from FairMCApplication. Generates an event vertex and calls the ReadEvent methods from the registered generators. Calls defined event (veto) filters to decide whether to process the event or to call the event generators again.
pStack | The particle stack |
Referenced by AddVetoFilter().
|
inline |
Definition at line 110 of file FairFilteredPrimaryGenerator.h.
References fFilterList.
|
inline |
Definition at line 112 of file FairFilteredPrimaryGenerator.h.
References fVetoFilterList.
|
inline |
Returns the number of cases in which no matching event was found within the set max. tries.
This method returns 0 if everything works fine. If it returns a value >0 it means that you should set a higher limit in SetFilterMaxTries. If it returns a value which is equal to the number of events that you requested, it means that either the max. number of tries is set way too low or that the generator does not create such events that you are interested in or that your event filters cannot be satisfied at all (logical error).
Definition at line 143 of file FairFilteredPrimaryGenerator.h.
References fEvtFilterStat, and FairEvtFilterParams::fFailedFilterEvents.
Referenced by WriteEvtFilterStatsToRootFile().
|
inline |
returns the maximum number of times that this object should try to find an event which suits all event filters.
Definition at line 126 of file FairFilteredPrimaryGenerator.h.
References fEvtFilterStat, and FairEvtFilterParams::fFilterMaxTries.
|
inline |
returns the total (accepted + rejected) number of events generated by the event generators. If no event filters are used this number is equal to the number of simulated events.
Definition at line 130 of file FairFilteredPrimaryGenerator.h.
References fEvtFilterStat, and FairEvtFilterParams::fGeneratedEvents.
Referenced by WriteEvtFilterStatsToRootFile().
|
virtual |
Initialize the event generator(s) and the event (veto) filter(s).
|
inline |
Register a non-veto event filter using a logical OR to connect with previously defined non-veto event filters.
Definition at line 82 of file FairFilteredPrimaryGenerator.h.
References AddFilter(), and FairEvtFilter::kOr.
|
inline |
Register a non-veto event filter using a logical OR NOT to connect with previously defined non-veto event filters.
Definition at line 85 of file FairFilteredPrimaryGenerator.h.
References AddFilter(), and FairEvtFilter::kOr.
|
inline |
Sets the frequency (accepted events) for printout (verbose>0) of accepted and generated events.
Definition at line 133 of file FairFilteredPrimaryGenerator.h.
References fEventPrintFreq.
|
inline |
Define the maximum number of times that this object should try to find an event which suits all event filters.
Definition at line 115 of file FairFilteredPrimaryGenerator.h.
References fEvtFilterStat, and FairEvtFilterParams::fFilterMaxTries.
|
inline |
Set the level of commenting output.
verbose | Level of commenting output, 0 means no output, higher gives more output. |
Definition at line 166 of file FairFilteredPrimaryGenerator.h.
References fVerbose.
|
inline |
Writes all relevant event filter information to the output root file.
Definition at line 146 of file FairFilteredPrimaryGenerator.h.
References fEvtFilterStat, GetNumberOfFilterFailedEvents(), and GetNumberOfGeneratedEvents().
|
protected |
returns kTRUE if any non-veto event filter is registerd.
Definition at line 193 of file FairFilteredPrimaryGenerator.h.
|
protected |
Event number (Set by the filtered primary generator.
Definition at line 213 of file FairFilteredPrimaryGenerator.h.
|
protected |
Print frequency for filtered events.
Definition at line 216 of file FairFilteredPrimaryGenerator.h.
Referenced by SetEventPrintFrequency().
|
protected |
returns kTRUE if any event veto filter is registered.
Definition at line 191 of file FairFilteredPrimaryGenerator.h.
Referenced by AddVetoFilter().
|
protected |
Contains the statistics of the event filtering process.
Definition at line 187 of file FairFilteredPrimaryGenerator.h.
Referenced by GetNumberOfFilterFailedEvents(), GetNumberOfFilterMaxTries(), GetNumberOfGeneratedEvents(), SetFilterMaxTries(), and WriteEvtFilterStatsToRootFile().
|
protected |
Iterator over filter list.
Definition at line 184 of file FairFilteredPrimaryGenerator.h.
|
protected |
List of registered filters.
Definition at line 182 of file FairFilteredPrimaryGenerator.h.
Referenced by GetListOfFilters().
|
protected |
vector determining whether the output of a non-veto event filter should be negated or not.
The vector grows automatically with every added non-veto event filter. A kTRUE entry at position i in the vector negates the i. filter's output, kFALSE entries do not negate.
Definition at line 210 of file FairFilteredPrimaryGenerator.h.
|
protected |
Vector containing the results of the EventMatches methods for every registered non-veto event filter in the corresponding order.
The content of the vector is overwritten for each generated event.
Definition at line 197 of file FairFilteredPrimaryGenerator.h.
|
protected |
vector containing the logical operations with which the outputs of the non-veto event filters should be combined.
The vector grows automatically with every added non-veto event filter. It is used to combine multiple filters via && or ||. The expression is evaluated sequentally from the first registered filter to the last one disregarding operator priorities.
Definition at line 204 of file FairFilteredPrimaryGenerator.h.
|
protected |
Level of commenting output, 0 means no output, higher gives more output.
Definition at line 189 of file FairFilteredPrimaryGenerator.h.
Referenced by SetVerbose().
|
protected |
Iterator over veto filter list.
Definition at line 180 of file FairFilteredPrimaryGenerator.h.
|
protected |
List of registered veto filters.
Definition at line 178 of file FairFilteredPrimaryGenerator.h.
Referenced by AddVetoFilter(), and GetListOfVetoFilters().