]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
08-mar-2003 NvE Compiler option /GR introduced for MSVC++ in mklibs.bat to explicitly...
authornick <nick@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 29 Aug 2003 09:05:12 +0000 (09:05 +0000)
committernick <nick@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 29 Aug 2003 09:05:12 +0000 (09:05 +0000)
                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.

44 files changed:
RALICE/Ali3Vector.cxx
RALICE/Ali3Vector.h
RALICE/Ali3VectorObj.cxx
RALICE/Ali3VectorObj.h
RALICE/Ali4Vector.cxx
RALICE/Ali4Vector.h
RALICE/Ali4VectorObj.cxx
RALICE/Ali4VectorObj.h
RALICE/AliBoost.cxx
RALICE/AliBoost.h
RALICE/AliCalcluster.cxx
RALICE/AliCalcluster.h
RALICE/AliCalmodule.cxx
RALICE/AliCalmodule.h
RALICE/AliCalorimeter.cxx
RALICE/AliCalorimeter.h
RALICE/AliCollider.cxx
RALICE/AliCollider.h
RALICE/AliEvent.cxx
RALICE/AliEvent.h
RALICE/AliInvmass.cxx
RALICE/AliInvmass.h
RALICE/AliJet.cxx
RALICE/AliJet.h
RALICE/AliMath.cxx
RALICE/AliMath.h
RALICE/AliObjMatrix.cxx
RALICE/AliObjMatrix.h
RALICE/AliPosition.cxx
RALICE/AliPosition.h
RALICE/AliPositionObj.cxx
RALICE/AliPositionObj.h
RALICE/AliRandom.cxx
RALICE/AliRandom.h
RALICE/AliSample.cxx
RALICE/AliSample.h
RALICE/AliSignal.cxx
RALICE/AliSignal.h
RALICE/AliTrack.cxx
RALICE/AliTrack.h
RALICE/AliVertex.cxx
RALICE/AliVertex.h
RALICE/history.txt
RALICE/scripts/mklibs.bat

index e3b3e3ed66f0f1bc664e6857bba6107c7e48132b..6a0daa501253daf231f51b5612f4288421a3f9b0 100644 (file)
@@ -77,6 +77,7 @@
 ///////////////////////////////////////////////////////////////////////////
 
 #include "Ali3Vector.h"
+#include "Riostream.h"
  
 ClassImp(Ali3Vector) // Class implementation to enable ROOT I/O
  
@@ -84,6 +85,29 @@ Ali3Vector::Ali3Vector()
 {
 // 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;
@@ -93,11 +117,6 @@ Ali3Vector::Ali3Vector()
  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
@@ -164,7 +183,7 @@ void Ali3Vector::SetVector(Double_t* v,TString 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;
@@ -202,7 +221,7 @@ void Ali3Vector::GetVector(Double_t* v,TString f)
    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++)
    {
@@ -277,7 +296,7 @@ void Ali3Vector::SetErrors(Double_t* e,TString f)
    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;
@@ -375,7 +394,7 @@ void Ali3Vector::GetErrors(Double_t* e,TString f)
    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++)
    {
@@ -416,14 +435,14 @@ void Ali3Vector::Data(TString f)
   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; 
  }
 }
index c5912eb26eefe0b78cd7a769cce8ee8956d73e12..4bf1a7d9c42d0955fa65ab5cc1aad274abf171bb 100644 (file)
@@ -5,7 +5,6 @@
 
 // $Id$
 
-#include "Riostream.h"
 #include <math.h>
  
 #include "TObject.h"
@@ -16,6 +15,8 @@ class Ali3Vector
  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
@@ -46,6 +47,6 @@ class Ali3Vector
   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
index 76e9bdecf7b0abc9fca9b25dd828dc1abda0a9c9..137ca49b0af3dbed1c844b34abe236233d61a181 100644 (file)
  
 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()
@@ -76,6 +76,11 @@ 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.
index 5c040196704bc096b172b07e9081be18e6763063..88a9a49f12246e5d2a0c8c0017d02b2a41440b1b 100644 (file)
 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
index ec29b812c6fa0936f2409914da865c7e9f8ce028..8d4604e4b768374961d9fdedf4d71e99a500a213 100644 (file)
 ///////////////////////////////////////////////////////////////////////////
 
 #include "Ali4Vector.h"
