GWOLLUM 4.2.0
Tools for gravitational-wave analyses
Loading...
Searching...
No Matches
TriggerPlot.h
Go to the documentation of this file.
1
6#ifndef __TriggerPlot__
7#define __TriggerPlot__
8
9#include "GwollumPlot.h"
10#include "ReadTriggers.h"
11#include "TriggerSelect.h"
12#include "Date.h"
13#include "TF1.h"
14#include "TH1.h"
15#include "TH2.h"
16#include "TGraph.h"
17
18using namespace std;
19
33class TriggerPlot: public GwollumPlot, public ReadTriggers {
34
35 public:
36
50 TriggerPlot(const unsigned int aNcoll, const string aPattern, const string aDirectory="",
51 const string aStyleName="GWOLLUM", const unsigned int aVerbose=0);
52
56 virtual ~TriggerPlot(void);
67 void MakeCollection(const int aCollIndex=-1, Segments *aInSeg=NULL);
68
73 inline void PrintPlot(TObject *aObj){
75 };
76
83 inline void PrintPlot(const string aPlotType,
84 const unsigned int aCollIndex,
85 const bool aFirst=true){
86 vector <unsigned int> ind(1, aCollIndex);
87 return PrintPlot(aPlotType, ind, aFirst);
88 };
89
94 inline void PrintPlot(const string aPlotType){
95 vector <unsigned int> ind;
96 for(unsigned int i=0; i<Ncoll; i++) ind.push_back(i);
97 return PrintPlot(aPlotType, ind, true);
98
99 };
100
108 void PrintPlot(const string aPlotType,
109 const vector<unsigned int> aCollIndex,
110 const bool aFirst);
111
117 inline TriggerSelect* GetCollectionSelection(const unsigned int aCollIndex){
118 return Collection[aCollIndex];
119 };
120
134 void SetSelectionSegments(Segments *SelectionSegments);
135
142 inline void SetCollectionLegend(const unsigned int aCollIndex,
143 const string aLegend){
144 legend[aCollIndex]=aLegend;
145 };
146
153 inline void SetCollectionColor(const unsigned int aCollIndex,
154 const unsigned int aColorIndex){
155 Hfreqtime[aCollIndex]->SetMarkerColor(aColorIndex);
156 };
157
165 inline void SetCollectionMarker(const unsigned int aCollIndex,
166 const unsigned int aMarkerStyleIndex,
167 const double aMarkerSize=1.0){
168 Hfreqtime[aCollIndex]->SetMarkerStyle(aMarkerStyleIndex);
169 Hfreqtime[aCollIndex]->SetMarkerSize(aMarkerSize);
170 };
171
177 inline unsigned int GetCollectionN(const unsigned int aCollIndex){
178 return (unsigned int)Gfreqtime[aCollIndex]->GetN();
179 };
180
187 TH1D* GetTH1D(const string aPlotType, const unsigned int aCollIndex);
188
196 TGraph* GetTGraph(TH1D** aFrame, const string aPlotType, const unsigned int aCollIndex);
197
201 inline unsigned int GetN(void){ return Ncoll; };
202
209 inline double GetYmax(const string aPlotType, const int aCollIndex){
210 if(!aPlotType.compare("snrtime"))
211 return Hsnrtime[aCollIndex]->GetYaxis()->GetXmax();
212 else if(!aPlotType.compare("snrfreq"))
213 return Hsnrfreq[aCollIndex]->GetYaxis()->GetXmax();
214 else if(!aPlotType.compare("rate"))
215 return Htime[aCollIndex]->GetYaxis()->GetXmax();
216 else if(!aPlotType.compare("frequency"))
217 return Hfreq[aCollIndex]->GetYaxis()->GetXmax();
218 else if(!aPlotType.compare("snr"))
219 return Hsnr[aCollIndex]->GetYaxis()->GetXmax();
220 else
221 return Hfreqtime[aCollIndex]->GetYaxis()->GetXmax();
222 };
223
230 inline double GetYmin(const string aPlotType, const int aCollIndex){
231 if(!aPlotType.compare("snrtime"))
232 return Hsnrtime[aCollIndex]->GetYaxis()->GetXmin();
233 else if(!aPlotType.compare("snrfreq"))
234 return Hsnrfreq[aCollIndex]->GetYaxis()->GetXmin();
235 else if(!aPlotType.compare("rate"))
236 return Htime[aCollIndex]->GetYaxis()->GetXmin();
237 else if(!aPlotType.compare("frequency"))
238 return Hfreq[aCollIndex]->GetYaxis()->GetXmin();
239 else if(!aPlotType.compare("snr"))
240 return Hsnr[aCollIndex]->GetYaxis()->GetXmin();
241 else
242 return Hfreqtime[aCollIndex]->GetYaxis()->GetXmin();
243 };
244
249 inline void PlotLoudestEvent(const bool aFlag=true){ plotstar=aFlag; };
250
257 inline void SetRateRange(const double aRateMin, const double aRateMax){
258 rate_min = aRateMin;
259 rate_max = aRateMax;
260 };
261
262
263 private:
264
265 // PLOTS
266 unsigned int Ncoll;
267 TH2D **Hfreqtime;
268 TGraph **Gfreqtime;
271 TH2D **Hsnrtime;
272 TGraph **Gsnrtime;
273 TH2D **Hsnrfreq;
274 TGraph **Gsnrfreq;
275 TH1D **Htime;
276 TH1D **Hfreq;
277 TH1D **Hsnr;
278
279 // STYLE
280 string *legend;
281 bool plotstar;
282 double rate_min;
283 double rate_max;
284
285 // SELECTION
288
289 // BOX
290 TPave *SegBox;
291 TPave **OnBox;
292 TPave **SelBox;
293 unsigned int nonbox;
294 unsigned int nselbox;
295
302 void ResetCollection(const unsigned int aCollIndex);
303
314 void ResetParameters(const unsigned int aCollIndex);
315
316
317 ClassDef(TriggerPlot,0)
318};
319
320#endif
321
322
Generic timing routines.
Interface to draw and print ROOT objects.
Read triggers in ROOT files.
Select trigger parameters.
Interface to draw and print ROOT objects.
Definition GwollumPlot.h:39
TPad * Wpad
Working pad.
Definition GwollumPlot.h:338
void Draw(TObject *aObj, const string aOptions="", const int aPadIndex=0)
Draws ROOT object.
Definition GwollumPlot.h:132
void ResetLegend(void)
Resets and removes current legend box.
Definition GwollumPlot.h:119
Read trigger files.
Definition ReadTriggers.h:19
Manage time segment lists.
Definition Segments.h:29
Plot triggers.
Definition TriggerPlot.h:33
TGraph * Gfreqtimeloud2
Freq vs. time (loudest event).
Definition TriggerPlot.h:270
TGraph ** Gsnrtime
SNR vs. time.
Definition TriggerPlot.h:272
void ResetCollection(const unsigned int aCollIndex)
Resets a collection.
Definition TriggerPlot.cc:542
TriggerSelect * GetCollectionSelection(const unsigned int aCollIndex)
Returns the selection of a given collection.
Definition TriggerPlot.h:117
unsigned int nonbox
Number of on-boxes.
Definition TriggerPlot.h:293
TH2D ** Hsnrtime
SNR vs. time container.
Definition TriggerPlot.h:271
TPave ** OnBox
ON segments.
Definition TriggerPlot.h:291
TH1D * GetTH1D(const string aPlotType, const unsigned int aCollIndex)
Returns a TH1D copy from a given collection.
Definition TriggerPlot.cc:497
void SetRateRange(const double aRateMin, const double aRateMax)
Sets the range for the rate plot.
Definition TriggerPlot.h:257
double rate_max
Maximum value to plot the rate [Hz].
Definition TriggerPlot.h:283
double GetYmax(const string aPlotType, const int aCollIndex)
Returns the Y max of the plot in the canvas.
Definition TriggerPlot.h:209
TPave * SegBox
Time box.
Definition TriggerPlot.h:290
void PlotLoudestEvent(const bool aFlag=true)
Plots the loudest event with a star marker.
Definition TriggerPlot.h:249
TPave ** SelBox
Selected segments.
Definition TriggerPlot.h:292
TH1D ** Htime
Time (rate).
Definition TriggerPlot.h:275
unsigned int nselbox
Number of selected-boxes.
Definition TriggerPlot.h:294
void MakeCollection(const int aCollIndex=-1, Segments *aInSeg=NULL)
Builds collection plots.
Definition TriggerPlot.cc:115
TGraph ** Gfreqtime
Freq vs. time.
Definition TriggerPlot.h:268
unsigned int GetCollectionN(const unsigned int aCollIndex)
Returns the number of triggers/clusters in a given collection.
Definition TriggerPlot.h:177
void ResetParameters(const unsigned int aCollIndex)
Resets collection parameters to default values.
Definition TriggerPlot.cc:714
unsigned int GetN(void)
Returns the number of collections.
Definition TriggerPlot.h:201
TriggerPlot(const unsigned int aNcoll, const string aPattern, const string aDirectory="", const string aStyleName="GWOLLUM", const unsigned int aVerbose=0)
Constructor of the TriggerPlot class.
TH2D ** Hfreqtime
Freq vs. time container.
Definition TriggerPlot.h:267
TH1D ** Hsnr
SNR.
Definition TriggerPlot.h:277
TGraph * Gfreqtimeloud
Freq vs. time (loudest event).
Definition TriggerPlot.h:269
virtual ~TriggerPlot(void)
Destructor of the TriggerPlot class.
Definition TriggerPlot.cc:77
void PrintPlot(const string aPlotType, const unsigned int aCollIndex, const bool aFirst=true)
Prints a given plot type from a given collection.
Definition TriggerPlot.h:83
void SetCollectionLegend(const unsigned int aCollIndex, const string aLegend)
Sets a legend to a collection.
Definition TriggerPlot.h:142
void SetCollectionMarker(const unsigned int aCollIndex, const unsigned int aMarkerStyleIndex, const double aMarkerSize=1.0)
Assigns a marker style to a collection.
Definition TriggerPlot.h:165
double rate_min
Minimum value to plot the rate [Hz].
Definition TriggerPlot.h:282
void SetSelectionSegments(Segments *SelectionSegments)
Sets selection segments for all collections.
Definition TriggerPlot.cc:474
void PrintPlot(const string aPlotType)
Prints a given plot type from all collections.
Definition TriggerPlot.h:94
TriggerSelect ** Collection
Collection selection.
Definition TriggerPlot.h:286
unsigned int Ncoll
Number of plot collections.
Definition TriggerPlot.h:266
TH1D ** Hfreq
Frequency.
Definition TriggerPlot.h:276
void SetCollectionColor(const unsigned int aCollIndex, const unsigned int aColorIndex)
Assigns a color to a collection.
Definition TriggerPlot.h:153
TGraph ** Gsnrfreq
SNR vs. freq.
Definition TriggerPlot.h:274
string * legend
Collection legend.
Definition TriggerPlot.h:280
double GetYmin(const string aPlotType, const int aCollIndex)
Returns the Y min of the plot in the canvas.
Definition TriggerPlot.h:230
TH2D ** Hsnrfreq
SNR vs. freq container.
Definition TriggerPlot.h:273
bool plotstar
Flag to plot the loudest event.
Definition TriggerPlot.h:281
void PrintPlot(TObject *aObj)
Prints an external object.
Definition TriggerPlot.h:73
TGraph * GetTGraph(TH1D **aFrame, const string aPlotType, const unsigned int aCollIndex)
Returns a TGraph copy from a given collection.
Definition TriggerPlot.cc:514
Segments * selseg
Selection segments for all collections.
Definition TriggerPlot.h:287
Select trigger parameters.
Definition TriggerSelect.h:23