// Author: Anders Vestbo //*-- Copyright © ASV #include #include #include #include #include #include #include #include #include #include "AliL3Transform.h" #include "AliL3HoughTrack.h" #include "AliL3TrackArray.h" #include "AliL3HoughDisplay.h" #include "AliL3Defs.h" #include "AliL3MemHandler.h" //_____________________________________________________________ // Display class for Hough transform code ClassImp(AliL3HoughDisplay) AliL3HoughDisplay::AliL3HoughDisplay() { fTracks = 0; fDigitRowData = 0; fNDigitRowData = 0; fShowSlice = -1; fPatch = -1; Init(); } AliL3HoughDisplay::~AliL3HoughDisplay() { } void AliL3HoughDisplay::Init() { TFile *file = TFile::Open("/prog/alice/data/GEO/alice.geom"); if(!file->IsOpen()) cerr<<"AliL3HoughDisplay::AliL3HoughDisplay : Geometry file alice.geom does not exist"<Get("AliceGeom"); file->Close(); } void AliL3HoughDisplay::GenerateHits(AliL3HoughTrack *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++) { if(track->GetCrossingPoint(i,xyz)) { AliL3Transform::Local2Global(xyz,slice); x[n] = xyz[0]; y[n] = xyz[1]; z[n] = xyz[2]; n++; } else break; } } TPolyMarker3D *AliL3HoughDisplay::LoadDigits() { AliL3DigitRowData *tempPt = fDigitRowData; if(!tempPt) { cerr<<"AliL3HoughDisplay::LoadDigits : No data"<fNDigit; AliL3MemHandler::UpdateRowPointer(tempPt); } tempPt = fDigitRowData; TPolyMarker3D *pm = new TPolyMarker3D(count); Float_t xyz[3]; Int_t sector,row; count=0; for(UInt_t i=0; ifDigitData; Int_t padrow = (Int_t)tempPt->fRow; for(UInt_t j=0; jfNDigit; j++) { AliL3Transform::Slice2Sector(fShowSlice,padrow,sector,row); AliL3Transform::Raw2Global(xyz,sector,row,(Int_t)digPt->fPad,(Int_t)digPt->fTime); pm->SetPoint(count,xyz[0],xyz[1],xyz[2]); count++; } AliL3MemHandler::UpdateRowPointer(tempPt); } cout<<"Displaying "<cd(); TView *v = new TView(1); v->SetRange(-430,-560,-430,430,560,1710); c1->Clear(); c1->SetFillColor(1); c1->SetTheta(90.); c1->SetPhi(0.); Int_t ntracks = fTracks->GetNTracks(); TPolyLine3D *line = new TPolyLine3D[ntracks]; Int_t n; Float_t x[176],y[176],z[176]; for(Int_t j=0; jGetCheckedTrack(j); if(!track) continue; 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->Draw(); TPolyLine3D *current_line = &(line[j]); current_line = new TPolyLine3D(n,x,y,z,""); current_line->SetLineColor(1); current_line->Draw("same"); } if(fShowSlice>=0) { TPolyMarker3D *pm = LoadDigits(); pm->SetMarkerColor(2); pm->Draw("same"); } fGeom->Draw("same"); c1->x3d(); }