//$Id$ // Author: Constantin Loizides //*-- Copyright&Copy CL #include "AliL3StandardIncludes.h" #include "AliL3RootTypes.h" #include "AliL3Logging.h" #include "AliL3MemHandler.h" #include "AliL3Transform.h" #include "AliL3DigitData.h" #include "AliL3HoughTransformerVhdl.h" #include "AliL3FFloat.h" #if GCCVERSION == 3 using namespace std; #endif /** \class AliL3HoughTransformerVhdl //
//_____________________________________________________________
// AliL3HoughTransformerVhdl
//
// Hough transformation class for VHDL comparism.
//
//
*/ ClassImp(AliL3HoughTransformerVhdl) AliL3HoughTransformerVhdl::AliL3HoughTransformerVhdl() : AliL3HoughTransformerLUT() { fEpsilon=0; fSinEpsilon=0; fCosEpsilon=1; fIts=0; } AliL3HoughTransformerVhdl::AliL3HoughTransformerVhdl(Int_t slice,Int_t patch,Int_t n_eta_segments,Int_t n_its) : AliL3HoughTransformerLUT(slice,patch,n_eta_segments) { fEpsilon=0; fSinEpsilon=0; fCosEpsilon=1; fIts=n_its; } AliL3HoughTransformerVhdl::~AliL3HoughTransformerVhdl() { } void AliL3HoughTransformerVhdl::CreateHistograms(Int_t nxbin,Double_t pt_min,Int_t nybin,Double_t phimin,Double_t phimax) { AliL3HoughTransformerLUT::CreateHistograms(nxbin,pt_min,nybin,phimin,phimax); } void AliL3HoughTransformerVhdl::CreateHistograms(Int_t nxbin,Double_t xmin,Double_t xmax, Int_t nybin,Double_t ymin,Double_t ymax) { AliL3HoughTransformerLUT::CreateHistograms(nxbin,xmin,xmax,nybin,ymin,ymax); fEpsilon=(ymax-ymin)/nybin; fSinEpsilon=sin(fEpsilon); fCosEpsilon=cos(fEpsilon); fNxbin=nxbin; fXmin=xmin; fXmax=xmax; fNybin=nybin; fYmin=ymin; fYmax=ymax; //cout << fEpsilon << " - " << (xmax-xmin)/nxbin << endl; } void AliL3HoughTransformerVhdl::Init(Int_t slice,Int_t patch,Int_t n_eta_segments,Int_t n_its) { AliL3HoughTransformerLUT::Init(slice,patch,n_eta_segments); } void AliL3HoughTransformerVhdl::TransformCircle() { //Transform the input data with a circle HT. //The function loops over all the data, and transforms each pixel with the equation: // //kappa = lastkappa +- epsilon * lastkappaprime // //kappaprime = lastkappaprime -+ epsilon * lastkappa // //Each pixel then transforms into a curve in the (kappa,phi0)-space. In order to find //which histogram in which the pixel should be transformed, the eta-value is calcluated //and the proper histogram index is found by GetEtaIndex(eta). AliL3DigitRowData *tempPt = GetDataPointer(); if(!tempPt) { LOG(AliL3Log::kError,"AliL3HoughTransformerVhdl::TransformCircle","Data") <<"No input data "<fDigitData; if(i != (Int_t)tempPt->fRow) { LOG(AliL3Log::kError,"AliL3HoughTransformerVhdl::TransformCircle","Data") <<"AliL3HoughTransformerLUT::TransformCircle : Mismatching padrow numbering "<max_error) { //cout << max_error << " - " << err << " " << kappa << " " << exact_kappa << " " << kappa/exact_kappa<< endl; max_error=err; } rel_error+=err; counter++; #endif //hist->Fill(kappa,fLUTphi0[b],charge); //cout << kappa << " " << fLUTphi0[b] << " " << charge << endl; } } //Move the data pointer to the next padrow: AliL3MemHandler::UpdateRowPointer(tempPt); } #ifdef use_error cout <<"Max Error: " << max_error << endl; cout <<"Rel Error average: " << rel_error/counter << endl; #endif } void AliL3HoughTransformerVhdl::Print() { AliL3HoughTransformerLUT::Print(); cout << "fEpsilon: " << fEpsilon << endl; cout << "fIts: " << fIts << endl; } void AliL3HoughTransformerVhdl::PrintVhdl() { cout << "fSlice := " << GetSlice() << ";" << endl; cout << "fPatch := " << GetPatch() << ";" << endl; //cout << "fSector := " << fSector << ";" << endl; //cout << "fSectorRow := " << fSectorRow << ";" << endl; //cout << "fMinRow := " << fMinRow << ";" << endl; //cout << "fMaxRow := " << fMaxRow << ";" << endl; //cout << "fNRows := " << fNRows << ";" << endl; //cout << "fNEtas := " << fNEtas << ";" << endl; //cout << "fNPhi0 := " << fNPhi0 << ";" << endl; cout << "fZSign := " << fZSign << ";" << endl; cout << "fZLengthPlusOff := " << fZLengthPlusOff << ";" << endl; cout << "fPadPitch := " << fPadPitch << ";" << endl; cout << "fTimeWidth := " << fTimeWidth << ";" << endl; if(!fNRows) return; cout << "fNLUTX :=" << fNRows << ";" << endl; cout << "fLUTX := ( "; for(Int_t i=0;i