1 ///////////////////////////////////////////////////////////////////////////
2 // Copyright(c) 2003, IceCube Experiment at the South Pole.
3 // All rights reserved.
5 // Author: The IceCube RALICE-based Offline Project.
6 // Contributors are mentioned in the code where appropriate.
8 // Permission to use, copy, modify and distribute this software and its
9 // documentation strictly for non-commercial purposes is hereby granted
10 // without fee, provided that the above copyright notice appears in all
11 // copies and that both the copyright notice and this permission notice
12 // appear in the supporting documentation.
13 // The authors make no claims about the suitability of this software for
14 // any purpose. It is provided "as is" without express or implied warranty.
15 ///////////////////////////////////////////////////////////////////////////
19 ///////////////////////////////////////////////////////////////////////////
21 // Handling of IceCube event data.
22 // Basically this class provides an IceCube tailored user interface
23 // to the functionality of the class AliEvent.
28 // Creation and filling of an event with some fictitious module data
29 // -----------------------------------------------------------------
30 // IceEvent* evt=new IceEvent();
33 // // The starting unique signal ID.
34 // // In this example it will be increased everytime
35 // // when a new signal is created.
40 // m.SetUniqueID(123);
41 // m.SetNameTitle("OM123","Amanda module");
43 // Float_t pos[3]={1,2,3};
44 // m.SetPosition(pos,"car");
48 // s.SetSlotName("ADC",1);
49 // s.SetSlotName("LE",2);
50 // s.SetSlotName("TOT",3);
53 // s.SetName("OM123 Hit 1");
54 // s.SetUniqueID(sid++);
55 // s.SetSignal(100,"ADC");
56 // s.SetSignal(-100,"LE");
57 // s.SetSignal(-1000,"TOT");
61 // s.SetName("OM123 Hit 2");
62 // s.SetUniqueID(sid++);
63 // s.SetSignal(110,"ADC");
64 // s.SetSignal(-101,"LE");
65 // s.SetSignal(1001,"TOT");
69 // s.SetName("OM123 Hit 3");
70 // s.SetUniqueID(sid++);
71 // s.SetSignal(120,"ADC");
72 // s.SetSignal(-102,"LE");
73 // s.SetSignal(-1002,"TOT");
79 // m.SetUniqueID(456);
80 // m.SetName("OM456");
85 // m.SetPosition(pos,"car");
88 // s.SetName("OM456 Hit 1");
89 // s.SetUniqueID(sid++);
90 // s.SetSignal(20,"ADC");
91 // s.SetSignal(-200,"LE");
92 // s.SetSignal(-2000,"TOT");
96 // s.SetName("OM456 Hit 2");
97 // s.SetUniqueID(sid++);
98 // s.SetSignal(21,"ADC");
99 // s.SetSignal(-201,"LE");
100 // s.SetSignal(2001,"TOT");
104 // s.SetName("OM456 Hit 3");
105 // s.SetUniqueID(sid++);
106 // s.SetSignal(22,"ADC");
107 // s.SetSignal(-202,"LE");
108 // s.SetSignal(-2002,"TOT");
111 // evt->AddDevice(m);
113 // // IceCube in-ice DOM
115 // mid.SetUniqueID(958);
116 // mid.SetNameTitle("OM958","IceCube in-ice module");
121 // mid.SetPosition(pos,"car");
124 // s.SetName("OM958 Hit 1");
125 // s.SetUniqueID(sid++);
126 // s.SetSignal(40,"ADC");
127 // s.SetSignal(-400,"LE");
128 // s.SetSignal(-4000,"TOT");
132 // s.SetName("OM958 Hit 2");
133 // s.SetUniqueID(sid++);
134 // s.SetSignal(41,"ADC");
135 // s.SetSignal(-401,"LE");
136 // s.SetSignal(4001,"TOT");
140 // s.SetName("OM958 Hit 3");
141 // s.SetUniqueID(sid++);
142 // s.SetSignal(42,"ADC");
143 // s.SetSignal(-402,"LE");
144 // s.SetSignal(-4002,"TOT");
147 // evt->AddDevice(mid);
151 // mtd.SetUniqueID(4958);
152 // mtd.SetNameTitle("OM4958","IceTop module");
157 // mtd.SetPosition(pos,"car");
160 // s.SetName("OM4958 Hit 1");
161 // s.SetUniqueID(sid++);
162 // s.SetSignal(50,"ADC");
163 // s.SetSignal(-500,"LE");
164 // s.SetSignal(-5000,"TOT");
168 // s.SetName("OM4958 Hit 2");
169 // s.SetUniqueID(sid++);
170 // s.SetSignal(51,"ADC");
171 // s.SetSignal(-501,"LE");
172 // s.SetSignal(5001,"TOT");
176 // s.SetName("OM4958 Hit 3");
177 // s.SetUniqueID(sid++);
178 // s.SetSignal(52,"ADC");
179 // s.SetSignal(-502,"LE");
180 // s.SetSignal(-5002,"TOT");
183 // evt->AddDevice(mtd);
185 // Investigation of the event contents
186 // -----------------------------------
187 // // Provide event data overview
190 // // Select a specific device (i.e. OM) from the event
191 // AliDevice* dx=(AliDevice*)evt->GetIdDevice(958);
192 // if (dx) dx->Data();
194 // // Select a specific hit from the event
195 // AliSignal* sx=evt->GetIdHit(5,"IceGOM");
196 // if (sx) sx->Data();
198 // // Dump all the information for the various stored devices
199 // Int_t ndev=evt->GetNdevices();
200 // for (Int_t idev=1; idev<=ndev; idev++)
202 // IceGOM* om=(IceGOM*)evt->GetDevice(idev);
203 // if (om) om->Data();
206 // // Dump all the information for the various stored hits
207 // // Obtain pointers to the hits for all generic OM's (i.e. IceGOM)
208 // TObjArray* hits=evt->GetHits("IceGOM");
210 // if (hits) nhits=hits->GetEntries();
211 // for (Int_t ih=0; ih<nhits; ih++)
213 // AliSignal* sx=(AliSignal*)hits->At(ih);
214 // if (sx) sx->Data();
217 // // Obtain the minimum and maximum recorded TOT value
218 // Float_t vmin,vmax;
219 // evt->GetExtremes("IceGOM",vmin,vmax,"TOT");
220 // cout << " Extreme values : vmin = " << vmin << " vmax = " << vmax << endl;
222 // Some simple module and hit manipulations
223 // ----------------------------------------
224 // // Ordered hits w.r.t. decreasing TOT
225 // TObjArray* ordered=evt->SortHits("IceGOM","TOT",-1);
227 // if (ordered) nhits=ordered->GetEntries();
228 // for (Int_t i=0; i<nhits; i++)
230 // AliSignal* sx=(AliSignal*)ordered->At(i);
231 // if (sx) sx->Data();
234 // // Ordered devices from the already ordered hit array
235 // TObjArray* devs=evt->SortDevices(ordered,0,0);
237 // if (devs) ndev=devs->GetEntries();
238 // for (Int_t id=0; id<ndev; id++)
240 // AliDevice* dx=(AliDevice*)devs->At(id);
241 // if (dx) dx->Data();
244 // // Newly ordered devices w.r.t. decreasing ADC
245 // TObjArray* devs=evt->SortDevices("IceGOM","ADC",-1);
247 // if (devs) ndev=devs->GetEntries();
248 // for (Int_t id2=0; id2<ndev; id2++)
250 // AliDevice* dx=(AliDevice*)devs->At(id2);
251 // if (dx) dx->Data();
254 // A simple 3D event display of the modules
255 // ----------------------------------------
256 // TCanvas* c1=new TCanvas("c1","c1");
258 // TView* view=new TView(1);
259 // view->SetRange(-50,-50,-50,50,50,50);
262 // evt->DisplayHits("IceGOM","TOT",1e4,1);
265 //--- Author: Nick van Eijndhoven 23-jun-2004 Utrecht University
266 //- Modified: NvE $Date$ Utrecht University
267 ///////////////////////////////////////////////////////////////////////////
269 #include "IceEvent.h"
270 #include "Riostream.h"
272 ClassImp(IceEvent) // Class implementation to enable ROOT I/O
274 IceEvent::IceEvent() : AliEvent()
276 // Default constructor.
278 ///////////////////////////////////////////////////////////////////////////
279 IceEvent::~IceEvent()
281 // Default destructor.
283 ///////////////////////////////////////////////////////////////////////////
284 IceEvent::IceEvent(const IceEvent& evt) : AliEvent(evt)
288 ///////////////////////////////////////////////////////////////////////////
289 TObject* IceEvent::Clone(const char* name) const
291 // Make a deep copy of the current object and provide the pointer to the copy.
292 // This memberfunction enables automatic creation of new objects of the
293 // correct type depending on the object type, a feature which may be very useful
294 // for containers like AliEvent when adding objects in case the
295 // container owns the objects. This feature allows e.g. AliEvent
296 // to store either IceEvent objects or objects derived from IceEvent
297 // via tha AddDevice memberfunction, provided these derived classes also have
298 // a proper Clone memberfunction.
300 IceEvent* evt=new IceEvent(*this);
303 if (strlen(name)) evt->SetName(name);
307 ///////////////////////////////////////////////////////////////////////////