+#include "Riostream.h"
  
 ClassImp(Ali4Vector) // Class implementation to enable ROOT I/O
  
@@ -139,14 +140,8 @@ Ali4Vector::Ali4Vector()
 // 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()
@@ -154,7 +149,31 @@ 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.
@@ -300,7 +319,7 @@ void Ali4Vector::SetScalarError(Double_t dv0)
  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,
@@ -486,15 +505,15 @@ void Ali4Vector::Data(TString f)
   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; 
  }
 }
index 90a3dbae4acb9774b39ccb67b757aa52b3f2d45b..bdd01ec5fdba73d984ad393bce087e566477b4af 100644 (file)
@@ -5,7 +5,6 @@
 
 // $Id$
 
-#include "Riostream.h"
 #include <math.h>
  
 #include "Ali3Vector.h"
@@ -15,7 +14,9 @@ class Ali4Vector
  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
@@ -23,7 +24,7 @@ class Ali4Vector
   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
@@ -61,6 +62,6 @@ class Ali4Vector
   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
index 3489a6ca3b5294a6f7fe11b3106532500b8b6164..b6e114dd2ab3e9c07d091ab110127e83c63e652b 100644 (file)
  
 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()
@@ -76,6 +76,11 @@ 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.
index 271dde07be0de6d82bc6972e58a84cd43481b8be..668f9b01acd433f06e607ff2266e54a1286f4a90 100644 (file)
 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
index fd3ba14fecfdb6c45e202247d69e9ef02a15c32f..19d329e2da076183332ea38ba45e5492e9fe76b9 100644 (file)
 ///////////////////////////////////////////////////////////////////////////
 
 #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. 
@@ -80,7 +81,16 @@ AliBoost::~AliBoost()
 // 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.
index 530761b2bb1ee7e853683b679d1e671a364dc69e..929050975869076e8733f06764849906e2dd0121 100644 (file)
@@ -5,7 +5,6 @@
 
 // $Id$
 
-#include "Riostream.h"
 #include <math.h>
  
 #include "TObject.h"
@@ -16,8 +15,9 @@ class AliBoost : public TObject
 {
  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
@@ -33,6 +33,6 @@ class AliBoost : public TObject
   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
index a5b7e9c7478dc11c6012b1983871a68cdc6b902b..b07d3b28475e80e27f14bdf92354b2205b1c0f54 100644 (file)
 ///////////////////////////////////////////////////////////////////////////
 
 #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()
@@ -71,7 +73,27 @@ 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,
@@ -88,7 +110,8 @@ AliCalcluster::AliCalcluster(AliCalmodule& m)
 
  if (sig>0. && m.GetDeadValue()==0)
  {
-  fCenter=&m;
+  fRow=m.GetRow();
+  fCol=m.GetColumn();
   r=m.GetPosition();
   SetPosition(r);
   SetSignal(sig);
@@ -101,7 +124,8 @@ AliCalcluster::AliCalcluster(AliCalmodule& m)
  }
  else
  {
-  fCenter=0;
+  fRow=0;
+  fCol=0;
   SetPosition(r);
   fNmods=0;
   fRowdisp=0.;
@@ -109,33 +133,19 @@ AliCalcluster::AliCalcluster(AliCalmodule& m)
   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()
@@ -189,7 +199,8 @@ void AliCalcluster::Start(AliCalmodule& m)
 
  if (m.GetClusteredSignal()>0. && m.GetDeadValue()==0)
  {
-  fCenter=&m;
+  fRow=m.GetRow();
+  fCol=m.GetColumn();
   r=m.GetPosition();
   SetPosition(r);
   SetSignal(m.GetSignal());
@@ -200,7 +211,8 @@ void AliCalcluster::Start(AliCalmodule& m)
  }
  else
  {
-  fCenter=0;
+  fRow=0;
+  fCol=0;
   SetPosition(r);
   fNmods=0;
   fRowdisp=0.;
@@ -291,17 +303,13 @@ void AliCalcluster::AddVetoSignal(AliSignal& s,Int_t extr)
  } 
 
  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;
@@ -312,15 +320,6 @@ void AliCalcluster::AddVetoSignal(AliSignal& s,Int_t extr)
   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"); 
index 13bc6d419863a19c11db7ef353de567c56d3133f..2884df3200eaf41674b61430b0c40a8449cfb4e1 100644 (file)
@@ -5,7 +5,6 @@
 
 // $Id$
 
-#include "Riostream.h"
 #include <math.h>
  
 #include "TObjArray.h"
@@ -18,7 +17,8 @@ class AliCalcluster : public AliSignal
 {
  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
@@ -35,13 +35,14 @@ class AliCalcluster : public AliSignal
   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
index b58078a8dbf08acfd454a397ab0dfd7cd1631e75..528dd8de75511b45aacb9949c0e7bc1ad560b230 100644 (file)
 ///////////////////////////////////////////////////////////////////////////
 
 #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;
@@ -45,7 +46,17 @@ AliCalmodule::~AliCalmodule()
 // 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;
@@ -147,3 +158,18 @@ Float_t AliCalmodule::GetGain()
  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;
+}
+///////////////////////////////////////////////////////////////////////////
index 5577f6017977f6217163d183df9dc29bb7828c5a..70c62aad3169be7c10e47b235130b4152f70b692 100644 (file)
@@ -5,15 +5,14 @@
 
 // $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
@@ -28,6 +27,7 @@ class AliCalmodule : public AliSignal
   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
@@ -36,6 +36,6 @@ class AliCalmodule : public AliSignal
   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
index baf5fa37cf5764f656f2757261b6af618499c6fb..61ce77be9fe593c27e3d5361b1ddd12ce13fa7fa 100644 (file)
 ///////////////////////////////////////////////////////////////////////////
 
 #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;
@@ -75,7 +76,7 @@ AliCalorimeter::AliCalorimeter()
  fAttributes=0;
  fGains=0;
  fPositions=0;
- fName=" ";
+ fName="Unspecified";
 }
 ///////////////////////////////////////////////////////////////////////////
 AliCalorimeter::~AliCalorimeter()
@@ -144,7 +145,7 @@ 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;
@@ -189,7 +190,76 @@ AliCalorimeter::AliCalorimeter(Int_t nrow,Int_t ncol)
  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()
@@ -224,6 +294,8 @@ void AliCalorimeter::SetSignal(Int_t row,Int_t col,Float_t sig)
    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;
   }
