1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line 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. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////
20 // Creation and investigation of an Alice physics event.
21 // An AliEvent can be constructed by adding AliTracks, Alivertices
24 // The basic functionality of AliEvent is identical to the one of AliVertex.
25 // So, an AliEvent may be regarded as the primary vertex with some
26 // additional functionality compared to AliVertex.
28 // Coding example to make an event consisting of a primary vertex
29 // and 2 secondary vertices.
30 // --------------------------------------------------------------
31 // v1 contains the tracks 1,2,3 and 4
32 // v2 contains the tracks 5,6 and 7
33 // v3 contains the jets 1 and 2
35 // AliTrack t1,t2,t3,t4,t5,t6,t7;
37 // ... // code to fill the track data
42 // ... // code to fill the jet data
52 // Float_t r0[3]={2.4,0.1,-8.5};
53 // evt.SetPosition(r0,"car");
60 // Float_t r1[3]={1.6,-3.2,5.7};
61 // v1.SetPosition(r1,"car");
68 // Float_t r2[3]={6.2,4.8,1.3};
69 // v2.SetPosition(r2,"car");
75 // Float_t etot=evt.GetEnergy();
76 // Ali3Vector ptot=evt.Get3Momentum();
78 // evt.GetPosition(loc,"sph");
79 // AliPosition r=v1.GetPosition();
81 // Int_t nt=v2.GetNtracks();
82 // AliTrack* tv=v2.GetTrack(1); // Access track number 1 of Vertex v2
84 // Specify the vertices v2 and v3 as secondary vertices of the primary
91 // Int_t nv=evt.GetNvtx();
92 // AliVertex* vx=evt.GetVertex(1); // Access 1st secondary vertex
93 // Float_t e=vx->GetEnergy();
95 // Float_t M=evt.GetInvmass();
97 // Reconstruct the event from scratch
100 // evt.SetNvmax(25); // Increase initial no. of sec. vertices
104 // Float_t pos[3]={7,9,4};
105 // evt.SetPosition(pos,"car");
107 // Note : All quantities are in GeV, GeV/c or GeV/c**2
109 //--- Author: Nick van Eijndhoven 27-may-2001 UU-SAP Utrecht
110 //- Modified: NvE $Date$ UU-SAP Utrecht
111 ///////////////////////////////////////////////////////////////////////////
113 #include "AliEvent.h"
115 ClassImp(AliEvent) // Class implementation to enable ROOT I/O
119 // Default constructor.
120 // All variables initialised to default values.
124 AliVertex::AliVertex();
126 ///////////////////////////////////////////////////////////////////////////
127 AliEvent::AliEvent(Int_t n)
129 // Create an event to hold initially a maximum of n tracks
130 // All variables initialised to default values
136 AliVertex::AliVertex(n);
141 cout << " *AliEvent* Initial max. number of tracks entered : " << n << endl;
142 cout << " This is invalid. Default initial maximum will be used." << endl;
144 AliVertex::AliVertex();
147 ///////////////////////////////////////////////////////////////////////////
148 AliEvent::~AliEvent()
150 // Default destructor
152 ///////////////////////////////////////////////////////////////////////////
153 void AliEvent::Reset()
155 // Reset all variables to default values
156 // The max. number of tracks is set to the initial value again
157 // The max. number of vertices is set to the default value again
164 ///////////////////////////////////////////////////////////////////////////
165 void AliEvent::SetDayTime(TDatime& stamp)
167 // Set the date and time stamp for this event
170 ///////////////////////////////////////////////////////////////////////////
171 void AliEvent::SetRunNumber(Int_t run)
173 // Set the run number for this event
176 ///////////////////////////////////////////////////////////////////////////
177 void AliEvent::SetEventNumber(Int_t evt)
179 // Set the event number for this event
182 ///////////////////////////////////////////////////////////////////////////
183 TDatime AliEvent::GetDayTime()
185 // Provide the date and time stamp for this event
188 ///////////////////////////////////////////////////////////////////////////
189 Int_t AliEvent::GetRunNumber()
191 // Provide the run number for this event
194 ///////////////////////////////////////////////////////////////////////////
195 Int_t AliEvent::GetEventNumber()
197 // Provide the event number for this event
200 ///////////////////////////////////////////////////////////////////////////
201 void AliEvent::HeaderInfo()
203 // Provide event header information
204 Int_t date=fDaytime.GetDate();
205 Int_t time=fDaytime.GetTime();
207 Int_t year=date/10000;
208 Int_t month=(date%10000)/100;
211 Int_t mm=(time%10000)/100;
214 char* c[12]={"jan","feb","mar","apr","may","jun",
215 "jul","aug","sep","oct","nov","dec"};
217 cout << " *AliEvent::Info* Run : " << fRun << " Event : " << fEvent;
219 cout << " Date : " << setw(2) << day << "-" << c[month-1] << "-" << year
220 << " Time : " << setw(2) << hh << ":" << setw(2) << mm << ":" << setw(2) << ss << endl;
223 ///////////////////////////////////////////////////////////////////////////
224 void AliEvent::Info(TString f)
226 // Provide event information within the coordinate frame f
230 ///////////////////////////////////////////////////////////////////////////