the C++ RTTI. This prevents a warning when creating shared libraries
using the "old streamer method" (i.e. NO "+" behind the class names
in the Linkdef file).
10-mar-2003 NvE AliPosition datamembers of AliTrack changed into AliPositionObj* to enable
minimisation of memory occupation and output file size in case a track
has not all attributes set.
13-mar-2003 NvE Memberfunction SetZero() introduced for Ali3Vector and Ali4Vector.
20-mar-2003 NvE Statement #include "Riostream.h" moved from header file into implementation file
for all classes and MSVC compiler option /Za replaced by /Ze in order to prevent
ANSI compliant compiler problems.
15-apr-2003 NvE Waveform histogram introduced in AliSignal.
29-apr-2003 NvE Memberfunction MakeCopy introduced for AliSignal and AliCalmodule.
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 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,
provided these derived classes also have a proper MakeCopy memberfunction.
17-jun-2003 NvE All TString objects "s" replaced by "s.Data()" in cout statements to comply
with MSVC++7.NET compiler and allow mixing with MSVC++6 libraries.
The classes in which these modifications were made are Ali3Vector, Ali4Vector,
AliSignal and AliEvent.
20-jun-2003 NvE Copy constructor introduced for nearly all classes and also all destructors
explicitly declared virtual.
11-jul-2003 NvE Functionality of AliObjMatrix extended by enabling removal of objects and
introduction of a linear object array for fast looping over the stored objects.
15-aug-2003 NvE Usage of TMCParticle removed from AliCollider; only Pythia intrinsic functionality
is used.
///////////////////////////////////////////////////////////////////////////
#include "Ali3Vector.h"
+#include "Riostream.h"
ClassImp(Ali3Vector) // Class implementation to enable ROOT I/O
{
// Creation of an Ali3Vector object and initialisation of parameters
// All attributes initialised to 0
+ SetZero();
+}
+///////////////////////////////////////////////////////////////////////////
+Ali3Vector::~Ali3Vector()
+{
+// Destructor to delete dynamically allocated memory
+}
+///////////////////////////////////////////////////////////////////////////
+Ali3Vector::Ali3Vector(const Ali3Vector& v)
+{
+// Copy constructor
+ fV=v.fV;
+ fTheta=v.fTheta;
+ fPhi=v.fPhi;
+ fDx=v.fDx;
+ fDy=v.fDy;
+ fDz=v.fDz;
+ fDresult=v.fDresult;
+}
+///////////////////////////////////////////////////////////////////////////
+void Ali3Vector::SetZero()
+{
+// (Re)set all attributes to zero.
fV=0;
fTheta=0;
fPhi=0;
fDresult=0;
}
///////////////////////////////////////////////////////////////////////////
-Ali3Vector::~Ali3Vector()
-{
-// Destructor to delete dynamically allocated memory
-}
-///////////////////////////////////////////////////////////////////////////
void Ali3Vector::SetVector(Double_t* v,TString f)
{
// Store vector according to reference frame f
break;
default: // Unsupported reference frame
- cout << "*Ali3Vector::SetVector* Unsupported frame : " << f << endl
+ cout << "*Ali3Vector::SetVector* Unsupported frame : " << f.Data() << endl
<< " Possible frames are 'car', 'sph' and 'cyl'." << endl;
fV=0;
fTheta=0;
break;
default: // Unsupported reference frame
- cout << "*Ali3Vector::GetVector* Unsupported frame : " << f << endl
+ cout << "*Ali3Vector::GetVector* Unsupported frame : " << f.Data() << endl
<< " Possible frames are 'car', 'sph' and 'cyl'." << endl;
for (Int_t i=0; i<3; i++)
{
break;
default: // Unsupported reference frame
- cout << "*Ali3Vector::SetErrors* Unsupported frame : " << f << endl
+ cout << "*Ali3Vector::SetErrors* Unsupported frame : " << f.Data() << endl
<< " Possible frames are 'car', 'sph' and 'cyl'." << endl;
fDx=0;
fDy=0;
break;
default: // Unsupported reference frame
- cout << "*Ali3Vector::GetErrors* Unsupported frame : " << f << endl
+ cout << "*Ali3Vector::GetErrors* Unsupported frame : " << f.Data() << endl
<< " Possible frames are 'car', 'sph' and 'cyl'." << endl;
for (Int_t i=0; i<3; i++)
{
Double_t vec[3],err[3];
GetVector(vec,f);
GetErrors(err,f);
- cout << " Vector in " << f << " coordinates : "
+ cout << " Vector in " << f.Data() << " coordinates : "
<< vec[0] << " " << vec[1] << " " << vec[2] << endl;
- cout << " Err. in " << f << " coordinates : "
+ cout << " Err. in " << f.Data() << " coordinates : "
<< err[0] << " " << err[1] << " " << err[2] << endl;
}
else
{
- cout << " *Ali3Vector::Data* Unsupported frame : " << f << endl
+ cout << " *Ali3Vector::Data* Unsupported frame : " << f.Data() << endl
<< " Possible frames are 'car', 'sph' and 'cyl'." << endl;
}
}
// $Id$
-#include "Riostream.h"
#include <math.h>
#include "TObject.h"
public:
Ali3Vector(); // Default constructor
virtual ~Ali3Vector(); // Destructor
+ Ali3Vector(const Ali3Vector& v); // Copy constructor
+ 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
Double_t fDx,fDy,fDz; // Errors on Cartesian coordinates
Double_t fDresult; // Error on scalar result (e.g. norm or dotproduct)
- ClassDef(Ali3Vector,2) // Handling of 3-vectors in various reference frames.
+ ClassDef(Ali3Vector,3) // Handling of 3-vectors in various reference frames.
};
#endif
ClassImp(Ali3VectorObj) // Class implementation to enable ROOT I/O
-Ali3VectorObj::Ali3VectorObj()
+Ali3VectorObj::Ali3VectorObj() : TObject(),Ali3Vector()
{
+// Default constructor
// Creation of an Ali3VectorObj object and initialisation of parameters.
// All attributes initialised to 0.
}
///////////////////////////////////////////////////////////////////////////
-Ali3VectorObj::Ali3VectorObj(Ali3Vector& q)
+Ali3VectorObj::Ali3VectorObj(Ali3Vector& q) : TObject(),Ali3Vector(q)
{
// Creation of an Ali3VectorObj object and initialisation of parameters.
// All attributes are initialised to the values of the input Ali3Vector.
- Load(q);
}
///////////////////////////////////////////////////////////////////////////
Ali3VectorObj::~Ali3VectorObj()
// Destructor to delete dynamically allocated memory.
}
///////////////////////////////////////////////////////////////////////////
+Ali3VectorObj::Ali3VectorObj(Ali3VectorObj& v) : TObject(v),Ali3Vector(v)
+{
+// Copy constructor
+}
+///////////////////////////////////////////////////////////////////////////
void Ali3VectorObj::Load(Ali3Vector& q)
{
// Load all attributes of the input Ali3Vector into this Ali3VectorObj object.
class Ali3VectorObj : public TObject,public Ali3Vector
{
public:
- Ali3VectorObj(); // Default constructor
- Ali3VectorObj(Ali3Vector& q); // Constructor
- ~Ali3VectorObj(); // Destructor
- void Load(Ali3Vector& q); // Load all attributes of input Ali3Vector
+ Ali3VectorObj(); // Default constructor
+ Ali3VectorObj(Ali3Vector& q); // Constructor
+ virtual ~Ali3VectorObj(); // Destructor
+ Ali3VectorObj(Ali3VectorObj& q); // Copy constructor
+ void Load(Ali3Vector& q); // Load all attributes of input Ali3Vector
- ClassDef(Ali3VectorObj,1) // Handling of 3-vectors in various reference frames.
+ ClassDef(Ali3VectorObj,2) // Handling of 3-vectors in various reference frames.
};
#endif
///////////////////////////////////////////////////////////////////////////
#include "Ali4Vector.h"
+#include "Riostream.h"
ClassImp(Ali4Vector) // Class implementation to enable ROOT I/O
// Creation of a contravariant 4-vector and initialisation of parameters.
// All values are initialised to 0.
// Scalar mode is initially selected.
+ SetZero();
fScalar=1;
- fV2=0;
- fDv2=0;
- fV0=0;
- fDv0=0;
- fDresult=0;
- Double_t a[3]={0,0,0};
- fV.SetVector(a,"sph");
}
///////////////////////////////////////////////////////////////////////////
Ali4Vector::~Ali4Vector()
// Destructor to delete dynamically allocated memory
}
///////////////////////////////////////////////////////////////////////////
-void Ali4Vector::SetVector(Double_t v0,Ali3Vector v)
+Ali4Vector::Ali4Vector(const Ali4Vector& v)
+{
+// Copy constructor
+ fScalar=v.fScalar;
+ fV2=v.fV2;
+ fDv2=v.fDv2;
+ fV0=v.fV0;
+ fDv0=v.fDv0;
+ fDresult=v.fDresult;
+ fV=v.fV;
+}
+///////////////////////////////////////////////////////////////////////////
+void Ali4Vector::SetZero()
+{
+// (Re)set all attributes to zero.
+// Note : The (de)selection of the scalar mode is not modified.
+ fV2=0;
+ fDv2=0;
+ fV0=0;
+ fDv0=0;
+ fDresult=0;
+ fV.SetZero();
+}
+///////////////////////////////////////////////////////////////////////////
+void Ali4Vector::SetVector(Double_t v0,Ali3Vector& v)
{
// Store contravariant vector.
// The error on the scalar part is initialised to 0.
fDresult=0;
}
///////////////////////////////////////////////////////////////////////////
-void Ali4Vector::Set3Vector(Ali3Vector v)
+void Ali4Vector::Set3Vector(Ali3Vector& v)
{
// Set the 3-vector part, the errors are taken from the input Ali3Vector
// Scalar mode : The scalar part and its error are not modified,
GetErrors(err,f);
Double_t inv=GetInvariant();
Double_t dinv=GetResultError();
- cout << " Contravariant vector in " << f << " coordinates : "
+ cout << " Contravariant vector in " << f.Data() << " coordinates : "
<< vec[0] << " " << vec[1] << " " << vec[2] << " " << vec[3] << endl;
- cout << " ------------- Errors in " << f << " coordinates : "
+ cout << " ------------- Errors in " << f.Data() << " coordinates : "
<< err[0] << " " << err[1] << " " << err[2] << " " << err[3] << endl;
cout << " --- Lorentz invariant (v^i*v_i) : " << inv << " error : " << dinv << endl;
}
else
{
- cout << " *Ali4Vector::Data* Unsupported frame : " << f << endl
+ cout << " *Ali4Vector::Data* Unsupported frame : " << f.Data() << endl
<< " Possible frames are 'car', 'sph' and 'cyl'." << endl;
}
}
// $Id$
-#include "Riostream.h"
#include <math.h>
#include "Ali3Vector.h"
public:
Ali4Vector(); // Default constructor for contravariant vector
virtual ~Ali4Vector(); // Destructor
- virtual void SetVector(Double_t v0,Ali3Vector v); // Store contravariant vector
+ Ali4Vector(const Ali4Vector& v); // Copy constructor
+ 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 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
Double_t GetScalar(); // Provide the scalar part of v
- virtual void Set3Vector(Ali3Vector v); // Set the 3-vector 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
Ali3Vector Get3Vector(); // Provide the 3-vector part of v
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,2) // Handling of Lorentz 4-vectors in various reference frames.
+ ClassDef(Ali4Vector,3) // Handling of Lorentz 4-vectors in various reference frames.
};
#endif
ClassImp(Ali4VectorObj) // Class implementation to enable ROOT I/O
-Ali4VectorObj::Ali4VectorObj()
+Ali4VectorObj::Ali4VectorObj() : TObject(),Ali4Vector()
{
+// Default constructor
// Creation of an Ali4VectorObj object and initialisation of parameters.
// All attributes initialised to 0.
}
///////////////////////////////////////////////////////////////////////////
-Ali4VectorObj::Ali4VectorObj(Ali4Vector& q)
+Ali4VectorObj::Ali4VectorObj(Ali4Vector& q) : TObject(),Ali4Vector(q)
{
// Creation of an Ali3VectorObj object and initialisation of parameters.
-// All attributes are initialised to the values of the input Ali3Vector.
- Load(q);
+// All attributes are initialised to the values of the input Ali4Vector.
}
///////////////////////////////////////////////////////////////////////////
Ali4VectorObj::~Ali4VectorObj()
// Destructor to delete dynamically allocated memory.
}
///////////////////////////////////////////////////////////////////////////
+Ali4VectorObj::Ali4VectorObj(Ali4VectorObj& v) : TObject(v),Ali4Vector(v)
+{
+// Copy constructor
+}
+///////////////////////////////////////////////////////////////////////////
void Ali4VectorObj::Load(Ali4Vector& q)
{
// Load all attributes of the input Ali4Vector into this Ali4VectorObj object.
class Ali4VectorObj : public TObject,public Ali4Vector
{
public:
- Ali4VectorObj(); // Default constructor
- Ali4VectorObj(Ali4Vector& q); // Constructor
- ~Ali4VectorObj(); // Destructor
- void Load(Ali4Vector& q); // Load all attributes of input Ali4Vector
+ Ali4VectorObj(); // Default constructor
+ Ali4VectorObj(Ali4Vector& q); // Constructor
+ virtual ~Ali4VectorObj(); // Destructor
+ Ali4VectorObj(Ali4VectorObj& q); // Copy constructor
+ void Load(Ali4Vector& q); // Load all attributes of input Ali4Vector
- ClassDef(Ali4VectorObj,1) // Handling of Lorentz 4-vectors in various reference frames.
+ ClassDef(Ali4VectorObj,2) // Handling of Lorentz 4-vectors in various reference frames.
};
#endif
///////////////////////////////////////////////////////////////////////////
#include "AliBoost.h"
+#include "Riostream.h"
ClassImp(AliBoost) // Class implementation to enable ROOT I/O
-AliBoost::AliBoost()
+AliBoost::AliBoost() : TObject()
{
// Creation of a Lorentz boost object and initialisation of parameters.
// Beta is set to (0,0,0) and consequently Gamma=1.
// Default destructor.
}
///////////////////////////////////////////////////////////////////////////
-void AliBoost::SetBeta(Ali3Vector b)
+AliBoost::AliBoost(AliBoost& b) : TObject(b)
+{
+// Copy constructor
+ fBeta=b.fBeta;
+ fGamma=b.fGamma;
+ fDgamma=b.fDgamma;
+ fDresult=b.fDresult;
+}
+///////////////////////////////////////////////////////////////////////////
+void AliBoost::SetBeta(Ali3Vector& b)
{
// Setting of boost parameters on basis of beta 3-vector.
// The errors on the beta 3-vector are taken from the input 3-vector.
// $Id$
-#include "Riostream.h"
#include <math.h>
#include "TObject.h"
{
public:
AliBoost(); // Default constructor
- ~AliBoost(); // Default destructor
- void SetBeta(Ali3Vector b); // Set boost parameters by beta 3-vector
+ virtual ~AliBoost(); // Default destructor
+ AliBoost(AliBoost& b); // Copy constructor
+ void SetBeta(Ali3Vector& b); // Set boost parameters by beta 3-vector
void Set4Momentum(Ali4Vector& p); // Set boost parameters by 4-momentum
Ali3Vector GetBetaVector(); // Provide the beta 3-vector
Double_t GetBeta(); // Provide norm of beta 3-vector
Double_t fDgamma; // Error on the gamma value
Double_t fDresult; // Error on scalar result
- ClassDef(AliBoost,2) // Perform various Lorentz transformations.
+ ClassDef(AliBoost,3) // Perform various Lorentz transformations.
};
#endif
///////////////////////////////////////////////////////////////////////////
#include "AliCalcluster.h"
+#include "Riostream.h"
ClassImp(AliCalcluster) // Class implementation to enable ROOT I/O
-AliCalcluster::AliCalcluster()
+AliCalcluster::AliCalcluster() : AliSignal()
{
-// Default constructer, all data is set to 0
- fCenter=0;
+// Default constructor, all data is set to 0
+ fRow=0;
+ fCol=0;
fNmods=0;
fRowdisp=0.;
fColdisp=0.;
fNvetos=0;
fVetos=0;
- SetName("AliCalcluster [sig, sig11, sig33, sig55, ...]");
+ SetName("AliCalcluster [sig, sig11, sig33, sig55,...]");
}
///////////////////////////////////////////////////////////////////////////
AliCalcluster::~AliCalcluster()
}
}
///////////////////////////////////////////////////////////////////////////
-AliCalcluster::AliCalcluster(AliCalmodule& m)
+AliCalcluster::AliCalcluster(AliCalcluster& c) : AliSignal(c)
+{
+// Copy constructor
+ fRow=c.fRow;
+ fCol=c.fCol;
+ fNmods=c.fNmods;
+ fRowdisp=c.fRowdisp;
+ fColdisp=c.fColdisp;
+ fNvetos=c.fNvetos;
+
+ fVetos=new TObjArray();
+ fVetos->SetOwner();
+
+ for (Int_t i=1; i<=fNvetos; i++)
+ {
+ AliSignal* sx=c.GetVetoSignal(i);
+ fVetos->Add(new AliSignal(*sx));
+ }
+}
+///////////////////////////////////////////////////////////////////////////
+AliCalcluster::AliCalcluster(AliCalmodule& m) : AliSignal()
{
// Cluster constructor with module m as center.
// Module data is only entered for a module which contains a signal,
if (sig>0. && m.GetDeadValue()==0)
{
- fCenter=&m;
+ fRow=m.GetRow();
+ fCol=m.GetColumn();
r=m.GetPosition();
SetPosition(r);
SetSignal(sig);
}
else
{
- fCenter=0;
+ fRow=0;
+ fCol=0;
SetPosition(r);
fNmods=0;
fRowdisp=0.;
fNvetos=0;
fVetos=0;
}
- SetName("AliCalcluster [sig, sig11, sig33, sig55, ...]");
+ SetName("AliCalcluster [sig, sig11, sig33, sig55,...]");
}
///////////////////////////////////////////////////////////////////////////
Int_t AliCalcluster::GetRow()
{
// Provide the row number of the cluster center
- if (fCenter)
- {
- return fCenter->GetRow();
- }
- else
- {
- return 0;
- }
+ return fRow;
}
///////////////////////////////////////////////////////////////////////////
Int_t AliCalcluster::GetColumn()
{
// Provide the column number of the cluster center
- if (fCenter)
- {
- return fCenter->GetColumn();
- }
- else
- {
- return 0;
- }
+ return fCol;
}
///////////////////////////////////////////////////////////////////////////
Int_t AliCalcluster::GetNmodules()
if (m.GetClusteredSignal()>0. && m.GetDeadValue()==0)
{
- fCenter=&m;
+ fRow=m.GetRow();
+ fCol=m.GetColumn();
r=m.GetPosition();
SetPosition(r);
SetSignal(m.GetSignal());
}
else
{
- fCenter=0;
+ fRow=0;
+ fCol=0;
SetPosition(r);
fNmods=0;
fRowdisp=0.;
}
Int_t nvalues=s.GetNvalues();
- AliSignal* sx=new AliSignal(nvalues+3); // Additional value added
+ AliSignal* sx=new AliSignal(s); // Additional values will be added
TString name=s.GetName();
name.Append(" + additional chi2, ndf and CL values");
sx->SetName(name);
Double_t vecc[3],vecv[3];
- if (!extr)
- {
- sx->SetPosition((Ali3Vector&)s);
- }
- else
+ if (extr)
{
// Extrapolate the veto hit position
Double_t scale=1;
sx->SetPosition(r);
}
- Double_t sig,err;
- for (Int_t i=1; i<=nvalues; i++)
- {
- sig=s.GetSignal(i);
- err=s.GetSignalError(i);
- sx->SetSignal(sig,i);
- sx->SetSignalError(err,i);
- }
-
// Calculate the confidence level of association
GetPosition(vecc,"car");
sx->GetPosition(vecv,"car");
// $Id$
-#include "Riostream.h"
#include <math.h>
#include "TObjArray.h"
{
public:
AliCalcluster(); // Default constructor, all data initialised to 0
- ~AliCalcluster(); // Default destructor
+ virtual ~AliCalcluster(); // Default destructor
+ AliCalcluster(AliCalcluster& c); // Copy constructor
AliCalcluster(AliCalmodule& m); // Create new cluster starting at module m
Int_t GetRow(); // Return row number of cluster center
Int_t GetColumn(); // Return column number of cluster center
Int_t HasVetoHit(Double_t cl); // Check for ass. veto hit with conf. level > cl
protected:
- AliCalmodule* fCenter; // Pointer to the central module of the cluster
+ Int_t fRow; // Row index of the central module of the cluster
+ Int_t fCol; // Column index of the central module of the cluster
Int_t fNmods; // The number of modules in the cluster
Float_t fRowdisp; // Row dispersion of cluster (not normalised)
Float_t fColdisp; // Column dispersion of cluster (not normalised)
Int_t fNvetos; // The number of associated veto signals
TObjArray* fVetos; // The array of associated veto signals
- ClassDef(AliCalcluster,3) // Description of a cluster of calorimeter modules.
+ ClassDef(AliCalcluster,4) // Description of a cluster of calorimeter modules.
};
#endif
///////////////////////////////////////////////////////////////////////////
#include "AliCalmodule.h"
+#include "Riostream.h"
ClassImp(AliCalmodule) // Class implementation to enable ROOT I/O
-AliCalmodule::AliCalmodule()
+AliCalmodule::AliCalmodule() : AliSignal()
{
// Default constructor, all module data is set to 0
fRow=0;
// Default destructor
}
///////////////////////////////////////////////////////////////////////////
-AliCalmodule::AliCalmodule(Int_t row,Int_t col,Float_t sig)
+AliCalmodule::AliCalmodule(AliCalmodule& m) : AliSignal(m)
+{
+// Copy constructor
+ fRow=m.fRow;
+ fCol=m.fCol;
+ fSigc=m.fSigc;
+ fDead=m.fDead;
+ fGain=m.fGain;
+}
+///////////////////////////////////////////////////////////////////////////
+AliCalmodule::AliCalmodule(Int_t row,Int_t col,Float_t sig) : AliSignal()
{
// Module constructor with initialisation of module data
fRow=row;
return fGain;
}
///////////////////////////////////////////////////////////////////////////
+AliCalmodule* AliCalmodule::MakeCopy(AliCalmodule& m)
+{
+// 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 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.
+
+ AliCalmodule* cal=new AliCalmodule(m);
+ return cal;
+}
+///////////////////////////////////////////////////////////////////////////
// $Id$
-#include "Riostream.h"
-
#include "AliSignal.h"
class AliCalmodule : public AliSignal
{
public:
AliCalmodule(); // Default constructor
- ~AliCalmodule(); // Default destructor
+ 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
Int_t GetDeadValue(); // Return the value of the dead module indicator
void SetGain(Float_t gain); // Set gain of the module's readout system
Float_t GetGain(); // Return the gain value
+ virtual AliCalmodule* MakeCopy(AliCalmodule& m); // Make a deep copy and provide its pointer
protected:
Int_t fRow; // The current row number
Int_t fDead; // Flag to indicate dead module (1=dead 0=alive)
Float_t fGain; // Gain of the module's readout system
- ClassDef(AliCalmodule,2) // Description of a module in a calorimeter system.
+ ClassDef(AliCalmodule,3) // Description of a module in a calorimeter system.
};
#endif
///////////////////////////////////////////////////////////////////////////
#include "AliCalorimeter.h"
+#include "Riostream.h"
ClassImp(AliCalorimeter) // Class implementation to enable ROOT I/O
-AliCalorimeter::AliCalorimeter()
+AliCalorimeter::AliCalorimeter() : TObject()
{
// Default constructor, all parameters set to 0
fNrows=0;
fAttributes=0;
fGains=0;
fPositions=0;
- fName=" ";
+ fName="Unspecified";
}
///////////////////////////////////////////////////////////////////////////
AliCalorimeter::~AliCalorimeter()
}
}
///////////////////////////////////////////////////////////////////////////
-AliCalorimeter::AliCalorimeter(Int_t nrow,Int_t ncol)
+AliCalorimeter::AliCalorimeter(Int_t nrow,Int_t ncol) : TObject()
{
// Create a calorimeter module matrix
fNrows=nrow;
fNvetos=0;
fVetos=0;
- fName=" ";
+ fName="Unspecified";
+}
+///////////////////////////////////////////////////////////////////////////
+AliCalorimeter::AliCalorimeter(AliCalorimeter& c) : TObject(c)
+{
+// Copy constructor
+ fNsignals=0;
+ fModules=0;
+ fNclusters=0;
+ fClusters=0;
+ fNvetos=0;
+ fVetos=0;
+
+ fAttributes=0;
+ fGains=0;
+
+ fHmodules=0;
+ fHclusters=0;
+
+ fMatrix=0;
+ fPositions=0;
+
+ fNrows=c.fNrows;
+ fNcolumns=c.fNcolumns;
+ fName=c.fName;
+
+ if (fNrows && fNcolumns)
+ {
+ if (c.fPositions)
+ {
+ for (Int_t irow=1; irow<=fNrows; irow++)
+ {
+ for (Int_t icol=1; icol<=fNcolumns; icol++)
+ {
+ AliPosition* p=c.GetPosition(irow,icol);
+ SetPosition(irow,icol,*p);
+ }
+ }
+ }
+
+ TMatrix* mat=c.fAttributes;
+ if (mat) fAttributes=new TMatrix(*mat);
+
+ mat=c.fGains;
+ if (mat) fGains=new TMatrix(*mat);
+
+ if (c.fNclusters)
+ {
+ fClusters=new TObjArray();
+ fClusters->SetOwner();
+ for (Int_t icl=1; icl<=c.fNclusters; icl++)
+ {
+ AliCalcluster* cl=c.GetCluster(icl);
+ fClusters->Add(new AliCalcluster(*cl));
+ fNclusters++;
+ }
+ }
+
+ for (Int_t im=1; im<=c.fNsignals; im++)
+ {
+ AliCalmodule* m=c.GetModule(im);
+ SetSignal(m->GetRow(),m->GetColumn(),m->GetSignal());
+ }
+
+ for (Int_t iv=1; iv<=c.fNvetos; iv++)
+ {
+ AliSignal* s=c.GetVetoSignal(iv);
+ AddVetoSignal(s);
+ }
+ }
}
///////////////////////////////////////////////////////////////////////////
Int_t AliCalorimeter::GetNrows()
m=new AliCalmodule();
AliPosition* r=fPositions[row-1][col-1];
if (r) m->SetPosition(*r);
+ m->SetGain(GetGain(row,col));
+ if (GetDeadValue(row,col)) m->SetDead();
fModules->Add(m);
fMatrix[row-1][col-1]=m;
}
delete fModules;
fModules=0;
}
- for (Int_t i=0; i<fNrows; i++)
- {
- for (Int_t j=0; j<fNcolumns; j++)
- {
- fMatrix[i][j]=0;
- }
- }
fNclusters=0;
if (fClusters)
fVetos->SetOwner();
}
- Int_t nvalues=s.GetNvalues();
- AliSignal* sx=new AliSignal(nvalues);
- sx->SetName(s.GetName());
-
- sx->SetPosition((Ali3Vector&)s);
-
- Double_t sig,err;
- for (Int_t i=1; i<=nvalues; i++)
- {
- sig=s.GetSignal(i);
- err=s.GetSignalError(i);
- sx->SetSignal(sig,i);
- sx->SetSignalError(err,i);
- }
+ AliSignal* sx=new AliSignal(s);
fVetos->Add(sx);
fNvetos++;
// $Id$
-#include "Riostream.h"
#include <math.h>
#include "TObject.h"
public:
AliCalorimeter(); // Default constructor
AliCalorimeter(Int_t nrow,Int_t ncol); // Create a calorimeter matrix
- ~AliCalorimeter(); // Destructor
+ virtual ~AliCalorimeter(); // Destructor
+ AliCalorimeter(AliCalorimeter& c); // Copy constructor
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
* provided "as is" without express or implied warranty. *
**************************************************************************/
-// $Id: AliCollider.cxx,v 1.4 2002/12/11 14:45:12 nick Exp $
+// $Id: AliCollider.cxx,v 1.5 2003/02/03 13:19:44 nick Exp $
///////////////////////////////////////////////////////////////////////////
// Class AliCollider
//
//
//--- Author: Nick van Eijndhoven 22-nov-2002 Utrecht University
-//- Modified: NvE $Date: 2002/12/11 14:45:12 $ Utrecht University
+//- Modified: NvE $Date: 2003/02/03 13:19:44 $ Utrecht University
///////////////////////////////////////////////////////////////////////////
#include "AliCollider.h"
+#include "Riostream.h"
ClassImp(AliCollider) // Class implementation to enable ROOT I/O
-AliCollider::AliCollider()
+AliCollider::AliCollider() : TPythia6()
{
// Default constructor.
// All variables initialised to default values.
fFrame=frame;
fWin=win;
Initialize(frame,beam,target,win);
+
+ cout << " *AliCollider::Init* Standard Pythia initialisation." << endl;
+ cout << " Beam particle : " << beam << " Target particle : " << target
+ << " Frame = " << frame << " Energy = " << win
+ << endl;
}
///////////////////////////////////////////////////////////////////////////
void AliCollider::Init(char* frame,Int_t zp,Int_t ap,Int_t zt,Int_t at,Float_t win)
// In case of a standard Pythia run for 'elementary' particle interactions,
// the value of npt is totally irrelevant.
//
-// The argument 'medit' denotes the edit mode used for Pyedit().
-// Note : medit<0 suppresses the invokation of Pyedit().
-// By default, only 'stable' final particles are kept (i.e. medit=1).
-//
// The argument 'mlist' denotes the list mode used for Pylist().
// Note : mlist<0 suppresses the invokation of Pylist().
// By default, no listing is produced (i.e. mlist=-1).
//
+// The argument 'medit' denotes the edit mode used for Pyedit().
+// Note : medit<0 suppresses the invokation of Pyedit().
+// By default, only 'stable' final particles are kept (i.e. medit=1).
+//
// In the case of a standard Pythia run concerning 'elementary' particle
// interactions, the projectile and target particle ID's for the created
// event structure are set to the corresponding Pythia KF codes.
// Counters for the various (proj,targ) combinations : p+p, n+p, p+n and n+n
Int_t ncols[4]={0,0,0,0};
+ Int_t ncol=1;
if (fNucl)
{
if (npt<1 || npt>(fAproj+fAtarg))
}
// Determine the number of nucleon-nucleon collisions
- Int_t ncol=npt/2;
+ ncol=npt/2;
if (npt%2 && fRan.Uniform()>0.5) ncol+=1;
// Determine the number of the various types of N+N interactions
}
}
delete [] rans;
+ }
if (!(fEventnum%fPrintfreq))
{
cout << " *AliCollider::MakeEvent* Run : " << fRunnum << " Event : " << fEventnum
<< endl;
- cout << " npart = " << npt << " ncol = " << ncol
- << " ncolpp = " << ncols[0] << " ncolnp = " << ncols[1]
- << " ncolpn = " << ncols[2] << " ncolnn = " << ncols[3] << endl;
+ if (fNucl)
+ {
+ cout << " npart = " << npt << " ncol = " << ncol
+ << " ncolpp = " << ncols[0] << " ncolnp = " << ncols[1]
+ << " ncolpn = " << ncols[2] << " ncolnn = " << ncols[3] << endl;
+ }
}
- }
-
if (!fEvent)
{
fEvent=new AliEvent();
fEvent->AddVertex(vert,0);
}
- Int_t kf=0,kc=0;
+ Int_t kf=0;
Float_t charge=0,mass=0;
- TMCParticle* part=0;
-
Int_t ntypes=4;
// Singular settings for a normal Pythia elementary particle interation
if (mlist >= 0) Pylist(mlist);
- ImportParticles();
- npart=0;
- if (fParticles) npart=fParticles->GetEntries();
-
- for (Int_t jpart=0; jpart<npart; jpart++)
+ npart=GetN();
+ for (Int_t jpart=1; jpart<=npart; jpart++)
{
- part=(TMCParticle*)fParticles->At(jpart);
- if (!part) continue;
-
- kf=part->GetKF();
- kc=Pycomp(kf);
-
- charge=GetKCHG(kc,1)/3.;
- if (kf<0) charge*=-1;
- mass=GetPMAS(kc,1);
+ kf=GetK(jpart,2);
+ charge=Pychge(kf)/3.;
+ mass=GetP(jpart,5);
// 3-momentum in GeV/c
- v[0]=part->GetPx();
- v[1]=part->GetPy();
- v[2]=part->GetPz();
+ v[0]=GetP(jpart,1);
+ v[1]=GetP(jpart,2);
+ v[2]=GetP(jpart,3);
p.SetVector(v,"car");
// Production location in cm.
- v[0]=(part->GetVx())/10;
- v[1]=(part->GetVy())/10;
- v[2]=(part->GetVz())/10;
+ v[0]=GetV(jpart,1)/10;
+ v[1]=GetV(jpart,2)/10;
+ v[2]=GetV(jpart,3)/10;
r.SetPosition(v,"car");
ntk++;
}
}
- if (mlist) cout << endl; // Create empty output line after the event
+ if (mlist && !(fEventnum%fPrintfreq)) cout << endl; // Create empty output line after the event
if (fOutTree) fOutTree->Fill();
}
///////////////////////////////////////////////////////////////////////////
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
-// $Id: AliCollider.h,v 1.2 2002/12/02 15:10:37 nick Exp $
+// $Id: AliCollider.h,v 1.3 2002/12/11 14:45:12 nick Exp $
-#include "Riostream.h"
#include "TPythia6.h"
-#include "TMCParticle.h"
#include "TString.h"
#include "TFile.h"
#include "TTree.h"
{
public:
AliCollider(); // Default constructor
- ~AliCollider(); // Default destructor
+ virtual ~AliCollider(); // Default destructor
void SetOutputFile(TString name); // Initialise the ROOT output data file
void SetVertexMode(Int_t mode); // Select mode for (sec.) vertex structure creation
Int_t GetVertexMode(); // Provide vertex structure creation mode
void GetFractions(Float_t zp,Float_t ap,Float_t zt,Float_t at); // Determine various N-N collision fractions
- ClassDef(AliCollider,2) // Pythia based universal physics event generator
+ ClassDef(AliCollider,3) // Pythia based universal physics event generator
};
#endif
* provided "as is" without express or implied warranty. *
**************************************************************************/
-// $Id: AliEvent.cxx,v 1.6 2002/04/26 11:23:37 nick Exp $
+// $Id: AliEvent.cxx,v 1.11 2003/02/25 12:36:28 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/02/03 13:19:44 $ UU-SAP Utrecht
+//- Modified: NvE $Date: 2003/02/25 12:36:28 $ UU-SAP Utrecht
///////////////////////////////////////////////////////////////////////////
#include "AliEvent.h"
+#include "Riostream.h"
ClassImp(AliEvent) // Class implementation to enable ROOT I/O
-AliEvent::AliEvent()
+AliEvent::AliEvent() : AliVertex()
{
// Default constructor.
// All variables initialised to default values.
fCalCopy=0;
}
///////////////////////////////////////////////////////////////////////////
-AliEvent::AliEvent(Int_t n): AliVertex(n)
+AliEvent::AliEvent(Int_t n) : AliVertex(n)
{
// Create an event to hold initially a maximum of n tracks
// All variables initialised to default values
- cout << "AliEvent init with n = " << n << endl;
+ if (n<=0)
+ {
+ cout << " *** This AliVertex initialisation was invoked via the AliEvent ctor." << endl;
+ }
fDaytime.Set();
fRun=0;
fEvent=0;
}
}
///////////////////////////////////////////////////////////////////////////
+AliEvent::AliEvent(AliEvent& evt) : AliVertex(evt)
+{
+// Copy constructor.
+ fDaytime=evt.fDaytime;
+ fRun=evt.fRun;
+ fEvent=evt.fEvent;
+ fAproj=evt.fAproj;
+ fZproj=evt.fZproj;
+ fPnucProj=evt.fPnucProj;
+ fIdProj=evt.fIdProj;
+ fAtarg=evt.fAtarg;
+ fZtarg=evt.fZtarg;
+ fPnucTarg=evt.fPnucTarg;
+ fIdTarg=evt.fIdTarg;
+ fNcals=evt.fNcals;
+ fCalCopy=evt.fCalCopy;
+
+ fCalorimeters=0;
+ if (fNcals)
+ {
+ fCalorimeters=new TObjArray(fNcals);
+ if (fCalCopy) fCalorimeters->SetOwner();
+ for (Int_t i=1; i<=fNcals; i++)
+ {
+ AliCalorimeter* cal=evt.GetCalorimeter(i);
+ if (cal)
+ {
+ if (fCalCopy)
+ {
+ fCalorimeters->Add(new AliCalorimeter(*cal));
+ }
+ else
+ {
+ fCalorimeters->Add(cal);
+ }
+ }
+ }
+ }
+}
+///////////////////////////////////////////////////////////////////////////
void AliEvent::Reset()
{
// Reset all variables to default values
// The max. number of tracks is set to the initial value again
// The max. number of vertices is set to the default value again
// Note : The CalCopy mode is maintained as it was set by the user before.
+
+ AliVertex::Reset();
+
fDaytime.Set();
fRun=0;
fEvent=0;
delete fCalorimeters;
fCalorimeters=0;
}
-
- AliVertex::Reset();
}
///////////////////////////////////////////////////////////////////////////
void AliEvent::SetOwner(Bool_t own)
fNcals++;
if (fCalCopy)
{
- fCalorimeters->AddLast((AliCalorimeter*)c.Clone());
+ fCalorimeters->Add(new AliCalorimeter(c));
}
else
{
- fCalorimeters->AddLast(&c);
+ fCalorimeters->Add(&c);
}
}
///////////////////////////////////////////////////////////////////////////
for (Int_t i=1; i<=fNcals; i++)
{
AliCalorimeter* cal=GetCalorimeter(i);
- if (cal) cout << " Calorimeter number : " << i << " Name : " << cal->GetName() << endl;
+ if (cal) cout << " Calorimeter number : " << i << " Name : " << (cal->GetName()).Data() << endl;
}
}
else
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* See cxx source for full Copyright notice */
-// $Id: AliEvent.h,v 1.4 2002/06/25 09:38:28 nick Exp $
+// $Id: AliEvent.h,v 1.8 2003/02/25 12:36:28 nick Exp $
-#include "Riostream.h"
#include <math.h>
#include "TObject.h"
public:
AliEvent(); // Default constructor
AliEvent(Int_t n); // Create an event to hold initially n tracks
- ~AliEvent(); // Default destructor
+ virtual ~AliEvent(); // Default destructor
+ AliEvent(AliEvent& evt); // Copy constructor
virtual void SetOwner(Bool_t own=kTRUE);// Set ownership of all added objects
void SetDayTime(TDatime& stamp); // Set the date and time stamp
void SetRunNumber(Int_t run); // Set the run number
TObjArray* fCalorimeters; // Array to hold the pointers to the calorimeter systems
Int_t fCalCopy; // Flag to denote creation of private copies in fCalorimeters
- ClassDef(AliEvent,6) // Creation and investigation of an Alice physics event.
+ ClassDef(AliEvent,7) // Creation and investigation of an Alice physics event.
};
#endif
////////////////////////////////////////////////////////////////////////////////
#include "AliInvmass.h"
+#include "Riostream.h"
ClassImp(AliInvmass) // Class implementation to enable ROOT I/O
// $Id$
-#include "Riostream.h"
#include <math.h>
#include "TObject.h"
///////////////////////////////////////////////////////////////////////////
#include "AliJet.h"
+#include "Riostream.h"
ClassImp(AliJet) // Class implementation to enable ROOT I/O
-AliJet::AliJet()
+AliJet::AliJet() : TObject(),Ali4Vector()
{
// Default constructor
// All variables initialised to 0
fTrackCopy=0;
}
///////////////////////////////////////////////////////////////////////////
-AliJet::AliJet(Int_t n)
+AliJet::AliJet(Int_t n) : TObject(),Ali4Vector()
{
// Create a jet to hold initially a maximum of n tracks
// All variables initialised to 0
fTrackCopy=mode;
}
///////////////////////////////////////////////////////////////////////////
-AliJet::AliJet(AliJet& j)
+AliJet::AliJet(AliJet& j) : TObject(j),Ali4Vector(j)
{
// Copy constructor
- Init();
- Reset();
- SetNtinit();
- SetTrackCopy(j.GetTrackCopy());
- SetId(j.GetId());
+ fNtinit=j.fNtinit;
+ fNtmax=j.fNtmax;
+ fQ=j.fQ;
+ fNtrk=j.fNtrk;
+ fTrackCopy=j.fTrackCopy;
+ fUserId=j.fUserId;
- AliTrack* tx=0;
- for (Int_t i=1; i<=j.GetNtracks(); i++)
+ fTracks=0;
+ if (fNtrk)
+ {
+ fTracks=new TObjArray(fNtmax);
+ if (fTrackCopy) fTracks->SetOwner();
+ }
+
+ for (Int_t i=1; i<=fNtrk; i++)
{
- tx=j.GetTrack(i);
- if (tx) AddTrack(tx);
+ AliTrack* tx=j.GetTrack(i);
+ if (fTrackCopy)
+ {
+ fTracks->Add(new AliTrack(*tx));
+ }
+ else
+ {
+ fTracks->Add(tx);
+ }
}
}
///////////////////////////////////////////////////////////////////////////
// Provide jet information within the coordinate frame f
cout << " *AliJet::Data* Id : " << fUserId << " Invmass : " << GetInvmass() << " Charge : " << fQ
<< " Momentum : " << GetMomentum() << " Ntracks : " << fNtrk << endl;
- cout << " ";
+
Ali4Vector::Data(f);
}
///////////////////////////////////////////////////////////////////////////
// $Id$
-#include "Riostream.h"
#include <math.h>
#include "TObject.h"
public:
AliJet(); // Default constructor
AliJet(Int_t n); // Create a Jet to hold initially n Tracks
- ~AliJet(); // Default destructor
- virtual void SetOwner(Bool_t own=kTRUE);// Set ownership of all added objects
+ 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,Int_t copy=1);// Add a track to the jet
void AddTrack(AliTrack* t,Int_t copy=1) { AddTrack(*t,copy); }
Int_t fTrackCopy; // Flag to denote creation of private copies in fTracks
Int_t fUserId; // The user defined identifier
- ClassDef(AliJet,3) // Creation and investigation of a jet of particle tracks.
+ ClassDef(AliJet,4) // Creation and investigation of a jet of particle tracks.
};
#endif
///////////////////////////////////////////////////////////////////////////
#include "AliMath.h"
+#include "Riostream.h"
ClassImp(AliMath) // Class implementation to enable ROOT I/O
-AliMath::AliMath()
+AliMath::AliMath() : TObject()
{
// Default constructor
}
// Destructor
}
///////////////////////////////////////////////////////////////////////////
+AliMath::AliMath(AliMath& m) : TObject(m)
+{
+// Copy constructor
+}
+///////////////////////////////////////////////////////////////////////////
Double_t AliMath::Gamma(Double_t z)
{
// Computation of gamma(z) for all z>0.
// $Id$
-#include "Riostream.h"
#include <math.h>
#include "TObject.h"
{
public:
AliMath(); // Default constructor
- ~AliMath(); // Destructor
+ virtual ~AliMath(); // Destructor
+ AliMath(AliMath& m); // Copy constructor
Double_t Gamma(Double_t z); // Standard gamma function Gamma(z)
Double_t Gamma(Double_t a,Double_t x); // Incomplete gamma function P(a,x)
Double_t LnGamma(Double_t z); // Compute ln[Gamma(z)]
Double_t BesselI1(Double_t x); // Compute modified Bessel function I_1(x)
Double_t BesselK1(Double_t x); // Compute modified Bessel function K_1(x)
- ClassDef(AliMath,1) // Various mathematical tools for physics analysis.
+ ClassDef(AliMath,2) // Various mathematical tools for physics analysis.
};
#endif
// pos[1]=78.25
// pos[3]=12.93
// s->SetPosition(pos,"car");
-// m->EnterObject(6,21,s);
+// matrix->EnterObject(6,21,s);
//
// s=new AliSignal();
// s->SetSignal(25.84);
// pos[1]=-53.88
// pos[3]=22.69
// s->SetPosition(pos,"car");
-// m->EnterObject(8,13,s);
+// matrix->EnterObject(8,13,s);
//
// s=new AliSignal();
// s->SetSignal(87.25);
// pos[1]=932.576
// pos[3]=-1382.754
// s->SetPosition(pos,"car");
-// m->EnterObject(64,3,s);
+// matrix->EnterObject(64,3,s);
//
// Int_t nrows=matrix->GetMaxRow();
// Int_t ncols=matrix->GetMaxColumn();
///////////////////////////////////////////////////////////////////////////
#include "AliObjMatrix.h"
+#include "Riostream.h"
ClassImp(AliObjMatrix) // Class implementation to enable ROOT I/O
fSwap=0;
fMaxrow=0;
fMaxcol=0;
- fNobjects=0;
+ fObjects=0;
}
///////////////////////////////////////////////////////////////////////////
AliObjMatrix::~AliObjMatrix()
delete fRows;
fRows=0;
}
+ if (fObjects)
+ {
+ delete fObjects;
+ fObjects=0;
+ }
}
///////////////////////////////////////////////////////////////////////////
void AliObjMatrix::Reset()
delete fRows;
fRows=0;
}
+ if (fObjects)
+ {
+ delete fObjects;
+ fObjects=0;
+ }
fMaxrow=0;
fMaxcol=0;
- fNobjects=0;
}
///////////////////////////////////////////////////////////////////////////
void AliObjMatrix::SetOwner(Int_t own)
// Enter an object to the matrix structure at location (row,col).
// In case the location already contained an object, the existing object
// will first be removed before the new object is stored.
-// According to the status of the copy flag (see the SetCopy() function)
+// According to the status of the owner flag (see the SetOwner() function)
// the existing object will also be deleted.
// Note : The first location in the matrix is indicated as (1,1).
if (row<1 || col<1)
}
TObject* old=(TObject*)mrow->At(colx-1);
- if (!old) fNobjects++;
- if (old && fOwn) delete old;
+ if (old)
+ {
+ fObjects->Remove(old);
+ fObjects->Compress();
+ if (fOwn) delete old;
+ }
mrow->AddAt(obj,colx-1);
+
+ if (!fObjects) fObjects=new TObjArray();
+ fObjects->Add(obj);
+}
+///////////////////////////////////////////////////////////////////////////
+void AliObjMatrix::RemoveObject(Int_t row,Int_t col)
+{
+// Remove the object stored at the matrix location (row,col).
+// In case the object was owned by the matrix, it will be deleted.
+//
+// Note : The first location in the matrix is indicated as (1,1).
+
+ TObject* obj=0;
+
+ if (!fRows || row<1 || col<1) return;
+
+
+ Int_t rowx=row;
+ if (fSwap) rowx=col;
+ Int_t colx=col;
+ if (fSwap) colx=row;
+
+ TObjArray* mrow=0;
+ if (rowx <= fRows->GetSize()) mrow=(TObjArray*)fRows->At(rowx-1);
+
+ if (!mrow) return;
+
+ if (colx <= mrow->GetSize()) obj=(TObject*)mrow->At(colx-1);
+
+ if (obj)
+ {
+ fObjects->Remove(obj);
+ fObjects->Compress();
+ mrow->Remove(obj);
+ if (fOwn) delete obj;
+ }
}
///////////////////////////////////////////////////////////////////////////
TObject* AliObjMatrix::GetObject(Int_t row,Int_t col)
return obj;
}
///////////////////////////////////////////////////////////////////////////
+TObject* AliObjMatrix::GetObject(Int_t j)
+{
+// Provide a pointer to the j-th stored object.
+// In case the index j is invalid, a value 0 will be returned.
+// The first stored object is indicated as j=1.
+//
+// Note : Do NOT delete the object.
+// To remove an object, the memberfunction RemoveObject()
+// should be used.
+
+ TObject* obj=0;
+ Int_t nobj=0;
+ if (fObjects) nobj=fObjects->GetSize();
+
+ if (j>0 && j<=nobj) obj=(TObject*)fObjects->At(j-1);
+
+ return obj;
+}
+///////////////////////////////////////////////////////////////////////////
+TObjArray* AliObjMatrix::GetObjects()
+{
+// Provide references to all the stored objects.
+// In case no objects are present, a value 0 will be returned.
+//
+// Note : Do NOT make any changes to the reference array apart from
+// changing the order of the pointers of the various objects.
+// For addition or removal of objects, the memberfunctions
+// EnterObject() and RemoveObject() should be used.
+
+ return fObjects;
+}
+///////////////////////////////////////////////////////////////////////////
Int_t AliObjMatrix::GetMaxRow()
{
// Provide the maximum row number index.
Int_t AliObjMatrix::GetNobjects()
{
// Provide the number of stored objects.
- return fNobjects;
+ Int_t nobj=0;
+ if (fObjects) nobj=fObjects->GetEntries();
+
+ return nobj;
}
///////////////////////////////////////////////////////////////////////////
// $Id$
-#include "Riostream.h"
-
#include "TObject.h"
#include "TObjArray.h"
+#include "TRefArray.h"
class AliObjMatrix : public TObject
{
public:
AliObjMatrix(); // Default constructor
- ~AliObjMatrix(); // Default destructor
+ virtual ~AliObjMatrix(); // Default destructor
virtual void Reset(); // Reset the whole matrix structure
virtual void SetOwner(Int_t own=1); // Set the owner flag for the stored objects
virtual Int_t GetOwner(); // Provide the owner flag for the stored objects
virtual void SetSwapMode(Int_t swap=1); // Set the swap mode flag for this matrix
virtual Int_t GetSwapMode(); // Provide the swap mode flag for this matrix
virtual void EnterObject(Int_t row,Int_t col,TObject* obj); // Enter an object into the matrix
+ virtual void RemoveObject(Int_t row,Int_t col); // Remove an object from the matrix
virtual TObject* GetObject(Int_t row,Int_t col); // Provide an object from the matrix
virtual Int_t GetMaxRow(); // Provide the maximum row number index
virtual Int_t GetMaxColumn(); // Provide the maximum column number index
virtual Int_t GetNobjects(); // Provide the number of stored objects
+ virtual TObject* GetObject(Int_t j); // Provide pointer to the j-th object
+ virtual TObjArray* GetObjects(); // Provide pointers of all stored onjects
protected:
- TObjArray* fRows; // Pointers to the various arrays representing the matrix rows
- Int_t fOwn; // Flag to indicate whether the objects are owned by the matrix structure
- Int_t fSwap; // Flag to indicate swapped mode for internal matrix storage
- Int_t fMaxrow; // The maximum row number index
- Int_t fMaxcol; // The maximum column number index
- Int_t fNobjects; // The number of stored objects
+ TObjArray* fRows; // Pointers to the various arrays representing the matrix rows
+ Int_t fOwn; // Flag to indicate whether the objects are owned by the matrix structure
+ Int_t fSwap; // Flag to indicate swapped mode for internal matrix storage
+ Int_t fMaxrow; // The maximum row number index
+ Int_t fMaxcol; // The maximum column number index
+ TObjArray* fObjects; // Linear reference array for fast looping over the stored objects
- ClassDef(AliObjMatrix,1) // Handling of a matrix structure of objects.
+ ClassDef(AliObjMatrix,2) // Handling of a matrix structure of objects.
};
#endif
///////////////////////////////////////////////////////////////////////////
#include "AliPosition.h"
+#include "Riostream.h"
ClassImp(AliPosition) // Class implementation to enable ROOT I/O
// Destructor to delete dynamically allocated memory
}
///////////////////////////////////////////////////////////////////////////
+AliPosition::AliPosition(const AliPosition& p) : Ali3Vector(p)
+{
+// Copy constructor
+}
+///////////////////////////////////////////////////////////////////////////
void AliPosition::SetPosition(Double_t* r,TString f)
{
// Store position according to reference frame f
// $Id$
-#include "Riostream.h"
#include <math.h>
#include "TObject.h"
public:
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
AliPosition& GetPosition(); // Provide position
virtual 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
- ClassDef(AliPosition,1) // Handling of positions in various reference frames.
+ ClassDef(AliPosition,2) // Handling of positions in various reference frames.
};
#endif
ClassImp(AliPositionObj) // Class implementation to enable ROOT I/O
-AliPositionObj::AliPositionObj()
+AliPositionObj::AliPositionObj() : TObject(),AliPosition()
{
// Creation of an AliPositionObj object and initialisation of parameters.
// All attributes initialised to 0.
}
///////////////////////////////////////////////////////////////////////////
-AliPositionObj::AliPositionObj(Ali3Vector& q)
+AliPositionObj::AliPositionObj(AliPosition& p) : TObject(),AliPosition(p)
{
// Creation of an AliPositionObj object and initialisation of parameters.
-// All attributes are initialised to the values of the input Ali3Vector.
- Load(q);
+// All attributes are initialised to the values of the input AliPosition.
}
///////////////////////////////////////////////////////////////////////////
AliPositionObj::~AliPositionObj()
// Destructor to delete dynamically allocated memory.
}
///////////////////////////////////////////////////////////////////////////
+AliPositionObj::AliPositionObj(const AliPositionObj& p) : TObject(p),AliPosition(p)
+{
+// Copy constructor
+}
+///////////////////////////////////////////////////////////////////////////
void AliPositionObj::Load(Ali3Vector& q)
{
// Load all attributes of the input Ali3Vector into this AliPositionObj object.
class AliPositionObj : public TObject,public AliPosition
{
public:
- AliPositionObj(); // Default constructor
- AliPositionObj(Ali3Vector& q); // Constructor
- ~AliPositionObj(); // Destructor
- void Load(Ali3Vector& q); // Load all attributes of input AliPosition
+ AliPositionObj(); // Default constructor
+ AliPositionObj(AliPosition& p); // Constructor
+ virtual ~AliPositionObj(); // Destructor
+ AliPositionObj(const AliPositionObj& p); // Copy constructor
+ void Load(Ali3Vector& q); // Load all attributes of input AliPosition
- ClassDef(AliPositionObj,1) // Handling of positions in various reference frames.
+ ClassDef(AliPositionObj,2) // Handling of positions in various reference frames.
};
#endif
///////////////////////////////////////////////////////////////////////////
#include "AliRandom.h"
+#include "Riostream.h"
ClassImp(AliRandom) // Class implementation to enable ROOT I/O
// $Id$
-#include "Riostream.h"
#include <math.h>
#include "TObject.h"
///////////////////////////////////////////////////////////////////////////
#include "AliSample.h"
+#include "Riostream.h"
ClassImp(AliSample) // Class implementation to enable ROOT I/O
// $Id$
#include <math.h>
-#include "Riostream.h"
#include "Rtypes.h"
// Float_t adc=s.GetSignal();
// Float_t sigma=s.GetSignalError();
//
-// AliSignal q(3); // q can store initially 3 signal values with their errors
-// // In the example below a signal contains the
+// AliSignal q; // In the example below a signal contains the
// // following data : timing, ADC and dE/dx
// q.SetName("TOF hit");
// q.SetPosition(pos,"car");
///////////////////////////////////////////////////////////////////////////
#include "AliSignal.h"
+#include "Riostream.h"
ClassImp(AliSignal) // Class implementation to enable ROOT I/O
-AliSignal::AliSignal(Int_t n)
+AliSignal::AliSignal() : TObject(),AliPosition()
{
// Creation of an AliSignal object and initialisation of parameters.
-// Initially a total of n (default n=1) values (with errors) can be stored.
+// Several values (with errors) can be stored.
// If needed, the storage for values (and errors) will be expanded automatically
// when entering values and/or errors.
fSignal=0;
fDsignal=0;
fName="Unspecified";
+ fHwaveform=0;
}
///////////////////////////////////////////////////////////////////////////
AliSignal::~AliSignal()
delete fDsignal;
fDsignal=0;
}
+ if (fHwaveform)
+ {
+ delete fHwaveform;
+ fHwaveform=0;
+ }
}
///////////////////////////////////////////////////////////////////////////
-AliSignal::AliSignal(AliSignal& s)
+AliSignal::AliSignal(AliSignal& s) : TObject(s),AliPosition(s)
{
// Copy constructor
fSignal=0;
fDsignal=0;
- fName=s.GetName();
-
- SetPosition((Ali3Vector&)s);
+ fName=s.fName;
+ fHwaveform=0;
Int_t nvalues=s.GetNvalues();
Double_t sig;
{
err=s.GetSignalError(j);
SetSignalError(err,j);
- }
+ }
+
+ TH1F* hist=s.GetWaveform();
+ if (hist) fHwaveform=new TH1F(*hist);
}
///////////////////////////////////////////////////////////////////////////
void AliSignal::Reset(Int_t mode)
// Reset all signal and position values and errors to 0.
//
// mode = 0 Reset position and all signal values and their errors to 0.
+// The waveform histogram is reset.
// 1 Reset position and delete the signal and error storage arrays.
+// The waveform histogram is deleted.
//
// The default when invoking Reset() corresponds to mode=0.
//
//
// For more specific actions see ResetPosition(), ResetSignals()
// and DeleteSignals().
+//
if (mode<0 || mode>1)
{
// 2 Reset only signal errors
//
// The default when invoking ResetSignals() corresponds to mode=0.
+//
+// Irrespective of the mode, the waveform histogram is reset.
if (mode<0 || mode>2)
{
fDsignal->AddAt(0,j);
}
}
+
+ if (fHwaveform) fHwaveform->Reset();
}
///////////////////////////////////////////////////////////////////////////
void AliSignal::DeleteSignals(Int_t mode)
// 2 Delete only signal errors array
//
// The default when invoking DeleteSignals() corresponds to mode=0.
+//
+// Irrespective of the mode, the waveform histogram is deleted.
if (mode<0 || mode>2)
{
delete fDsignal;
fDsignal=0;
}
+
+ if (fHwaveform)
+ {
+ delete fHwaveform;
+ fHwaveform=0;
+ }
}
///////////////////////////////////////////////////////////////////////////
void AliSignal::ResetPosition()
void AliSignal::Data(TString f)
{
// Provide signal information within the coordinate frame f
- cout << " *AliSignal::Data* Signal of kind : " << fName << endl;
+ cout << " *AliSignal::Data* Signal of kind : " << fName.Data() << endl;
cout << " Position";
Ali3Vector::Data(f);
return n;
}
///////////////////////////////////////////////////////////////////////////
+TH1F* AliSignal::GetWaveform()
+{
+// Provide pointer to the 1D waveform histogram.
+ return fHwaveform;
+}
+///////////////////////////////////////////////////////////////////////////
+void AliSignal::SetWaveform(TH1F* waveform)
+{
+// Set the 1D waveform histogram.
+//
+// In case the input argument has the same value as the current waveform
+// histogram pointer value, no action is taken since the user has already
+// modified the actual histogram.
+//
+// In case the input argument is zero, the current waveform histogram
+// is deleted and the pointer set to zero.
+//
+// In all other cases the current waveform histogram is deleted and a new
+// copy of the input histogram is created which becomes the current waveform
+// histogram.
+
+ if (waveform != fHwaveform)
+ {
+ if (fHwaveform)
+ {
+ delete fHwaveform;
+ fHwaveform=0;
+ }
+ if (waveform) fHwaveform=new TH1F(*waveform);
+ }
+}
+///////////////////////////////////////////////////////////////////////////
+AliSignal* AliSignal::MakeCopy(AliSignal& s)
+{
+// 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.
+// 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.
+
+ AliSignal* sig=new AliSignal(s);
+ return sig;
+}
+///////////////////////////////////////////////////////////////////////////
#include "TObject.h"
#include "TArrayF.h"
+#include "TH1.h"
#include "AliPosition.h"
class AliSignal : public TObject,public AliPosition
{
public:
- AliSignal(Int_t n=1); // Default constructor
- ~AliSignal(); // Destructor
+ AliSignal(); // Default constructor
+ virtual ~AliSignal(); // Destructor
AliSignal(AliSignal& s); // Copy constructor
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
TString GetName(); // Provide the name tag indicating the kind of signal
Int_t GetNvalues(); // Provide the number of signal values
Int_t GetNerrors(); // Provide the number of specified errors
+ TH1F* GetWaveform(); // Provide pointer of the waveform histogram
+ void SetWaveform(TH1F* waveform); // Set the waveform histogram
+ virtual AliSignal* MakeCopy(AliSignal& s); // Make a deep copy and provide its pointer
+
protected:
TArrayF* fSignal; // Signal values
TArrayF* fDsignal; // Errors on signal values
TString fName; // Name tag to identify the kind of signal
+ TH1F* fHwaveform; // The 1D histogram containing the waveform
- ClassDef(AliSignal,6) // Generic handling of (extrapolated) detector signals.
+ ClassDef(AliSignal,7) // Generic handling of (extrapolated) detector signals.
};
#endif
///////////////////////////////////////////////////////////////////////////
#include "AliTrack.h"
+#include "Riostream.h"
ClassImp(AliTrack) // Class implementation to enable ROOT I/O
-AliTrack::AliTrack()
+AliTrack::AliTrack() : TObject(),Ali4Vector()
{
// Default constructor
// All variables initialised to 0
fMasses=0;
fDmasses=0;
fPmasses=0;
+ fBegin=0;
+ fEnd=0;
+ fImpactXY=0;
+ fImpactXZ=0;
+ fImpactYZ=0;
+ fClosest=0;
}
///////////////////////////////////////////////////////////////////////////
AliTrack::~AliTrack()
delete fSignals;
fSignals=0;
}
+ if (fMasses)
+ {
+ delete fMasses;
+ fMasses=0;
+ }
+ if (fDmasses)
+ {
+ delete fDmasses;
+ fDmasses=0;
+ }
+ if (fPmasses)
+ {
+ delete fPmasses;
+ fPmasses=0;
+ }
+ if (fBegin)
+ {
+ delete fBegin;
+ fBegin=0;
+ }
+ if (fEnd)
+ {
+ delete fEnd;
+ fEnd=0;
+ }
+ if (fImpactXY)
+ {
+ delete fImpactXY;
+ fImpactXY=0;
+ }
+ if (fImpactXZ)
+ {
+ delete fImpactXZ;
+ fImpactXZ=0;
+ }
+ if (fImpactYZ)
+ {
+ delete fImpactYZ;
+ fImpactYZ=0;
+ }
+ if (fClosest)
+ {
+ delete fClosest;
+ fClosest=0;
+ }
}
///////////////////////////////////////////////////////////////////////////
-AliTrack::AliTrack(AliTrack& t)
+AliTrack::AliTrack(AliTrack& t) : TObject(t),Ali4Vector(t)
{
// Copy constructor
Init();
- fQ=t.GetCharge();
- fChi2=t.GetChi2();
- fNdf=t.GetNdf();
- fUserId=t.GetId();
- fCode=t.GetParticleCode();
- fNdec=t.GetNdecay();
- fNsig=t.GetNsignals();
- fNmasses=t.GetNMassHypotheses();
- Set4Momentum((Ali4Vector&)t);
- fBegin=t.GetBeginPoint();
- fEnd=t.GetEndPoint();
- fImpactXY=t.GetImpactPoint("z");
- fImpactXZ=t.GetImpactPoint("y");
- fImpactYZ=t.GetImpactPoint("x");
- fClosest=t.GetClosestPoint();
-
- AliTrack* tx;
+ fQ=t.fQ;
+ fNdec=t.fNdec;
+ fNsig=t.fNsig;
+ fNmasses=t.fNmasses;
+ if (fNmasses)
+ {
+ fMasses=new TArrayD(*(t.fMasses));
+ fDmasses=new TArrayD(*(t.fDmasses));
+ fPmasses=new TArrayD(*(t.fPmasses));
+ }
+ if (t.fBegin) fBegin=new AliPositionObj(*(t.fBegin));
+ if (t.fEnd) fEnd=new AliPositionObj(*(t.fEnd));
+ if (t.fImpactXY) fImpactXY=new AliPositionObj(*(t.fImpactXY));
+ if (t.fImpactXZ) fImpactXZ=new AliPositionObj(*(t.fImpactXZ));
+ if (t.fImpactYZ) fImpactYZ=new AliPositionObj(*(t.fImpactYZ));
+ if (t.fClosest) fClosest=new AliPositionObj(*(t.fClosest));
+ fUserId=t.fUserId;
+ fChi2=t.fChi2;
+ fNdf=t.fNdf;
+ fCode=t.fCode;
+
if (fNdec)
{
fDecays=new TObjArray(fNdec);
fDecays->SetOwner();
for (Int_t it=1; it<=fNdec; it++)
{
- tx=t.GetDecayTrack(it);
+ AliTrack* tx=t.GetDecayTrack(it);
fDecays->Add(new AliTrack(*tx));
}
}
- AliSignal* sx;
if (fNsig)
{
fSignals=new TObjArray(fNsig);
for (Int_t is=1; is<=fNsig; is++)
{
- sx=t.GetSignal(is);
+ AliSignal* sx=t.GetSignal(is);
fSignals->Add(sx);
}
}
-
- Double_t prob,m,dm;
- if (fNmasses)
- {
- fMasses=new TArrayD(fNmasses);
- fDmasses=new TArrayD(fNmasses);
- fPmasses=new TArrayD(fNmasses);
- for (Int_t ih=1; ih<=fNmasses; ih++)
- {
- prob=t.GetMassHypothesisProb(ih);
- m=t.GetMassHypothesis(ih);
- dm=t.GetResultError();
- fMasses->AddAt(m,ih-1);
- fDmasses->AddAt(dm,ih-1);
- fPmasses->AddAt(prob,ih-1);
- }
- }
}
///////////////////////////////////////////////////////////////////////////
void AliTrack::Reset()
delete fSignals;
fSignals=0;
}
- Double_t b[3]={0,0,0};
- fBegin.SetPosition(b,"sph");
- fEnd.SetPosition(b,"sph");
- fImpactXY.SetPosition(b,"sph");
- fImpactXZ.SetPosition(b,"sph");
- fImpactYZ.SetPosition(b,"sph");
- fClosest.SetPosition(b,"sph");
if (fMasses)
{
delete fMasses;
delete fPmasses;
fPmasses=0;
}
+ if (fBegin)
+ {
+ delete fBegin;
+ fBegin=0;
+ }
+ if (fEnd)
+ {
+ delete fEnd;
+ fEnd=0;
+ }
+ if (fImpactXY)
+ {
+ delete fImpactXY;
+ fImpactXY=0;
+ }
+ if (fImpactXZ)
+ {
+ delete fImpactXZ;
+ fImpactXZ=0;
+ }
+ if (fImpactYZ)
+ {
+ delete fImpactYZ;
+ fImpactYZ=0;
+ }
+ if (fClosest)
+ {
+ delete fClosest;
+ fClosest=0;
+ }
}
///////////////////////////////////////////////////////////////////////////
void AliTrack::Set3Momentum(Ali3Vector& p)
// Provide complete track and decay information within the coordinate frame f
Data(f); // Information of the current track
- cout << " Begin-point :"; fBegin.Data(f);
- cout << " End-point :"; fEnd.Data(f);
+ if (fBegin) { cout << " Begin-point :"; fBegin->Data(f); }
+ if (fEnd) { cout << " End-point :"; fEnd->Data(f); }
for (Int_t is=1; is<=GetNsignals(); is++)
{
((AliSignal*)GetSignal(is))->Data(f);
}
}
///////////////////////////////////////////////////////////////////////////
-void AliTrack::SetBeginPoint(AliPosition p)
+void AliTrack::SetBeginPoint(AliPosition& p)
{
// Store the position of the track begin-point.
- fBegin=p;
+ if (!fBegin)
+ {
+ fBegin=new AliPositionObj(p);
+ }
+ else
+ {
+ fBegin->Load(p);
+ }
}
///////////////////////////////////////////////////////////////////////////
-AliPosition AliTrack::GetBeginPoint()
+AliPosition* AliTrack::GetBeginPoint()
{
// Provide the position of the track begin-point.
return fBegin;
}
///////////////////////////////////////////////////////////////////////////
-void AliTrack::SetEndPoint(AliPosition p)
+void AliTrack::SetEndPoint(AliPosition& p)
{
// Store the position of the track end-point.
- fEnd=p;
+ if (!fEnd)
+ {
+ fEnd=new AliPositionObj(p);
+ }
+ else
+ {
+ fEnd->Load(p);
+ }
}
///////////////////////////////////////////////////////////////////////////
-AliPosition AliTrack::GetEndPoint()
+AliPosition* AliTrack::GetEndPoint()
{
// Provide the position of the track end-point.
return fEnd;
return y;
}
///////////////////////////////////////////////////////////////////////////
-void AliTrack::SetImpactPoint(AliPosition p,TString q)
+void AliTrack::SetImpactPoint(AliPosition& p,TString q)
{
// Store the position of the impact-point in the plane "q=0".
// Here q denotes one of the axes X, Y or Z.
switch (axis)
{
case 1: // Impact-point in the plane X=0
- fImpactYZ=p;
+ if (!fImpactYZ)
+ {
+ fImpactYZ=new AliPositionObj(p);
+ }
+ else
+ {
+ fImpactYZ->Load(p);
+ }
break;
case 2: // Impact-point in the plane Y=0
- fImpactXZ=p;
+ if (!fImpactXZ)
+ {
+ fImpactXZ=new AliPositionObj(p);
+ }
+ else
+ {
+ fImpactXZ->Load(p);
+ }
break;
case 3: // Impact-point in the plane Z=0
- fImpactXY=p;
+ if (!fImpactXY)
+ {
+ fImpactXY=new AliPositionObj(p);
+ }
+ else
+ {
+ fImpactXY->Load(p);
+ }
break;
default: // Unsupported axis
}
}
///////////////////////////////////////////////////////////////////////////
-AliPosition AliTrack::GetImpactPoint(TString q)
+AliPosition* AliTrack::GetImpactPoint(TString q)
{
// Provide the position of the impact-point in the plane "q=0".
// Here q denotes one of the axes X, Y or Z.
// Note : The character to denote the axis may be entered in lower or
// in uppercase.
- AliPosition dummy;
Int_t axis=0;
if (q=="x" || q=="X") axis=1;
if (q=="y" || q=="Y") axis=2;
default: // Unsupported axis
cout << "*AliTrack::GetImpactPoint* Unsupported axis : " << q << endl
<< " Possible axes are 'X', 'Y' and 'Z'." << endl;
- return dummy;
+ return 0;
}
}
///////////////////////////////////////////////////////////////////////////
return fUserId;
}
///////////////////////////////////////////////////////////////////////////
-void AliTrack::SetClosestPoint(AliPosition p)
+void AliTrack::SetClosestPoint(AliPosition& p)
{
// Set position p as the point of closest approach w.r.t. some reference
- fClosest=p;
+ if (!fClosest)
+ {
+ fClosest=new AliPositionObj(p);
+ }
+ else
+ {
+ fClosest->Load(p);
+ }
}
///////////////////////////////////////////////////////////////////////////
-AliPosition AliTrack::GetClosestPoint()
+AliPosition* AliTrack::GetClosestPoint()
{
// Provide the point of closest approach w.r.t. some reference
return fClosest;
#include "AliSignal.h"
#include "AliBoost.h"
-#include "AliPosition.h"
+#include "AliPositionObj.h"
class AliTrack : public TObject,public Ali4Vector
{
public:
- AliTrack(); // Default constructor
- ~AliTrack(); // Destructor
- AliTrack(AliTrack& t); // Copy constructor
- void Reset(); // Reset all values to 0
- void Set4Momentum(Ali4Vector& p); // Set track 4-momentum
- void Set3Momentum(Ali3Vector& p); // Set track 3-momentum
+ AliTrack(); // Default constructor
+ virtual ~AliTrack(); // Destructor
+ AliTrack(AliTrack& t); // Copy constructor
+ 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
- Ali3Vector Get3Momentum(); // Provide track 3-momentum
- Double_t GetMomentum(); // Provide value of track 3-momentum
- Double_t GetMass(); // Provide particle mass
- Float_t GetCharge(); // Provide particle charge
- Double_t GetEnergy(); // Provide particle total energy
+ 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
+ Ali3Vector Get3Momentum(); // Provide track 3-momentum
+ Double_t GetMomentum(); // Provide value of track 3-momentum
+ Double_t GetMass(); // Provide particle mass
+ Float_t GetCharge(); // Provide particle charge
+ Double_t GetEnergy(); // Provide particle total energy
void Decay(Double_t m1,Double_t m2,Double_t thcms,Double_t phicms); // Perform 2-body decay
- Int_t GetNdecay(); // Provide number of decay products
- AliTrack* GetDecayTrack(Int_t j); // Access to decay produced track number j
- void AddSignal(AliSignal& s); // Relate an AliSignal to this track
- void RemoveSignal(AliSignal& s); // Remove related AliSignal from this track
- Int_t GetNsignals(); // Provide number of related AliSignals
- AliSignal* GetSignal(Int_t j); // Access to the related AliSignal number j
- void SetBeginPoint(AliPosition p);// Set the track begin-point
- AliPosition GetBeginPoint(); // Provide the track begin-point
- void SetEndPoint(AliPosition p); // Set the track end-point
- AliPosition GetEndPoint(); // Provide the track end-point
+ Int_t GetNdecay(); // Provide number of decay products
+ AliTrack* GetDecayTrack(Int_t j); // Access to decay produced track number j
+ void AddSignal(AliSignal& s); // Relate an AliSignal to this track
+ void RemoveSignal(AliSignal& s); // Remove related AliSignal from this track
+ Int_t GetNsignals(); // Provide number of related AliSignals
+ AliSignal* GetSignal(Int_t j); // Access to the related AliSignal number j
+ void SetBeginPoint(AliPosition& p); // Set the track begin-point
+ AliPosition* GetBeginPoint(); // Provide the track begin-point
+ void SetEndPoint(AliPosition& p); // Set the track end-point
+ AliPosition* GetEndPoint(); // Provide the track end-point
void AddMassHypothesis(Double_t prob,Double_t m,Double_t dm=0); // Add mass hypothesis data
Int_t GetNMassHypotheses(); // Provide number of mass hypotheses
Double_t GetMassHypothesis(Int_t j=0); // Provide mass of jth hypothesis
Double_t GetMassHypothesisProb(Int_t j=0); // Provide prob. of jth mass hypothesis
void RemoveMassHypothesis(Int_t j); // Remove the jth mass hypothesis
- 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 GetMt(Int_t j); // Provide trans. mass w.r.t. z-axis and jth mass hypothesis
- Double_t GetRapidity(); // Provide rapidity value w.r.t. z-axis
- void SetImpactPoint(AliPosition p,TString q); // Set the impact-point in plane "q=0"
- AliPosition GetImpactPoint(TString q); // Provide the impact-point in plane "q=0"
- void SetId(Int_t id); // Set the user defined unique track identifier
- Int_t GetId(); // Provide the user defined unique track identifier
- void SetClosestPoint(AliPosition p); // Set position p as point of closest approach w.r.t. some reference
- AliPosition GetClosestPoint(); // Provide point of closest approach w.r.t. some reference
- void SetChi2(Float_t chi2); // Set the chi-squared value of the track fit
- void SetNdf(Int_t ndf); // Set the number of degrees of freedom for the track fit
- Float_t GetChi2(); // Provide the chi-squared value of the track fit
- Int_t GetNdf(); // Provide the number of degrees of freedom for the track fit
- void SetParticleCode(Int_t code); // Set the user defined particle id code (e.g. the PDF convention)
- Int_t GetParticleCode(); // Provide the user defined particle id code
+ 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 GetMt(Int_t j); // Provide trans. mass w.r.t. z-axis and jth mass hypothesis
+ Double_t GetRapidity(); // Provide rapidity value w.r.t. z-axis
+ void SetImpactPoint(AliPosition& p,TString q); // Set the impact-point in plane "q=0"
+ AliPosition* GetImpactPoint(TString q); // Provide the impact-point in plane "q=0"
+ void SetId(Int_t id); // Set the user defined unique track identifier
+ Int_t GetId(); // Provide the user defined unique track identifier
+ void SetClosestPoint(AliPosition& p); // Set position p as point of closest approach w.r.t. some reference
+ AliPosition* GetClosestPoint(); // Provide point of closest approach w.r.t. some reference
+ void SetChi2(Float_t chi2); // Set the chi-squared value of the track fit
+ void SetNdf(Int_t ndf); // Set the number of degrees of freedom for the track fit
+ Float_t GetChi2(); // Provide the chi-squared value of the track fit
+ Int_t GetNdf(); // Provide the number of degrees of freedom for the track fit
+ void SetParticleCode(Int_t code); // Set the user defined particle id code (e.g. the PDF convention)
+ Int_t GetParticleCode(); // Provide the user defined particle id code
protected:
- void Init(); // Initialisation of pointers etc...
- Float_t fQ; // The charge of the particle
- Int_t fNdec; // The number of decay products
- TObjArray* fDecays; // The array of decay produced tracks
- Int_t fNsig; // The number of related AliSignals
- TObjArray* fSignals; // The array of related AliSignals
- AliPosition fBegin; // The begin-point of the track
- AliPosition fEnd; // The end-point of the track
- Int_t fNmasses; // The number of mass hypotheses
- TArrayD* fMasses; // The various mass hypotheses
- TArrayD* fDmasses; // The errors on the various masses
- TArrayD* fPmasses; // The probabilities of the various mass hypotheses
- AliPosition fImpactXY; // The (extrapolated) impact-point in the plane z=0
- AliPosition fImpactXZ; // The (extrapolated) impact-point in the plane y=0
- AliPosition fImpactYZ; // The (extrapolated) impact-point in the plane x=0
- Int_t fUserId; // The user defined identifier
- AliPosition fClosest; // The (extrapolated) point of closest approach w.r.t some reference
- Float_t fChi2; // The Chi-squared of the track fit
- Int_t fNdf; // The number of degrees of freedom of the track fit
- Int_t fCode; // The user defined particle id code
+ void Init(); // Initialisation of pointers etc...
+ Float_t fQ; // The charge of the particle
+ Int_t fNdec; // The number of decay products
+ TObjArray* fDecays; // The array of decay produced tracks
+ Int_t fNsig; // The number of related AliSignals
+ TObjArray* fSignals; // The array of related AliSignals
+ AliPositionObj* fBegin; // The begin-point of the track
+ AliPositionObj* fEnd; // The end-point of the track
+ Int_t fNmasses; // The number of mass hypotheses
+ TArrayD* fMasses; // The various mass hypotheses
+ TArrayD* fDmasses; // The errors on the various masses
+ TArrayD* fPmasses; // The probabilities of the various mass hypotheses
+ AliPositionObj* fImpactXY; // The (extrapolated) impact-point in the plane z=0
+ AliPositionObj* fImpactXZ; // The (extrapolated) impact-point in the plane y=0
+ AliPositionObj* fImpactYZ; // The (extrapolated) impact-point in the plane x=0
+ Int_t fUserId; // The user defined identifier
+ AliPositionObj* fClosest; // The (extrapolated) point of closest approach w.r.t some reference
+ Float_t fChi2; // The Chi-squared of the track fit
+ Int_t fNdf; // The number of degrees of freedom of the track fit
+ Int_t fCode; // The user defined particle id code
private:
void Dump(AliTrack* t,Int_t n,TString f); // Recursively print all decay levels
- ClassDef(AliTrack,3) // Handling of the attributes of a reconstructed particle track.
+ ClassDef(AliTrack,4) // Handling of the attributes of a reconstructed particle track.
};
#endif
///////////////////////////////////////////////////////////////////////////
#include "AliVertex.h"
+#include "Riostream.h"
ClassImp(AliVertex) // Class implementation to enable ROOT I/O
-AliVertex::AliVertex()
+AliVertex::AliVertex() : AliJet(),AliPosition()
{
// Default constructor.
// All variables initialised to 0.
// Initial maximum number of sec. vertices is set to the default value.
Init();
Reset();
- SetNtinit();
SetNvmax();
SetNjmax();
}
void AliVertex::Init()
{
// Initialisation of pointers etc...
- AliJet::Init();
fNvmax=0;
fVertices=0;
fConnects=0;
fLines=0;
}
///////////////////////////////////////////////////////////////////////////
-AliVertex::AliVertex(Int_t n)
+AliVertex::AliVertex(Int_t n) : AliJet(n),AliPosition()
{
// Create a vertex to hold initially a maximum of n tracks
// All variables initialised to 0
- Init();
- Reset();
- if (n > 0)
+ if (n<=0)
{
- SetNtinit(n);
- }
- else
- {
- cout << endl;
- cout << " *AliVertex* Initial max. number of tracks entered : " << n << endl;
- cout << " This is invalid. Default initial maximum will be used." << endl;
- cout << endl;
- SetNtinit();
+ cout << " *** This AliJet initialisation was invoked via the AliVertex ctor." << endl;
}
+ Init();
+ Reset();
SetNvmax();
SetNjmax();
}
AliJet::SetOwner(own);
}
///////////////////////////////////////////////////////////////////////////
-AliVertex::AliVertex(AliVertex& v)
+AliVertex::AliVertex(AliVertex& v) : AliJet(v.fNtinit),AliPosition(v)
{
// Copy constructor
Init();
- Reset();
- SetNtinit();
- SetNvmax();
- SetNjmax();
+ fNvtx=0;
+ fNjets=0;
+ SetNvmax(v.fNvmax);
+ SetNjmax(v.fNjmax);
SetTrackCopy(v.GetTrackCopy());
SetVertexCopy(v.GetVertexCopy());
SetJetCopy(v.GetJetCopy());
SetId(v.GetId());
- SetPosition(v.GetPosition());
// Copy all tracks except the ones coming from jets
AliTrack* tx=0;
Double_t vec[3]={0,0,0};
AliTrack* tx=0;
AliVertex* vx=0;
- AliPosition r;
+ AliPosition* r=0;
Ali3Vector p;
Int_t charge;
+ AliPosition dummy;
+
if (fLines) delete fLines;
fLines=new TObjArray();
fLines->SetOwner();
if (cons==1)
{
r=tx->GetBeginPoint();
- r.GetPosition(vec,"car");
+ if (!r) r=&dummy;
+ r->GetPosition(vec,"car");
line->SetNextPoint(vec[0],vec[1],vec[2]);
r=tx->GetEndPoint();
- r.GetPosition(vec,"car");
+ if (!r) r=&dummy;
+ r->GetPosition(vec,"car");
line->SetNextPoint(vec[0],vec[1],vec[2]);
line->SetLineWidth(1);
}
else
{
r=tx->GetClosestPoint();
- r.GetPosition(vec,"car");
+ if (!r) r=&dummy;
+ r->GetPosition(vec,"car");
line->SetNextPoint(vec[0],vec[1],vec[2]);
p=tx->Get3Momentum();
- p=p+r;
+ p=p+(*r);
p.GetVector(vec,"car");
line->SetNextPoint(vec[0],vec[1],vec[2]);
line->SetLineWidth(3);
// $Id$
-#include "Riostream.h"
#include <math.h>
#include "TObject.h"
public:
AliVertex(); // Default constructor
AliVertex(Int_t n); // Create a vertex to hold initially n tracks
- ~AliVertex(); // Default destructor
- virtual void SetOwner(Bool_t own=kTRUE);// Set ownership of all added objects
+ 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
void ResetVertices(); // Reset stored vertex list
void AddJet(AliJet& j,Int_t tracks=1); // Add a jet (and its tracks) to the vertex
18-feb-2003 NvE Memberfunction ShowCalorimeters() introduced in AliEvent to display an overview of all
available calorimeter systems.
Date/time format changed and ShowCalorimeters() invoked in AliEvent::HeaderData().
+08-mar-2003 NvE Compiler option /GR introduced for MSVC++ in mklibs.bat to explicitly enable
+ the C++ RTTI. This prevents a warning when creating shared libraries
+ using the "old streamer method" (i.e. NO "+" behind the class names
+ in the Linkdef file).
+10-mar-2003 NvE AliPosition datamembers of AliTrack changed into AliPositionObj* to enable
+ minimisation of memory occupation and output file size in case a track
+ has not all attributes set.
+13-mar-2003 NvE Memberfunction SetZero() introduced for Ali3Vector and Ali4Vector.
+20-mar-2003 NvE Statement #include "Riostream.h" moved from header file into implementation file
+ for all classes and MSVC compiler option /Za replaced by /Ze in order to prevent
+ ANSI compliant compiler problems.
+15-apr-2003 NvE Waveform histogram introduced in AliSignal.
+29-apr-2003 NvE Memberfunction MakeCopy introduced for AliSignal and AliCalmodule.
+ 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 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,
+ provided these derived classes also have a proper MakeCopy memberfunction.
+17-jun-2003 NvE All TString objects "s" replaced by "s.Data()" in cout statements to comply
+ with MSVC++7.NET compiler and allow mixing with MSVC++6 libraries.
+ The classes in which these modifications were made are Ali3Vector, Ali4Vector,
+ AliSignal and AliEvent.
+20-jun-2003 NvE Copy constructor introduced for nearly all classes and also all destructors
+ explicitly declared virtual.
+11-jul-2003 NvE Functionality of AliObjMatrix extended by enabling removal of objects and
+ introduction of a linear object array for fast looping over the stored objects.
+15-aug-2003 NvE Usage of TMCParticle removed from AliCollider; only Pythia intrinsic functionality
+ is used.
echo .
rem --- The option strings for MSVC++ DLL compilation and linking ---
-set mscomp=/nologo /c /TP /Za /MD /I%ROOTSYS%\include
-set msdll=/nologo /TP /Za /MD /LD /GD /I%ROOTSYS%\include
+set mscomp=/nologo /c /Ze /TP /MD /GR /GX /I%ROOTSYS%\include
+set msdll=/nologo /Ze /TP /MD /LD /GD /GR /GX /I%ROOTSYS%\include
set mslink=/ENTRY:_DllMainCRTStartup@12 %ROOTSYS%\lib\*.lib
if "%1" == "" goto export