NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
IceGOM.cxx
Go to the documentation of this file.
1
17
19
116
117#include "IceGOM.h"
118#include "Riostream.h"
119
120ClassImp(IceGOM); // Class implementation to enable ROOT I/O
121
124{
130}
131
133{
139}
140
142{
148}
149
150Int_t IceGOM::GetString(Int_t id) const
151{
166
167 Int_t omid=GetUniqueID();
168 if (id>0) omid=id;
169
170 if (omid<=0) return 0;
171
172 Int_t string=0;
173 if (InheritsFrom("IceAOM"))
174 {
175 if (omid<=20) return -1;
176 if (omid>=21 && omid<=40) return -2;
177 if (omid>=41 && omid<=60) return -3;
178 if (omid>=61 && omid<=86) return -4;
179 if (omid>=87 && omid<=122) return -5;
180 if (omid>=123 && omid<=158) return -6;
181 if (omid>=159 && omid<=194) return -7;
182 if (omid>=195 && omid<=230) return -8;
183 if (omid>=231 && omid<=266) return -9;
184 if (omid>=267 && omid<=302) return -10;
185 if (omid>=303 && omid<=344) return -11;
186 if (omid>=345 && omid<=386) return -12;
187 if (omid>=387 && omid<=428) return -13;
188 if (omid>=429 && omid<=470) return -14;
189 if (omid>=471 && omid<=512) return -15;
190 if (omid>=513 && omid<=554) return -16;
191 if (omid>=555 && omid<=596) return -17;
192 if (omid>=597 && omid<=638) return -18;
193 if (omid>=639 && omid<=680) return -19;
194
195 // OM681 is a special case on string 18
196 if (omid==681) return -18;
197 }
198 else
199 {
200 string=omid/100;
201 }
202
203 return string;
204}
205
206Int_t IceGOM::GetLevel(Int_t id) const
207{
224
225 Int_t omid=GetUniqueID();
226 if (id>0) omid=id;
227
228 if (omid<=0) return 0;
229
230 Int_t level=0;
231 if (InheritsFrom("IceAOM"))
232 {
233 if (omid<=20) return omid;
234 if (omid>=21 && omid<=40) return (omid-20);
235 if (omid>=41 && omid<=60) return (omid-40);
236 if (omid>=61 && omid<=86) return (omid-60);
237 if (omid>=87 && omid<=122) return (omid-86);
238 if (omid>=123 && omid<=158) return (omid-122);
239 if (omid>=159 && omid<=194) return (omid-158);
240 if (omid>=195 && omid<=230) return (omid-194);
241 if (omid>=231 && omid<=266) return (omid-230);
242 if (omid>=267 && omid<=302) return (omid-266);
243 if (omid>=303 && omid<=344) return (omid-302);
244 if (omid>=345 && omid<=386) return (omid-344);
245 if (omid>=387 && omid<=428) return (omid-386);
246 if (omid>=429 && omid<=470) return (omid-428);
247 if (omid>=471 && omid<=512) return (omid-470);
248 if (omid>=513 && omid<=554) return (omid-512);
249 if (omid>=555 && omid<=596) return (omid-554);
250 if (omid>=597 && omid<=638) return (omid-596);
251 if (omid>=639 && omid<=680) return (omid-638);
252
253 // OM681 is physically the 4th module on string 18
254 // but the database convention is to regard it as
255 // a module at the bottom of string 18
256 if (omid==681) return 43;
257 }
258 else
259 {
260 level=omid%100;
261 }
262
263 return level;
264}
265
266Int_t IceGOM::GetOMId(Int_t string,Int_t level) const
267{
275
276 Int_t omid=0;
277 Int_t s=0,l=0;
278 if (InheritsFrom("IceAOM"))
279 {
280 for (Int_t i=1; i<=681; i++)
281 {
282 s=GetString(i);
283 l=GetLevel(i);
284 if (abs(s)==abs(string) && l==level) return i;
285 }
286 }
287 else
288 {
289 omid=100*string+level;
290 }
291
292 return omid;
293}
294
295Double_t IceGOM::GetTimeResidual(NcEvent* evt,NcTrack* t,NcSignal* s,TString name,Int_t mode,Int_t vgroup) const
296{
324
325 Double_t tres=-99999;
326
327 if (!evt || !t || !s) return tres;
328
329 IceGOM* om=(IceGOM*)s->GetDevice();
330 if (!om) return tres;
331
332 // No implementation (yet) for IceTOP signals
333 if (om->InheritsFrom("IceTDOM")) return tres;
334
335 Nc3Vector p=t->Get3Momentum();
336 if (!p.HasVector() || !p.GetNorm()) return tres;
337
338 const Float_t pi=acos(-1.);
339 const Float_t c=0.299792458; // Light speed in vacuum in meters per ns
340 const Float_t npice=1.31768387; // Phase refractive index (c/v_phase) of ice
341 const Float_t ngice=1.35075806; // Group refractive index (c/v_group) of ice
342 const Float_t thetac=acos(1./npice); // Cherenkov angle (in radians)
343
344 // Angular reduction of complement of thetac due to v_phase and v_group difference
345 Float_t alphac=0;
346 if (vgroup) alphac=atan((1.-npice/ngice)/sqrt(npice*npice-1.));
347
348 // The track reference point
350 if (!r0) return tres;
351
352 // Absolute (UT) time stamp of the track reference point
353 NcTimestamp* tt0=r0->GetTimestamp();
354 if (!tt0) return tres;
355
356 // Time stamp of the track relative to the event time stamp
357 Float_t t0=evt->GetDifference(tt0,"ns");
358
359 NcPosition rhit=om->GetPosition();
360 Float_t d=t->GetDistance(rhit);
361 Nc3Vector r12=rhit-(*r0);
362 Float_t hproj=p.Dot(r12)/p.GetNorm();
363 Float_t dist=fabs(hproj)+d/tan(pi/2.-thetac-alphac);
364 if (hproj<0) dist=-dist;
365 Float_t tgeo=t0+dist/c; // The predicted geometrical hit time
366 Float_t thit=s->GetSignal("LE",7); // Hit time relative to the event time stamp
367
368 tres=thit-tgeo;
369 return tres;
370}
371
372Double_t IceGOM::GetTimeResidual(NcEvent* evt,NcTrack* t,Int_t j,TString name,Int_t mode,Int_t vgroup) const
373{
401
402 NcSignal* s=GetHit(j);
403 Double_t tres=GetTimeResidual(evt,t,s,name,mode,vgroup);
404 return tres;
405}
406
407TObject* IceGOM::Clone(const char* name) const
408{
421
422 IceGOM* m=new IceGOM(*this);
423 if (name)
424 {
425 if (strlen(name)) m->SetName(name);
426 }
427 return m;
428}
429
ClassImp(IceGOM)
Signal (Hit) handling of a generic IceCube Optical Module (GOM).
Definition IceGOM.h:12
Int_t GetString(Int_t id=0) const
Definition IceGOM.cxx:150
Int_t GetLevel(Int_t id=0) const
Definition IceGOM.cxx:206
virtual ~IceGOM()
Definition IceGOM.cxx:132
Double_t GetTimeResidual(NcEvent *evt, NcTrack *t, NcSignal *s, TString name="LE", Int_t mode=7, Int_t vgroup=1) const
Definition IceGOM.cxx:295
IceGOM()
Definition IceGOM.cxx:123
virtual TObject * Clone(const char *name="") const
Definition IceGOM.cxx:407
Int_t GetOMId(Int_t string, Int_t level) const
Definition IceGOM.cxx:266
Handling of 3-vectors in various reference frames.
Definition Nc3Vector.h:15
Double_t Dot(Nc3Vector &q)
Int_t HasVector() const
Double_t GetNorm()
NcDevice(const char *name="", const char *title="")
Definition NcDevice.cxx:109
NcSignal * GetHit(Int_t j) const
Definition NcDevice.cxx:489
Creation and investigation of an NCFS generic event structure.
Definition NcEvent.h:15
void GetPosition(Double_t *r, TString f, TString u="rad", Float_t s=-1) const
NcTimestamp * GetTimestamp()
NcDevice * GetDevice() const
virtual Float_t GetSignal(Int_t j=1, Int_t mode=0) const
Definition NcSignal.cxx:651
NcSignal(const char *name="", const char *title="")
Definition NcSignal.cxx:155
Handling of timestamps for (astro)particle physics research.
Definition NcTimestamp.h:20
Int_t GetDifference(NcTimestamp *t, Int_t &days, Int_t &sec, Int_t &ns, Int_t &ps, TString type="UT")
Handling of the attributes of a reconstructed particle track.
Definition NcTrack.h:19
Double_t GetDistance(NcPosition *p, Float_t scale=-1)
Definition NcTrack.cxx:2011
NcPosition * GetReferencePoint()
Definition NcTrack.cxx:1485
Nc3Vector Get3Momentum(Float_t scale=-1) const
Definition NcTrack.cxx:652