1 /*******************************************************************************
2 * Copyright(c) 2003, IceCube Experiment at the South Pole. All rights reserved.
4 * Author: The IceCube RALICE-based Offline Project.
5 * Contributors are mentioned in the code where appropriate.
7 * Permission to use, copy, modify and distribute this software and its
8 * documentation strictly for non-commercial purposes is hereby granted
9 * without fee, provided that the above copyright notice appears in all
10 * copies and that both the copyright notice and this permission notice
11 * appear in the supporting documentation.
12 * The authors make no claims about the suitability of this software for
13 * any purpose. It is provided "as is" without express or implied warranty.
14 *******************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////
20 // Handling of IceCube event data.
21 // Basically this class provides an IceCube tailored user interface
22 // to the functionality of the class AliEvent.
27 // Creation and filling of an event with some fictitious module data
28 // -----------------------------------------------------------------
29 // IceEvent* evt=new IceEvent();
32 // // The starting unique signal ID.
33 // // In this example it will be increased everytime
34 // // when a new signal is created.
39 // m.SetUniqueID(123);
40 // m.SetNameTitle("OM123","Amanda module");
42 // Float_t pos[3]={1,2,3};
43 // m.SetPosition(pos,"car");
47 // s.SetSlotName("ADC",1);
48 // s.SetSlotName("LE",2);
49 // s.SetSlotName("TOT",3);
52 // s.SetName("OM123 Hit 1");
53 // s.SetUniqueID(sid++);
54 // s.SetSignal(100,"ADC");
55 // s.SetSignal(-100,"LE");
56 // s.SetSignal(-1000,"TOT");
60 // s.SetName("OM123 Hit 2");
61 // s.SetUniqueID(sid++);
62 // s.SetSignal(110,"ADC");
63 // s.SetSignal(-101,"LE");
64 // s.SetSignal(1001,"TOT");
68 // s.SetName("OM123 Hit 3");
69 // s.SetUniqueID(sid++);
70 // s.SetSignal(120,"ADC");
71 // s.SetSignal(-102,"LE");
72 // s.SetSignal(-1002,"TOT");
78 // m.SetUniqueID(456);
79 // m.SetName("OM456");
84 // m.SetPosition(pos,"car");
87 // s.SetName("OM456 Hit 1");
88 // s.SetUniqueID(sid++);
89 // s.SetSignal(20,"ADC");
90 // s.SetSignal(-200,"LE");
91 // s.SetSignal(-2000,"TOT");
95 // s.SetName("OM456 Hit 2");
96 // s.SetUniqueID(sid++);
97 // s.SetSignal(21,"ADC");
98 // s.SetSignal(-201,"LE");
99 // s.SetSignal(2001,"TOT");
103 // s.SetName("OM456 Hit 3");
104 // s.SetUniqueID(sid++);
105 // s.SetSignal(22,"ADC");
106 // s.SetSignal(-202,"LE");
107 // s.SetSignal(-2002,"TOT");
110 // evt->AddDevice(m);
112 // // IceCube in-ice DOM
114 // mid.SetUniqueID(958);
115 // mid.SetNameTitle("OM958","IceCube in-ice module");
120 // mid.SetPosition(pos,"car");
123 // s.SetName("OM958 Hit 1");
124 // s.SetUniqueID(sid++);
125 // s.SetSignal(40,"ADC");
126 // s.SetSignal(-400,"LE");
127 // s.SetSignal(-4000,"TOT");
131 // s.SetName("OM958 Hit 2");
132 // s.SetUniqueID(sid++);
133 // s.SetSignal(41,"ADC");
134 // s.SetSignal(-401,"LE");
135 // s.SetSignal(4001,"TOT");
139 // s.SetName("OM958 Hit 3");
140 // s.SetUniqueID(sid++);
141 // s.SetSignal(42,"ADC");
142 // s.SetSignal(-402,"LE");
143 // s.SetSignal(-4002,"TOT");
146 // evt->AddDevice(mid);
150 // mtd.SetUniqueID(4958);
151 // mtd.SetNameTitle("OM4958","IceTop module");
156 // mtd.SetPosition(pos,"car");
159 // s.SetName("OM4958 Hit 1");
160 // s.SetUniqueID(sid++);
161 // s.SetSignal(50,"ADC");
162 // s.SetSignal(-500,"LE");
163 // s.SetSignal(-5000,"TOT");
167 // s.SetName("OM4958 Hit 2");
168 // s.SetUniqueID(sid++);
169 // s.SetSignal(51,"ADC");
170 // s.SetSignal(-501,"LE");
171 // s.SetSignal(5001,"TOT");
175 // s.SetName("OM4958 Hit 3");
176 // s.SetUniqueID(sid++);
177 // s.SetSignal(52,"ADC");
178 // s.SetSignal(-502,"LE");
179 // s.SetSignal(-5002,"TOT");
182 // evt->AddDevice(mtd);
184 // Investigation of the event contents
185 // -----------------------------------
186 // // Provide event data overview
189 // // Select a specific device (i.e. OM) from the event
190 // AliDevice* dx=(AliDevice*)evt->GetIdDevice(958);
191 // if (dx) dx->Data();
193 // // Select a specific hit from the event
194 // AliSignal* sx=evt->GetIdHit(5,"IceGOM");
195 // if (sx) sx->Data();
197 // // Dump all the information for the various stored devices
198 // Int_t ndev=evt->GetNdevices();
199 // for (Int_t idev=1; idev<=ndev; idev++)
201 // IceGOM* om=(IceGOM*)evt->GetDevice(idev);
202 // if (om) om->Data();
205 // // Dump all the information for the various stored hits
206 // // Obtain pointers to the hits for all generic OM's (i.e. IceGOM)
207 // TObjArray* hits=evt->GetHits("IceGOM");
209 // if (hits) nhits=hits->GetEntries();
210 // for (Int_t ih=0; ih<nhits; ih++)
212 // AliSignal* sx=(AliSignal*)hits->At(ih);
213 // if (sx) sx->Data();
216 // // Obtain the minimum and maximum recorded TOT value
217 // Float_t vmin,vmax;
218 // evt->GetExtremes("IceGOM",vmin,vmax,"TOT");
219 // cout << " Extreme values : vmin = " << vmin << " vmax = " << vmax << endl;
221 // Some simple module and hit manipulations
222 // ----------------------------------------
223 // // Ordered hits w.r.t. decreasing TOT
224 // TObjArray* ordered=evt->SortHits("IceGOM","TOT",-1);
226 // if (ordered) nhits=ordered->GetEntries();
227 // for (Int_t i=0; i<nhits; i++)
229 // AliSignal* sx=(AliSignal*)ordered->At(i);
230 // if (sx) sx->Data();
233 // // Ordered devices from the already ordered hit array
234 // TObjArray* devs=evt->SortDevices(ordered,0,0);
236 // if (devs) ndev=devs->GetEntries();
237 // for (Int_t id=0; id<ndev; id++)
239 // AliDevice* dx=(AliDevice*)devs->At(id);
240 // if (dx) dx->Data();
243 // // Newly ordered devices w.r.t. decreasing ADC
244 // TObjArray* devs=evt->SortDevices("IceGOM","ADC",-1);
246 // if (devs) ndev=devs->GetEntries();
247 // for (Int_t id2=0; id2<ndev; id2++)
249 // AliDevice* dx=(AliDevice*)devs->At(id2);
250 // if (dx) dx->Data();
253 // A simple 3D event display of the modules
254 // ----------------------------------------
255 // TCanvas* c1=new TCanvas("c1","c1");
257 // TView* view=new TView(1);
258 // view->SetRange(-50,-50,-50,50,50,50);
261 // evt->DisplayHits("IceGOM","TOT",1e4,1);
264 //--- Author: Nick van Eijndhoven 23-jun-2004 Utrecht University
265 //- Modified: NvE $Date$ Utrecht University
266 ///////////////////////////////////////////////////////////////////////////
268 #include "IceEvent.h"
269 #include "Riostream.h"
271 ClassImp(IceEvent) // Class implementation to enable ROOT I/O
273 IceEvent::IceEvent() : AliEvent()
275 // Default constructor.
277 ///////////////////////////////////////////////////////////////////////////
278 IceEvent::~IceEvent()
280 // Default destructor.
282 ///////////////////////////////////////////////////////////////////////////
283 IceEvent::IceEvent(const IceEvent& evt) : AliEvent(evt)
287 ///////////////////////////////////////////////////////////////////////////
288 TObject* IceEvent::Clone(const char* name) const
290 // Make a deep copy of the current object and provide the pointer to the copy.
291 // This memberfunction enables automatic creation of new objects of the
292 // correct type depending on the object type, a feature which may be very useful
293 // for containers like AliEvent when adding objects in case the
294 // container owns the objects. This feature allows e.g. AliEvent
295 // to store either IceEvent objects or objects derived from IceEvent
296 // via tha AddDevice memberfunction, provided these derived classes also have
297 // a proper Clone memberfunction.
299 IceEvent* evt=new IceEvent(*this);
302 if (strlen(name)) evt->SetName(name);
306 ///////////////////////////////////////////////////////////////////////////