@@ -355,13 +427,6 @@ void AliCalorimeter::Reset(Int_t mode)
   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)
@@ -1153,20 +1218,7 @@ void AliCalorimeter::AddVetoSignal(AliSignal& s)
   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++;
index 762d0538c10f6e637fd66ca6bd9af8a5b7b0d21e..c1d232e1dd61631efbb7cd93d61d2bacb004cd49 100644 (file)
@@ -5,7 +5,6 @@
 
 // $Id$
 
-#include "Riostream.h"
 #include <math.h>
  
 #include "TObject.h"
@@ -23,7 +22,8 @@ class AliCalorimeter : public TObject
  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
index 0b6518b4d39ffd86822aed12393b8907b0f19a9a..ba1d16c6bc728d9759013f0083efdaf0543c06e5 100644 (file)
@@ -13,7 +13,7 @@
  * 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.
@@ -297,6 +298,11 @@ void AliCollider::Init(char* frame,char* beam,char* target,Float_t win)
  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)
@@ -370,14 +376,14 @@ void AliCollider::MakeEvent(Int_t npt,Int_t mlist,Int_t medit)
 // 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.
@@ -391,6 +397,7 @@ void AliCollider::MakeEvent(Int_t npt,Int_t mlist,Int_t medit)
  // 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))
@@ -401,7 +408,7 @@ void AliCollider::MakeEvent(Int_t npt,Int_t mlist,Int_t medit)
   }
 
   // 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
@@ -472,18 +479,20 @@ void AliCollider::MakeEvent(Int_t npt,Int_t mlist,Int_t medit)
    }
   }
   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();
@@ -519,11 +528,9 @@ void AliCollider::MakeEvent(Int_t npt,Int_t mlist,Int_t medit)
   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 
@@ -588,32 +595,23 @@ void AliCollider::MakeEvent(Int_t npt,Int_t mlist,Int_t medit)
 
    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++;
@@ -696,7 +694,7 @@ void AliCollider::MakeEvent(Int_t npt,Int_t mlist,Int_t medit)
   }
  }
 
- 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();
 }
 ///////////////////////////////////////////////////////////////////////////
