]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RALICE/icepack/IceEvent.cxx
History file of Wa98 updated and subdirectory icepack introduced.
[u/mrichter/AliRoot.git] / RALICE / icepack / IceEvent.cxx
1 ///////////////////////////////////////////////////////////////////////////
2 // Copyright(c) 2003, IceCube Experiment at the South Pole.
3 // All rights reserved.
4 //
5 // Author: The IceCube RALICE-based Offline Project.
6 // Contributors are mentioned in the code where appropriate.
7 //
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 ///////////////////////////////////////////////////////////////////////////
16
17 // $Id$
18
19 ///////////////////////////////////////////////////////////////////////////
20 // Class IceEvent
21 // Handling of IceCube event data.
22 // Basically this class provides an IceCube tailored user interface
23 // to the functionality of the class AliEvent.
24 //
25 // Examples :
26 // ==========
27 //
28 // Creation and filling of an event with some fictitious module data
29 // -----------------------------------------------------------------
30 // IceEvent* evt=new IceEvent();
31 // evt->SetOwner();
32 //
33 // // The starting unique signal ID.
34 // // In this example it will be increased everytime
35 // // when a new signal is created.
36 // Int_t sid=1;
37 //
38 // // Amanda module
39 // IceAOM m;
40 // m.SetUniqueID(123);
41 // m.SetNameTitle("OM123","Amanda module");
42 //
43 // Float_t pos[3]={1,2,3};
44 // m.SetPosition(pos,"car");
45 //
46 // AliSignal s;
47 //
48 // s.SetSlotName("ADC",1);
49 // s.SetSlotName("LE",2);
50 // s.SetSlotName("TOT",3);
51 //
52 // s.Reset();
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");
58 // m.AddHit(s);
59 //
60 // s.Reset();
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");
66 // m.AddHit(s);
67 //
68 // s.Reset();
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");
74 // m.AddHit(s);
75 //
76 // evt->AddDevice(m);
77 //
78 // m.Reset();
79 // m.SetUniqueID(456);
80 // m.SetName("OM456");
81 //
82 // pos[0]=-4;
83 // pos[1]=-5;
84 // pos[2]=-6;
85 // m.SetPosition(pos,"car");
86 //
87 // s.Reset();
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");
93 // m.AddHit(s);
94 //
95 // s.Reset();
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");
101 // m.AddHit(s);
102 //
103 // s.Reset();
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");
109 // m.AddHit(s);
110 //
111 // evt->AddDevice(m);
112 //
113 // // IceCube in-ice DOM
114 // IceIDOM mid;
115 // mid.SetUniqueID(958);
116 // mid.SetNameTitle("OM958","IceCube in-ice module");
117 //
118 // pos[0]=9;
119 // pos[1]=5;
120 // pos[2]=8;
121 // mid.SetPosition(pos,"car");
122 //
123 // s.Reset();
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");
129 // mid.AddHit(s);
130 //
131 // s.Reset();
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");
137 // mid.AddHit(s);
138 //
139 // s.Reset();
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");
145 // mid.AddHit(s);
146 //
147 // evt->AddDevice(mid);
148 //
149 // // IceTop DOM
150 // IceTDOM mtd;
151 // mtd.SetUniqueID(4958);
152 // mtd.SetNameTitle("OM4958","IceTop module");
153 //
154 // pos[0]=49;
155 // pos[1]=5;
156 // pos[2]=8;
157 // mtd.SetPosition(pos,"car");
158 //
159 // s.Reset();
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");
165 // mtd.AddHit(s);
166 //
167 // s.Reset();
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");
173 // mtd.AddHit(s);
174 //
175 // s.Reset();
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");
181 // mtd.AddHit(s);
182 //
183 // evt->AddDevice(mtd);
184 //
185 // Investigation of the event contents
186 // -----------------------------------
187 // // Provide event data overview
188 // evt->Data();
189 //
190 // // Select a specific device (i.e. OM) from the event
191 // AliDevice* dx=(AliDevice*)evt->GetIdDevice(958);
192 // if (dx) dx->Data();
193 //
194 // // Select a specific hit from the event
195 // AliSignal* sx=evt->GetIdHit(5,"IceGOM");
196 // if (sx) sx->Data();
197 //
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++)
201 // {
202 //  IceGOM* om=(IceGOM*)evt->GetDevice(idev);
203 //  if (om) om->Data();
204 // }
205 //
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");
209 // Int_t nhits=0;
210 // if (hits) nhits=hits->GetEntries();
211 // for (Int_t ih=0; ih<nhits; ih++)
212 // {
213 //  AliSignal* sx=(AliSignal*)hits->At(ih);
214 //  if (sx) sx->Data();
215 // }
216 //
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;
221 //
222 // Some simple module and hit manipulations
223 // ----------------------------------------
224 // // Ordered hits w.r.t. decreasing TOT
225 // TObjArray* ordered=evt->SortHits("IceGOM","TOT",-1);
226 // nhits=0;
227 // if (ordered) nhits=ordered->GetEntries();
228 // for (Int_t i=0; i<nhits; i++)
229 // {
230 //  AliSignal* sx=(AliSignal*)ordered->At(i);
231 //  if (sx) sx->Data();
232 // }
233 //
234 // // Ordered devices from the already ordered hit array
235 // TObjArray* devs=evt->SortDevices(ordered,0,0);
236 // ndev=0;
237 // if (devs) ndev=devs->GetEntries();
238 // for (Int_t id=0; id<ndev; id++)
239 // {
240 //  AliDevice* dx=(AliDevice*)devs->At(id);
241 //  if (dx) dx->Data();
242 // }
243 //
244 // // Newly ordered devices w.r.t. decreasing ADC
245 // TObjArray* devs=evt->SortDevices("IceGOM","ADC",-1);
246 // ndev=0;
247 // if (devs) ndev=devs->GetEntries();
248 // for (Int_t id2=0; id2<ndev; id2++)
249 // {
250 //  AliDevice* dx=(AliDevice*)devs->At(id2);
251 //  if (dx) dx->Data();
252 // }
253 //
254 // A simple 3D event display of the modules
255 // ----------------------------------------
256 // TCanvas* c1=new TCanvas("c1","c1");
257 // c1->x3d();
258 // TView* view=new TView(1);
259 // view->SetRange(-50,-50,-50,50,50,50);
260 // view->ShowAxis();
261 //
262 // evt->DisplayHits("IceGOM","TOT",1e4,1);
263 //
264 //
265 //--- Author: Nick van Eijndhoven 23-jun-2004 Utrecht University
266 //- Modified: NvE $Date$ Utrecht University
267 ///////////////////////////////////////////////////////////////////////////
268
269 #include "IceEvent.h"
270 #include "Riostream.h"
271  
272 ClassImp(IceEvent) // Class implementation to enable ROOT I/O
273  
274 IceEvent::IceEvent() : AliEvent()
275 {
276 // Default constructor.
277 }
278 ///////////////////////////////////////////////////////////////////////////
279 IceEvent::~IceEvent()
280 {
281 // Default destructor.
282 }
283 ///////////////////////////////////////////////////////////////////////////
284 IceEvent::IceEvent(const IceEvent& evt) : AliEvent(evt)
285 {
286 // Copy constructor.
287 }
288 ///////////////////////////////////////////////////////////////////////////
289 TObject* IceEvent::Clone(const char* name) const
290 {
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. 
299
300  IceEvent* evt=new IceEvent(*this);
301  if (name)
302  {
303   if (strlen(name)) evt->SetName(name);
304  }
305  return evt;
306 }
307 ///////////////////////////////////////////////////////////////////////////