to comply with the corresponding virtual functions of AliSignal.
AliCalorimeter modified accordingly.
09-oct-2003 NvE Argument of all MakeCopy memberfunctions removed to obey the ANSI C++ rules for
virtual functions and to prepare for a common base class.
Due to the fact that not all compilers seem to accept the standard ANSI rule
that a virtual function is allowed to differ in return type from the corresponding
virtual function in the base class, the MakeCopy() memberfunctions have all been
given a return type of TObject*.
Also AliAttrib::Data renamed to AliAttrib::List to prevent violation of ANSI virtual
function rules and class AliSignal updated accordingly.
Memberfunction ResetPosition() moved from AliSignal to AliPosition.
Explicitly declared all memberfunctions virtual in the derived classes in case
the corresponding memberfunctions were also declared virtual in the base class.
Various memberfunctions which were declared virtual but were actually not meant
to be overridden declared as non-virtual in various low-level classes like
Ali3Vector, Ali4Vector, AliPosition etc...
13-oct-2003 NvE Argument 'npt' of AliCollider::MakeEvent also made optional.
24-oct-2003 NvE Private memberfunction Dump of AliTrack and AliVertex renamed to Dumps in order
not to override the Dump memberfunction of TObject.
Also definition of AliVertex::Draw slightly modified to comply with the standard
ANSI virtual function rules concerning TObject::Draw.
Invokation of ClassName() used in printout of AliSignal::Data to make the output
information more generic.
25-oct-2003 NvE Memberfunction AddCalorimeter of AliEvent replaced by memberfunction AddDevice
to make the functionality more generic.
To comply with the enhanced flexibility of AliEvent::AddDevice the class
AliCalorimeter has been derived from TNamed and the MakeCopy() memberfunction
has been replaced by Clone() to override the default one of TNamed.
The specific GetName and SetName memberfunctions of AliCalorimeter have been removed.
26-oct-2003 NvE Class AliSignal derived from TNamed and MakeCopy() memberfunction replaced by Clone()
like was done for AliCalorimeter.
The latter was also done for AliCalmodule and AliAttribObj.
Ali3Vector(const Ali3Vector& v); // Copy constructor
virtual void Load(Ali3Vector& q); // Load all attributes of input Ali3Vector
virtual void SetZero(); // (Re)set all attributes to zero.
- virtual void SetVector(Double_t* v,TString f); // Store vector v in frame f
- virtual void GetVector(Double_t* v,TString f); // Provide vector v in frame f
- virtual void SetVector(Float_t* v,TString f); // Store vector v in frame f
- virtual void GetVector(Float_t* v,TString f); // Provide vector v in frame f
- virtual void SetErrors(Double_t* e,TString f); // Store errors of vector in frame f
- virtual void GetErrors(Double_t* e,TString f); // Provide errors of vector in frame f
- virtual void SetErrors(Float_t* e,TString f); // Store errors of vector in frame f
- virtual void GetErrors(Float_t* e,TString f); // Provide errors of vector in frame f
+ void SetVector(Double_t* v,TString f); // Store vector v in frame f
+ void GetVector(Double_t* v,TString f); // Provide vector v in frame f
+ void SetVector(Float_t* v,TString f); // Store vector v in frame f
+ void GetVector(Float_t* v,TString f); // Provide vector v in frame f
+ void SetErrors(Double_t* e,TString f); // Store errors of vector in frame f
+ void GetErrors(Double_t* e,TString f); // Provide errors of vector in frame f
+ void SetErrors(Float_t* e,TString f); // Store errors of vector in frame f
+ void GetErrors(Float_t* e,TString f); // Provide errors of vector in frame f
virtual void Data(TString f="car"); // Print vector components in frame f
Double_t GetNorm(); // Provide norm of the vector
Double_t Dot(Ali3Vector& q); // Provide dot product with q
Double_t fDx,fDy,fDz; // Errors on Cartesian coordinates
Double_t fDresult; // Error on scalar result (e.g. norm or dotproduct)
- ClassDef(Ali3Vector,4) // Handling of 3-vectors in various reference frames.
+ ClassDef(Ali3Vector,5) // Handling of 3-vectors in various reference frames.
};
#endif
Double_t a[3];
fV.GetErrors(a,f);
+ Double_t dum=GetScalar();
e[0]=GetResultError();
+
for (Int_t i=0; i<3; i++)
{
e[i+1]=a[i];
Ali4Vector(const Ali4Vector& v); // Copy constructor
virtual void Load(Ali4Vector& q); // Load all attributes of input Ali4Vector
virtual void SetZero(); // (Re)set all attributes to zero
- virtual void SetVector(Double_t v0,Ali3Vector& v);// Store contravariant vector
- virtual void SetVector(Double_t* v,TString f); // Store contravariant vector v^i in frame f
- virtual void GetVector(Double_t* v,TString f); // Provide contravariant vector v^i in frame f
- virtual void SetVector(Float_t* v,TString f); // Store contravariant vector v^i in frame f
- virtual void GetVector(Float_t* v,TString f); // Provide contravariant vector v^i in frame f
- virtual void SetScalar(Double_t v0,Double_t dv0=0); // Set the scalar part (with error) of v
- virtual void SetScalarError(Double_t dv0); // Set error on the scalar part of v
+ void SetVector(Double_t v0,Ali3Vector& v); // Store contravariant vector
+ void SetVector(Double_t* v,TString f); // Store contravariant vector v^i in frame f
+ void GetVector(Double_t* v,TString f); // Provide contravariant vector v^i in frame f
+ void SetVector(Float_t* v,TString f); // Store contravariant vector v^i in frame f
+ void GetVector(Float_t* v,TString f); // Provide contravariant vector v^i in frame f
+ void SetScalar(Double_t v0,Double_t dv0=0); // Set the scalar part (with error) of v
+ void SetScalarError(Double_t dv0); // Set error on the scalar part of v
Double_t GetScalar(); // Provide the scalar part of v
- virtual void Set3Vector(Ali3Vector& v); // Set the 3-vector part of v
- virtual void Set3Vector(Double_t* v,TString f); // Set the 3-vector part of v in frame f
- virtual void Set3Vector(Float_t* v,TString f); // Set the 3-vector part of v in frame f
+ void Set3Vector(Ali3Vector& v); // Set the 3-vector part of v
+ void Set3Vector(Double_t* v,TString f); // Set the 3-vector part of v in frame f
+ void Set3Vector(Float_t* v,TString f); // Set the 3-vector part of v in frame f
Ali3Vector Get3Vector(); // Provide the 3-vector part of v
- virtual void SetInvariant(Double_t v2,Double_t dv2=0); // Set the Lorentz invariant (with error)
- virtual void SetInvariantError(Double_t dv2); // Set error on the Lorentz invariant
+ void SetInvariant(Double_t v2,Double_t dv2=0); // Set the Lorentz invariant (with error)
+ void SetInvariantError(Double_t dv2); // Set error on the Lorentz invariant
Double_t GetInvariant(); // Provide the Lorentz invariant
- virtual void SetErrors(Double_t* v,TString f); // Store errors of vector v^i in frame f
- virtual void GetErrors(Double_t* v,TString f); // Provide errors of vector v^i in frame f
- virtual void SetErrors(Float_t* v,TString f); // Store errors of vector v^i in frame f
- virtual void GetErrors(Float_t* v,TString f); // Provide errors of vector v^i in frame f
+ void SetErrors(Double_t* v,TString f); // Store errors of vector v^i in frame f
+ void GetErrors(Double_t* v,TString f); // Provide errors of vector v^i in frame f
+ void SetErrors(Float_t* v,TString f); // Store errors of vector v^i in frame f
+ void GetErrors(Float_t* v,TString f); // Provide errors of vector v^i in frame f
virtual void Data(TString f="car"); // Print contravariant components in frame f
Double_t Dot(Ali4Vector& q); // Provide dot product v^i*q_i
Double_t GetResultError(); // Provide error on scalar result (e.g. Dot)
Double_t GetScaTrans(); // Provide "transverse value" of scalar part w.r.t. z-axis
Double_t GetScaLong(); // Provide "longitudinal value" of scalar part w.r.t. z-axis
- ClassDef(Ali4Vector,4) // Handling of Lorentz 4-vectors in various reference frames.
+ ClassDef(Ali4Vector,5) // Handling of Lorentz 4-vectors in various reference frames.
};
#endif
return dead;
}
///////////////////////////////////////////////////////////////////////////
-AliAttrib* AliAttrib::MakeCopy(AliAttrib& a)
-{
-// Make a deep copy of the input object and provide the pointer to the copy.
-// This memberfunction enables automatic creation of new objects of the
-// correct type depending on the argument type, a feature which may be very useful
-// for containers when adding objects in case the container owns the objects.
-
- AliAttrib* att=new AliAttrib(a);
- return att;
-}
-///////////////////////////////////////////////////////////////////////////
void AliAttrib::SetSlotName(TString s,Int_t j)
{
// Set a user defined name for the j-th (default j=1) slot.
return index;
}
///////////////////////////////////////////////////////////////////////////
-void AliAttrib::Data(Int_t j)
+void AliAttrib::List(Int_t j)
{
// Provide attribute information for the j-th slot.
// The first slot is at j=1.
Int_t GetNoffsets(); // Provide the number of specified offsets
Int_t GetNcalflags(); // Provide the number of specified calib. flags
Int_t GetNnames(); // Provide the maximum number of specified names
- virtual AliAttrib* MakeCopy(AliAttrib& a); // Make a deep copy and provide its pointer
void SetGain(Double_t gain,Int_t j=1); // Set gain of the j-th attribute slot
Float_t GetGain(Int_t j=1); // Provide gain of the j-th attribute slot
void SetOffset(Double_t off,Int_t j=1); // Set offset value of the j-th attribute slot
void DecreaseEdgeValue(Int_t j=1); // Decrease the edge value of the j-th slot by 1
void SetEdgeValue(Int_t val,Int_t j=1); // Set a specific edge value for the j-th slot
Int_t GetEdgeValue(Int_t j=1); // Provide the edge value of the j-th slot
- virtual void Data(Int_t j=0); // Printout of attribute data
+ virtual void List(Int_t j=0); // Printout of attribute data
virtual void Load(AliAttrib& a,Int_t j=0); // Load j-th slot or all attributes of the input AliAttrib
void SetSlotName(TString s,Int_t j=1); // Set user defined name for the j-th slot
TString GetSlotName(Int_t j=1); // Provide user defined name for the j-th slot
// Copy constructor
}
///////////////////////////////////////////////////////////////////////////
-AliAttribObj* AliAttribObj::MakeCopy(AliAttribObj& a)
+TObject* AliAttribObj::Clone(char* name)
{
-// Make a deep copy of the input object and provide the pointer to the copy.
+// 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 argument type, a feature which may be very useful
+// 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.
- AliAttribObj* att=new AliAttribObj(a);
+ AliAttribObj* att=new AliAttribObj(*this);
return att;
}
///////////////////////////////////////////////////////////////////////////
AliAttribObj(AliAttrib& a); // Constructor
virtual ~AliAttribObj(); // Destructor
AliAttribObj(AliAttribObj& a); // Copy constructor
- virtual AliAttribObj* MakeCopy(AliAttribObj& a); // Make a deep copy and provide its pointer
+ virtual TObject* Clone(char* name); // Make a deep copy and provide its pointer
- ClassDef(AliAttribObj,1) // Generic handling of detector signal (calibration) attributes.
+ ClassDef(AliAttribObj,2) // Generic handling of detector signal (calibration) attributes.
};
#endif
fSigc=m.fSigc;
}
///////////////////////////////////////////////////////////////////////////
-AliCalmodule::AliCalmodule(Int_t row,Int_t col,Float_t sig) : AliSignal()
+AliCalmodule::AliCalmodule(Int_t row,Int_t col,Double_t sig) : AliSignal()
{
// Module constructor with initialisation of module data
fRow=row;
fCol=i;
}
///////////////////////////////////////////////////////////////////////////
-void AliCalmodule::SetSignal(Int_t row,Int_t col,Float_t sig)
+void AliCalmodule::SetSignal(Double_t sig,Int_t j)
{
-// Set or change the data of the module
- fRow=row;
- fCol=col;
- AliSignal::SetSignal(sig);
- fSigc=sig;
+// Set or change the data of the module.
+// This is an extension of AliSignal::SetSignal in view of the clustered signal.
+ AliSignal::SetSignal(sig,j);
+ if (j==1) fSigc=sig;
}
///////////////////////////////////////////////////////////////////////////
-void AliCalmodule::AddSignal(Int_t row,Int_t col,Float_t sig)
+void AliCalmodule::AddSignal(Double_t sig,Int_t j)
{
// Add or change the data of the module
- fRow=row;
- fCol=col;
- AliSignal::AddSignal(sig);
- fSigc+=sig;
+// This is an extension of AliSignal::AddSignal in view of the clustered signal.
+ AliSignal::AddSignal(sig,j);
+ if (j==1) fSigc+=sig;
}
///////////////////////////////////////////////////////////////////////////
-void AliCalmodule::SetClusteredSignal(Float_t sig)
+void AliCalmodule::SetClusteredSignal(Double_t sig)
{
// Set or change the signal of the module after clustering
fSigc=sig;
}
}
///////////////////////////////////////////////////////////////////////////
-AliCalmodule* AliCalmodule::MakeCopy(AliCalmodule& m)
+TObject* AliCalmodule::Clone(char* name)
{
-// Make a deep copy of the input object and provide the pointer to the copy.
+// 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 argument type, a feature which may be very useful
+// correct type depending on the object type, a feature which may be very useful
// for containers like AliCalorimeter when adding objects in case the
// container owns the objects. This feature allows e.g. AliCalorimeter
// to store either AliCalmodule objects or objects derived from AliCalmodule
// via tha AddSignal memberfunction, provided these derived classes also have
-// a proper MakeCopy memberfunction.
+// a proper Clone memberfunction.
- AliCalmodule* cal=new AliCalmodule(m);
- return cal;
+ AliCalmodule* m=new AliCalmodule(*this);
+ if (name)
+ {
+ if (strlen(name)) m->SetName(name);
+ }
+ return m;
}
///////////////////////////////////////////////////////////////////////////
AliCalmodule(); // Default constructor
virtual ~AliCalmodule(); // Default destructor
AliCalmodule(AliCalmodule& m); // Copy constructor
- AliCalmodule(Int_t row,Int_t col,Float_t sig); // Create a module and initialise data
- virtual void SetSignal(Int_t row,Int_t col,Float_t sig); // Set or change data for certain module
- virtual void AddSignal(Int_t row,Int_t col,Float_t sig); // Add signal to a certain module
+ AliCalmodule(Int_t row,Int_t col,Double_t sig); // Create a module and initialise data
+ virtual TObject* Clone(char* name); // Make a deep copy and provide its pointer
+ virtual void SetSignal(Double_t sig,Int_t j=1); // Set or change data for certain module
+ virtual void AddSignal(Double_t sig,Int_t j=1); // Add signal to a certain module
void SetRow(Int_t i); // Set the row number of the module
void SetColumn(Int_t i); // Set the column number of the module
Int_t GetRow(); // Return the row number of the module
Int_t GetColumn(); // Return the column number of the module
- void SetClusteredSignal(Float_t val); // Set the signal of the module after clustering
+ void SetClusteredSignal(Double_t val); // Set the signal of the module after clustering
Float_t GetClusteredSignal(); // Return module signal after clustering
- virtual AliCalmodule* MakeCopy(AliCalmodule& m); // Make a deep copy and provide its pointer
protected:
Int_t fRow; // The current row number
Int_t fCol; // The current column number
Float_t fSigc; // The signal after clustering
- ClassDef(AliCalmodule,4) // Description of a module in a calorimeter system.
+ ClassDef(AliCalmodule,6) // Description of a module in a calorimeter system.
};
#endif
ClassImp(AliCalorimeter) // Class implementation to enable ROOT I/O
-AliCalorimeter::AliCalorimeter() : TObject()
+AliCalorimeter::AliCalorimeter() : TNamed()
{
// Default constructor, all parameters set to 0.
// Create a calorimeter module matrix with fixed row and column size.
fVetos=0;
fAttributes=0;
fPositions=0;
- fName="Unspecified AliCalorimeter";
+ SetName("Unspecified");
}
///////////////////////////////////////////////////////////////////////////
AliCalorimeter::~AliCalorimeter()
}
}
///////////////////////////////////////////////////////////////////////////
-AliCalorimeter::AliCalorimeter(Int_t nrow,Int_t ncol) : TObject()
+AliCalorimeter::AliCalorimeter(Int_t nrow,Int_t ncol) : TNamed()
{
// Create a calorimeter module matrix with fixed row and column size.
// The modules at the edges are automatically marked as "edge modules".
fVetos=0;
- fName="Unspecified AliCalorimeter";
+ SetName("Unspecified");
}
///////////////////////////////////////////////////////////////////////////
-AliCalorimeter::AliCalorimeter(AliCalorimeter& c) : TObject(c)
+AliCalorimeter::AliCalorimeter(AliCalorimeter& c) : TNamed(c)
{
// Copy constructor
fClusters=0;
fNrows=c.fNrows;
fNcolumns=c.fNcolumns;
- fName=c.fName;
fSwap=c.fSwap;
if (!m) // initialise for a new module
{
m=new AliCalmodule();
+ m->SetRow(row);
+ m->SetColumn(col);
AliPosition* r=0;
if (fPositions) r=(AliPositionObj*)fPositions->GetObject(row,col);
if (r) m->SetPosition(*r);
fMatrix->EnterObject(row,col,m);
}
- m->SetSignal(row,col,sig);
+ m->SetSignal(sig);
}
///////////////////////////////////////////////////////////////////////////
void AliCalorimeter::AddSignal(Int_t row, Int_t col, Float_t sig)
}
else
{
- m->AddSignal(row,col,sig);
+ m->AddSignal(sig);
}
}
///////////////////////////////////////////////////////////////////////////
}
else
{
- m->AddSignal(row,col,sig);
+ m->AddSignal(sig);
}
}
///////////////////////////////////////////////////////////////////////////
Int_t nmods=GetNsignals();
- Float_t row,col,signal;
+ Int_t row,col;
+ Float_t signal;
Int_t dead;
for (Int_t i=1; i<=nmods; i++)
{
AliCalmodule* m=(AliCalmodule*)fMatrix->GetObject(i);
if (m)
{
- row=float(m->GetRow());
- col=float(m->GetColumn());
+ row=m->GetRow();
+ col=m->GetColumn();
dead=m->GetDeadValue();
signal=0;
- if (!dead) signal=GetSignal(static_cast<Int_t>(row),
- static_cast<Int_t>(col),mode);
- if (signal>thresh) fHmodules->Fill(col,row,signal);
+ if (!dead) signal=GetSignal(row,col,mode);
+ if (signal>thresh) fHmodules->Fill(float(col),float(row),signal);
}
}
}
AliCalcluster* c;
- Float_t row,col,signal;
+ Int_t row,col;
+ Float_t signal;
for (Int_t i=0; i<GetNclusters(); i++)
{
c=(AliCalcluster*)fClusters->At(i);
if (c)
{
- row=float(c->GetRow());
- col=float(c->GetColumn());
+ row=c->GetRow();
+ col=c->GetColumn();
signal=c->GetSignal();
- if (signal>thresh) fHclusters->Fill(col,row,signal);
+ if (signal>thresh) fHclusters->Fill(float(col),float(row),signal);
}
}
}
}
///////////////////////////////////////////////////////////////////////////
-void AliCalorimeter::SetName(TString name)
-{
-// Set the name of the calorimeter system.
- fName=name;
-}
-///////////////////////////////////////////////////////////////////////////
-TString AliCalorimeter::GetName()
-{
-// Provide the name of the calorimeter system.
- return fName;
-}
-///////////////////////////////////////////////////////////////////////////
void AliCalorimeter::SetSwapMode(Int_t swap)
{
// Set the swap mode for the module and position matrices.
return fSwap;
}
///////////////////////////////////////////////////////////////////////////
-AliCalorimeter* AliCalorimeter::MakeCopy(AliCalorimeter& c)
+TObject* AliCalorimeter::Clone(char* name)
{
-// Make a deep copy of the input object and provide the pointer to the copy.
+// 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 argument type, a feature which may be very useful
+// correct type depending on the object type, a feature which may be very useful
// for containers like AliEvent when adding objects in case the
// container owns the objects.
- AliCalorimeter* cal=new AliCalorimeter(c);
+ AliCalorimeter* cal=new AliCalorimeter(*this);
+ if (name)
+ {
+ if (strlen(name)) cal->SetName(name);
+ }
return cal;
}
///////////////////////////////////////////////////////////////////////////
#include <math.h>
-#include "TObject.h"
+#include "TNamed.h"
#include "TObjArray.h"
#include "TH2.h"
#include "TString.h"
#include "AliPositionObj.h"
#include "AliAttribObj.h"
-class AliCalorimeter : public TObject
+class AliCalorimeter : public TNamed
{
public:
AliCalorimeter(); // Default constructor
AliCalorimeter(Int_t nrow,Int_t ncol); // Create a calorimeter matrix
virtual ~AliCalorimeter(); // Destructor
AliCalorimeter(AliCalorimeter& c); // Copy constructor
- virtual AliCalorimeter* MakeCopy(AliCalorimeter& c); // Make a deep copy and provide pointer of the copy
+ virtual TObject* Clone(char* name); // Make a deep copy and provide pointer of the copy
Int_t GetNrows(); // Return number of rows of the matrix
Int_t GetNcolumns(); // Return number of columns of the matrix
void SetSignal(Int_t row,Int_t col,Float_t s); // Set signal for a certain module
void AddVetoSignal(AliSignal* s) { AddVetoSignal(*s); }
AliSignal* GetVetoSignal(Int_t j); // Access to veto signal number j
Int_t GetNvetos(); // Provide the number of veto signals
- void SetName(TString name); // Set the name of the calorimeter system
- TString GetName(); // Provide the name of the calorimeter system
void SetSwapMode(Int_t swap=1); // Set the swapmode for the storage of the matrices
Int_t GetSwapMode(); // Provide the swapmode for the storage of the matrices
TObjArray* fVetos; // The array of associated (extrapolated) veto signals
TObjArray* fAttributes; //! Matrix with module attributes (e.g. gain, offset etc...)
AliObjMatrix* fPositions; //! The matrix of module position pointers
- TString fName; // Name of the calorimeter system
- ClassDef(AliCalorimeter,5) // Description of a modular calorimeter system.
+ ClassDef(AliCalorimeter,6) // Description of a modular calorimeter system.
};
#endif
* provided "as is" without express or implied warranty. *
**************************************************************************/
-// $Id: AliCollider.cxx,v 1.5 2003/02/03 13:19:44 nick Exp $
+// $Id: AliCollider.cxx,v 1.6 2003/08/29 09:05:11 nick Exp $
///////////////////////////////////////////////////////////////////////////
// Class AliCollider
//
//
//--- Author: Nick van Eijndhoven 22-nov-2002 Utrecht University
-//- Modified: NvE $Date: 2003/02/03 13:19:44 $ Utrecht University
+//- Modified: NvE $Date: 2003/08/29 09:05:11 $ Utrecht University
///////////////////////////////////////////////////////////////////////////
#include "AliCollider.h"
delete [] rans;
}
- if (!(fEventnum%fPrintfreq))
+ if (!(fEventnum%fPrintfreq))
+ {
+ cout << " *AliCollider::MakeEvent* Run : " << fRunnum << " Event : " << fEventnum
+ << endl;
+ if (fNucl)
{
- cout << " *AliCollider::MakeEvent* Run : " << fRunnum << " Event : " << fEventnum
- << endl;
- if (fNucl)
- {
- cout << " npart = " << npt << " ncol = " << ncol
- << " ncolpp = " << ncols[0] << " ncolnp = " << ncols[1]
- << " ncolpn = " << ncols[2] << " ncolnn = " << ncols[3] << endl;
- }
+ cout << " npart = " << npt << " ncol = " << ncol
+ << " ncolpp = " << ncols[0] << " ncolnp = " << ncols[1]
+ << " ncolpn = " << ncols[2] << " ncolnn = " << ncols[3] << endl;
}
+ }
if (!fEvent)
{
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
-// $Id: AliCollider.h,v 1.3 2002/12/11 14:45:12 nick Exp $
+// $Id: AliCollider.h,v 1.4 2003/08/29 09:05:11 nick Exp $
#include "TPythia6.h"
#include "TString.h"
Int_t GetPrintFreq(); // Provide the print frequency
void Init(char* frame,char* beam,char* target,Float_t win); // Standard Pythia initialisation
void Init(char* frame,Int_t zp,Int_t ap,Int_t zt,Int_t at,Float_t win); // Nucl-Nucl initialisation
- void MakeEvent(Int_t npt,Int_t mlist=-1,Int_t medit=1);// Generate a single event with npt participant nucleons
+ void MakeEvent(Int_t npt=0,Int_t mlist=-1,Int_t medit=1);// Generate a single event with npt participant nucleons
void EndRun(); // Properly close all buffers and output file
AliEvent* GetEvent(); // Provide pointer to the generated event structure
void GetFractions(Float_t zp,Float_t ap,Float_t zt,Float_t at); // Determine various N-N collision fractions
- ClassDef(AliCollider,3) // Pythia based universal physics event generator
+ ClassDef(AliCollider,4) // Pythia based universal physics event generator
};
#endif
* provided "as is" without express or implied warranty. *
**************************************************************************/
-// $Id: AliEvent.cxx,v 1.11 2003/02/25 12:36:28 nick Exp $
+// $Id: AliEvent.cxx,v 1.13 2003/08/29 09:05:11 nick Exp $
///////////////////////////////////////////////////////////////////////////
// Class AliEvent
// Creation and investigation of an Alice physics event.
// An AliEvent can be constructed by adding AliTracks, Alivertices, AliJets
-// and/or AliCalorimeters.
+// and/or devices like AliCalorimeters.
+// All objects which are derived from TObject can be regarded as a device.
//
// The basic functionality of AliEvent is identical to the one of AliVertex.
// So, an AliEvent may be used as the primary vertex with some additional
//
// To provide maximal flexibility to the user, the two modes of track/jet/vertex
// storage as described in AliJet and AliVertex can be used.
-// In addition an identical structure is provided for the storage of AliCalorimeter
-// objects, which can be selected by means of the memberfunction SetCalCopy().
-//
-// a) SetCalCopy(0) (which is the default).
-// Only the pointers of the 'added' calorimeters are stored.
-// This mode is typically used by making cal. studies based on a fixed set
-// of calorimeters which stays under user control or is kept on an external
+// In addition an identical structure is provided for the storage of devices like
+// AliCalorimeter objects, which can be selected by means of the memberfunction
+// SetDevCopy().
+//
+// a) SetDevCopy(0) (which is the default).
+// Only the pointers of the 'added' devices are stored.
+// This mode is typically used by making studies based on a fixed set
+// of devices which stays under user control or is kept on an external
// file/tree.
// In this way the AliEvent just represents a 'logical structure' for the
// physics analysis.
//
// Note :
-// Modifications made to the original calorimeters also affect the AliCalorimeter
+// Modifications made to the original devices also affect the device
// objects which are stored in the AliEvent.
//
-// b) SetCalCopy(1).
-// Of every 'added' calorimeter a private copy will be made of which the pointer
+// b) SetDevCopy(1).
+// Of every 'added' device a private copy will be made of which the pointer
// will be stored.
// In this way the AliEvent represents an entity on its own and modifications
// made to the original calorimeters do not affect the AliCalorimeter objects
// which are stored in the AliEvent.
-// This mode will allow 'adding' many different AliCalorimeters into an AliEvent by
-// creating only one AliCalorimeter instance in the main programme and using the
-// AliCalorimeter::Reset() and AliCalorimeter parameter setting memberfunctions.
+// This mode will allow 'adding' many different devices into an AliEvent by
+// creating only one device instance in the main programme and using the
+// Reset() and parameter setting memberfunctions of the object representing the device.
+//
+// Note :
+// The copy is made using the Clone() memberfunction.
+// All devices (i.e. classes derived from TObject) have the default TObject::Clone()
+// memberfunction.
+// However, devices generally contain an internal (signal) data structure
+// which may include pointers to other objects. Therefore it is recommended to provide
+// for all devices a specific copy constructor and override the default Clone()
+// memberfunction using this copy constructor.
+// An example for this may be seen from AliCalorimeter.
//
// See also the documentation provided for the memberfunction SetOwner().
//
// Specify the event object as the repository of all objects
// for the event building and physics analysis.
//
-// evt.SetCalCopy(1);
+// evt.SetDevCopy(1);
// evt.SetTrackCopy(1);
//
// Fill the event structure with the basic objects
// ... // code to fill the calorimeter data
// ...
//
-// evt.AddCalorimeter(emcal);
+// evt.AddDevice(emcal);
//
// AliTrack* tx=new AliTrack();
// for (Int_t i=0; i<10; i++)
// 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/02/25 12:36:28 $ UU-SAP Utrecht
+//- Modified: NvE $Date: 2003/08/29 09:05:11 $ UU-SAP Utrecht
///////////////////////////////////////////////////////////////////////////
#include "AliEvent.h"
fZtarg=0;
fPnucTarg=0;
fIdTarg=0;
- fNcals=0;
- fCalorimeters=0;
- fCalCopy=0;
+ fDevices=0;
+ fDevCopy=0;
}
///////////////////////////////////////////////////////////////////////////
AliEvent::AliEvent(Int_t n) : AliVertex(n)
fZtarg=0;
fPnucTarg=0;
fIdTarg=0;
- fNcals=0;
- fCalorimeters=0;
- fCalCopy=0;
+ fDevices=0;
+ fDevCopy=0;
}
///////////////////////////////////////////////////////////////////////////
AliEvent::~AliEvent()
{
// Default destructor
- if (fCalorimeters)
+ if (fDevices)
{
- delete fCalorimeters;
- fCalorimeters=0;
+ delete fDevices;
+ fDevices=0;
}
}
///////////////////////////////////////////////////////////////////////////
fZtarg=evt.fZtarg;
fPnucTarg=evt.fPnucTarg;
fIdTarg=evt.fIdTarg;
- fNcals=evt.fNcals;
- fCalCopy=evt.fCalCopy;
+ fDevCopy=evt.fDevCopy;
- fCalorimeters=0;
- if (fNcals)
+ fDevices=0;
+ Int_t ndevs=evt.GetNdevices();
+ if (ndevs)
{
- fCalorimeters=new TObjArray(fNcals);
- if (fCalCopy) fCalorimeters->SetOwner();
- for (Int_t i=1; i<=fNcals; i++)
+ fDevices=new TObjArray(ndevs);
+ if (fDevCopy) fDevices->SetOwner();
+ for (Int_t i=1; i<=ndevs; i++)
{
- AliCalorimeter* cal=evt.GetCalorimeter(i);
- if (cal)
+ TObject* dev=evt.GetDevice(i);
+ if (dev)
{
- if (fCalCopy)
+ if (fDevCopy)
{
- fCalorimeters->Add(new AliCalorimeter(*cal));
+ fDevices->Add(dev->Clone());
}
else
{
- fCalorimeters->Add(cal);
+ fDevices->Add(dev);
}
}
}
fPnucTarg=0;
fIdTarg=0;
- fNcals=0;
- if (fCalorimeters)
+ if (fDevices)
{
- delete fCalorimeters;
- fCalorimeters=0;
+ delete fDevices;
+ fDevices=0;
}
}
///////////////////////////////////////////////////////////////////////////
Int_t mode=1;
if (!own) mode=0;
- if (fCalorimeters) fCalorimeters->SetOwner(own);
- fCalCopy=mode;
+ if (fDevices) fDevices->SetOwner(own);
+ fDevCopy=mode;
AliVertex::SetOwner(own);
}
void AliEvent::HeaderData()
{
// Provide event header information
- cout << " *AliEvent::Data* Run : " << fRun << " Event : " << fEvent
+ cout << " *" << ClassName() << "::Data* Run : " << fRun << " Event : " << fEvent
<< " Date : " << fDaytime.AsString() << endl;
- ShowCalorimeters();
+ ShowDevices();
}
///////////////////////////////////////////////////////////////////////////
void AliEvent::Data(TString f)
AliVertex::Data(f);
}
///////////////////////////////////////////////////////////////////////////
-Int_t AliEvent::GetNcalorimeters()
+Int_t AliEvent::GetNdevices()
{
-// Provide the number of stored calorimeter systems
- return fNcals;
+// Provide the number of stored devices
+ Int_t ndevs=0;
+ if (fDevices) ndevs=fDevices->GetEntries();
+ return ndevs;
}
///////////////////////////////////////////////////////////////////////////
-void AliEvent::AddCalorimeter(AliCalorimeter& c)
+void AliEvent::AddDevice(TObject& d)
{
-// Add a calorimeter system to the event
- if (!fCalorimeters)
+// Add a device to the event.
+//
+// Note :
+// In case a private copy is made, this is performed via the Clone() memberfunction.
+// All devices (i.e. classes derived from TObject) have the default TObject::Clone()
+// memberfunction.
+// However, devices generally contain an internal (signal) data structure
+// which may include pointers to other objects. Therefore it is recommended to provide
+// for all devices a specific copy constructor and override the default Clone()
+// memberfunction using this copy constructor.
+// An example for this may be seen from AliCalorimeter.
+
+ if (!fDevices)
{
- fCalorimeters=new TObjArray();
- if (fCalCopy) fCalorimeters->SetOwner();
+ fDevices=new TObjArray();
+ if (fDevCopy) fDevices->SetOwner();
}
- // Add the calorimeter system to this event
- fNcals++;
- if (fCalCopy)
+ // Add the device to this event
+ if (fDevCopy)
{
- fCalorimeters->Add(new AliCalorimeter(c));
+ fDevices->Add(d.Clone());
}
else
{
- fCalorimeters->Add(&c);
+ fDevices->Add(&d);
}
}
///////////////////////////////////////////////////////////////////////////
-void AliEvent::SetCalCopy(Int_t j)
+void AliEvent::SetDevCopy(Int_t j)
{
-// (De)activate the creation of private copies of the added calorimeters.
-// j=0 ==> No private copies are made; pointers of original cals. are stored.
-// j=1 ==> Private copies of the cals. are made and these pointers are stored.
-//
-// Note : Once the storage contains pointer(s) to AliCalorimeter(s) one cannot
-// change the CalCopy mode anymore.
-// To change the CalCopy mode for an existing AliEvent containing
-// calorimeters one first has to invoke Reset().
- if (!fCalorimeters)
+// (De)activate the creation of private copies of the added devices.
+// j=0 ==> No private copies are made; pointers of original devices are stored.
+// j=1 ==> Private copies of the devices are made and these pointers are stored.
+//
+//
+// Notes :
+// In case a private copy is made, this is performed via the Clone() memberfunction.
+// All devices (i.e. classes derived from TObject) have the default TObject::Clone()
+// memberfunction.
+// However, devices generally contain an internal (signal) data structure
+// which may include pointers to other objects. Therefore it is recommended to provide
+// for all devices a specific copy constructor and override the default Clone()
+// memberfunction using this copy constructor.
+// An example for this may be seen from AliCalorimeter.
+//
+// Once the storage contains pointer(s) to device(s) one cannot
+// change the DevCopy mode anymore.
+// To change the DevCopy mode for an existing AliEvent containing
+// devices one first has to invoke Reset().
+
+ if (!fDevices)
{
if (j==0 || j==1)
{
- fCalCopy=j;
+ fDevCopy=j;
}
else
{
- cout << "*AliEvent::SetCalCopy* Invalid argument : " << j << endl;
+ cout << " *" << ClassName() << "::SetDevCopy* Invalid argument : " << j << endl;
}
}
else
{
- cout << "*AliEvent::SetCalCopy* Storage already contained calorimeters."
- << " ==> CalCopy mode not changed." << endl;
+ cout << " *" << ClassName() << "::SetDevCopy* Storage already contained devices."
+ << " ==> DevCopy mode not changed." << endl;
}
}
///////////////////////////////////////////////////////////////////////////
-Int_t AliEvent::GetCalCopy()
+Int_t AliEvent::GetDevCopy()
{
-// Provide value of the CalCopy mode.
-// 0 ==> No private copies are made; pointers of original cals. are stored.
-// 1 ==> Private copies of the cals. are made and these pointers are stored.
- return fCalCopy;
+// Provide value of the DevCopy mode.
+// 0 ==> No private copies are made; pointers of original devices are stored.
+// 1 ==> Private copies of the devices are made and these pointers are stored.
+//
+// Note :
+// In case a private copy is made, this is performed via the Clone() memberfunction.
+// All devices (i.e. classes derived from TObject) have the default TObject::Clone()
+// memberfunction.
+// However, devices generally contain an internal (signal) data structure
+// which may include pointers to other objects. Therefore it is recommended to provide
+// for all devices a specific copy constructor and override the default Clone()
+// memberfunction using this copy constructor.
+// An example for this may be seen from AliCalorimeter.
+
+ return fDevCopy;
}
///////////////////////////////////////////////////////////////////////////
-AliCalorimeter* AliEvent::GetCalorimeter(Int_t i)
+TObject* AliEvent::GetDevice(Int_t i)
{
-// Return the i-th calorimeter of this event
- if (!fCalorimeters)
+// Return the i-th device of this event.
+// The first device corresponds to i=1.
+
+ if (!fDevices)
{
- cout << " *AliEvent::GetCalorimeter* No calorimeters present." << endl;
+ cout << " *AliEvent::GetDevice* No devices present." << endl;
return 0;
}
else
{
- if (i<=0 || i>fNcals)
+ Int_t ndevs=GetNdevices();
+ if (i<=0 || i>ndevs)
{
- cout << " *AliEvent::GetCalorimeter* Invalid argument i : " << i
- << " Ncals = " << fNcals << endl;
+ cout << " *" << ClassName() << "::GetDevice* Invalid argument i : " << i
+ << " ndevs = " << ndevs << endl;
return 0;
}
else
{
- return (AliCalorimeter*)fCalorimeters->At(i-1);
+ return fDevices->At(i-1);
}
}
}
///////////////////////////////////////////////////////////////////////////
-AliCalorimeter* AliEvent::GetCalorimeter(TString name)
+TObject* AliEvent::GetDevice(TString name)
{
-// Return the calorimeter with name tag "name"
- if (!fCalorimeters)
+// Return the device with name tag "name"
+ if (!fDevices)
{
- cout << " *AliEvent::GetCalorimeter* No calorimeters present." << endl;
+ cout << " *" << ClassName() << "::GetDevice* No devices present." << endl;
return 0;
}
else
{
- AliCalorimeter* cx;
TString s;
- for (Int_t i=0; i<fNcals; i++)
+ Int_t ndevs=GetNdevices();
+ for (Int_t i=0; i<ndevs; i++)
{
- cx=(AliCalorimeter*)fCalorimeters->At(i);
- if (cx)
+ TObject* dev=fDevices->At(i);
+ if (dev)
{
- s=cx->GetName();
- if (s == name) return cx;
+ s=dev->GetName();
+ if (s == name) return dev;
}
}
}
}
///////////////////////////////////////////////////////////////////////////
-void AliEvent::ShowCalorimeters()
+void AliEvent::ShowDevices()
{
-// Provide an overview of the available calorimeter systems.
- if (fNcals>0)
+// Provide an overview of the available devices.
+ Int_t ndevs=GetNdevices();
+ if (ndevs)
{
- cout << " The following " << fNcals << " calorimeter systems are available :" << endl;
- for (Int_t i=1; i<=fNcals; i++)
+ cout << " The following " << ndevs << " devices are available :" << endl;
+ for (Int_t i=1; i<=ndevs; i++)
{
- AliCalorimeter* cal=GetCalorimeter(i);
- if (cal) cout << " Calorimeter number : " << i << " Name : " << (cal->GetName()).Data() << endl;
+ TObject* dev=GetDevice(i);
+ if (dev)
+ {
+ cout << " Device number : " << i
+ << " Class : " << dev->ClassName()
+ << " Name : " << dev->GetName() << endl;
+ }
}
}
else
{
- cout << " No calorimeters present for this event." << endl;
+ cout << " No devices present for this event." << endl;
}
}
///////////////////////////////////////////////////////////////////////////
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
-// $Id: AliEvent.h,v 1.8 2003/02/25 12:36:28 nick Exp $
+// $Id: AliEvent.h,v 1.10 2003/08/29 09:05:11 nick Exp $
#include <math.h>
TDatime GetDayTime(); // Provide the date and time stamp
Int_t GetRunNumber(); // Provide the run number
Int_t GetEventNumber(); // Provide the event number
- void HeaderData(); // Print the event header information
- void Data(TString f="car"); // Print the event info within coordinate frame f
- void SetCalCopy(Int_t j); // (De)activate creation of private copies in fCalorimeters
- Int_t GetCalCopy(); // Provide CalCopy flag value
- void AddCalorimeter(AliCalorimeter& c); // Add a calorimeter system to the event
- void AddCalorimeter(AliCalorimeter* c) { AddCalorimeter(*c); }
- Int_t GetNcalorimeters(); // Provide the number of calorimeter systems
- void ShowCalorimeters(); // Provide on overview of the available calorimeter systems
- AliCalorimeter* GetCalorimeter(Int_t i);// Provide i-th calorimeter system of the event
- AliCalorimeter* GetCalorimeter(TString name); // Provide calorimeter with name "name"
+ virtual void HeaderData(); // Print the event header information
+ virtual void Data(TString f="car"); // Print the event info within coordinate frame f
+ void SetDevCopy(Int_t j); // (De)activate creation of private copies of the devices
+ Int_t GetDevCopy(); // Provide DevCopy flag value
+ void AddDevice(TObject& d); // Add a device to the event
+ void AddDevice(TObject* d) { AddDevice(*d); }
+ Int_t GetNdevices(); // Provide the number of devices
+ void ShowDevices(); // Provide on overview of the available devices
+ TObject* GetDevice(Int_t i); // Provide i-th device of the event
+ TObject* GetDevice(TString name); // Provide device with name "name"
protected:
TDatime fDaytime; // The date and time stamp
Int_t fZtarg; // The target Z value
Double_t fPnucTarg; // The target momentum per nucleon
Int_t fIdTarg; // User defined target particle ID
- Int_t fNcals; // The number of calorimeter systems
- TObjArray* fCalorimeters; // Array to hold the pointers to the calorimeter systems
- Int_t fCalCopy; // Flag to denote creation of private copies in fCalorimeters
+ TObjArray* fDevices; // Array to hold the pointers to the various devices
+ Int_t fDevCopy; // Flag to denote creation of private copies of the devices
- ClassDef(AliEvent,7) // Creation and investigation of an Alice physics event.
+ ClassDef(AliEvent,9) // Creation and investigation of an Alice physics event.
};
#endif
class AliJet : public TObject,public Ali4Vector
{
public:
- AliJet(); // Default constructor
- AliJet(Int_t n); // Create a Jet to hold initially n Tracks
- virtual ~AliJet(); // Default destructor
- AliJet(AliJet& j); // Copy constructor
- virtual void SetOwner(Bool_t own=kTRUE);// Set ownership of all added objects
- void Reset(); // Reset all values
- void AddTrack(AliTrack& t); // Add a track to the jet
+ AliJet(); // Default constructor
+ AliJet(Int_t n); // Create a Jet to hold initially n Tracks
+ virtual ~AliJet(); // Default destructor
+ AliJet(AliJet& j); // Copy constructor
+ virtual void SetOwner(Bool_t own=kTRUE); // Set ownership of all added objects
+ virtual void Reset(); // Reset all values
+ void AddTrack(AliTrack& t); // Add a track to the jet
void AddTrack(AliTrack* t) { AddTrack(*t); }
- void Data(TString f); // Print jet information in coordinate frame f
- void List(TString f="car"); // Print jet prim. track information for coord. frame f
- void ListAll(TString f="car"); // Print jet prim. and decay track information for coord. frame f
- Double_t GetEnergy(); // Provide the total jet energy
- Double_t GetMomentum(); // Provide the value of the total jet 3-momentum
- Ali3Vector Get3Momentum(); // Provide the total jet 3-momentum
- Double_t GetInvmass(); // Provide the invariant mass
- Float_t GetCharge(); // Provide the total charge of the jet
- Int_t GetNtracks(); // Return the number of tracks in the jet
- AliTrack* GetTrack(Int_t i); // Provide i-th track of the jet (1=first track)
- AliTrack* GetIdTrack(Int_t id); // Provide the track with user identifier "id"
- Double_t GetPt(); // Provide trans. momentum w.r.t. z-axis
- Double_t GetPl(); // Provide long. momentum w.r.t. z-axis
- Double_t GetEt(); // Provide trans. energy w.r.t. z-axis
- Double_t GetEl(); // Provide long. energy w.r.t. z-axis
- Double_t GetMt(); // Provide trans. mass w.r.t. z-axis
- Double_t GetRapidity(); // Provide rapidity value w.r.t. z-axis
- void SetTrackCopy(Int_t j); // (De)activate creation of private copies in fTracks
- Int_t GetTrackCopy(); // Provide TrackCopy flag value
- void SetId(Int_t id); // Set the user defined identifier
- Int_t GetId(); // Provide the user defined identifier
+ virtual void Data(TString f="car"); // Print jet information in coordinate frame f
+ virtual void List(TString f="car"); // Print jet prim. track information for coord. frame f
+ virtual void ListAll(TString f="car"); // Print jet prim. and decay track information for coord. frame f
+ Double_t GetEnergy(); // Provide the total jet energy
+ Double_t GetMomentum(); // Provide the value of the total jet 3-momentum
+ Ali3Vector Get3Momentum(); // Provide the total jet 3-momentum
+ Double_t GetInvmass(); // Provide the invariant mass
+ Float_t GetCharge(); // Provide the total charge of the jet
+ Int_t GetNtracks(); // Return the number of tracks in the jet
+ AliTrack* GetTrack(Int_t i); // Provide i-th track of the jet (1=first track)
+ AliTrack* GetIdTrack(Int_t id); // Provide the track with user identifier "id"
+ Double_t GetPt(); // Provide trans. momentum w.r.t. z-axis
+ Double_t GetPl(); // Provide long. momentum w.r.t. z-axis
+ Double_t GetEt(); // Provide trans. energy w.r.t. z-axis
+ Double_t GetEl(); // Provide long. energy w.r.t. z-axis
+ Double_t GetMt(); // Provide trans. mass w.r.t. z-axis
+ Double_t GetRapidity(); // Provide rapidity value w.r.t. z-axis
+ void SetTrackCopy(Int_t j); // (De)activate creation of private copies in fTracks
+ Int_t GetTrackCopy(); // Provide TrackCopy flag value
+ void SetId(Int_t id); // Set the user defined identifier
+ Int_t GetId(); // Provide the user defined identifier
protected:
void Init(); // Initialisation of pointers etc...
Int_t fTrackCopy; // Flag to denote creation of private copies in fTracks
Int_t fUserId; // The user defined identifier
- ClassDef(AliJet,4) // Creation and investigation of a jet of particle tracks.
+ ClassDef(AliJet,5) // Creation and investigation of a jet of particle tracks.
};
#endif
GetErrors(r,f);
}
///////////////////////////////////////////////////////////////////////////
+void AliPosition::ResetPosition()
+{
+// Reset the position and corresponding errors to 0.
+ Double_t r[3]={0,0,0};
+ SetVector(r,"sph");
+ SetErrors(r,"car");
+}
+///////////////////////////////////////////////////////////////////////////
Double_t AliPosition::GetDistance(AliPosition& p)
{
// Provide distance to position p.
AliPosition(); // Default constructor
virtual ~AliPosition(); // Destructor
AliPosition(const AliPosition& p); // Copy constructor
- virtual void SetPosition(Double_t* r,TString f); // Store position r in frame f
- virtual void GetPosition(Double_t* r,TString f); // Provide position r in frame f
- virtual void SetPosition(Float_t* r,TString f); // Store position r in frame f
- virtual void GetPosition(Float_t* r,TString f); // Provide position r in frame f
+ void SetPosition(Double_t* r,TString f); // Store position r in frame f
+ void GetPosition(Double_t* r,TString f); // Provide position r in frame f
+ void SetPosition(Float_t* r,TString f); // Store position r in frame f
+ void GetPosition(Float_t* r,TString f); // Provide position r in frame f
AliPosition& GetPosition(); // Provide position
- virtual void SetPosition(Ali3Vector& r); // Store position r
+ void SetPosition(Ali3Vector& r); // Store position r
Double_t GetDistance(AliPosition& p); // Provide distance to position p
Double_t GetDistance(AliPosition* p) { return GetDistance(*p); }
- virtual void SetPositionErrors(Double_t* r,TString f); // Store position r in frame f
- virtual void GetPositionErrors(Double_t* r,TString f); // Provide position r in frame f
- virtual void SetPositionErrors(Float_t* r,TString f); // Store position r in frame f
- virtual void GetPositionErrors(Float_t* r,TString f); // Provide position r in frame f
+ void SetPositionErrors(Double_t* r,TString f); // Store position r in frame f
+ void GetPositionErrors(Double_t* r,TString f); // Provide position r in frame f
+ void SetPositionErrors(Float_t* r,TString f); // Store position r in frame f
+ void GetPositionErrors(Float_t* r,TString f); // Provide position r in frame f
+ void ResetPosition(); // Reset position and errors to 0
- ClassDef(AliPosition,2) // Handling of positions in various reference frames.
+ ClassDef(AliPosition,4) // Handling of positions in various reference frames.
};
#endif
AliRandom(); // Constructor with default sequence
AliRandom(Int_t seed); // Constructor with user defined seed
AliRandom(Int_t seed,Int_t cnt1,Int_t cnt2); // User defined starting point
- ~AliRandom(); // Destructor
+ virtual ~AliRandom(); // Destructor
Int_t GetSeed(); // Provide current seed value
Int_t GetCnt1(); // Provide current counter value cnt1
Int_t GetCnt2(); // Provide current counter value cnt2
ClassImp(AliSignal) // Class implementation to enable ROOT I/O
-AliSignal::AliSignal() : TObject(),AliPosition(),AliAttrib()
+AliSignal::AliSignal() : TNamed(),AliPosition(),AliAttrib()
{
// Creation of an AliSignal object and initialisation of parameters.
// Several signal values (with errors) can be stored in different slots.
fSignals=0;
fDsignals=0;
fWaveforms=0;
- fName="Unspecified";
+ SetName("Unspecified");
}
///////////////////////////////////////////////////////////////////////////
AliSignal::~AliSignal()
}
}
///////////////////////////////////////////////////////////////////////////
-AliSignal::AliSignal(AliSignal& s) : TObject(s),AliPosition(s),AliAttrib(s)
+AliSignal::AliSignal(AliSignal& s) : TNamed(s),AliPosition(s),AliAttrib(s)
{
// Copy constructor
fSignals=0;
fDsignals=0;
- fName=s.fName;
fWaveforms=0;
Int_t n=s.GetNvalues();
DeleteWaveform(0);
}
///////////////////////////////////////////////////////////////////////////
-void AliSignal::ResetPosition()
-{
-// Reset the position and corresponding errors to 0.
- Double_t r[3]={0,0,0};
- SetPosition(r,"sph");
- SetErrors(r,"car");
-}
-///////////////////////////////////////////////////////////////////////////
void AliSignal::SetSignal(Double_t sig,Int_t j)
{
// Store value in the j-th (default j=1) signal slot.
return err;
}
///////////////////////////////////////////////////////////////////////////
-void AliSignal::Data(TString f,Int_t j)
+void AliSignal::Data(TString f)
+{
+// Provide all signal information within the coordinate frame f.
+
+ cout << " *" << ClassName() << "::Data* Signal of kind : " << GetName() << endl;
+ cout << " Position";
+ Ali3Vector::Data(f);
+
+ List(-1);
+}
+///////////////////////////////////////////////////////////////////////////
+void AliSignal::List(Int_t j)
{
-// Provide signal information for the j-th slot within the coordinate frame f.
+// Provide signal information for the j-th slot.
// The first slot is at j=1.
// In case j=0 (default) the data of all slots will be listed.
+// In case j=-1 the data of all slots will be listed, but the header
+// information will be suppressed.
- if (j<0)
+ if (j<-1)
{
- cout << " *AliSignal::Data* Invalid argument j = " << j << endl;
+ cout << " *AliSignal::List* Invalid argument j = " << j << endl;
return;
}
- cout << " *AliSignal::Data* Signal of kind : " << fName.Data() << endl;
- cout << " Position";
- Ali3Vector::Data(f);
+ if (j != -1) cout << " *" << ClassName() << "::List* Signal of kind : " << GetName() << endl;
Int_t nvalues=GetNvalues();
Int_t nerrors=GetNerrors();
Int_t n=nvalues;
if (nerrors>n) n=nerrors;
- if (j==0)
+ if (j<=0)
{
for (Int_t i=1; i<=n; i++)
{
cout << " Signal";
if (i<=nvalues) cout << " value : " << GetSignal(i);
if (i<=nerrors) cout << " error : " << GetSignalError(i);
- AliAttrib::Data(i);
+ AliAttrib::List(i);
cout << endl;
}
}
cout << " Signal";
if (j<=nvalues) cout << " value : " << GetSignal(j);
if (j<=nerrors) cout << " error : " << GetSignalError(j);
- AliAttrib::Data(j);
+ AliAttrib::List(j);
cout << endl;
}
}
}
///////////////////////////////////////////////////////////////////////////
-void AliSignal::SetName(TString name)
-{
-// Set the name tag to indicate the kind of signal.
- fName=name;
-}
-///////////////////////////////////////////////////////////////////////////
-TString AliSignal::GetName()
-{
-// Provide the name tag indicating the kind of signal.
- return fName;
-}
-///////////////////////////////////////////////////////////////////////////
Int_t AliSignal::GetNvalues()
{
// Provide the number of values for this signal.
}
}
///////////////////////////////////////////////////////////////////////////
-AliSignal* AliSignal::MakeCopy(AliSignal& s)
+TObject* AliSignal::Clone(char* name)
{
-// Make a deep copy of the input object and provide the pointer to the copy.
+// 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 argument type, a feature which may be very useful
+// 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 e.g. AliTrack to store either AliSignal objects or
// objects derived from AliSignal via the AddSignal memberfunction, provided
-// these derived classes also have a proper MakeCopy memberfunction.
+// these derived classes also have a proper Clone memberfunction.
- AliSignal* sig=new AliSignal(s);
+ AliSignal* sig=new AliSignal(*this);
+ if (name)
+ {
+ if (strlen(name)) sig->SetName(name);
+ }
return sig;
}
///////////////////////////////////////////////////////////////////////////
#include "AliPosition.h"
#include "AliAttrib.h"
-class AliSignal : public TObject,public AliPosition,public AliAttrib
+class AliSignal : public TNamed,public AliPosition,public AliAttrib
{
public:
AliSignal(); // Default constructor
virtual ~AliSignal(); // Destructor
AliSignal(AliSignal& s); // Copy constructor
+ virtual TObject* Clone(char* name); // Make a deep copy and provide its pointer
virtual void SetSignal(Double_t sig,Int_t j=1); // Store j-th signal value
virtual void AddSignal(Double_t sig,Int_t j=1); // Add value to j-th signal value
virtual Float_t GetSignal(Int_t j=1,Int_t mode=0); // Provide j-th (corrected) signal value
virtual Float_t GetSignalError(Int_t j=1); // Provide error j-th signal value
virtual void ResetSignals(Int_t mode=0); // User selected reset of signal values and/or errors
virtual void DeleteSignals(Int_t mode=0); // User selected delete of signal values and/or errors
- virtual void ResetPosition(); // Reset position and errors to 0
virtual void Reset(Int_t mode=0); // Reset signal and position values and errors
- void Data(TString f="car",Int_t j=0); // Print j-th signal info for coord. frame f
- void SetName(TString name); // Set the name tag to indicate the kind of signal
- TString GetName(); // Provide the name tag indicating the kind of signal
+ virtual void Data(TString f="car"); // Print all signal info for coord. frame f
+ virtual void List(Int_t j=0); // Print signal info for the j-th (or all) slot(s)
Int_t GetNvalues(); // Provide the number of signal values
Int_t GetNerrors(); // Provide the number of specified errors
Int_t GetNwaveforms(); // Provide the number of specified waveforms
TH1F* GetWaveform(Int_t j=1); // Provide pointer of the j-th waveform histogram
void ResetWaveform(Int_t j=1); // Reset the j-th waveform histogram
void DeleteWaveform(Int_t j=1); // Delete the j-th waveform histogram
- virtual AliSignal* MakeCopy(AliSignal& s); // Make a deep copy and provide its pointer
protected:
TArrayF* fSignals; // Signal values
TArrayF* fDsignals; // Errors on signal values
- TString fName; // Name tag to identify the kind of signal
TObjArray* fWaveforms; // The 1D histograms containing the signal waveforms
- ClassDef(AliSignal,8) // Generic handling of (extrapolated) detector signals.
+ ClassDef(AliSignal,9) // Generic handling of (extrapolated) detector signals.
};
#endif
}
AliTrack* t=this;
- Dump(t,1,f); // Information of all decay products
+ Dumps(t,1,f); // Information of all decay products
}
//////////////////////////////////////////////////////////////////////////
-void AliTrack::Dump(AliTrack* t,Int_t n,TString f)
+void AliTrack::Dumps(AliTrack* t,Int_t n,TString f)
{
// Recursively provide the info of all decay levels of this track
AliTrack* td;
}
// Go for next decay level of this decay track recursively
- Dump(td,n+1,f);
+ Dumps(td,n+1,f);
}
else
{
- cout << " *AliTrack::Dump* Error : No decay track present." << endl;
+ cout << " *AliTrack::Dumps* Error : No decay track present." << endl;
}
}
}
AliTrack(); // Default constructor
virtual ~AliTrack(); // Destructor
AliTrack(AliTrack& t); // Copy constructor
- void Reset(); // Reset all values to 0
+ virtual void Reset(); // Reset all values to 0
void Set4Momentum(Ali4Vector& p); // Set track 4-momentum
void Set3Momentum(Ali3Vector& p); // Set track 3-momentum
void SetMass(Double_t m,Double_t dm=0); // Set particle mass and error
void SetMass(); // Set mass and error to mass hypothesis with highest prob.
void SetCharge(Float_t q); // Set particle charge
- void Data(TString f="car"); // Print track information for coord. frame f
- void List(TString f="car"); // Print track and decay level 1 information for coord. frame f
- void ListAll(TString f="car"); // Print track and all decay level information for coord. frame f
+ virtual void Data(TString f="car"); // Print track information for coord. frame f
+ virtual void List(TString f="car"); // Print track and decay level 1 information for coord. frame f
+ virtual void ListAll(TString f="car");// Print track and all decay level information for coord. frame f
Ali3Vector Get3Momentum(); // Provide track 3-momentum
Double_t GetMomentum(); // Provide value of track 3-momentum
Double_t GetMass(); // Provide particle mass
AliTrack* fParent; // Pointer to the parent track
private:
- void Dump(AliTrack* t,Int_t n,TString f); // Recursively print all decay levels
+ void Dumps(AliTrack* t,Int_t n,TString f); // Recursively print all decay levels
- ClassDef(AliTrack,5) // Handling of the attributes of a reconstructed particle track.
+ ClassDef(AliTrack,7) // Handling of the attributes of a reconstructed particle track.
};
#endif
}
AliVertex* v=this;
- Dump(v,1,f); // Information of all sec. vertices
+ Dumps(v,1,f); // Information of all sec. vertices
}
//////////////////////////////////////////////////////////////////////////
-void AliVertex::Dump(AliVertex* v,Int_t n,TString f)
+void AliVertex::Dumps(AliVertex* v,Int_t n,TString f)
{
// Recursively provide the info of all secondary vertices of this vertex
AliVertex* vs;
}
else
{
- cout << " *AliVertex::Dump* Error : No track present." << endl;
+ cout << " *AliVertex::Dumps* Error : No track present." << endl;
}
}
// Go for next sec. vertex level of this sec. vertex recursively
- Dump(vs,n+1,f);
+ Dumps(vs,n+1,f);
}
else
{
- cout << " *AliVertex::Dump* Error : No sec. vertex present." << endl;
+ cout << " *AliVertex::Dumps* Error : No sec. vertex present." << endl;
}
}
}
// negative track : blue
// jet-track : magenta (if explicit marking selected)
//
-// secs = 1 --> Draw secondary vertices.
+// secs = 1 --> Draw secondary vertices. (Default)
// 0 --> Don't draw secondary vertices.
//
-// cons = 1 --> Draw (auto generated) connecting tracks.
+// cons = 1 --> Draw (auto generated) connecting tracks. (Default)
// 0 --> Don't draw (auto generated) connecting tracks.
//
// jets = 1 --> Mark tracks belonging to jets.
-// 0 --> Don't mark jet-tracks.
+// 0 --> Don't mark jet-tracks. (Default)
//
// Notes :
// -------
AliVertex* vx=0;
AliPosition* r=0;
Ali3Vector p;
- Int_t charge;
+ Float_t charge;
AliPosition dummy;
if (!tx) continue;
- charge=static_cast<int>(tx->GetCharge());
+ charge=tx->GetCharge();
TPolyLine3D* line=new TPolyLine3D();
fLines->Add(line);
line->SetLineWidth(3);
}
- if (charge>0) line->SetLineColor(kRed); // Positive track
- if (!charge) line->SetLineColor(kGreen); // Neutral track
- if (charge<0) line->SetLineColor(kBlue); // Negative track
+ line->SetLineColor(kGreen); // Neutral track
+ if (charge>0) line->SetLineColor(kRed); // Positive track
+ if (charge<0) line->SetLineColor(kBlue); // Negative track
// Mark tracks belonging to jets
if (IsJetTrack(tx))
virtual ~AliVertex(); // Default destructor
AliVertex(AliVertex& v); // Copy constructor
virtual void SetOwner(Bool_t own=kTRUE);// Set ownership of all added objects
- void Reset(); // Reset all values and stored vertex and jet lists
+ virtual void Reset(); // Reset all values and stored vertex and jet lists
void ResetVertices(); // Reset stored vertex list
void AddJet(AliJet& j,Int_t tracks=1); // Add a jet (and its tracks) to the vertex
void AddVertex(AliVertex& v,Int_t connect=1);// Add (and connect) a (sec.) vertex to the current vertex
void AddJet(AliJet* j,Int_t tracks=1) { AddJet(*j,tracks); }
void AddVertex(AliVertex* v,Int_t connect=1) { AddVertex(*v,connect); }
- void Data(TString f="car"); // Print the vertex info within coordinate frame f
- void List(TString f="car"); // Print vertex prim. track information for coord. frame f
- void ListAll(TString f="car"); // Print prim. + sec. vertex full track info for coord. frame f
+ virtual void Data(TString f="car"); // Print the vertex info within coordinate frame f
+ virtual void List(TString f="car"); // Print vertex prim. track information for coord. frame f
+ virtual void ListAll(TString f="car"); // Print prim. + sec. vertex full track info for coord. frame f
Int_t GetNvertices(); // Return the number of (secondary) vertices
AliVertex* GetVertex(Int_t i); // Provide i-th (secondary) vertex
AliVertex* GetIdVertex(Int_t id); // Provide the vertex with user identifier "id"
Int_t GetJetCopy(); // Provide JetCopy flag value
Int_t IsConnectTrack(AliTrack* t); // Indicate if track is created by vertex connection
Int_t IsJetTrack(AliTrack* t); // Indicate if track is resulting from jet addition
- void Draw(Int_t secs=1,Int_t cons=1,Int_t jets=0); // Draw the vertex in an event display
+ virtual void Draw(Option_t* opt) { Draw(1,1,0); } // Override TObject::Draw for default event display
+ virtual void Draw(Int_t secs,Int_t cons=1,Int_t jets=0); // Draw the vertex in an event display
protected:
void Init(); // Initialisation of pointers etc...
TObjArray* fLines; //! Array to (temporarily) store the 3D lines for the event display
private:
- void Dump(AliVertex* v,Int_t n,TString f); // Recursively print all sec. vertices
+ void Dumps(AliVertex* v,Int_t n,TString f); // Recursively print all sec. vertices
- ClassDef(AliVertex,4) // Creation and investigation of an AliVertex.
+ ClassDef(AliVertex,6) // Creation and investigation of an AliVertex.
};
#endif
Therefore the Load() memberfunction has been removed from AliPositionObj.
03-oct-2003 NvE Typos fixed in AliCalorimeter.cxx.
Also memberfunction MakeCopy introduced in class AliCalorimeter.
+07-oct-2003 NvE Arguments of SetSignal and AddSignal memberfunctions of AliCalmodule corrected
+ to comply with the corresponding virtual functions of AliSignal.
+ AliCalorimeter modified accordingly.
+09-oct-2003 NvE Argument of all MakeCopy memberfunctions removed to obey the ANSI C++ rules for
+ virtual functions and to prepare for a common base class.
+ Due to the fact that not all compilers seem to accept the standard ANSI rule
+ that a virtual function is allowed to differ in return type from the corresponding
+ virtual function in the base class, the MakeCopy() memberfunctions have all been
+ given a return type of TObject*.
+ Also AliAttrib::Data renamed to AliAttrib::List to prevent violation of ANSI virtual
+ function rules and class AliSignal updated accordingly.
+ Memberfunction ResetPosition() moved from AliSignal to AliPosition.
+ Explicitly declared all memberfunctions virtual in the derived classes in case
+ the corresponding memberfunctions were also declared virtual in the base class.
+ Various memberfunctions which were declared virtual but were actually not meant
+ to be overridden declared as non-virtual in various low-level classes like
+ Ali3Vector, Ali4Vector, AliPosition etc...
+13-oct-2003 NvE Argument 'npt' of AliCollider::MakeEvent also made optional.
+24-oct-2003 NvE Private memberfunction Dump of AliTrack and AliVertex renamed to Dumps in order
+ not to override the Dump memberfunction of TObject.
+ Also definition of AliVertex::Draw slightly modified to comply with the standard
+ ANSI virtual function rules concerning TObject::Draw.
+ Invokation of ClassName() used in printout of AliSignal::Data to make the output
+ information more generic.
+25-oct-2003 NvE Memberfunction AddCalorimeter of AliEvent replaced by memberfunction AddDevice
+ to make the functionality more generic.
+ To comply with the enhanced flexibility of AliEvent::AddDevice the class
+ AliCalorimeter has been derived from TNamed and the MakeCopy() memberfunction
+ has been replaced by Clone() to override the default one of TNamed.
+ The specific GetName and SetName memberfunctions of AliCalorimeter have been removed.
+26-oct-2003 NvE Class AliSignal derived from TNamed and MakeCopy() memberfunction replaced by Clone()
+ like was done for AliCalorimeter.
+ The latter was also done for AliCalmodule and AliAttribObj.