NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
RnoDetector.cxx
Go to the documentation of this file.
1
17
19
98
99#include "RnoDetector.h"
100#include "Riostream.h"
101
102ClassImp(RnoDetector); // Class implementation to enable ROOT I/O
103
105RnoDetector::RnoDetector(const char* name,const char* title) : NcDetector(name,title)
106{
112
113 TString sname=name;
114 TString stitle=title;
115
116 if (sname=="") sname="RNO-G";
117 if (stitle=="") stitle="The Radio Neutrino Observatory in Greenland";
118
119 SetNameTitle(sname,stitle);
120}
121
130
139
140RnoStation* RnoDetector::GetStation(Int_t id,Bool_t create)
141{
149
150 // Only allow the "matrix element" labeled station IDs
151 if (id<0 || !id%10)
152 {
153 cout << " *" << ClassName() << "::GetStation* Invalid station ID : " << id << endl;
154 return 0;
155 }
156
157 RnoStation* station=0;
158
159 TString name="Station";
160 name+=id;
161
162 station=(RnoStation*)GetDetectorUnit(name,kTRUE);
163
164 if (!create) return station;
165
166 // Creation of a new station
167 CreateStation(id);
168
169 station=(RnoStation*)GetDetectorUnit(name,kTRUE);
170
171 return station;
172}
173
175{
181
182 RnoStation station("Station","RNO-G detector station");
183
184 RnoString string("String","RNO-G string");
185
186//@@@@ NcDetectorUnit trench("Trench","RNO-G surface trench");
187
188 RnoULPDA ulpda("Channel","LPDA-up antenna");
189 RnoDLPDA dlpda("Channel","LPDA-down antenna");
190 RnoVPOL vpol("Channel","Vpol antenna");
191 RnoHPOL hpol("Channel","Hpol antenna");
192
193 Int_t nstr=3; // Number of strings per station
194 Int_t ntre=3; // Number of surface trenches per station
195
196 Int_t staid=id; // The unique station ID
197 Int_t strid=0; // The unique string ID
198 Int_t antid=0; // The unique antenna ID
199 TString name="";
200 Float_t depths[9]={-40,-60,-80,-92,-93,-94,-95,-96,-97}; // All antenna depths
201
202 Int_t icha=0; // The RADIANT channel number
203
204 name="Station";
205 name+=staid;
206 station.SetName(name);
207 station.SetUniqueID(staid);
208
209 // Loop over the strings of this station
210 for (Int_t istr=1; istr<=nstr; istr++)
211 {
212 strid=1000*staid+100*istr;
213 string.Reset();
214 string.SetUniqueID(strid);
215
216 name="String";
217 name+=istr;
218 string.SetName(name);
219
220 // Power string
221 if (istr==1) // Power string
222 {
223 for (Int_t ia=1; ia<=9; ia++)
224 {
225 antid=strid+ia;
226 vpol.Reset();
227 vpol.SetUniqueID(antid);
228 vpol.SetPosition(0,-20,depths[ia-1],"car");
229
230 hpol.Reset();
231 hpol.SetUniqueID(antid);
232 hpol.SetPosition(0,-20,depths[ia-1],"car");
233
234 if (ia<4 || ia>5) // VPOL setting
235 {
236 icha=8-ia;
237 if (ia>5) icha++;
238 name="Ch";
239 name+=icha;
240 vpol.SetName(name);
241 string.AddDevice(vpol);
242 }
243 if (ia==4 || ia==5) // HPOL setting
244 {
245 if (ia==4) icha=4;
246 if (ia==5) icha=8;
247 name="Ch";
248 name+=icha;
249 hpol.SetName(name);
250 string.AddDevice(hpol);
251 }
252 }
253 }
254
255 // Helper string
256 if (istr>1)
257 {
258 for (Int_t ia=7; ia<=9; ia++)
259 {
260 antid=strid+ia;
261 vpol.Reset();
262 vpol.SetUniqueID(antid);
263 vpol.SetPosition(45-istr*15,10,depths[ia-1],"car");
264
265 hpol.Reset();
266 hpol.SetUniqueID(antid);
267 hpol.SetPosition(45-istr*15,10,depths[ia-1],"car");
268
269 icha=18-ia; // Helper string 1
270 if (istr==3) icha=14+ia; // Helper string 2
271
272 if (ia==7)
273 {
274 name="Ch";
275 name+=icha;
276 hpol.SetName(name);
277 string.AddDevice(hpol);
278 }
279 else
280 {
281 name="Ch";
282 name+=icha;
283 vpol.SetName(name);
284 string.AddDevice(vpol);
285 }
286 }
287 }
288 station.AddDevice(string);
289 } // End of string loop
290
291 // Loop over the surface trenches with surface antennas of this station
292 icha=12;
293 Int_t iadd=0;
294 for (Int_t itre=1; itre<=ntre; itre++)
295 {
296 for (Int_t ia=1; ia<=3; ia++)
297 {
298 ulpda.Reset();
299 ulpda.SetUniqueID(ia+iadd+1000*staid);
300 ulpda.SetPosition(ia-2,itre,0,"car");
301
302 dlpda.Reset();
303 dlpda.SetUniqueID(ia+iadd+1000*staid);
304 dlpda.SetPosition(ia,itre,0,"car");
305
306 if (ia==1 || ia==3)
307 {
308 name="Ch";
309 name+=icha;
310 dlpda.SetName(name);
311 station.AddDevice(dlpda);
312 }
313 else
314 {
315 name="Ch";
316 name+=icha;
317 ulpda.SetName(name);
318 station.AddDevice(ulpda);
319 }
320 icha++;
321 }
322 iadd+=3;
323 } // End of trench loop
324
325 AddDevice(station);
326}
327
328TGraph* RnoDetector::DisplaySampling(Int_t ista,Int_t ich,Int_t j)
329{
342
343 RnoStation* sta=GetStation(ista,kFALSE);
344
345 if (!sta)
346 {
347 cout << " *" << ClassName() << "::DisplayWaveform* Could not find Station" << ista << endl;
348 return 0;
349 }
350
351 TGraph* gr=sta->DisplaySampling(ich,j);
352 return gr;
353}
354
355TCanvas* RnoDetector::DisplaySamplings(Int_t ista,Int_t j)
356{
369
370 RnoStation* sta=GetStation(ista,kFALSE);
371
372 if (!sta)
373 {
374 cout << " *" << ClassName() << "::DisplayWaveform* Could not find Station" << ista << endl;
375 return 0;
376 }
377
378 TCanvas* c=sta->DisplaySamplings(j);
379 return c;
380}
381
382TObject* RnoDetector::Clone(const char* name) const
383{
393
394 RnoDetector* d=new RnoDetector(*this);
395 if (name)
396 {
397 if (strlen(name)) d->SetName(name);
398 }
399 return d;
400}
401
ClassImp(RnoDetector)
NcDetector(const char *name="", const char *title="")
void AddDevice(NcDevice &d)
NcDetectorUnit * GetDetectorUnit(TString name, Bool_t follow)
virtual void Reset(Int_t mode=0)
Definition NcDevice.cxx:222
void SetPosition(Double_t *r, TString f, TString u="rad")
Signal (Hit) handling of an RNO-G surface Downward pointing LogPeriodic Dipole Antenna (DLPDA).
Definition RnoDLPDA.h:12
Handling of RNO-G detector data.
Definition RnoDetector.h:14
RnoStation * GetStation(Int_t id, Bool_t create)
TCanvas * DisplaySamplings(Int_t ista, Int_t j=1)
TGraph * DisplaySampling(Int_t ista, Int_t ich, Int_t j=1)
virtual ~RnoDetector()
virtual TObject * Clone(const char *name="") const
RnoDetector(const char *name="", const char *title="")
void CreateStation(Int_t id)
Signal (Hit) handling of an RNO-G deep Horizontal Polarisation antenna (HPOL).
Definition RnoHPOL.h:12
Handling of RNO-G event data.
Definition RnoStation.h:19
TCanvas * DisplaySamplings(Int_t j=1)
TGraph * DisplaySampling(Int_t ich, Int_t j=1)
Data handling of an RNO-G string.
Definition RnoString.h:15
Signal (Hit) handling of an RNO-G surface Upward pointing LogPeriodic Dipole Antenna (ULPDA).
Definition RnoULPDA.h:12
Signal (Hit) handling of an RNO-G deep Vertical Polarisation antenna (VPOL).
Definition RnoVPOL.h:12