From: loizides Date: Fri, 14 Jun 2002 21:40:18 +0000 (+0000) Subject: Created cluster finder class that simulates the VHDL cluster finder on Altro data. X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=8e1f5064d69afcd219089b70f362f6ff15247814 Created cluster finder class that simulates the VHDL cluster finder on Altro data. --- diff --git a/HLT/misc/AliL3MiscLinkDef.h b/HLT/misc/AliL3MiscLinkDef.h index ec6d87d6304..f28b4e25860 100644 --- a/HLT/misc/AliL3MiscLinkDef.h +++ b/HLT/misc/AliL3MiscLinkDef.h @@ -9,5 +9,6 @@ #pragma link C++ class AliTransBit_v2; #pragma link C++ class AliL3AltroMemHandler; #pragma link C++ class AliL3DataHandler; +#pragma link C++ class AliL3VHDLClusterFinder; #endif diff --git a/HLT/misc/AliL3VHDLClusterFinder.cxx b/HLT/misc/AliL3VHDLClusterFinder.cxx new file mode 100644 index 00000000000..f451903f9cb --- /dev/null +++ b/HLT/misc/AliL3VHDLClusterFinder.cxx @@ -0,0 +1,404 @@ +/* $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") + <