]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCLaserTracks.cxx
Macros to load TPC calib libraries
[u/mrichter/AliRoot.git] / TPC / AliTPCLaserTracks.cxx
index 6255f1754a137bdc2b3e5b1795b928a6befc592c..0986e3a0b1ff0f7db09423b4316b7c69fec1fff0 100644 (file)
@@ -43,7 +43,7 @@
  
 */
 
-#include <iostream.h>
+#include <Riostream.h>
 #include <TString.h>
 #include <TPolyLine3D.h>
 #include <TMath.h>
 
 ClassImp(AliTPCLaserTracks)
 
-AliTPCLaserTracks::AliTPCLaserTracks():
+  AliTPCLaserTracks::AliTPCLaserTracks():TObject(),
     fId(-1),
     fSide(-1),
     fRod(-1),
     fBundle(-1),
     fBeam(-1),
-    fX(0),
-    fY(0),
-    fZ(0),
-    fPhi(0),
-    fTheta(0),
+    fX(0.),
+    fY(0.),
+    fZ(0.),
+    fTime(0.),
+    fPhi(0.),
+    fTheta(0.),
     fMaxSize(0),
     fNpoints(0),
     fXarr(0x0),
@@ -89,17 +90,18 @@ AliTPCLaserTracks::AliTPCLaserTracks():
 }
 
 //_______________________________________________________________________
-AliTPCLaserTracks::AliTPCLaserTracks(Int_t npoints):
+AliTPCLaserTracks::AliTPCLaserTracks(Int_t npoints):TObject(),
     fId(-1),
     fSide(-1),
     fRod(-1),
     fBundle(-1),
     fBeam(-1),
-    fX(0),
-    fY(0),
-    fZ(0),
-    fPhi(0),
-    fTheta(0),
+    fX(0.),
+    fY(0.),
+    fZ(0.),
+    fTime(0.),
+    fPhi(0.),
+    fTheta(0.),
     fMaxSize(0),
     fNpoints(0),
     fXarr(0x0),
@@ -113,6 +115,39 @@ AliTPCLaserTracks::AliTPCLaserTracks(Int_t npoints):
     fNpoints = npoints;
     InitPoints();
 }
+//______________________________________________________________________
+AliTPCLaserTracks::AliTPCLaserTracks(const AliTPCLaserTracks &param):TObject(),
+    fId(-1),
+    fSide(-1),
+    fRod(-1),
+    fBundle(-1),
+    fBeam(-1),
+    fX(0.),
+    fY(0.),
+    fZ(0.),
+    fTime(0.),
+    fPhi(0.),
+    fTheta(0.),
+    fMaxSize(0),
+    fNpoints(0),
+    fXarr(0x0),
+    fYarr(0x0),
+    fZarr(0x0)
+{
+  //
+  // dummy
+  //
+  fPhi=param.fPhi;
+}
+//______________________________________________________________________
+AliTPCLaserTracks & AliTPCLaserTracks::operator=(const AliTPCLaserTracks & param)
+{
+  //
+  // assignment operator - dummy
+  //
+  fPhi=param.fPhi;
+  return (*this);
+}
 
 //_______________________________________________________________________
 Double_t AliTPCLaserTracks::FindBeamLength(TVector3 vF, TVector3 vP)
@@ -157,11 +192,12 @@ Double_t AliTPCLaserTracks::FindBeamLength(TVector3 vF, TVector3 vP)
 
 
            //if we cross two boarders on our way return the closer boarder
-            if ( n1>0 && n2>0 )
+            if ( (n1>0) && (n2>0) ) {
                if ( (vF-vI1).Mag() <= (vF-vI2).Mag() )
                    return (vF-vI1).Mag();
                else
-                   return (vF-vI2).Mag();
+                   return (vF-vI2).Mag();
+           }
 
            if ( n1>0 )
                return (vF-vI1).Mag();
@@ -292,15 +328,21 @@ void AliTPCLaserTracks::WriteTreeDesignData()
 //_______________________________________________________________________
 TPolyLine3D* AliTPCLaserTracks::GetLine()
 {
+  //
+  // Make a polilyne object oout of the points
+  //
    if ( fNpoints ) return new TPolyLine3D(fNpoints,fXarr,fYarr,fZarr);
 
     return 0x0;
 }
 
 //_______________________________________________________________________
-TObjArray* AliTPCLaserTracks::GetLines(Char_t* file, Char_t *cuts)
+TObjArray* AliTPCLaserTracks::GetLines(const Char_t* file, const Char_t *cuts)
 {
-
+  //
+  // Read the input files with the laser track 
+  // Make a array of polylines for visualization
+  
     TObjArray *array = new TObjArray;
 
     TFile *f = TFile::Open(file,"read");
@@ -398,9 +440,8 @@ Int_t AliTPCLaserTracks::FindMirror(Char_t *file, Double_t x, Double_t y, Double
            id = ltp->GetId();
        }
     }
-
-    return id;
     delete f;
+    return id;
 }
 
 //_______________________________________________________________________
@@ -411,7 +452,7 @@ AliTPCLaserTracks::~AliTPCLaserTracks()
     //
 
 //    if ( fP ) delete fP;
-    if ( fXarr ) delete fXarr;
-    if ( fYarr ) delete fYarr;
-    if ( fZarr ) delete fZarr;
+    if ( fXarr ) delete [] fXarr;
+    if ( fYarr ) delete [] fYarr;
+    if ( fZarr ) delete [] fZarr;
 }