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.
125 ///////////////////////////////////////////////////////////////////////////
126 AliEvent::AliEvent(Int_t n): AliVertex(n)
128 // Create an event to hold initially a maximum of n tracks
129 // All variables initialised to default values
134 ///////////////////////////////////////////////////////////////////////////
135 AliEvent::~AliEvent()
137 // Default destructor
139 ///////////////////////////////////////////////////////////////////////////
140 void AliEvent::Reset()
142 // Reset all variables to default values
143 // The max. number of tracks is set to the initial value again
144 // The max. number of vertices is set to the default value again
151 ///////////////////////////////////////////////////////////////////////////
152 void AliEvent::SetDayTime(TDatime& stamp)
154 // Set the date and time stamp for this event
157 ///////////////////////////////////////////////////////////////////////////
158 void AliEvent::SetRunNumber(Int_t run)
160 // Set the run number for this event
163 ///////////////////////////////////////////////////////////////////////////
164 void AliEvent::SetEventNumber(Int_t evt)
166 // Set the event number for this event
169 ///////////////////////////////////////////////////////////////////////////
170 TDatime AliEvent::GetDayTime()
172 // Provide the date and time stamp for this event
175 ///////////////////////////////////////////////////////////////////////////
176 Int_t AliEvent::GetRunNumber()
178 // Provide the run number for this event
181 ///////////////////////////////////////////////////////////////////////////
182 Int_t AliEvent::GetEventNumber()
184 // Provide the event number for this event
187 ///////////////////////////////////////////////////////////////////////////
188 void AliEvent::HeaderInfo()
190 // Provide event header information
191 Int_t date=fDaytime.GetDate();
192 Int_t time=fDaytime.GetTime();
194 Int_t year=date/10000;
195 Int_t month=(date%10000)/100;
198 Int_t mm=(time%10000)/100;
201 char* c[12]={"jan","feb","mar","apr","may","jun",
202 "jul","aug","sep","oct","nov","dec"};
204 cout << " *AliEvent::Info* Run : " << fRun << " Event : " << fEvent;
206 cout << " Date : " << setw(2) << day << "-" << c[month-1] << "-" << year
207 << " Time : " << setw(2) << hh << ":" << setw(2) << mm << ":" << setw(2) << ss << endl;
210 ///////////////////////////////////////////////////////////////////////////
211 void AliEvent::Info(TString f)
213 // Provide event information within the coordinate frame f
217 ///////////////////////////////////////////////////////////////////////////