]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDpoints.cxx
Remove dependency on f2c
[u/mrichter/AliRoot.git] / TRD / AliTRDpoints.cxx
index 8effe433d809d93d903f418b992625d9b600b981..ec0f3c73d24628e54f171fb0fa9462f369f4bcc0 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.2  2000/10/06 16:49:46  cblume
-Made Getters const
-
-Revision 1.1.2.1  2000/09/18 13:44:21  cblume
-New class AliTRDpoints to display the TR photon hits
-
-*/
+/* $Id$ */
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
-//  This class contains the TRD points for the ALICE event display           //
+//  This class contains the TRD points for the ALICE event display.          //
+//  Used to seperately display dEdx and TR photon hits.                      //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -40,37 +33,42 @@ New class AliTRDpoints to display the TR photon hits
 ClassImp(AliTRDpoints)
 
 //_____________________________________________________________________________
-AliTRDpoints::AliTRDpoints():AliPoints()
+AliTRDpoints::AliTRDpoints()
+  :AliPoints()
+  ,fNTRpoints(0)
+  ,fTRpolyMarker(0)
 {
   //
   // Default constructor
   //
 
-  fNTRpoints    = 0;
-  fTRpolyMarker = 0;
-
 }
 
 //_____________________________________________________________________________
-AliTRDpoints::AliTRDpoints(Int_t nhitsE, Int_t nhitsT):AliPoints(nhitsE)
+AliTRDpoints::AliTRDpoints(Int_t nhitsE, Int_t nhitsT)
+  :AliPoints(nhitsE)
+  ,fNTRpoints(nhitsT)
+  ,fTRpolyMarker(0)
 {
   //
   // Standard constructor
   //
 
-  fNTRpoints    = nhitsT;
-  fTRpolyMarker = 0;
-
 }
         
 //_____________________________________________________________________________
 AliTRDpoints::AliTRDpoints(const AliTRDpoints &p)
+  :AliPoints(p)
+  ,fNTRpoints(p.fNTRpoints)
+  ,fTRpolyMarker(0)
 {
   //
   // Copy contructor
   //
-  ((AliTRDpoints &) p).Copy(*this);
+
+  for (Int_t i = 0; i < 3*fNTRpoints; i++) {
+    ((AliTRDpoints &) p).fTRpoints[i] = fTRpoints[i];
+  }
 
 }
 
@@ -81,7 +79,10 @@ AliTRDpoints::~AliTRDpoints()
   // Default destructor
   //
 
-  if (fTRpolyMarker) delete fTRpolyMarker;
+  if (fTRpolyMarker) {
+    delete fTRpolyMarker;
+    fTRpolyMarker = 0;
+  }
 
 }
 
@@ -98,7 +99,7 @@ AliTRDpoints &AliTRDpoints::operator=(const AliTRDpoints &p)
 }
 
 //_____________________________________________________________________________
-void AliTRDpoints::Copy(TObject &p)
+void AliTRDpoints::Copy(TObject &p) const
 {
   //
   // Copy function
@@ -120,7 +121,6 @@ void AliTRDpoints::Draw(Option_t *option)
 
   AliPoints::Draw(option);
 
-  //if (fTRpolyMarker) delete fTRpolyMarker;
   if (fNTRpoints) {
     fTRpolyMarker = new TPolyMarker3D(fNTRpoints,fTRpoints,29);
     fTRpolyMarker->SetMarkerColor(2); 
@@ -137,15 +137,14 @@ void AliTRDpoints::SetTRpoints(Int_t n, Float_t *coor)
   // Sets the number and the coordinates of the photon hits
   //
 
-  if (kNTRpoints >= 3 * n) {
+  if (kNTRpoints >= 3*n) {
     fNTRpoints = n;
     for (Int_t i = 0; i < 3*n; i++) {
       fTRpoints[i] = coor[i];
     } 
   }
   else {
-    printf("AliTRDpoints::SetTRpoints -- ");
-    printf("Boundary error: %d/%d\n",3*n,kNTRpoints);
+    AliError(Form("Boundary error: %d/%d\n",3*n,kNTRpoints));
   }
 
 }