// @(#) $Id$ // Author: Constantin Loizides //*-- Copyright © ALICE HLT Group #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 __GNUC__ >= 3 using namespace std; #endif /** \class AliL3HoughTransformerVhdl //
//_____________________________________________________________
// AliL3HoughTransformerVhdl
//
// Hough transformation class for VHDL comparism.
//
//
*/ ClassImp(AliL3HoughTransformerVhdl) AliL3HoughTransformerVhdl::AliL3HoughTransformerVhdl() : AliL3HoughTransformerLUT() { //default ctor fEpsilon=0; fSinEpsilon=0; fCosEpsilon=1; fIts=0; } AliL3HoughTransformerVhdl::AliL3HoughTransformerVhdl(Int_t slice,Int_t patch,Int_t netasegments,Int_t nits) : AliL3HoughTransformerLUT(slice,patch,netasegments) { //normal ctor fEpsilon=0; fSinEpsilon=0; fCosEpsilon=1; fIts=nits; } AliL3HoughTransformerVhdl::~AliL3HoughTransformerVhdl() { //dtor } void AliL3HoughTransformerVhdl::CreateHistograms(Int_t nxbin,Float_t ptmin,Int_t nybin,Float_t phimin,Float_t phimax) { //Create histograms containing the hough space AliL3HoughTransformerLUT::CreateHistograms(nxbin,ptmin,nybin,phimin,phimax); } void AliL3HoughTransformerVhdl::CreateHistograms(Int_t nxbin,Float_t xmin,Float_t xmax, Int_t nybin,Float_t ymin,Float_t ymax) { //Create histograms containing the hough space 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 netasegments,Int_t /*nits*/) { //Init hough transformer AliL3HoughTransformerLUT::Init(slice,patch,netasegments); } 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() { //Print transformer params AliL3HoughTransformerLUT::Print(); cout << "fEpsilon: " << fEpsilon << endl; cout << "fIts: " << fIts << endl; } void AliL3HoughTransformerVhdl::PrintVhdl() const { //Print all transformer params 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