Coinc2 Class Reference

Set 2 trigger sets in coincidence. More...

#include <Coinc2.h>

Inheritance diagram for Coinc2:
Inheritance graph
[legend]
Collaboration diagram for Coinc2:
Collaboration graph
[legend]

List of all members.

Public Member Functions

int GetClusterIndex (const int aSampleIndex, const int aCoincIndex)
 Returns the cluster index involved in a given coinc event.
double GetCoincLiveTime (void)
 Returns the live time of coinc segments.
bool GetCoincTag (const int aCoincIndex)
 Gets the tag value of a given coinc.
int GetNActiveClusters (const int aSampleIndex)
 Gets the tag value of a given coinc.
int GetNCoinc (void)
 Returns the current number of coinc events.
int MakeCoinc (void)
 Runs the reference coincidence algorithm.
int MakeCoincWithSmartShift (void)
 Runs the coincidence algorithm with a smart shift.
bool MakeComparators (const string aTriggerId0, const string aTriggerId1)
 Fills monitors.
void PrintCoinc (void)
 Prints coinc events.
bool PrintComparator (const string aComparatorName)
void SetCoincAf (const double aAf)
 Sets the maximum frequency asymmetry to define a coinc.
void SetCoincDf (const double aDf)
 Sets the maximum frequency distance to define a coinc.
void SetCoincDt (const double aDt)
 Sets the maximum time distance to define a coinc.
void SetCoincTag (const bool aNewTag)
 Sets a new tag for all coincs.
void SetCoincTag (const int aCoincIndex, const bool aNewTag)
 Sets a new tag to a given coinc.
bool SetTriggerSamples (ReadTriggers *aTriggerSample0, ReadTriggers *aTriggerSample1, const double aTimeOffset0=0.0, const double aTimeOffset1=0.0, Segments *aValidSegments=NULL)
 Sets trigger samples.
bool WriteCoinc (const string aOutDir, const string aOutFileName)
 Writes coinc events on disk.
Constructors and destructors



 Coinc2 (ReadTriggers *aTriggerSample0, ReadTriggers *aTriggerSample1, const int aVerbose=0)
 Constructor of the Coinc2 class.
 Coinc2 (const int aVerbose=0)
 Constructor of the Coinc2 class.
virtual ~Coinc2 (void)
 Destructor of the Coinc2 class.

Protected Attributes

vector< int > CoC [2]
 coinc cluster index
double coinc_af
 coinc frequency asymmetry
double coinc_df
 coinc frequency distance
double coinc_dt
 coinc time distance
SegmentsCoSeg
 coinc segments
bool * CoTag
 coinc tag
TTree * CoTree
 coinc tree
TH2D * h_ct [2]
 number of active clusters
TH2D * h_ct_coinc [2]
 number of clusters in a coinc
TH2D * h_ctcum [2]
 cumulative number of active clusters
TH2D * h_ctcum_coinc [2]
 cumulative number of clusters in a coinc
TH2D * hc_af
 frequency asymmetry vs SNR
TH2D * hc_asnr
 SNR asymmetry vs SNR.
TH2D * hc_ff
 frequency vs frequency
TH2D * hc_snrsnr
 SNR vs snr.
int nactive [2]
 number of active clusters
bool smartshift
 smart shift flag
double toffset [2]
 time offset
ReadTriggerstriggers [2]
 trigger samples
int verbosity
 verbosity level

Detailed Description

Set 2 trigger sets in coincidence.

The coincidence algorithm includes a time and a frequency coincidence scheme.

Author:
Florent Robinet

Constructor & Destructor Documentation

Coinc2::Coinc2 ( const int  aVerbose = 0  ) 

Constructor of the Coinc2 class.

Sets parameters to default:

Two input triggger samples must be given. They are indexed 0 and 1. Triggers must be clustered before using this class! Triggers must not be changed when using the Coinc2 class methods. Use SetTriggerSamples() to define the input trigger samples.

Parameters:
aVerbose verbosity level
Coinc2::Coinc2 ( ReadTriggers aTriggerSample0,
ReadTriggers aTriggerSample1,
const int  aVerbose = 0 
)

Constructor of the Coinc2 class.

