// @(#) $Id$ // Author: Constantin Loizides //*-- Copyright © ALICE HLT Group #include "AliHLTStandardIncludes.h" #include "AliHLTRootTypes.h" #include "AliHLTLogging.h" #include "AliHLTMemHandler.h" #include "AliHLTTransform.h" #include "AliHLTDigitData.h" #include "AliHLTHoughTransformerVhdl.h" #include "AliHLTFFloat.h" #if __GNUC__ >= 3 using namespace std; #endif /** \class AliHLTHoughTransformerVhdl //
//_____________________________________________________________
// AliHLTHoughTransformerVhdl
//
// Hough transformation class for VHDL comparism.
//
//
*/ ClassImp(AliHLTHoughTransformerVhdl) AliHLTHoughTransformerVhdl::AliHLTHoughTransformerVhdl() : AliHLTHoughTransformerLUT() { //default ctor fEpsilon=0; fSinEpsilon=0; fCosEpsilon=1; fIts=0; } AliHLTHoughTransformerVhdl::AliHLTHoughTransformerVhdl(Int_t slice,Int_t patch,Int_t netasegments,Int_t nits) : AliHLTHoughTransformerLUT(slice,patch,netasegments) { //normal ctor fEpsilon=0; fSinEpsilon=0; fCosEpsilon=1; fIts=nits; } AliHLTHoughTransformerVhdl::~AliHLTHoughTransformerVhdl() { //dtor } void AliHLTHoughTransformerVhdl::CreateHistograms(Int_t nxbin,Float_t ptmin,Int_t nybin,Float_t phimin,Float_t phimax) { //Create histograms containing the hough space AliHLTHoughTransformerLUT::CreateHistograms(nxbin,ptmin,nybin,phimin,phimax); } void AliHLTHoughTransformerVhdl::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 AliHLTHoughTransformerLUT::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 AliHLTHoughTransformerVhdl::Init(Int_t slice,Int_t patch,Int_t netasegments,Int_t /*nits*/) { //Init hough transformer AliHLTHoughTransformerLUT::Init(slice,patch,netasegments); } void AliHLTHoughTransformerVhdl::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). AliHLTDigitRowData *tempPt = GetDataPointer(); if(!tempPt) { LOG(AliHLTLog::kError,"AliHLTHoughTransformerVhdl::TransformCircle","Data") <<"No input data "<fDigitData; if(i != (Int_t)tempPt->fRow) { LOG(AliHLTLog::kError,"AliHLTHoughTransformerVhdl::TransformCircle","Data") <<"AliHLTHoughTransformerLUT::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: AliHLTMemHandler::UpdateRowPointer(tempPt); } #ifdef use_error cout <<"Max Error: " << max_error << endl; cout <<"Rel Error average: " << rel_error/counter << endl; #endif } void AliHLTHoughTransformerVhdl::Print() { //Print transformer params AliHLTHoughTransformerLUT::Print(); cout << "fEpsilon: " << fEpsilon << endl; cout << "fIts: " << fIts << endl; } void AliHLTHoughTransformerVhdl::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