]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Made display class work. Also added it to makefile.
authorvestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 29 May 2002 14:19:22 +0000 (14:19 +0000)
committervestbo <vestbo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 29 May 2002 14:19:22 +0000 (14:19 +0000)
HLT/hough/AliL3HoughDisplay.cxx
HLT/hough/AliL3HoughDisplay.h
HLT/hough/Makefile

index 85785d3fe26892ffafb6a1749ad817e141634a85..db5ec6650824b808b9fdff7ec353ed4654c1f2ed 100644 (file)
@@ -1,3 +1,5 @@
+//$Id$
+
 // Author: Anders Vestbo <mailto:vestbo@fi.uib.no>
 //*-- Copyright &copy ASV 
 
@@ -15,7 +17,6 @@
 #include "AliL3HoughTrack.h"
 #include "AliL3TrackArray.h"
 #include "AliL3HoughDisplay.h"
-#include "AliL3Defs.h"
 #include "AliL3MemHandler.h"
 
 //_____________________________________________________________
@@ -32,33 +33,40 @@ AliL3HoughDisplay::AliL3HoughDisplay()
   fNDigitRowData = 0;
   fShowSlice = -1;
   fPatch = -1;
-  Init();
 }
 
 AliL3HoughDisplay::~AliL3HoughDisplay()
 {
+  if(fTracks)
+    delete fTracks;
 }
 
-void AliL3HoughDisplay::Init()
+void AliL3HoughDisplay::Init(Char_t *trackfile)
 {
   TFile *file = TFile::Open("$(LEVEL3)/GEO/alice.geom");
   if(!file->IsOpen())
     cerr<<"AliL3HoughDisplay::AliL3HoughDisplay : Geometry file alice.geom does not exist"<<endl;
   fGeom = (TGeometry*)file->Get("AliceGeom");
   file->Close();
+  
+  fTracks = new AliL3TrackArray();
+  AliL3MemHandler *tfile = new AliL3MemHandler();
+  tfile->SetBinaryInput(trackfile);
+  tfile->Binary2TrackArray(fTracks);
+  tfile->CloseBinaryInput();
+  delete tfile;
 }
 
 
-void AliL3HoughDisplay::GenerateHits(AliL3HoughTrack *track,Float_t *x,Float_t *y,Float_t *z,Int_t &n)
+void AliL3HoughDisplay::GenerateHits(AliL3Track *track,Float_t *x,Float_t *y,Float_t *z,Int_t &n)
 {
   n=0;
   Float_t xyz[3];
-  Int_t slice = track->GetSlice();
-  for(Int_t i=track->GetFirstRow(); i<track->GetLastRow(); i++)
+  for(Int_t i=AliL3Transform::GetFirstRow(0); i<AliL3Transform::GetLastRow(5); i++)
     {
       if(track->GetCrossingPoint(i,xyz))
        {
-         AliL3Transform::Local2Global(xyz,slice);
+         AliL3Transform::Local2Global(xyz,0);
          x[n] = xyz[0];
          y[n] = xyz[1];
          z[n] = xyz[2];
@@ -79,7 +87,7 @@ TPolyMarker3D *AliL3HoughDisplay::LoadDigits()
       return 0;
     }
   
-  Int_t nrows = NRows[fPatch][1] - NRows[fPatch][0] + 1;
+  UInt_t nrows = AliL3Transform::GetNRows(fPatch);
   Int_t count=0;
   for(UInt_t i=0; i<nrows; i++)
     {
@@ -115,7 +123,7 @@ void AliL3HoughDisplay::DisplayEvent()
   
   if(!fTracks)
     {
-      printf("AliL3HoughDisplay::DisplayTracks() : No tracks\n");
+      cerr<<"AliL3HoughDisplay::DisplayTracks() : No tracks"<<endl;
       return;
     }
   
@@ -137,18 +145,20 @@ void AliL3HoughDisplay::DisplayEvent()
   Float_t x[176],y[176],z[176];
   for(Int_t j=0; j<ntracks; j++)
     {
-      AliL3HoughTrack *track = (AliL3HoughTrack*)fTracks->GetCheckedTrack(j); 
+      AliL3Track *track = fTracks->GetCheckedTrack(j); 
       if(!track) continue;        
+      track->CalculateHelix();
       GenerateHits(track,x,y,z,n);
       TPolyMarker3D *pm = new TPolyMarker3D(n);
+      
       for(Int_t h=0; h<n; h++)
        pm->SetPoint(h,x[h],y[h],z[h]);
       
-      pm->SetMarkerColor(1);
+      pm->SetMarkerColor(2);
       pm->Draw();
       TPolyLine3D *current_line = &(line[j]);
       current_line = new TPolyLine3D(n,x,y,z,"");
-      current_line->SetLineColor(1);
+      current_line->SetLineColor(4);
       current_line->Draw("same");
       
     }
@@ -160,6 +170,8 @@ void AliL3HoughDisplay::DisplayEvent()
       pm->Draw("same");
     }
   
+  cout<<"Displaying...."<<endl;
   fGeom->Draw("same");
-  c1->x3d();
+  //c1->x3d();
 }
+  
index 1ff8be09f3149664d9a911346f01225fe85dd863..97631d3f78e0355c21e90ef0bad18a6af9dac71e 100644 (file)
@@ -7,7 +7,7 @@ class TGeometry;
 class AliL3TrackArray;
 class AliL3DigitRowData;
 class TPolyMarker3D;
-class AliL3HoughTrack;
+class AliL3Track;
 
 class AliL3HoughDisplay {
 
@@ -20,16 +20,16 @@ class AliL3HoughDisplay {
   Int_t fShowSlice; 
   Int_t fPatch;
   
-  void GenerateHits(AliL3HoughTrack *track,Float_t *x,Float_t *y,Float_t *z,Int_t &n);
-  void Init();
+  void GenerateHits(AliL3Track *track,Float_t *x,Float_t *y,Float_t *z,Int_t &n);
+  
   TPolyMarker3D *LoadDigits();
 
  public:
   AliL3HoughDisplay();
   virtual ~AliL3HoughDisplay();
-
+  
+  void Init(Char_t *trackfile);
   void DisplayEvent();
-  void SetTracks(AliL3TrackArray *tracks) {fTracks = tracks;}
   void ShowData(AliL3DigitRowData *data,UInt_t size,Int_t slice,Int_t patch);
 
   ClassDef(AliL3HoughDisplay,1) 
index c343655dbc163be6fda1b2ec094cd669fba8994a..29a50e2c2d29459437aaa0556c6fcadbca0f9df2 100644 (file)
@@ -57,7 +57,7 @@ SRCS  = AliL3HoughTransformer.cxx AliL3Hough.cxx AliL3HoughTrack.cxx\
          AliL3HoughMaxFinder.cxx AliL3HoughEval.cxx AliL3HoughMerger.cxx \
          AliL3Histogram.cxx AliL3Histogram1D.cxx AliL3HoughBaseTransformer.cxx \
          AliL3HoughIntMerger.cxx AliL3HoughGlobalMerger.cxx \
-         AliL3HoughTransformerVhdl.cxx
+         AliL3HoughTransformerVhdl.cxx AliL3HoughDisplay.cxx
 
 DICT = AliL3HoughCint.cxx
 DICTH = AliL3HoughCint.h