Sets parameters to default:

  • coincidence time distance = 0.0s (see SetCoincDt())
  • coincidence frequency distance = 0.0Hz (see SetCoincDf())
  • coincidence frequency asymmetry = 1.0 (see SetCoincAf())
  • no time offset applied to the cluster (see SetTriggerSample())

Two input triggger samples must be given. They are indexed 0 and 1. Triggers must be clustered before using this class! Triggers must not be changed when using the Coinc2 class methods. If needed, use SetTriggerSamples() to change the input trigger samples defined in this constructor.

Parameters:
aTriggerSample0 first input trigger sample
aTriggerSample1 second input trigger sample
aVerbose verbosity level
Coinc2::~Coinc2 ( void   )  [virtual]

Destructor of the Coinc2 class.


Member Function Documentation

int Coinc2::GetClusterIndex ( const int  aSampleIndex,
const int  aCoincIndex 
) [inline]

Returns the cluster index involved in a given coinc event.

Returns -1 if this function fails.

Parameters:
aSampleIndex trigger sample index: 0 or 1
aCoincIndex coinc index
double Coinc2::GetCoincLiveTime ( void   )  [inline]

Returns the live time of coinc segments.

bool Coinc2::GetCoincTag ( const int  aCoincIndex  )  [inline]

Gets the tag value of a given coinc.

Returns false if this function fails.

Parameters:
aCoincIndex coinc index
int Coinc2::GetNActiveClusters ( const int  aSampleIndex  )  [inline]

Gets the tag value of a given coinc.

Returns false if this function fails.

Parameters:
aSampleIndex trigger sample index: 0 or 1
int Coinc2::GetNCoinc ( void   )  [inline]

Returns the current number of coinc events.

int Coinc2::MakeCoinc ( void   ) 

Runs the reference coincidence algorithm.

Returns the number of coinc events. Returns -1 if this function fails. 2 clusters are said to coincide if 3 conditions are verified:

  • the time distance between the cluster time limits is smaller than the coinc parameter set with SetCoincDt() (note that the time offset defined with SetTriggerSample() is applied).
  • the frequency distance between the cluster frequency limits is smaller than the coinc parameter set with SetCoincDf().
  • the frequency asymmetry between the cluster peak frequency is smaller or equal to the coinc parameter set with SetCoincAf().

Coinc events can be tagged (see SetCoincTag()), by default, all coincs are tagged to true.

int Coinc2::MakeCoincWithSmartShift ( void   ) 

Runs the coincidence algorithm with a smart shift.

Returns the number of coinc events. Returns -1 if this function fails. 2 clusters are said to coincide if only a time condition is verified:

  • the time distance between the cluster time limits is smaller than the coinc parameter set with SetCoincDt() (note that the time offset defined with SetTriggerSample() is applied).

For the time coincidence, the cluster time edges of sample 0 are redefined: this is called the "smart shift". The cluster is shifted forward in time so that it starts where it used to end (+ the clustering Dt). If the new cluster ends after the next cluster starts (- the clustering Dt), the new cluster end is set to this limit.

bool Coinc2::MakeComparators ( const string  aTriggerId0,
const string  aTriggerId1 
)

Fills monitors.

When called after performing a coincidence, this function fills 2-dimensional (cluster SNR/frequency) histograms, called monitors. There are 3 types of monitors, they are filled with:

  • the number of valid clusters
  • the number of valid clusters involved in a coinc
  • the number of valid clusters not involved in a coinc

If requested, clusters can be weighted by 1.0/(cluster duration)

Parameters:
aWeighted flag to use weighted monitors Writes monitors on disk (root file).
aOutDir output directory (must exist)
aOutFileName output file name (do not provide an extension)
void Coinc2::PrintCoinc ( void   ) 

Prints coinc events.

bool Coinc2::PrintComparator ( const string  aComparatorName  ) 
void Coinc2::SetCoincAf ( const double  aAf  )  [inline]

Sets the maximum frequency asymmetry to define a coinc.

Parameters:
aDf maximum frequency asymmetry value [between 0 and 1]
void Coinc2::SetCoincDf ( const double  aDf  )  [inline]

