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.
26 // * In the event structure MC tracks are labeled with a negative track ID,
27 // whereas reconstructed tracks are labeled with a positive track ID.
28 // This allows for a direct selection of either MC or Reco tracks via the
29 // GetIdTrack() facility.
30 // * The particle codes used for the various tracks are the PDG ones.
31 // For IceCube specific "particle" types (e.g. deltae) the PDG database
32 // has been extended, as can be seen in the IceF2k class which provides
33 // a conversion facility from the F2K into the Ralice/IcePack format.
38 // Creation and filling of an event with some fictitious module data
39 // -----------------------------------------------------------------
40 // IceEvent* evt=new IceEvent();
43 // // The starting unique signal ID.
44 // // In this example it will be increased everytime
45 // // when a new signal is created.
50 // m.SetUniqueID(123);
51 // m.SetNameTitle("OM123","Amanda module");
53 // Float_t pos[3]={1,2,3};
54 // m.SetPosition(pos,"car");
58 // s.SetSlotName("ADC",1);
59 // s.SetSlotName("LE",2);
60 // s.SetSlotName("TOT",3);
63 // s.SetName("OM123 Hit 1");
64 // s.SetUniqueID(sid++);
65 // s.SetSignal(100,"ADC");
66 // s.SetSignal(-100,"LE");
67 // s.SetSignal(-1000,"TOT");
71 // s.SetName("OM123 Hit 2");
72 // s.SetUniqueID(sid++);
73 // s.SetSignal(110,"ADC");
74 // s.SetSignal(-101,"LE");
75 // s.SetSignal(1001,"TOT");
79 // s.SetName("OM123 Hit 3");
80 // s.SetUniqueID(sid++);
81 // s.SetSignal(120,"ADC");
82 // s.SetSignal(-102,"LE");
83 // s.SetSignal(-1002,"TOT");
89 // m.SetUniqueID(456);
90 // m.SetName("OM456");
95 // m.SetPosition(pos,"car");
98 // s.SetName("OM456 Hit 1");
99 // s.SetUniqueID(sid++);
100 // s.SetSignal(20,"ADC");
101 // s.SetSignal(-200,"LE");
102 // s.SetSignal(-2000,"TOT");
106 // s.SetName("OM456 Hit 2");
107 // s.SetUniqueID(sid++);
108 // s.SetSignal(21,"ADC");
109 // s.SetSignal(-201,"LE");
110 // s.SetSignal(2001,"TOT");
114 // s.SetName("OM456 Hit 3");
115 // s.SetUniqueID(sid++);
116 // s.SetSignal(22,"ADC");
117 // s.SetSignal(-202,"LE");
118 // s.SetSignal(-2002,"TOT");
121 // evt->AddDevice(m);
123 // // IceCube in-ice DOM
125 // mid.SetUniqueID(958);
126 // mid.SetNameTitle("OM958","IceCube in-ice module");
131 // mid.SetPosition(pos,"car");
134 // s.SetName("OM958 Hit 1");
135 // s.SetUniqueID(sid++);
136 // s.SetSignal(40,"ADC");
137 // s.SetSignal(-400,"LE");
138 // s.SetSignal(-4000,"TOT");
142 // s.SetName("OM958 Hit 2");
143 // s.SetUniqueID(sid++);
144 // s.SetSignal(41,"ADC");
145 // s.SetSignal(-401,"LE");
146 // s.SetSignal(4001,"TOT");
150 // s.SetName("OM958 Hit 3");
151 // s.SetUniqueID(sid++);
152 // s.SetSignal(42,"ADC");
153 // s.SetSignal(-402,"LE");
154 // s.SetSignal(-4002,"TOT");
157 // evt->AddDevice(mid);
161 // mtd.SetUniqueID(4958);
162 // mtd.SetNameTitle("OM4958","IceTop module");
167 // mtd.SetPosition(pos,"car");
170 // s.SetName("OM4958 Hit 1");
171 // s.SetUniqueID(sid++);
172 // s.SetSignal(50,"ADC");
173 // s.SetSignal(-500,"LE");
174 // s.SetSignal(-5000,"TOT");
178 // s.SetName("OM4958 Hit 2");
179 // s.SetUniqueID(sid++);
180 // s.SetSignal(51,"ADC");
181 // s.SetSignal(-501,"LE");
182 // s.SetSignal(5001,"TOT");
186 // s.SetName("OM4958 Hit 3");
187 // s.SetUniqueID(sid++);
188 // s.SetSignal(52,"ADC");
189 // s.SetSignal(-502,"LE");
190 // s.SetSignal(-5002,"TOT");
193 // evt->AddDevice(mtd);
195 // Investigation of the event contents
196 // -----------------------------------
197 // // Provide event data overview
200 // // Select a specific device (i.e. OM) from the event
201 // AliDevice* dx=(AliDevice*)evt->GetIdDevice(958);
202 // if (dx) dx->Data();
204 // // Select a specific hit from the event
205 // AliSignal* sx=evt->GetIdHit(5,"IceGOM");
206 // if (sx) sx->Data();
208 // // Dump all the information for the various stored devices
209 // Int_t ndev=evt->GetNdevices();
210 // for (Int_t idev=1; idev<=ndev; idev++)
212 // IceGOM* om=(IceGOM*)evt->GetDevice(idev);
213 // if (om) om->Data();
216 // // Dump all the information for the various stored hits
217 // // Obtain pointers to the hits for all generic OM's (i.e. IceGOM)
218 // TObjArray* hits=evt->GetHits("IceGOM");
220 // if (hits) nhits=hits->GetEntries();
221 // for (Int_t ih=0; ih<nhits; ih++)
223 // AliSignal* sx=(AliSignal*)hits->At(ih);
224 // if (sx) sx->Data();
227 // // Obtain the minimum and maximum recorded TOT value
228 // Float_t vmin,vmax;
229 // evt->GetExtremes("IceGOM",vmin,vmax,"TOT");
230 // cout << " Extreme values : vmin = " << vmin << " vmax = " << vmax << endl;
232 // Some simple module and hit manipulations
233 // ----------------------------------------
234 // // Ordered hits w.r.t. decreasing TOT
235 // TObjArray* ordered=evt->SortHits("IceGOM","TOT",-1);
237 // if (ordered) nhits=ordered->GetEntries();
238 // for (Int_t i=0; i<nhits; i++)
240 // AliSignal* sx=(AliSignal*)ordered->At(i);
241 // if (sx) sx->Data();
244 // // Ordered devices from the already ordered hit array
245 // TObjArray* devs=evt->SortDevices(ordered,0,0);
247 // if (devs) ndev=devs->GetEntries();
248 // for (Int_t id=0; id<ndev; id++)
250 // AliDevice* dx=(AliDevice*)devs->At(id);
251 // if (dx) dx->Data();
254 // // Newly ordered devices w.r.t. decreasing ADC
255 // TObjArray* devs=evt->SortDevices("IceGOM","ADC",-1);
257 // if (devs) ndev=devs->GetEntries();
258 // for (Int_t id2=0; id2<ndev; id2++)
260 // AliDevice* dx=(AliDevice*)devs->At(id2);
261 // if (dx) dx->Data();
264 // A simple 3D event display of the modules
265 // ----------------------------------------
266 // TCanvas* c1=new TCanvas("c1","c1");
268 // TView* view=new TView(1);
269 // view->SetRange(-50,-50,-50,50,50,50);
272 // evt->DisplayHits("IceGOM","TOT",1e4,1);
275 //--- Author: Nick van Eijndhoven 23-jun-2004 Utrecht University
276 //- Modified: NvE $Date$ Utrecht University
277 ///////////////////////////////////////////////////////////////////////////
279 #include "IceEvent.h"
280 #include "Riostream.h"
282 ClassImp(IceEvent) // Class implementation to enable ROOT I/O
284 IceEvent::IceEvent() : AliEvent()
286 // Default constructor.
288 ///////////////////////////////////////////////////////////////////////////
289 IceEvent::~IceEvent()
291 // Default destructor.
293 ///////////////////////////////////////////////////////////////////////////
294 IceEvent::IceEvent(const IceEvent& evt) : AliEvent(evt)
298 ///////////////////////////////////////////////////////////////////////////
299 TObject* IceEvent::Clone(const char* name) const
301 // Make a deep copy of the current object and provide the pointer to the copy.
302 // This memberfunction enables automatic creation of new objects of the
303 // correct type depending on the object type, a feature which may be very useful
304 // for containers like AliEvent when adding objects in case the
305 // container owns the objects. This feature allows e.g. AliEvent
306 // to store either IceEvent objects or objects derived from IceEvent
307 // via tha AddDevice memberfunction, provided these derived classes also have
308 // a proper Clone memberfunction.
310 IceEvent* evt=new IceEvent(*this);
313 if (strlen(name)) evt->SetName(name);
317 ///////////////////////////////////////////////////////////////////////////