GWOLLUM 4.2.0
Tools for gravitational-wave analyses
Loading...
Searching...
No Matches
Coinc2.h
Go to the documentation of this file.
1
6#ifndef __Coinc2__
7#define __Coinc2__
8
9#include "GwollumPlot.h"
10#include "TriggerSelect.h"
11
12using namespace std;
13
17#define COINC2_NT 2
18
27class Coinc2: public GwollumPlot {
28
29 public:
30
39 Coinc2(const unsigned int aVerbose=0);
40
44 virtual ~Coinc2(void);
52 inline bool GetStatus(void){ return mon->GetStatus(); };
53
73 bool SetTriggers(ReadTriggers *aTrigger0, ReadTriggers *aTrigger1,
74 const double aTimeOffset0=0.0, const double aTimeOffset1=0.0,
75 Segments *aValidSegments=NULL);
76
90 unsigned int MakeCoinc(void);
91
95 void PrintCoinc(void);
96
102 void PrintCoincNot(const unsigned int aSampleIndex);
103
115 inline double GetCoincTimeWindowStart(const unsigned int aSampleIndex, const unsigned int aClusterIndex){
116 return TMath::Max(triggers[aSampleIndex]->GetClusterTime(aClusterIndex)+toffset[aSampleIndex]-coinc_dt/2.0,
117 triggers[aSampleIndex]->GetClusterTimeStart(aClusterIndex)+toffset[aSampleIndex]);
118 };
119
131 inline double GetCoincTimeWindowEnd(const unsigned int aSampleIndex, const unsigned int aClusterIndex){
132 return TMath::Min(triggers[aSampleIndex]->GetClusterTime(aClusterIndex)+toffset[aSampleIndex]+coinc_dt/2.0,
133 triggers[aSampleIndex]->GetClusterTimeEnd(aClusterIndex)+toffset[aSampleIndex]);
134 };
135
140 inline void SetCoincDeltat(const double aDeltat){ coinc_dt=aDeltat; };
141
145 inline unsigned int GetCoincN(void){ return CoC[0].size(); };
146
153 inline unsigned int GetClusterIndex(const unsigned int aSampleIndex, const unsigned int aCoincIndex){
154 return CoC[aSampleIndex%COINC2_NT][aCoincIndex];
155 };
156
163 inline void SetCoincTag(const unsigned int aCoincIndex, const bool aNewTag){
164 CoTag[aCoincIndex]=aNewTag;
165 };
166
171 inline void SetCoincTag(const bool aNewTag){
172 for(unsigned int c=0; c<CoC[0].size(); c++) CoTag[c]=aNewTag;
173 };
174
180 inline bool GetCoincTag(const unsigned int aCoincIndex){ return CoTag[aCoincIndex]; };
181
189 inline unsigned int GetActiveClusterN(const unsigned int aSampleIndex){
190 return nactive[aSampleIndex%COINC2_NT];
191 };
192
197 inline double GetTimeOffset(const unsigned int aSampleIndex){
198 return toffset[aSampleIndex%COINC2_NT];
199 };
200
204 inline double GetCoincDeltat(void){ return coinc_dt; };
205
209 inline double GetCoincLiveTime(void){ return CoSeg->GetLiveTime(); };
210
215 return CoSeg;
216 };
217
222 return new Segments(CoSeg->GetStarts(), CoSeg->GetEnds());
223 };
224
231 inline void SetSnrMin(const unsigned int aSampleIndex, const double aSnrMin){
232 snrmin[aSampleIndex%COINC2_NT]=aSnrMin;
233 return;
234 };
235
240 inline double GetSnrMin(const unsigned int aSampleIndex){
241 return snrmin[aSampleIndex%COINC2_NT];
242 };
243
251 inline void SetFrequencyRange(const unsigned int aSampleIndex, const double aFrequencyMin, const double aFrequencyMax){
252 freqmin[aSampleIndex%COINC2_NT]=aFrequencyMin;
253 freqmax[aSampleIndex%COINC2_NT]=aFrequencyMax;
254 return;
255 };
256
261 inline double GetFrequencyMin(const unsigned int aSampleIndex){
262 return freqmin[aSampleIndex%COINC2_NT];
263 };
264
269 inline double GetFrequencyMax(const unsigned int aSampleIndex){
270 return freqmax[aSampleIndex%COINC2_NT];
271 };
272
286 bool MakeComparators(void);
287
293 void PrintComparators(const string aFileName);
294
295 private:
296
298
299 // TRIGGERS
302 unsigned int nactive[COINC2_NT];
306
307 // COINC
308 double coinc_dt;
309 vector <unsigned int> CoC[COINC2_NT];
310 bool *CoTag;
312
313 // COMPARATORS
314 TH1D *hc_snrfrac[2];
315 TH1D *hc_freqfrac[2];
316 TGraph *gc_snrtime[4];
317 TGraph *gc_freqtime[4];
318 TGraph *gc_snrsnr;
319 TGraph *gc_freqfreq;
320
332 void SelectClusters(const unsigned int aSampleIndex);
333
334 ClassDef(Coinc2,0)
335};
336
337#endif
338
339
#define COINC2_NT
Number of trigger sets.
Definition Coinc2.h:17
Interface to draw and print ROOT objects.
Select trigger parameters.
Set two trigger sets in coincidence.
Definition Coinc2.h:27
double GetFrequencyMax(const unsigned int aSampleIndex)
Returns the miaximum frequency used to select input clusters [Hz].
Definition Coinc2.h:269
Monitor * mon
Class monitor.
Definition Coinc2.h:297
double freqmax[COINC2_NT]
Frequency max selection [Hz].
Definition Coinc2.h:305
TGraph * gc_snrtime[4]
SNR vs time.
Definition Coinc2.h:316
double snrmin[COINC2_NT]
SNR min selection.
Definition Coinc2.h:303
void SetCoincTag(const unsigned int aCoincIndex, const bool aNewTag)
Sets a new tag to a given coinc event.
Definition Coinc2.h:163
bool MakeComparators(void)
Produce plots for coinc events.
Definition Coinc2.cc:298
vector< unsigned int > CoC[COINC2_NT]
Coinc cluster index.
Definition Coinc2.h:309
double freqmin[COINC2_NT]
Frequency min selection [Hz].
Definition Coinc2.h:304
void SetSnrMin(const unsigned int aSampleIndex, const double aSnrMin)
Sets a minimum SNR to select input clusters.
Definition Coinc2.h:231
unsigned int GetClusterIndex(const unsigned int aSampleIndex, const unsigned int aCoincIndex)
Returns the cluster index involved in a given coinc event.
Definition Coinc2.h:153
bool SetTriggers(ReadTriggers *aTrigger0, ReadTriggers *aTrigger1, const double aTimeOffset0=0.0, const double aTimeOffset1=0.0, Segments *aValidSegments=NULL)
Sets the trigger sets.
Definition Coinc2.cc:68
double GetSnrMin(const unsigned int aSampleIndex)
Returns the minimum SNR used to select input clusters [Hz].
Definition Coinc2.h:240
ReadTriggers * triggers[COINC2_NT]
Trigger sets.
Definition Coinc2.h:300
void PrintCoincNot(const unsigned int aSampleIndex)
Prints the list of active clusters NOT participating to a coinc event.
Definition Coinc2.cc:258
void SelectClusters(const unsigned int aSampleIndex)
Select input clusters.
Definition Coinc2.cc:605
virtual ~Coinc2(void)
Destructor of the Coinc2 class.
Definition Coinc2.cc:47
bool GetStatus(void)
Returns the class status.
Definition Coinc2.h:52
double GetCoincLiveTime(void)
Returns the livetime of coinc segments [s].
Definition Coinc2.h:209
Segments * GetCoincSegments(void)
Returns a pointer to the coincidence segments.
Definition Coinc2.h:214
double GetFrequencyMin(const unsigned int aSampleIndex)
Returns the minimum frequency used to select input clusters [Hz].
Definition Coinc2.h:261
unsigned int GetActiveClusterN(const unsigned int aSampleIndex)
Gets the number of active clusters.
Definition Coinc2.h:189
double GetTimeOffset(const unsigned int aSampleIndex)
Returns the time offset of a trigger set [s].
Definition Coinc2.h:197
void PrintComparators(const string aFileName)
Prints plots for coinc events.
Definition Coinc2.cc:472
TGraph * gc_freqfreq
Frequency vs frequency.
Definition Coinc2.h:319
TGraph * gc_snrsnr
Coinc SNR vs SNR.
Definition Coinc2.h:318
unsigned int nactive[COINC2_NT]
Number of active clusters.
Definition Coinc2.h:302
double GetCoincTimeWindowEnd(const unsigned int aSampleIndex, const unsigned int aClusterIndex)
Returns the coincidence time window end [s].
Definition Coinc2.h:131
void PrintCoinc(void)
Prints the list of coinc events in the standard output.
Definition Coinc2.cc:237
Segments * GetCoincSegmentsCopy(void)
Returns a copy of coincidence segments.
Definition Coinc2.h:221
double coinc_dt
Coinc time distance [s].
Definition Coinc2.h:308
TGraph * gc_freqtime[4]
Coinc Frequency vs time.
Definition Coinc2.h:317
bool * CoTag
Coinc tags.
Definition Coinc2.h:310
TH1D * hc_freqfrac[2]
coinc fraction vs frequency
Definition Coinc2.h:315
double GetCoincTimeWindowStart(const unsigned int aSampleIndex, const unsigned int aClusterIndex)
Returns the coincidence time window start [s].
Definition Coinc2.h:115
unsigned int GetCoincN(void)
Returns the current number of coinc events.
Definition Coinc2.h:145
bool GetCoincTag(const unsigned int aCoincIndex)
Gets the tag value of a given coinc event.
Definition Coinc2.h:180
void SetCoincDeltat(const double aDeltat)
Sets the chacteristic duration to define a coinc .
Definition Coinc2.h:140
double GetCoincDeltat(void)
Returns the chacteristic duration defining a coinc [s].
Definition Coinc2.h:204
void SetFrequencyRange(const unsigned int aSampleIndex, const double aFrequencyMin, const double aFrequencyMax)
Sets a frequency range to select input clusters.
Definition Coinc2.h:251
double toffset[COINC2_NT]
Time offsets [s].
Definition Coinc2.h:301
Segments * CoSeg
Coinc segments.
Definition Coinc2.h:311
unsigned int MakeCoinc(void)
Runs the coincidence algorithm.
Definition Coinc2.cc:173
Coinc2(const unsigned int aVerbose=0)
Constructor of the Coinc2 class.
void SetCoincTag(const bool aNewTag)
Sets a new tag for all coinc events.
Definition Coinc2.h:171
TH1D * hc_snrfrac[2]
coinc fraction vs SNR
Definition Coinc2.h:314
Interface to draw and print ROOT objects.
Definition GwollumPlot.h:39
Monitor a GWOLLUM processing.
Definition Monitor.h:39
bool GetStatus(void)
Returns the object status.
Definition Monitor.h:109
Read trigger files.
Definition ReadTriggers.h:19
Manage time segment lists.
Definition Segments.h:29
vector< double > GetEnds(void)
Returns the list of segment ends.
Definition Segments.h:144
vector< double > GetStarts(void)
Returns the list of segment starts.
Definition Segments.h:139
double GetLiveTime(void)
Returns the total livetime.
Definition Segments.h:195