index 62c7ee4d03bf17efb947e4d616a998b80d349afc..f1b081529a8a083ed50971ae57c45f55cc60d6e7 100644 (file)
@@ -3,11 +3,9 @@
 /* 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" 
@@ -19,7 +17,7 @@ class AliCollider : public TPythia6
 {
  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
@@ -60,6 +58,6 @@ class AliCollider : public TPythia6
 
   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
index 54b455b6c551813816c6b5b6c85f3497ac75a75a..84414d23c169702b67e2dd3b116c49bac5d1f4b0 100644 (file)
@@ -13,7 +13,7 @@
  * 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.
@@ -216,11 +217,14 @@ AliEvent::AliEvent()
  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;
@@ -247,12 +251,55 @@ AliEvent::~AliEvent()
  }
 }
 ///////////////////////////////////////////////////////////////////////////
+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;
@@ -271,8 +318,6 @@ void AliEvent::Reset()
   delete fCalorimeters;
   fCalorimeters=0;
  }
-
- AliVertex::Reset();
 }
 ///////////////////////////////////////////////////////////////////////////
 void AliEvent::SetOwner(Bool_t own)
@@ -443,11 +488,11 @@ void AliEvent::AddCalorimeter(AliCalorimeter& c)
  fNcals++;
  if (fCalCopy)
  {
-  fCalorimeters->AddLast((AliCalorimeter*)c.Clone());
+  fCalorimeters->Add(new AliCalorimeter(c));
  }
  else
  {
-  fCalorimeters->AddLast(&c);
+  fCalorimeters->Add(&c);
  }
 }
 ///////////////////////////////////////////////////////////////////////////
@@ -545,7 +590,7 @@ void AliEvent::ShowCalorimeters()
   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
index d3c866df330ee59d2771f14a46806f55d0942a84..ef43f45bd75f82914f92d211213469dd91eb0215 100644 (file)
@@ -3,9 +3,8 @@
 /* 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"
@@ -20,7 +19,8 @@ class AliEvent : public AliVertex
  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
@@ -66,6 +66,6 @@ class AliEvent : public AliVertex
   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
index ecd0d0c6b8bf7403f26f9da86e633f2ee2ac2f59..b044dbf7672f3cceda3066976fa0b0135e8d7230 100644 (file)
 ////////////////////////////////////////////////////////////////////////////////
 
 #include "AliInvmass.h"
+#include "Riostream.h"
  
 ClassImp(AliInvmass) // Class implementation to enable ROOT I/O
  
index 5a7443b98752b31a5419c393d1d8f45f326e3e54..c3be81bf9922e21d8f8f13186a62dd1a6ba33ba9 100644 (file)
@@ -5,7 +5,6 @@
 
 // $Id$
 
-#include "Riostream.h"
 #include <math.h>
  
 #include "TObject.h"
index d8bdff3c0d7790633b0b6450cb36e31e2a8dc459..233db4726b76aa997a2c00d77b438d1bb249cffa 100644 (file)
 ///////////////////////////////////////////////////////////////////////////
 
 #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
@@ -112,7 +113,7 @@ void AliJet::Init()
  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
@@ -169,20 +170,34 @@ void AliJet::SetOwner(Bool_t own)
  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);
+  }
  } 
 }
 ///////////////////////////////////////////////////////////////////////////
@@ -249,7 +264,7 @@ void AliJet::Data(TString f)
 // 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); 
 } 
 ///////////////////////////////////////////////////////////////////////////
index 7ed9c10159df47acd9c726f1ff7106785e69f437..8df7713f4decbf60f7bfec6a89310479eaa6cbb9 100644 (file)
@@ -5,7 +5,6 @@
 
 // $Id$
  
-#include "Riostream.h"
 #include <math.h>
  
 #include "TObject.h"
@@ -19,9 +18,9 @@ class AliJet : public TObject,public Ali4Vector
  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); }
@@ -58,6 +57,6 @@ class AliJet : public TObject,public Ali4Vector
   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
index 0ccafef38dea479620b488c57524cfe0e626abf0..fcf42eaecef6a394f4f5daea75ab0bf6a63d67c6 100644 (file)
 ///////////////////////////////////////////////////////////////////////////
 
 #include "AliMath.h"
+#include "Riostream.h"
  
 ClassImp(AliMath) // Class implementation to enable ROOT I/O
  
-AliMath::AliMath()
+AliMath::AliMath() : TObject()
 {
 // Default constructor
 }
@@ -48,6 +49,11 @@ AliMath::~AliMath()
 // Destructor
 }
 ///////////////////////////////////////////////////////////////////////////
+AliMath::AliMath(AliMath& m) : TObject(m)
+{
+// Copy constructor
+}
+///////////////////////////////////////////////////////////////////////////
 Double_t AliMath::Gamma(Double_t z)
 {
 // Computation of gamma(z) for all z>0.
index a161898080a046c417635a840184c31eb97fa8df..888ce97e26d47b4fb3fa4e7fe6966f509fe5bdd7 100644 (file)
@@ -5,7 +5,6 @@
 
 // $Id$
 
-#include "Riostream.h"
 #include <math.h>
  
 #include "TObject.h"
@@ -14,7 +13,8 @@ class AliMath : public TObject
 {
  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)]
@@ -32,7 +32,7 @@ class AliMath : public TObject
   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
index 0a12ac3c47720f13e4e2900c330b1eb5f2a55c59..7730ef1b49b4dba5340158396409119b41fb531b 100644 (file)
@@ -39,7 +39,7 @@
 // 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);
@@ -47,7 +47,7 @@
 // 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);
@@ -55,7 +55,7 @@
 // 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();
@@ -77,6 +77,7 @@
 ///////////////////////////////////////////////////////////////////////////
 
 #include "AliObjMatrix.h"
+#include "Riostream.h"
  
 ClassImp(AliObjMatrix) // Class implementation to enable ROOT I/O
  
@@ -91,7 +92,7 @@ AliObjMatrix::AliObjMatrix()
  fSwap=0;
  fMaxrow=0;
  fMaxcol=0;
- fNobjects=0;
+ fObjects=0;
 }
 ///////////////////////////////////////////////////////////////////////////
 AliObjMatrix::~AliObjMatrix()
@@ -102,6 +103,11 @@ AliObjMatrix::~AliObjMatrix()
   delete fRows;
   fRows=0;
  }
+ if (fObjects)
+ {
+  delete fObjects;
+  fObjects=0;
+ }
 }
 ///////////////////////////////////////////////////////////////////////////
 void AliObjMatrix::Reset()
@@ -115,10 +121,14 @@ 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)
@@ -190,7 +200,7 @@ void AliObjMatrix::EnterObject(Int_t row,Int_t col,TObject* obj)
 // 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)
@@ -233,10 +243,50 @@ void AliObjMatrix::EnterObject(Int_t row,Int_t col,TObject* obj)
  }
 
  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)
@@ -266,6 +316,38 @@ 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.
@@ -281,6 +363,9 @@ Int_t AliObjMatrix::GetMaxColumn()
 Int_t AliObjMatrix::GetNobjects()
 {
 // Provide the number of stored objects.
- return fNobjects;
+ Int_t nobj=0;
+ if (fObjects) nobj=fObjects->GetEntries();
+
+ return nobj;
 }
 ///////////////////////////////////////////////////////////////////////////
index c1d0728c4b9b2858a970cddf83d50d4dfa93be01..70d1c54f6ab446e88c6aaa4ab2447cc6d545fe44 100644 (file)
@@ -5,35 +5,37 @@
 
 // $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
index e20f1b97bfdb4e0c09c6102d1a7a681ad99f6f70..6286171c75cfc0070b0dac1a78919910ace41bba 100644 (file)
@@ -54,6 +54,7 @@
 ///////////////////////////////////////////////////////////////////////////
 
 #include "AliPosition.h"
+#include "Riostream.h"
  
 ClassImp(AliPosition) // Class implementation to enable ROOT I/O
  
@@ -67,6 +68,11 @@ AliPosition::~AliPosition()
 // 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
index d875f8ad8f88d6a406eb668253a94858643e98a9..247f56ec8f3db567e7f3d335fa361708cf292573 100644 (file)
@@ -5,7 +5,6 @@
 
 // $Id$
 
-#include "Riostream.h"
 #include <math.h>
  
 #include "TObject.h"
@@ -18,6 +17,7 @@ class AliPosition : public Ali3Vector
  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
@@ -25,11 +25,12 @@ class AliPosition : public Ali3Vector
   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
index 64b84724b5b24ce92af826a67d26900d6a6124a8..b6fcfab6251d13f50478a883099a0f2f3c9f485f 100644 (file)
  
 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()
@@ -76,6 +75,11 @@ 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.
index bc2b27865f09f38a9eebbbb2f3b408a43be4e1bb..0875ab097b64ae1bde3b9bb583b8277bdd563ddb 100644 (file)
 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
index 22e5445374201f039e6bbf85d5fa19f2cd0f97bd..195b92bd0bb5a8ee6313c381f62f1b591de2f808 100644 (file)
 ///////////////////////////////////////////////////////////////////////////
 
 #include "AliRandom.h"
+#include "Riostream.h"
  
 ClassImp(AliRandom) // Class implementation to enable ROOT I/O
  
index 5fe52fee3fcb173f42dd267294b0ce3ef431ad5e..63aadcd88ca48de0f183834d6e891b5eab55209c 100644 (file)
@@ -5,7 +5,6 @@
 
 // $Id$
 
-#include "Riostream.h"
 #include <math.h>
  
 #include "TObject.h"
index cd3977c1be99037b207ccc56a26c959648d5a42f..c0843df758f07d0fdf2b2323c9e115eeae611960 100644 (file)
@@ -43,6 +43,7 @@
 ///////////////////////////////////////////////////////////////////////////
 
 #include "AliSample.h"
+#include "Riostream.h"
  
 ClassImp(AliSample) // Class implementation to enable ROOT I/O
  
index d1fef5c228cb1841d8a4f2941e87accd21f97c31..3113463ceeaafdd70052cb6149af4a6ee6a3d578 100644 (file)
@@ -6,7 +6,6 @@
 // $Id$
 
 #include <math.h>
-#include "Riostream.h"
 
 #include "Rtypes.h"
  
index 4b381f7a3e4555bb6d2e1de93d24f113b699723b..7f14ca86d401c1a823e63d1203d1639b893c6c70 100644 (file)
@@ -51,8 +51,7 @@
 // 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()
@@ -102,16 +103,20 @@ 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;
@@ -127,7 +132,10 @@ AliSignal::AliSignal(AliSignal& s)
  {
   err=s.GetSignalError(j);
   SetSignalError(err,j);
- } 
+ }
+
+ TH1F* hist=s.GetWaveform();
+ if (hist) fHwaveform=new TH1F(*hist); 
 }
 ///////////////////////////////////////////////////////////////////////////
 void AliSignal::Reset(Int_t mode)
@@ -135,7 +143,9 @@ 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.
 //
@@ -148,6 +158,7 @@ void AliSignal::Reset(Int_t mode)
 //
 // For more specific actions see ResetPosition(), ResetSignals()
 // and DeleteSignals().
+//
 
  if (mode<0 || mode>1)
  {
@@ -176,6 +187,8 @@ void AliSignal::ResetSignals(Int_t mode)
 //        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)
  {
@@ -199,6 +212,8 @@ void AliSignal::ResetSignals(Int_t mode)
    fDsignal->AddAt(0,j);
   }
  }
+
+ if (fHwaveform) fHwaveform->Reset();
 }
 ///////////////////////////////////////////////////////////////////////////
 void AliSignal::DeleteSignals(Int_t mode)
@@ -210,6 +225,8 @@ 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)
  {
@@ -229,6 +246,12 @@ void AliSignal::DeleteSignals(Int_t mode)
   delete fDsignal;
   fDsignal=0;
  }
+
+ if (fHwaveform)
+ {
+  delete fHwaveform;
+  fHwaveform=0;
+ }
 }
 ///////////////////////////////////////////////////////////////////////////
 void AliSignal::ResetPosition()
@@ -355,7 +378,7 @@ Float_t AliSignal::GetSignalError(Int_t j)
 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);
 
@@ -401,3 +424,49 @@ Int_t AliSignal::GetNerrors()
  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;
+}
+///////////////////////////////////////////////////////////////////////////
index 7cd00a94fd0663b8d656c038433020d348c60909..678b3c0eed5a647cbce73700c6d35c428cf6244f 100644 (file)
@@ -7,14 +7,15 @@
 
 #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
@@ -30,12 +31,17 @@ class AliSignal : public TObject,public AliPosition
   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
index f520ceb2acd6f6f662b227b87ff461ed3383856e..c8d62ed167515212f27b48e04320760e0a665660 100644 (file)
 ///////////////////////////////////////////////////////////////////////////
 
 #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
@@ -109,6 +110,12 @@ void AliTrack::Init()
  fMasses=0;
  fDmasses=0;
  fPmasses=0;
+ fBegin=0;
+ fEnd=0;
+ fImpactXY=0;
+ fImpactXZ=0;
+ fImpactYZ=0;
+ fClosest=0;
 }
 ///////////////////////////////////////////////////////////////////////////
 AliTrack::~AliTrack()
@@ -125,68 +132,99 @@ 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()
@@ -213,13 +251,6 @@ 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;
@@ -235,6 +266,36 @@ void AliTrack::Reset()
   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)
@@ -314,8 +375,8 @@ void AliTrack::ListAll(TString f)
 // 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);
@@ -570,25 +631,39 @@ AliSignal* AliTrack::GetSignal(Int_t j)
  }
 }
 ///////////////////////////////////////////////////////////////////////////
-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;
@@ -870,7 +945,7 @@ Double_t AliTrack::GetRapidity()
  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.
@@ -884,15 +959,36 @@ void AliTrack::SetImpactPoint(AliPosition p,TString q)
  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
@@ -902,13 +998,12 @@ void AliTrack::SetImpactPoint(AliPosition p,TString q)
  }
 }
 ///////////////////////////////////////////////////////////////////////////
-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;
@@ -928,7 +1023,7 @@ AliPosition AliTrack::GetImpactPoint(TString q)
   default: // Unsupported axis
    cout << "*AliTrack::GetImpactPoint* Unsupported axis : " << q << endl
         << " Possible axes are 'X', 'Y' and 'Z'." << endl; 
-   return dummy;
+   return 0;
  }
 }
 ///////////////////////////////////////////////////////////////////////////
@@ -944,13 +1039,20 @@ Int_t AliTrack::GetId()
  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;
index c879664f1bc26b63ad149c40bcbcf9db834a2456..0dd6145feb005aa8dc5aed5267279475b67bd52d 100644 (file)
  
 #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
index 086692fe9708633f4a856f37301928d8d513c695..c557324316a00e6dfc2296aa33f53402669ac226 100644 (file)
 ///////////////////////////////////////////////////////////////////////////
 
 #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.
@@ -155,7 +156,6 @@ AliVertex::AliVertex()
 // Initial maximum number of sec. vertices is set to the default value.
  Init();
  Reset();
- SetNtinit();
  SetNvmax();
  SetNjmax();
 }
@@ -163,7 +163,6 @@ AliVertex::AliVertex()
 void AliVertex::Init()
 {
 // Initialisation of pointers etc...
- AliJet::Init();
  fNvmax=0;
  fVertices=0;
  fConnects=0;
@@ -175,24 +174,16 @@ void AliVertex::Init()
  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();
 }
@@ -258,19 +249,18 @@ void AliVertex::SetOwner(Bool_t own)
  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;
@@ -900,10 +890,12 @@ void AliVertex::Draw(Int_t secs,Int_t cons,Int_t jets)
  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();
@@ -925,10 +917,12 @@ void AliVertex::Draw(Int_t secs,Int_t cons,Int_t jets)
    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);
    }
@@ -936,10 +930,11 @@ void AliVertex::Draw(Int_t secs,Int_t cons,Int_t jets)
   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);
index a0b9eacdf5994c8b09223346315254139d4b894e..048befded23df00ad854e0f3f116c6dd43d2537a 100644 (file)
@@ -5,7 +5,6 @@
 
 // $Id$
 
-#include "Riostream.h"
 #include <math.h>
  
 #include "TObject.h"
@@ -20,9 +19,9 @@ class AliVertex : public AliJet,public AliPosition
  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
index d35080d94fced097acec920c766efd7c14d53e6c..aea0195550878ff50bdf393f7d21cc37f019e1a8 100644 (file)
 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.
index 19a9ab5230accdc3f41ab5c511b96c0e72552c7f..6262e89e41f721b9e5433f0869adeb1b76187888 100755 (executable)
@@ -31,8 +31,8 @@ echo === Automatic ROOT library production of files ralice.lib and ralice.dll ==
 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