/* $Id$ // Author: Constantin Loizides */ #include #include #include #include #include #include "AliL3VHDLClusterFinder.h" /** \class AliL3VHDLClusterFinder //
//____________________________________________________
// AliL3VHDLClusterFinder
//
// The current VHDL cluster finder for HLT
// Based on STAR L3
//
// Most important parameters:
// fThreshold - threshold for noise clusters
// fMatch - length in time for overlapping sequences
//
*/ ClassImp(AliL3VHDLClusterFinder) AliL3VHDLClusterFinder::AliL3VHDLClusterFinder() { fMatch = 4; fThreshold = 10; fMinMerge = 1; fNClusters=0; fXYErr = 0.2; fZErr = 0.3; fDeconvPad = kTRUE; fDeconvTime = kTRUE; fstdout = kFALSE; fcalcerr = kTRUE; Clear(); #ifdef DEBUG fdeb=fopen("vhdlclusterfinder.debug","w"); //fdeb=stderr; #endif } AliL3VHDLClusterFinder::~AliL3VHDLClusterFinder() { #ifdef DEBUG fclose(fdeb); #endif } void AliL3VHDLClusterFinder::ProcessDigits() { //Loop over data like the analyzer of the VHDL code const UChar_t n=255; UShort_t rrow=0,rtime=0; UChar_t rpad=0,i=n; UShort_t *charges=new UShort_t[n]; Int_t tc=0,mp=0,mt=0,sp=0,st=0; fNClusters=0; fRow=0; fPad=0; Clear(); //loop over input data while(fAltromem.ReadSequence(rrow,rpad,rtime,i,&charges)){ tc=0;mp=0;mt=0;sp=0;st=0; #if 0 cout << "Padrow " << (int)rrow << " pad " << (int)rpad << " time " <<(int)rtime << " charges "; for(UChar_t ii=0;iifMatch){ //no match IncRPointer(); //cluster finished continue; } else if(diff<-fMatch){ //no match break; //insert new cluster } else { //match found, merge it MergeSeq(); return; } } InsertSeq(); //start new cluster } void AliL3VHDLClusterFinder::MergeSeq() { #ifdef DEBUG fprintf(fdeb,"merged with Mean=%d TC=%d (new Merge=%d)\n",fSeqs[fPList[fRP]].fMean,fSeqs[fPList[fRP]].fTotalCharge,fSeqs[fPList[fRP]].fMerge+1); #endif if(fSeqs[fPList[fRP]].fRow==fSeq.fRow){ LOG(AliL3Log::kWarning,"AliL3VHDLClusterFinder::","Memory Check") <<"Sequences can be merged on the same rows only."<=N_clmem) return; //nothing to do //if(index>=N_clmem) continue; //nothing to do tc=fSeqs[index].fTotalCharge; mno=fSeqs[index].fMerge; row=fSeqs[index].fRow; if(tc!=0){ mtime=(Float_t)(fSeqs[index].fTime)/tc; mtime2=sqrt((Float_t)(fSeqs[index].fTime2)/tc-mtime*mtime); } if(tc!=0){ mpad=(Float_t)(fSeqs[index].fPad)/tc; mpad2=sqrt((Float_t)(fSeqs[index].fPad2)/tc-mpad*mpad); } if(mno=N) p=UShort_t(pp-N); else if(pp<0) p=UShort_t(pp+N); else p=UShort_t(pp); } inline void AliL3VHDLClusterFinder::IncRPointer(){ IncPointer(fRP); } inline void AliL3VHDLClusterFinder::IncWPointer(){ IncPointer(fWP); if(fWP==fOP){ LOG(AliL3Log::kWarning,"AliL3VHDLClusterFinder::IncWPointer","Memory Check") <<"Write pointer overwrites output pointer."<= fMaxNClusters) { LOG(AliL3Log::kError,"AliL3ClustFinder::WriteClusters","Cluster Finder") <