From: vestbo Date: Wed, 29 May 2002 14:19:22 +0000 (+0000) Subject: Made display class work. Also added it to makefile. X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=1ed2ff53c31bc88ecfa7677fb1e58741e55bdc5b Made display class work. Also added it to makefile. --- diff --git a/HLT/hough/AliL3HoughDisplay.cxx b/HLT/hough/AliL3HoughDisplay.cxx index 85785d3fe26..db5ec665082 100644 --- a/HLT/hough/AliL3HoughDisplay.cxx +++ b/HLT/hough/AliL3HoughDisplay.cxx @@ -1,3 +1,5 @@ +//$Id$ + // Author: Anders Vestbo //*-- Copyright © 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"<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(); iGetLastRow(); i++) + for(Int_t i=AliL3Transform::GetFirstRow(0); iGetCrossingPoint(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; iGetCheckedTrack(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; hSetPoint(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...."<Draw("same"); - c1->x3d(); + //c1->x3d(); } + diff --git a/HLT/hough/AliL3HoughDisplay.h b/HLT/hough/AliL3HoughDisplay.h index 1ff8be09f31..97631d3f78e 100644 --- a/HLT/hough/AliL3HoughDisplay.h +++ b/HLT/hough/AliL3HoughDisplay.h @@ -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) diff --git a/HLT/hough/Makefile b/HLT/hough/Makefile index c343655dbc1..29a50e2c2d2 100644 --- a/HLT/hough/Makefile +++ b/HLT/hough/Makefile @@ -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