NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
RnoEvent.cxx
Go to the documentation of this file.
1
17
19
41
42#include "RnoEvent.h"
43#include "Riostream.h"
44
45ClassImp(RnoEvent); // Class implementation to enable ROOT I/O
46
56
65
67{
73}
74
76{
82
84}
85
86TGraph* RnoEvent::DisplaySampling(Int_t ista,Int_t ich,Int_t j)
87{
100
101 TString name="Station";
102 name+=ista;
103 RnoStation* sta=(RnoStation*)GetDevice(name);
104
105 if (!sta)
106 {
107 cout << " *" << ClassName() << "::DisplaySampling* Could not find Station" << ista << endl;
108 return 0;
109 }
110
111 TGraph* gr=sta->DisplaySampling(ich,j);
112
113 if (!gr) return 0;
114
115 // Add run and event numbers and timestamp to the graph title
116 TString title=gr->GetTitle();
117 title+=" Run:";
118 title+=GetRunNumber();
119 title+=" Event:";
120 title+=GetEventNumber();
121 title+=" ";
122 title+=GetDayTimeString("UT",3);
123 gr->SetTitle(title);
124
125 gPad->Modified();
126
127 return gr;
128}
129
130TCanvas* RnoEvent::DisplaySamplings(Int_t ista,Int_t j)
131{
144
145 TString name="Station";
146 name+=ista;
147 RnoStation* sta=(RnoStation*)GetDevice(name);
148
149 if (!sta)
150 {
151 cout << " *" << ClassName() << "::DisplaySamplings* Could not find Station" << ista << endl;
152 return 0;
153 }
154
155 TCanvas* c=sta->DisplaySamplings(j);
156
157 if (!c) return 0;
158
159 // Indicate the Run and Event number and timestamp at each sampling display
160 TVirtualPad* pad=0;
161 TGraph* gr=0;
162 TString title="";
163 for (Int_t i=1; i<=24; i++)
164 {
165 pad=c->cd(i);
166 if (!pad) continue;
167
168 gr=(TGraph*)pad->FindObject("NcSample");
169 if (!gr) continue;
170
171 title=gr->GetTitle();
172 title+=" Run:";
173 title+=GetRunNumber();
174 title+=" Event:";
175 title+=GetEventNumber();
176 title+=" ";
177 title+=GetDayTimeString("UT",3);
178 gr->SetTitle(title);
179
180 pad->Modified();
181 } // End of loop over the channels
182
183 return c;
184}
185
186TGraph RnoEvent::GetSamplingGraph(Int_t ista,Int_t ich,Int_t j)
187{
197
198 TString name="Station";
199 name+=ista;
200 RnoStation* sta=(RnoStation*)GetDevice(name);
201
202 if (!sta)
203 {
204 cout << " *" << ClassName() << "::GetSamplingGraph* Could not find Station" << ista << endl;
205 return 0;
206 }
207
208 TGraph gr=sta->GetSamplingGraph(ich,j);
209
210 // Add run and event numbers and timestamp to the graph title
211 TString title=gr.GetTitle();
212 title+=" Run:";
213 title+=GetRunNumber();
214 title+=" Event:";
215 title+=GetEventNumber();
216 title+=" ";
217 title+=GetDayTimeString("UT",3);
218 gr.SetTitle(title);
219
220 return gr;
221}
222
223TH1F RnoEvent::GetSamplingDFT(Int_t ista,Int_t ich,TString sel,Int_t j)
224{
251
252 TH1F his;
253
254 TString name="Station";
255 name+=ista;
256 RnoStation* sta=(RnoStation*)GetDevice(name);
257
258 if (!sta)
259 {
260 cout << " *" << ClassName() << "::GetSamplingDFT* Could not find Station" << ista << endl;
261 return his;
262 }
263
264 his=sta->GetSamplingDFT(ich,sel,j);
265
266 // Add run and event numbers and timestamp to the histogram title
267 TString title=his.GetTitle();
268 title+=" Run:";
269 title+=GetRunNumber();
270 title+=" Event:";
271 title+=GetEventNumber();
272 title+=" ";
273 title+=GetDayTimeString("UT",3);
274 his.SetTitle(title);
275
276 return his;
277}
278
279TObject* RnoEvent::Clone(const char* name) const
280{
290
291 RnoEvent* evt=new RnoEvent(*this);
292 if (name)
293 {
294 if (strlen(name)) evt->SetName(name);
295 }
296 return evt;
297}
298
ClassImp(RnoEvent)
virtual void Reset()
Definition NcEvent.cxx:436
Int_t GetEventNumber() const
Definition NcEvent.cxx:637
Int_t GetRunNumber() const
Definition NcEvent.cxx:626
NcDevice * GetDevice(Int_t i) const
Definition NcEvent.cxx:1380
TString GetDayTimeString(TString mode, Int_t ndig=0, Double_t offset=0, TString *date=0, TString *time=0, Bool_t full=kTRUE)
Handling of RNO-G event data.
Definition RnoEvent.h:14
virtual ~RnoEvent()
Definition RnoEvent.cxx:57
virtual TObject * Clone(const char *name="") const
Definition RnoEvent.cxx:279
virtual void Reset()
Definition RnoEvent.cxx:75
TGraph GetSamplingGraph(Int_t ista, Int_t ich, Int_t j=1)
Definition RnoEvent.cxx:186
TGraph * DisplaySampling(Int_t ista, Int_t ich, Int_t j=1)
Definition RnoEvent.cxx:86
TH1F GetSamplingDFT(Int_t ista, Int_t ich, TString sel="AMP Hz", Int_t j=1)
Definition RnoEvent.cxx:223
TCanvas * DisplaySamplings(Int_t ista, Int_t j=1)
Definition RnoEvent.cxx:130
Handling of RNO-G event data.
Definition RnoStation.h:19
TH1F GetSamplingDFT(Int_t ich, TString sel="AMP Hz", Int_t j=1)
TGraph GetSamplingGraph(Int_t ich, Int_t j=1)
TCanvas * DisplaySamplings(Int_t j=1)
TGraph * DisplaySampling(Int_t ich, Int_t j=1)