Sets the maximum frequency distance to define a coinc.

Parameters:
aDf maximum frequency distance value [Hz]
void Coinc2::SetCoincDt ( const double  aDt  )  [inline]

Sets the maximum time distance to define a coinc.

Parameters:
aDt maximum time distance value [s]
void Coinc2::SetCoincTag ( const bool  aNewTag  )  [inline]

Sets a new tag for all coincs.

Parameters:
aNewTag new tag value
void Coinc2::SetCoincTag ( const int  aCoincIndex,
const bool  aNewTag 
) [inline]

Sets a new tag to a given coinc.

Parameters:
aCoincIndex coinc index
aNewTag new tag value
bool Coinc2::SetTriggerSamples ( ReadTriggers aTriggerSample0,
ReadTriggers aTriggerSample1,
const double  aTimeOffset0 = 0.0,
const double  aTimeOffset1 = 0.0,
Segments aValidSegments = NULL 
)

Sets trigger samples.

This function is used to define the input trigger samples. This function is also to be used after any change performed in the trigger sample (with ReadTriggers methods). Finally, this function can be used to apply a time offset to the clusters.

  • coinc segments are defined as the intersection of both trigger samples (using time offsets and user time segements).
  • previous coinc events are deleted from memory
  • clusters are tagged: 1 if the peak time is inside a coinc segment, -1 otherwise (the cluster is discarded by the methods of this class).
  • coinc monitors are reset

IMPORTANT1: input triggers must be clustered first! IMPORTANT2: if clusters are tagged with -1 value before calling this function, they will not be considered at all, even if inside a coinc segment.

Parameters:
aTriggerSample0 pointer to the first trigger object
aTriggerSample1 pointer to the second trigger object
aTimeOffset0 time offset to apply to the clusters of the first sample
aTimeOffset1 time offset to apply to the clusters of the second sample
aValidSegments list of segments where to consider clusters (before time offset!)
bool Coinc2::WriteCoinc ( const string  aOutDir,
const string  aOutFileName 
)

Writes coinc events on disk.

Two trigger structures (See MakeTriggers) are saved in two separate root directories (clusters_0 and clusters_1). The trigger structures contain parameters for clusters involved in a coinc event. Only coinc with a tag set to true are saved, see SetCoincTag(). Additionally, a tree named coinc2param is saved. It contains a single entry with the parameters used for the coincidence (time and frequency windows, time offsets etc.).

Parameters:
aOutDir output directory (must exist)
aOutFileName output file name (do not provide an extension)

Reimplemented in InjCoi.


Member Data Documentation

vector<int> Coinc2::CoC[2] [protected]

coinc cluster index

double Coinc2::coinc_af [protected]

coinc frequency asymmetry

double Coinc2::coinc_df [protected]

coinc frequency distance

double Coinc2::coinc_dt [protected]

coinc time distance

Segments* Coinc2::CoSeg [protected]

coinc segments

bool* Coinc2::CoTag [protected]

coinc tag

TTree* Coinc2::CoTree [protected]

coinc tree

TH2D* Coinc2::h_ct[2] [protected]

number of active clusters

TH2D* Coinc2::h_ct_coinc[2] [protected]

number of clusters in a coinc

TH2D* Coinc2::h_ctcum[2] [protected]

cumulative number of active clusters

TH2D* Coinc2::h_ctcum_coinc[2] [protected]

cumulative number of clusters in a coinc

TH2D* Coinc2::hc_af [protected]

frequency asymmetry vs SNR

TH2D* Coinc2::hc_asnr [protected]

SNR asymmetry vs SNR.

TH2D* Coinc2::hc_ff [protected]

frequency vs frequency

TH2D* Coinc2::hc_snrsnr [protected]

SNR vs snr.

int Coinc2::nactive[2] [protected]

number of active clusters

bool Coinc2::smartshift [protected]

smart shift flag

double Coinc2::toffset[2] [protected]

time offset

ReadTriggers* Coinc2::triggers[2] [protected]

trigger samples

Reimplemented in MorphMatch.

int Coinc2::verbosity [protected]

verbosity level


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Friends Defines

Generated on 29 Sep 2016 by  doxygen 1.6.1