UPV
3.2.0
An algorithm to measure noise correlations for gravitational-wave detectors
|
Study and characterize coupling between 2 trigger data sets. More...
#include <UUPV.h>
Public Member Functions | |
void | ComputeVetoSegments (void) |
Computes the veto segments. More... | |
unsigned int | GetSourceN (void) |
Returns the number of source channels. More... | |
string | GetSourceName (const unsigned int aSourceIndex) |
Returns the stream name of a given source. More... | |
bool | GetStatus (void) |
Returns the class status. More... | |
string | GetTargetName (void) |
Returns the target stream name. More... | |
unsigned int | GetVetoN (void) |
Returns the current number of vetoes. More... | |
string | GetVetoName (const unsigned int aVetoIndex) |
Returns the name of a given veto. More... | |
string | GetVetoName (void) |
Returns the name of the most recent veto. More... | |
bool | GetVetoPerfFlag (void) |
Returns the VetoPerf flag. More... | |
bool | GetVetoPrintFlag (void) |
Returns the print-veto flag. More... | |
Segments * | GetVetoSegments (void) |
Returns a copy of the most recent veto segments. More... | |
unsigned int | GetVetoUsed (const unsigned int aVetoIndex) |
Returns the number of source clusters used to veto a target cluster. More... | |
unsigned int | GetVetoUsed (void) |
Returns the number of source clusters used to veto a target cluster. More... | |
bool | MakeReport (vector< unsigned int > aVetoIndex) |
Generates a html report. More... | |
bool | MakeVeto (const unsigned int aSourceIndex, Segments *aSelSegments=NULL) |
Loads a set of source triggers and creates a new veto. More... | |
void | PrintMonitors (const unsigned int aVetoIndex) |
Prints veto monitors as plots in PNG files. More... | |
void | PrintMonitors (void) |
Prints the most recent veto monitors as plots in PNG files. More... | |
void | PrintVetoThr (const unsigned int aVetoIndex) |
Prints the veto threshold in a ROOT file. More... | |
void | PrintVetoThr (void) |
Prints the most recent veto threshold in a ROOT file. More... | |
void | RemoveVeto (const bool aRemoveDirectory=true) |
Removes the most recent veto from the veto list. More... | |
void | RemoveVeto (const unsigned int aVetoIndex, const bool aRemoveDirectory=true) |
Removes a given veto from the veto list. More... | |
void | SetSubTitle (const string aSubTitle) |
Adds a subtitle in the html output. More... | |
vector< unsigned int > | SortVetoes (void) |
Sorts vetoes by decreasing efficiencies (for html report). More... | |
void | VetoAttachChannels (vector< unsigned int > aSourceIndexList) |
Attaches a list of source channels to the last veto. More... | |
Constructors and destructors | |
UPV (const string aOptFile, Segments *aInSeg) | |
Constructor of the UPV class. More... | |
virtual | ~UPV (void) |
Destructor of the UPV class. More... | |
Private Member Functions | |
bool | GetParameters (void) |
Extract parameters from the option file. More... | |
void | InitVetoMonitors (void) |
Initializes the veto monitors. More... | |
Private Attributes | |
Coinc2 * | C2 |
Coincs object. More... | |
Segments * | insegments |
Initial segments. More... | |
string | optionfile |
Parameter file. More... | |
string | outdir |
Main output directory. More... | |
bool | printveto |
Flag to print the veto segments in UPV report. More... | |
ReadTriggers * | source |
Current source triggers. More... | |
double | source_clusterdt |
Time clustering to cluster source triggers [s]. More... | |
unsigned int | source_index |
Current source index. More... | |
bool | status_OK |
Class status. More... | |
string | subtitle |
Subtitle. More... | |
TriggerPlot * | target |
Target triggers. More... | |
time_t | timer_start |
Timer start. More... | |
vector< Usource > | usource |
List of sources. More... | |
vector< Uveto > | uveto |
List of vetoes. More... | |
unsigned int | verbosity |
Verbosity level. More... | |
unsigned int | veto_umin |
Veto use min. More... | |
double | veto_upmin |
Veto use-percentage min. More... | |
VetoPerf * | vp |
Veto perf object. More... | |
bool | vp_printveto |
VetoPerf: flag to print the veto segments. More... | |
bool | vp_printvetoclusters |
VetoPerf: flag to print the veto clusters. More... | |
bool | vp_report |
VetoPerf: flag to produce a VetoPerf report. More... | |
vector< double > | vp_snrthr |
VetoPerf SNR thresolds. More... | |
Study and characterize coupling between 2 trigger data sets.
The coupling is characterized using 'monitors' which are histograms measuring the trigger parameters as a function of the trigger frequency.
After the coupling is characterized, a veto is optimized for target triggers and using the source triggers.
UPV::UPV | ( | const string | aOptFile, |
Segments * | aInSeg | ||
) |
Constructor of the UPV class.
The option file is parsed with GetParameters(). Target triggers are loaded and clustered. The coincidence algorithm is initialized.
[in] | aOptFile | Path to option file. |
[in] | aInSeg | Pointer to input segments. |
|
virtual |
Destructor of the UPV class.
void UPV::ComputeVetoSegments | ( | void | ) |
Computes the veto segments.
This function should be called for each generated veto, after MakeVeto() and before MakeReport(). It loops over active source clusters loaded with MakeVeto() and adds a veto segment for each clusters above the veto threshold.
|
private |
Extract parameters from the option file.
Downloads the parameters from the option file.
The UPV parameters must be listed in a text file with a system of keywords.
TARGET TRIGGERS [path to trigger files]
This option provides the target trigger dataset. Triggers must be stored in ROOT files following the GWOLLUM convention. The list of trigger files must be separated by a space. Alternatively, a file pattern like /path/to/my/files/myfiles*.root
can be used, or even a list of file patterns. With this option, one can also simply give one directory where ROOT files are saved.
TARGET OMICRON [channel name]
Omicron triggers can also be used as target triggers. Here, just specify the name of the channel to consider. Of course, this option only works if Omicron triggers are centrally managed.
TARGET CLUSTERDT [time window]
Target triggers are clustered before being processed. Here you can specify the time window [s] for the clustering. Default: 0.1 s
TARGET SNRMIN [SNR]
Target clusters can be selected. Here specify the minimum SNR. Default: 7.
TARGET FREQUENCYMIN [frequency]
Target clusters can be selected. Here specify the minimum Frequency [Hz]. Default: -1.0 Hz.
TARGET FREQUENCYMAX [frequency]
Target clusters can be selected. Here specify the maximum Frequency [Hz]. Default: 1e20 Hz.
SOURCE TRIGGERS [path to trigger files]
This option provides the source trigger dataset. Triggers must be stored in ROOT files following the GWOLLUM convention. The list of trigger files must be separated by a space. Alternatively, a file pattern like /path/to/my/files/myfiles*.root
can be used, or even a list of file patterns. With this option, one can also simply give a list of directories where ROOT files are saved.
SOURCE OMICRON [channel names]
Omicron triggers can also be used as source triggers. Here, just specify the names of channels to consider. Of course this option only works if Omicron triggers are centrally managed.
SOURCE CLUSTERDT [time window]
Source triggers are clustered before being processed. Here you can specify the time window [s] for the clustering. Default: 0.1 s
COINC TIMEWIN [time window]
Coincidence time window [s]. Default: 1.0 s
VETO UMIN [minimum statistic]
Vetoes optimized with UPV require a minimum number of source clusters participating to a coincidence with a target cluster in a frequency bin. Define this parameter here. Default: 10
VETO UPMIN [minimum use-percentage]
Vetoes optimized with UPV require a minimum use-percentage. Define this parameter here. Default: 0.5
VETO PRINT [flag to print veto segments]
Veto segments are printed in text file if the flag is set to a non-zero value. Default: 0
VETO PERF [list of SNR thresholds]
After being optimized, vetoes can be tested using the VetoPerf algorithm. Provide here the list of SNR thresholds (target) to evaluate the veto performance. Default: no VetoPerf analysis.
VETO PERFPRINT [flag to print veto segments] [flag to print vetoed clusters]
Set these flags to 1 (or 0) to print (or not) in the vetoperf report:
OUTPUT DIRECTORY [output directory path]
Set the path to the output directory (must exist!) to save the result plots and the html report. Default: current directory.
OUTPUT VERBOSITY [verbosity level]
Set the verbosity level from 0 to 3. Default: 0
Example/template:
|
inline |
Returns the number of source channels.
|
inline |
Returns the stream name of a given source.
[in] | aSourceIndex | Source index. |
|
inline |
Returns the class status.
|
inline |
Returns the target stream name.
|
inline |
Returns the current number of vetoes.
|
inline |
Returns the name of a given veto.
[in] | aVetoIndex | Veto index. |
|
inline |
Returns the name of the most recent veto.
|
inline |
Returns the VetoPerf flag.
|
inline |
Returns the print-veto flag.
|
inline |
Returns a copy of the most recent veto segments.
|
inline |
Returns the number of source clusters used to veto a target cluster.
[in] | aVetoIndex | Veto index. |
|
inline |
Returns the number of source clusters used to veto a target cluster.
|
private |
Initializes the veto monitors.
bool UPV::MakeReport | ( | vector< unsigned int > | aVetoIndex | ) |
Generates a html report.
The VetoPerf report is also generated if requested in the UPV option file: see GetParameters().
[in] | aVetoIndex | Sorted list of veto indices. |
bool UPV::MakeVeto | ( | const unsigned int | aSourceIndex, |
Segments * | aSelSegments = NULL |
||
) |
Loads a set of source triggers and creates a new veto.
The source triggers are loaded and clustered. The resulting clusters are set in coincidence with the target clusters.
A new veto is created and tuned using the coincidence results. All the tuning monitors are saved in memory as well as the veto threshold.
The veto threshold is a SNR threshold which is frequency dependent. It applies to the source triggers. The veto threshold is tuned to have a minimum source use-percentage and a minimum number of coincident clusters, as requested from the option file.
[in] | aSourceIndex | Source index. |
[in] | aSelSegments | If not NULL, these segments are used to select the coincidence segments. |
void UPV::PrintMonitors | ( | const unsigned int | aVetoIndex | ) |
Prints veto monitors as plots in PNG files.
The PNG files are saved in the veto output directory.
[in] | aVetoIndex | Veto index |
|
inline |
Prints the most recent veto monitors as plots in PNG files.
The PNG files are saved in the veto output directory.
void UPV::PrintVetoThr | ( | const unsigned int | aVetoIndex | ) |
Prints the veto threshold in a ROOT file.
The ROOT file is saved in the veto output directory.
[in] | aVetoIndex | Veto index |
|
inline |
Prints the most recent veto threshold in a ROOT file.
The ROOT file is saved in the veto output directory.
|
inline |
Removes the most recent veto from the veto list.
[in] | aRemoveDirectory | Set this flag to true to also remove the veto directory and its content. |
void UPV::RemoveVeto | ( | const unsigned int | aVetoIndex, |
const bool | aRemoveDirectory = true |
||
) |
Removes a given veto from the veto list.
[in] | aVetoIndex | Veto index. |
[in] | aRemoveDirectory | Set this flag to true to also remove the veto directory and its content. |
|
inline |
Adds a subtitle in the html output.
[in] | aSubTitle | Subtitle string. |
vector< unsigned int > UPV::SortVetoes | ( | void | ) |
Sorts vetoes by decreasing efficiencies (for html report).
void UPV::VetoAttachChannels | ( | vector< unsigned int > | aSourceIndexList | ) |
Attaches a list of source channels to the last veto.
A list of source channels can be attached to a veto. It is provided as a list of source indices. The list of channels is printed in a text file in the veto directory: "veto_attached.txt".
[in] | aSourceIndexList | List of source indices. |
|
private |
Coincs object.
|
private |
Initial segments.
|
private |
Parameter file.
|
private |
Main output directory.
|
private |
Flag to print the veto segments in UPV report.
|
private |
Current source triggers.
|
private |
Time clustering to cluster source triggers [s].
|
private |
Current source index.
|
private |
Class status.
|
private |
Subtitle.
|
private |
Target triggers.
|
private |
Timer start.
|
private |
List of sources.
|
private |
List of vetoes.
|
private |
Verbosity level.
|
private |
Veto use min.
|
private |
Veto use-percentage min.
|
private |
Veto perf object.
|
private |
VetoPerf: flag to print the veto segments.
|
private |
VetoPerf: flag to print the veto clusters.
|
private |
VetoPerf: flag to produce a VetoPerf report.
|
private |
VetoPerf SNR thresolds.