WCSim
|
The base class for WCSim triggering algorithms. More...
#include <WCSimWCTrigger.hh>
Public Member Functions | |
WCSimWCTriggerBase (G4String name, WCSimDetectorConstruction *, WCSimWCDAQMessenger *, G4String) | |
Create WCSimWCTriggerBase instance with knowledge of the detector and DAQ options. More... | |
virtual | ~WCSimWCTriggerBase () |
void | Digitize () |
The main user-callable routine of the class. Gets the input & creates the output WCSimWCTriggeredDigitsCollection's, then calls DoTheWork() More... | |
int | NumberOfGatesInThisEvent () |
Returns the number of trigger gates in the event (i.e. the number of triggers passed) More... | |
Double_t | GetTriggerTime (int i) |
Get the time of the ith trigger. More... | |
TriggerType_t | GetTriggerType (int i) |
Get the trigger type of the ith trigger. More... | |
std::vector< Float_t > | GetTriggerInfo (int i) |
Get the additional trigger information associated with the ith trigger. More... | |
G4String | GetTriggerClassName () |
Get the trigger class name. More... | |
void | SetMultiDigitsPerTrigger (G4bool allow_multi) |
Set whether to allow the number of digits per PMT per trigger to go > 1. More... | |
G4bool | GetMultiDigitsPerTrigger () |
void | SetNDigitsThreshold (G4int threshold) |
Set the threshold for the NDigits trigger. More... | |
void | SetNDigitsWindow (G4int window) |
Set the time window for the NDigits trigger. More... | |
void | SetNDigitsAdjustForNoise (G4bool adjust) |
Automatically adjust the NDigits threshold based on the average noise occupancy? More... | |
void | SetNDigitsPreTriggerWindow (G4int window) |
Set the pretrigger window for the NDigits trigger (value will be forced negative) More... | |
void | SetNDigitsPostTriggerWindow (G4int window) |
Set the posttrigger window for the NDigits trigger (value will be forced positive) More... | |
void | SetSaveFailuresMode (G4int mode) |
Set the mode for saving failed triggers (0:save only triggered events, 1:save both triggered events & failed events, 2:save only failed events) More... | |
void | SetSaveFailuresTime (G4double time) |
Set the dummy trigger time for the failed triggers. More... | |
void | SetSaveFailuresPreTriggerWindow (G4int window) |
Set the pretrigger window for the SaveFailures trigger (value will be forced negative) More... | |
void | SetSaveFailuresPostTriggerWindow (G4int window) |
Set the posttrigger window for the SaveFailures trigger (value will be forced positive) More... | |
void | SetDarkRate (double idarkrate) |
Knowledge of the dark rate (use for automatically adjusting for noise) More... | |
void | SaveOptionsToOutput (WCSimRootOptions *wcopt) |
Save current values of options. More... | |
Protected Member Functions | |
virtual void | DoTheWork (WCSimWCDigitsCollection *WCDCPMT)=0 |
This should call the trigger algorithms, and handle any temporary DigitsCollection's. More... | |
void | GetVariables () |
Get the default threshold, etc. from the derived class, and override with read from the .mac file. More... | |
virtual bool | GetDefaultMultiDigitsPerTrigger () |
Set the default trigger class specific decision of whether to save multiple digits per PMT per trigger (overridden by .mac) More... | |
virtual int | GetDefaultNDigitsWindow () |
Set the default trigger class specific NDigits window (in ns) (overridden by .mac) More... | |
virtual int | GetDefaultNDigitsThreshold () |
Set the default trigger class specific NDigits threshold (in ns) (overridden by .mac) More... | |
virtual int | GetDefaultNDigitsPreTriggerWindow () |
Set the default trigger class specific NDigits pretrigger window (in ns) (overridden by .mac) More... | |
virtual int | GetDefaultNDigitsPostTriggerWindow () |
Set the default trigger class specific NDigits posttrigger window (in ns) (overridden by .mac) More... | |
double | GetPreTriggerWindow (TriggerType_t t) |
Get the pretrigger window for a given trigger algorithm. More... | |
double | GetPostTriggerWindow (TriggerType_t t) |
Get the posttrigger window for a given trigger algorithm. More... | |
void | AlgNDigits (WCSimWCDigitsCollection *WCDCPMT, bool remove_hits, bool test=false) |
An NDigits trigger algorithm. More... | |
void | AlgNoTrigger (WCSimWCDigitsCollection *WCDCPMT, bool remove_hits, bool test=false) |
void | ReInitialize () |
Clear the Trigger* vectors and DigiHitMap. More... | |
Protected Attributes | |
WCSimWCTriggeredDigitsCollection * | DigitsCollection |
The main output of the class - collection of digits in the trigger window. More... | |
std::map< int, int > | DigiHitMap |
Keeps track of the PMTs that have been added to the output WCSimWCTriggeredDigitsCollection. More... | |
std::vector< Double_t > | TriggerTimes |
The times of the triggers. More... | |
std::vector< TriggerType_t > | TriggerTypes |
The type of the triggers. More... | |
std::vector< std::vector < Float_t > > | TriggerInfos |
Additional information associated with each trigger. More... | |
WCSimWCDAQMessenger * | DAQMessenger |
Get the options from the .mac file. More... | |
WCSimDetectorConstruction * | myDetector |
Know about the detector, so can add appropriate PMT time smearing. More... | |
G4String | detectorElement |
double | PMTDarkRate |
Dark noise rate of the PMTs. More... | |
G4bool | multiDigitsPerTrigger |
Allow the number of digits per PMT saved in each trigger window to go > 1? More... | |
G4int | ndigitsThreshold |
The threshold for the NDigits trigger. More... | |
G4int | ndigitsWindow |
The time window for the NDigits trigger. More... | |
G4bool | ndigitsAdjustForNoise |
Automatically adjust the NDigits trigger threshold based on the average dark noise rate? More... | |
G4int | ndigitsPreTriggerWindow |
The pretrigger window to save before an NDigits trigger. More... | |
G4int | ndigitsPostTriggerWindow |
The posttrigger window to save after an NDigits trigger. More... | |
G4int | saveFailuresMode |
The mode for saving events which don't pass triggers. More... | |
G4double | saveFailuresTime |
The dummy trigger time for failed events. More... | |
G4int | saveFailuresPreTriggerWindow |
The pretrigger window to save before an SaveFailures trigger. More... | |
G4int | saveFailuresPostTriggerWindow |
The posttrigger window to save after an SaveFailures trigger. More... | |
G4String | triggerClassName |
Save the name of the trigger class. More... | |
Private Member Functions | |
void | AdjustNDigitsThresholdForNoise () |
modify the NDigits threshold based on the average dark noise rate More... | |
void | FillDigitsCollection (WCSimWCDigitsCollection *WCDCPMT, bool remove_hits, TriggerType_t save_triggerType) |
takes all trigger times, then loops over all Digits & fills the output DigitsCollection More... | |
void | SortTriggersByTime () |
sort the Trigger vectors (Time, Type, Info) by Trigger Time More... | |
Private Attributes | |
bool | digitizeCalled |
Has Digitize() been called yet? More... | |
Static Private Attributes | |
static const double | offset = 950.0 |
Hit time offset (ns) More... | |
static const double | LongTime = 40E9 |
An arbitrary long time to use in loops (ns) More... | |
The base class for WCSim triggering algorithms.
Concrete implementations of a trigger class should inherit from this class. Minimally, only DoTheWork() needs to be implemented in the implementation class.
Definition at line 33 of file WCSimWCTrigger.hh.
WCSimWCTriggerBase::WCSimWCTriggerBase | ( | G4String | name, |
WCSimDetectorConstruction * | inDetector, | ||
WCSimWCDAQMessenger * | myMessenger, | ||
G4String | detectorElement | ||
) |
Create WCSimWCTriggerBase instance with knowledge of the detector and DAQ options.
Definition at line 38 of file WCSimWCTrigger.cc.
|
virtual |
Definition at line 65 of file WCSimWCTrigger.cc.
|
private |
modify the NDigits threshold based on the average dark noise rate
Definition at line 149 of file WCSimWCTrigger.cc.
|
protected |
An NDigits trigger algorithm.
Looks through the input WCSimWCDigitsCollection and integrates the number of hits in a (specified) time window If the integral passes above a (specified) threshold, a trigger is issued
The trigger type is kTriggerNDigits
The trigger time is the time of the first digit above threshold
The trigger information is the number of hits in the time window (i.e. the number of hits that caused the trigger to fire)
Currently setup with the optional 'test' argument which runs the algorithm with half the hit threshold for testing purposes. Triggers issued in this mode have type kTriggerNDigitsTest
Definition at line 226 of file WCSimWCTrigger.cc.
|
protected |
Definition at line 466 of file WCSimWCTrigger.cc.
void WCSimWCTriggerBase::Digitize | ( | ) |
The main user-callable routine of the class. Gets the input & creates the output WCSimWCTriggeredDigitsCollection's, then calls DoTheWork()
Definition at line 168 of file WCSimWCTrigger.cc.
|
protectedpure virtual |
This should call the trigger algorithms, and handle any temporary DigitsCollection's.
Implemented in WCSimWCTriggerNDigits2, WCSimWCTriggerNoTrigger, and WCSimWCTriggerNDigits.
|
private |
takes all trigger times, then loops over all Digits & fills the output DigitsCollection
Definition at line 338 of file WCSimWCTrigger.cc.
|
inlineprotectedvirtual |
Set the default trigger class specific decision of whether to save multiple digits per PMT per trigger (overridden by .mac)
Reimplemented in WCSimWCTriggerNDigits2, WCSimWCTriggerNoTrigger, and WCSimWCTriggerNDigits.
Definition at line 102 of file WCSimWCTrigger.hh.
|
inlineprotectedvirtual |
Set the default trigger class specific NDigits posttrigger window (in ns) (overridden by .mac)
Reimplemented in WCSimWCTriggerNDigits2, WCSimWCTriggerNoTrigger, and WCSimWCTriggerNDigits.
Definition at line 110 of file WCSimWCTrigger.hh.
|
inlineprotectedvirtual |
Set the default trigger class specific NDigits pretrigger window (in ns) (overridden by .mac)
Reimplemented in WCSimWCTriggerNDigits2, WCSimWCTriggerNoTrigger, and WCSimWCTriggerNDigits.
Definition at line 108 of file WCSimWCTrigger.hh.
|
inlineprotectedvirtual |
Set the default trigger class specific NDigits threshold (in ns) (overridden by .mac)
Reimplemented in WCSimWCTriggerNDigits2, WCSimWCTriggerNoTrigger, and WCSimWCTriggerNDigits.
Definition at line 106 of file WCSimWCTrigger.hh.
|
inlineprotectedvirtual |
Set the default trigger class specific NDigits window (in ns) (overridden by .mac)
Reimplemented in WCSimWCTriggerNDigits2, WCSimWCTriggerNoTrigger, and WCSimWCTriggerNDigits.
Definition at line 104 of file WCSimWCTrigger.hh.
|
inline |
Definition at line 63 of file WCSimWCTrigger.hh.
|
protected |
Get the posttrigger window for a given trigger algorithm.
Definition at line 128 of file WCSimWCTrigger.cc.
|
protected |
Get the pretrigger window for a given trigger algorithm.
Definition at line 107 of file WCSimWCTrigger.cc.
|
inline |
Get the trigger class name.
Definition at line 55 of file WCSimWCTrigger.hh.
|
inline |
Get the additional trigger information associated with the ith trigger.
Definition at line 53 of file WCSimWCTrigger.hh.
|
inline |
Get the time of the ith trigger.
Definition at line 49 of file WCSimWCTrigger.hh.
|
inline |
Get the trigger type of the ith trigger.
Definition at line 51 of file WCSimWCTrigger.hh.
|
protected |
Get the default threshold, etc. from the derived class, and override with read from the .mac file.
Definition at line 69 of file WCSimWCTrigger.cc.
|
inline |
Returns the number of trigger gates in the event (i.e. the number of triggers passed)
Definition at line 47 of file WCSimWCTrigger.hh.
|
inlineprotected |
Clear the Trigger* vectors and DigiHitMap.
Definition at line 150 of file WCSimWCTrigger.hh.
void WCSimWCTriggerBase::SaveOptionsToOutput | ( | WCSimRootOptions * | wcopt | ) |
Save current values of options.
Definition at line 483 of file WCSimWCTrigger.cc.
|
inline |
Knowledge of the dark rate (use for automatically adjusting for noise)
Definition at line 88 of file WCSimWCTrigger.hh.
|
inline |
Set whether to allow the number of digits per PMT per trigger to go > 1.
Definition at line 62 of file WCSimWCTrigger.hh.
|
inline |
Automatically adjust the NDigits threshold based on the average noise occupancy?
Definition at line 71 of file WCSimWCTrigger.hh.
|
inline |
Set the posttrigger window for the NDigits trigger (value will be forced positive)
Definition at line 75 of file WCSimWCTrigger.hh.
|
inline |
Set the pretrigger window for the NDigits trigger (value will be forced negative)
Definition at line 73 of file WCSimWCTrigger.hh.
|
inline |
Set the threshold for the NDigits trigger.
Definition at line 67 of file WCSimWCTrigger.hh.
|
inline |
Set the time window for the NDigits trigger.
Definition at line 69 of file WCSimWCTrigger.hh.
|
inline |
Set the mode for saving failed triggers (0:save only triggered events, 1:save both triggered events & failed events, 2:save only failed events)
Definition at line 79 of file WCSimWCTrigger.hh.
|
inline |
Set the posttrigger window for the SaveFailures trigger (value will be forced positive)
Definition at line 85 of file WCSimWCTrigger.hh.
|
inline |
Set the pretrigger window for the SaveFailures trigger (value will be forced negative)
Definition at line 83 of file WCSimWCTrigger.hh.
|
inline |
Set the dummy trigger time for the failed triggers.
Definition at line 81 of file WCSimWCTrigger.hh.
|
inlineprivate |
sort the Trigger vectors (Time, Type, Info) by Trigger Time
Definition at line 183 of file WCSimWCTrigger.hh.
|
protected |
Get the options from the .mac file.
Definition at line 145 of file WCSimWCTrigger.hh.
|
protected |
Definition at line 147 of file WCSimWCTrigger.hh.
|
protected |
Keeps track of the PMTs that have been added to the output WCSimWCTriggeredDigitsCollection.
Definition at line 139 of file WCSimWCTrigger.hh.
|
private |
Has Digitize() been called yet?
Definition at line 206 of file WCSimWCTrigger.hh.
|
protected |
The main output of the class - collection of digits in the trigger window.
Definition at line 138 of file WCSimWCTrigger.hh.
|
staticprivate |
An arbitrary long time to use in loops (ns)
Definition at line 204 of file WCSimWCTrigger.hh.
|
protected |
Allow the number of digits per PMT saved in each trigger window to go > 1?
Definition at line 160 of file WCSimWCTrigger.hh.
|
protected |
Know about the detector, so can add appropriate PMT time smearing.
Definition at line 146 of file WCSimWCTrigger.hh.
|
protected |
Automatically adjust the NDigits trigger threshold based on the average dark noise rate?
Definition at line 164 of file WCSimWCTrigger.hh.
|
protected |
The posttrigger window to save after an NDigits trigger.
Definition at line 166 of file WCSimWCTrigger.hh.
|
protected |
The pretrigger window to save before an NDigits trigger.
Definition at line 165 of file WCSimWCTrigger.hh.
|
protected |
The threshold for the NDigits trigger.
Definition at line 162 of file WCSimWCTrigger.hh.
|
protected |
The time window for the NDigits trigger.
Definition at line 163 of file WCSimWCTrigger.hh.
|
staticprivate |
Hit time offset (ns)
Definition at line 203 of file WCSimWCTrigger.hh.
|
protected |
Dark noise rate of the PMTs.
Definition at line 157 of file WCSimWCTrigger.hh.
|
protected |
The mode for saving events which don't pass triggers.
Definition at line 168 of file WCSimWCTrigger.hh.
|
protected |
The posttrigger window to save after an SaveFailures trigger.
Definition at line 171 of file WCSimWCTrigger.hh.
|
protected |
The pretrigger window to save before an SaveFailures trigger.
Definition at line 170 of file WCSimWCTrigger.hh.
|
protected |
The dummy trigger time for failed events.
Definition at line 169 of file WCSimWCTrigger.hh.
|
protected |
Save the name of the trigger class.
Definition at line 173 of file WCSimWCTrigger.hh.
|
protected |
Additional information associated with each trigger.
Definition at line 143 of file WCSimWCTrigger.hh.
|
protected |
The times of the triggers.
Definition at line 141 of file WCSimWCTrigger.hh.
|
protected |
The type of the triggers.
Definition at line 142 of file WCSimWCTrigger.hh.