]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliPoints.cxx
Correct overloading of virtual functions in the derived classes (icc)
[u/mrichter/AliRoot.git] / STEER / AliPoints.cxx
index 54838004f615518a8af7ffcbf232a929b05daa44..8e7e9ffc7cb57a199041d34be1393d3446684395 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.6  2000/10/02 21:28:14  fca
-Removal of useless dependecies via forward declarations
-
-Revision 1.5  2000/07/11 18:24:59  fca
-Coding convention corrections + few minor bug fixes
-
-Revision 1.4  1999/09/29 09:24:29  fca
-Introduction of the Copyright and cvs Log
-
-*/
+/* $Id$ */
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
@@ -39,27 +28,32 @@ Introduction of the Copyright and cvs Log
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
-#include "AliPoints.h"
-#include "AliRun.h"
-#include "AliDetector.h"
 #include "TPad.h"
-#include "TView.h"
 #include "TParticle.h"
+#include "TView.h"
+
+#include "AliDetector.h"
+#include "AliMC.h"
+#include "AliPoints.h"
+#include "AliRun.h"
  
 ClassImp(AliPoints)
 
-//_____________________________________________________________________________
-AliPoints::AliPoints()
+//_______________________________________________________________________
+AliPoints::AliPoints():
+  fDetector(0),
+  fIndex(0)
 {
   //
   // Default constructor
   //
-  fDetector = 0;       
-  fIndex    = 0;
 }
 
-//_____________________________________________________________________________
-AliPoints::AliPoints(const AliPoints &pts)
+//_______________________________________________________________________
+AliPoints::AliPoints(const AliPoints &pts):
+  TPolyMarker3D(pts),
+  fDetector(0),
+  fIndex(0)
 {
   //
   // Copy constructor
@@ -67,45 +61,42 @@ AliPoints::AliPoints(const AliPoints &pts)
   pts.Copy(*this);
 }
 
-//_____________________________________________________________________________
-AliPoints::AliPoints(Int_t nhits)
-  :TPolyMarker3D(nhits)
+//_______________________________________________________________________
+AliPoints::AliPoints(Int_t nhits):
+  TPolyMarker3D(nhits),
+  fDetector(0),
+  fIndex(0)
 {
   //
   // Standard constructor
   //
-  fDetector = 0;       
-  fIndex    = 0;
   ResetBit(kCanDelete);
 }
         
-//_____________________________________________________________________________
+//_______________________________________________________________________
 AliPoints::~AliPoints()
 {
   //
-  // Default constructor
+  // Default destructor
   //
-  fDetector = 0;       
-  fIndex    = 0;
 }
 
-//_____________________________________________________________________________
-void AliPoints::Copy(AliPoints &pts) const
+//_______________________________________________________________________
+void AliPoints::Copy(TObject &pts) const
 {
   //
   // Copy *this onto pts
   //
-  if(this != &pts) {
-    ((TPolyMarker3D*)this)->Copy((TPolyMarker3D&)pts);
-    pts.fGLList = fGLList;
-    pts.fLastPoint = fLastPoint;
-    pts.fDetector = fDetector;
-    pts.fIndex = fIndex;
+  if((TObject*)this != &pts) {
+    ((TPolyMarker3D*)this)->Copy(dynamic_cast<TPolyMarker3D&>(pts));
+    (dynamic_cast<AliPoints&>(pts)).fGLList = fGLList;
+    (dynamic_cast<AliPoints&>(pts)).fLastPoint = fLastPoint;
+    (dynamic_cast<AliPoints&>(pts)).fDetector = fDetector;
+    (dynamic_cast<AliPoints&>(pts)).fIndex = fIndex;
   }
 }
 
-
-//_____________________________________________________________________________
+//_______________________________________________________________________
 Int_t AliPoints::DistancetoPrimitive(Int_t px, Int_t py)
 {
   //
@@ -125,8 +116,8 @@ Int_t AliPoints::DistancetoPrimitive(Int_t px, Int_t py)
   return TPolyMarker3D::DistancetoPrimitive(px,py);
 }
 
-//_____________________________________________________________________________
-void AliPoints::DumpParticle()
+//_______________________________________________________________________
+void AliPoints::DumpParticle() const
 {
   //
   //   Dump particle corresponding to this point
@@ -135,7 +126,7 @@ void AliPoints::DumpParticle()
   if (particle) particle->Dump();
 }
 
-//_____________________________________________________________________________
+//_______________________________________________________________________
 void AliPoints::ExecuteEvent(Int_t event, Int_t px, Int_t py)
 {
   //
@@ -154,7 +145,7 @@ void AliPoints::ExecuteEvent(Int_t event, Int_t px, Int_t py)
 
 }
 
-//_____________________________________________________________________________
+//_______________________________________________________________________
 const Text_t *AliPoints::GetName() const
 {
   //
@@ -165,8 +156,8 @@ const Text_t *AliPoints::GetName() const
   return particle->GetName();
 }
 
-//_____________________________________________________________________________
-Text_t *AliPoints::GetObjectInfo(Int_t, Int_t)
+//_______________________________________________________________________
+Text_t *AliPoints::GetObjectInfo(Int_t, Int_t) const
 {
   //
   //   Redefines TObject::GetObjectInfo.
@@ -178,18 +169,18 @@ Text_t *AliPoints::GetObjectInfo(Int_t, Int_t)
   return info;
 }
 
-//_____________________________________________________________________________
+//_______________________________________________________________________
 TParticle *AliPoints::GetParticle() const
 {
   //
   //   Returns pointer to particle index in AliRun::fParticles
   //
-  if (fIndex < 0 || fIndex >= gAlice->GetNtrack()) return 0;
-  else return gAlice->Particle(fIndex);
+  if (fIndex < 0 || fIndex >= gAlice->GetMCApp()->GetNtrack()) return 0;
+  else return gAlice->GetMCApp()->Particle(fIndex);
 }
 
-//_____________________________________________________________________________
-void AliPoints::InspectParticle()
+//_______________________________________________________________________
+void AliPoints::InspectParticle() const
 {
   //
   //   Inspect particle corresponding to this point
@@ -198,17 +189,7 @@ void AliPoints::InspectParticle()
   if (particle) particle->Inspect();
 }
 
-//_____________________________________________________________________________
-AliPoints & AliPoints::operator=(const AliPoints &pts)
-{
-  //
-  // Assignment operator
-  //
-  pts.Copy(*this);
-  return (*this);
-}
-
-//_____________________________________________________________________________
+//_______________________________________________________________________
 void AliPoints::Propagate()
 {
   //
@@ -220,13 +201,13 @@ void AliPoints::Propagate()
   //  
   TIter next(gAlice->Detectors());
   AliDetector *detector;
-  while((detector = (AliDetector*)next())) {
+  while((detector = (AliDetector*)(next()))) {
     if (!detector->IsActive()) continue;
     points = detector->Points();
     if (!points) continue;
     ntracks = points->GetEntriesFast();
     for (track=0;track<ntracks;track++) {
-      pm = (AliPoints*)points->UncheckedAt(track);
+      pm = dynamic_cast<AliPoints*>(points->UncheckedAt(track));
       if (!pm) continue;
       if (fIndex == pm->GetIndex()) {
        pm->SetMarkerColor(GetMarkerColor());