* provided "as is" without express or implied warranty. *
**************************************************************************/
-// $Id: AliEvent.cxx,v 1.13 2003/08/29 09:05:11 nick Exp $
+// $Id: AliEvent.cxx,v 1.17 2003/12/18 09:28:06 nick Exp $
///////////////////////////////////////////////////////////////////////////
// Class AliEvent
// Note : All quantities are in GeV, GeV/c or GeV/c**2
//
//--- Author: Nick van Eijndhoven 27-may-2001 UU-SAP Utrecht
-//- Modified: NvE $Date: 2003/08/29 09:05:11 $ UU-SAP Utrecht
+//- Modified: NvE $Date: 2003/12/18 09:28:06 $ UU-SAP Utrecht
///////////////////////////////////////////////////////////////////////////
#include "AliEvent.h"
{
// Default constructor.
// All variables initialised to default values.
- fDaytime.Set();
+ TTimeStamp tx;
+ fDaytime=tx;
fRun=0;
fEvent=0;
fAproj=0;
{
cout << " *** This AliVertex initialisation was invoked via the AliEvent ctor." << endl;
}
- fDaytime.Set();
+ TTimeStamp tx;
+ fDaytime=tx;
fRun=0;
fEvent=0;
fAproj=0;
AliVertex::Reset();
- fDaytime.Set();
+ TTimeStamp tx;
+ fDaytime=tx;
fRun=0;
fEvent=0;
fAproj=0;
AliVertex::SetOwner(own);
}
///////////////////////////////////////////////////////////////////////////
-void AliEvent::SetDayTime(TDatime& stamp)
+void AliEvent::SetDayTime(TTimeStamp& stamp)
{
-// Set the date and time stamp for this event
+// Set the date and time stamp for this event.
+// An exact copy of the entered date/time stamp will be saved with an
+// accuracy of 1 nanosecond.
fDaytime=stamp;
}
///////////////////////////////////////////////////////////////////////////
+void AliEvent::SetDayTime(TDatime& stamp)
+{
+// Set the date and time stamp for this event.
+// The entered date/time will be interpreted as being the local date/time
+// and the accuracy is 1 second.
+// This function with the TDatime argument is mainly kept for backward
+// compatibility reasons. It is recommended to use the corresponding
+// function with the TTimeStamp argument.
+
+ TTimeStamp ts(stamp.GetDate(),stamp.GetTime(),0,kFALSE);
+ fDaytime=ts;
+}
+///////////////////////////////////////////////////////////////////////////
void AliEvent::SetRunNumber(Int_t run)
{
// Set the run number for this event
fEvent=evt;
}
///////////////////////////////////////////////////////////////////////////
-TDatime AliEvent::GetDayTime()
+TTimeStamp AliEvent::GetDayTime()
{
// Provide the date and time stamp for this event
return fDaytime;
void AliEvent::HeaderData()
{
// Provide event header information
- cout << " *" << ClassName() << "::Data* Run : " << fRun << " Event : " << fEvent
- << " Date : " << fDaytime.AsString() << endl;
+ const char* name=GetName();
+ const char* title=GetTitle();
+ Int_t ndevs=GetNdevices();
+ cout << " *" << ClassName() << "::Data*";
+ if (strlen(name)) cout << " Name : " << GetName();
+ if (strlen(title)) cout << " Title : " << GetTitle();
+ cout << endl;
+ cout << " " << fDaytime.AsString() << endl;
+ cout << " Run : " << fRun << " Event : " << fEvent
+ << " Number of devices : " << ndevs << endl;
- ShowDevices();
+ if (ndevs) ShowDevices();
}
///////////////////////////////////////////////////////////////////////////
void AliEvent::Data(TString f)
if (!fDevices)
{
- cout << " *AliEvent::GetDevice* No devices present." << endl;
return 0;
}
else
// Return the device with name tag "name"
if (!fDevices)
{
- cout << " *" << ClassName() << "::GetDevice* No devices present." << endl;
return 0;
}
else
}
}
///////////////////////////////////////////////////////////////////////////
+TObject* AliEvent::Clone(char* name)
+{
+// Make a deep copy of the current object and provide the pointer to the copy.
+// This memberfunction enables automatic creation of new objects of the
+// correct type depending on the object type, a feature which may be very useful
+// for containers when adding objects in case the container owns the objects.
+// This feature allows to store either AliEvent objects or objects derived from
+// AliEvent via some generic AddEvent memberfunction, provided these derived
+// classes also have a proper Clone memberfunction.
+
+ AliEvent* evt=new AliEvent(*this);
+ if (name)
+ {
+ if (strlen(name)) evt->SetName(name);
+ }
+ return evt;
+}
+///////////////////////////////////////////////////////////////////////////