From: sgorbuno Date: Fri, 9 Sep 2011 21:13:42 +0000 (+0000) Subject: HWCFEmulator update X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=4d67c3e3d409df290e51b4f315e04a82fd4240e5 HWCFEmulator update --- diff --git a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFConsistencyControlComponent.cxx b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFConsistencyControlComponent.cxx index fc4a1ce2ecf..2049d740de3 100644 --- a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFConsistencyControlComponent.cxx +++ b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFConsistencyControlComponent.cxx @@ -151,10 +151,10 @@ int AliHLTTPCHWCFConsistencyControlComponent::DoInit( int argc, const char** arg fHistHeaderAll = new TH1F("hHWCFHeaderAll", "fHistHeaderAll",6,0.,6.); fHistHeaderGood = new TH1F("hHWCFHeaderGood", "fHistHeaderGood",6,0.,6.); - fHistClusterAll = new TH1F("hHWCFClusterAll", "fHistClusterAll",7,0.,7.); - fHistClusterGood = new TH1F("hHWCFClusterGood", "fHistClusterGood",7,0.,7.); + fHistClusterAll = new TH1F("hHWCFClusterAll", "fHistClusterAll",8,0.,8.); + fHistClusterGood = new TH1F("hHWCFClusterGood", "fHistClusterGood",8,0.,8.); fProfHeader = new TH1F("pHWCFHeader", "HWCF: Consistency of header data", 6, 0., 6.); - fProfCluster = new TH1F("pHWCFClusters", "HWCF: Consisteny of cluster data", 7, 0., 7.); + fProfCluster = new TH1F("pHWCFClusters", "HWCF: Consisteny of cluster data", 8, 0., 8.); TString arguments = ""; for ( int i = 0; i < argc; i++ ) { @@ -346,12 +346,12 @@ int AliHLTTPCHWCFConsistencyControlComponent::DoEvent( const AliHLTComponentEven for( unsigned long i=0; ifSize); if ( iter1->fDataType != (AliHLTTPCDefinitions::fgkHWClustersDataType | kAliHLTDataOriginTPC) ) continue; + if( checkedBlocks[ndx1] ) continue;// block already checked checkedBlocks[ndx1] = 1; @@ -374,6 +374,7 @@ int AliHLTTPCHWCFConsistencyControlComponent::DoEvent( const AliHLTComponentEven bool sameSize = 1; bool sameFlag = 1; + bool sameQMax = 1; bool sameCharge = 1; bool sameRow = 1; bool sameFloat[4] = {1,1,1,1}; @@ -423,20 +424,14 @@ int AliHLTTPCHWCFConsistencyControlComponent::DoEvent( const AliHLTComponentEven int startRCU1 = nWordsHeader; int startRCU2 = nWordsHeader; - - for( AliHLTInt32_t i=nWordsHeader; i>30 == 0x2 ){ - startRCU1 = i; - break; - } + + for( ; startRCU1>30 == 0x2 ) break; } - - for( AliHLTInt32_t i=nWordsHeader; i>30 == 0x2 ){ - startRCU2 = i; - break; - } - } + + for( ; startRCU2>30 == 0x2 ) break; + } // compare RCU headers @@ -458,19 +453,21 @@ int AliHLTTPCHWCFConsistencyControlComponent::DoEvent( const AliHLTComponentEven if( sameSize ) fHistHeaderGood->Fill(5); // compare clusters - + if( startRCU1 == startRCU2 ){ - for( AliHLTInt32_t i=nWordsHeader; i> 30; - AliHLTUInt32_t charge1 = ( header1 & 0xFFFFFF ) >> 6; - AliHLTUInt32_t row1 = header1 & 0x3f; + AliHLTUInt32_t qmax1 = ( header1 & 0xFFFFFF ) >> 6; + AliHLTUInt32_t row1 = (header1>>24) & 0x3f; AliHLTUInt32_t flag2 = header2 >> 30; - AliHLTUInt32_t charge2 = ( header2 & 0xFFFFFF ) >> 6; - AliHLTUInt32_t row2 = header2 & 0x3f; + AliHLTUInt32_t qmax2 = ( header2 & 0xFFFFFF ) >> 6; + AliHLTUInt32_t row2 = (header2>>24) & 0x3f; fHistClusterAll->Fill(0); if( flag1 == flag2 ) fHistClusterGood->Fill(0); @@ -478,11 +475,11 @@ int AliHLTTPCHWCFConsistencyControlComponent::DoEvent( const AliHLTComponentEven if( flag1!=0x3 || flag2!=0x3 ) continue; - // compare cluster charge + // compare cluster qMax fHistClusterAll->Fill(1); - if( charge1 == charge2 ) fHistClusterGood->Fill(1); - else sameCharge = 0; + if( qmax1 == qmax2 ) fHistClusterGood->Fill(1); + else sameQMax = 0; // compare cluster row index @@ -490,15 +487,21 @@ int AliHLTTPCHWCFConsistencyControlComponent::DoEvent( const AliHLTComponentEven if( row1 == row2 ) fHistClusterGood->Fill(2); else sameRow = 0; + // compare cluster charge + + fHistClusterAll->Fill(3); + if( charge1 == charge2 ) fHistClusterGood->Fill(3); + else sameCharge = 0; + // compare floating point data for( int j=0; j<4; j++ ){ - AliHLTFloat64_t f1 = *((AliHLTFloat32_t*)&p1[i+j]); - AliHLTFloat64_t f2 = *((AliHLTFloat32_t*)&p2[i+j]); + AliHLTFloat64_t f1 = *((AliHLTFloat32_t*)&p1[i+2+j]); + AliHLTFloat64_t f2 = *((AliHLTFloat32_t*)&p2[i+2+j]); double w = (fabs(f1) + fabs(f2))/2; if( w>1.e-20 ){ - fHistClusterAll->Fill(3+j); - if( fabs(f1 - f2) < 1.e-6*w ) fHistClusterGood->Fill(3+j); + fHistClusterAll->Fill(4+j); + if( fabs(f1 - f2) < 1.e-6*w ) fHistClusterGood->Fill(4+j); else sameFloat[j] = 0; } } @@ -523,6 +526,7 @@ int AliHLTTPCHWCFConsistencyControlComponent::DoEvent( const AliHLTComponentEven if( !sameRCU ){ err=1; warn+=", RCU header";} if( !sameSize ){ err=1; warn+=", N Clusters";} if( !sameFlag ){ err=1; warn+=", Cluster Header";} + if( !sameQMax ){ err=1; warn+=", Cluster Qmax";} if( !sameCharge ){ err=1; warn+=", Cluster Charge";} if( !sameRow ){ err=1; warn+=", Cluster Row";} if( !sameFloat[0] ){ err=1; warn+=", Cluster Pad value";} @@ -549,7 +553,7 @@ int AliHLTTPCHWCFConsistencyControlComponent::DoEvent( const AliHLTComponentEven delete[] checkedBlocks; HLTInfo("HWCF consistency check: %.10f %s of %ld data blocks are OK", - (double)(fNBlocks-fNDismatch)/(double)fNBlocks*100.,"%",fNBlocks); + (double)(fNBlocks-fNDismatch)/(double)fNBlocks*100.,"%",fNBlocks); //if( fNDismatch>0 ){ //HLTWarning("HWCF inconsistency: %ld of %ld data blocks are not OK", diff --git a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFDivisionUnit.cxx b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFDivisionUnit.cxx index 399978d7716..0298e501e7c 100644 --- a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFDivisionUnit.cxx +++ b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFDivisionUnit.cxx @@ -69,7 +69,7 @@ int AliHLTTPCHWCFDivisionUnit::InputStream( const AliHLTTPCHWCFClusterFragment * // input stream of data fkInput = fragment; if( fkInput && fDebug ){ - std::cout<<"HWCF Division: input F: "<fFlag<<" R: "<fRow + std::cout<<"HWCF Division: input Br: "<fBranch<<" F: "<fFlag<<" R: "<fRow <<" Q: "<<(fragment->fQ>>AliHLTTPCHWCFDefinitions::kFixedPoint) <<" P: "<fPad<<" Tmean: "<fTMean; if( fragment->fFlag==1 && fragment->fQ > 0 ){ diff --git a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulator.cxx b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulator.cxx index 80faa796f46..9aaa45337a7 100644 --- a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulator.cxx +++ b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulator.cxx @@ -82,12 +82,13 @@ void AliHLTTPCHWCFEmulator::Init( const AliHLTUInt32_t *mapping, AliHLTUInt32_t fChannelProcessor.SetSingleSeqLimit( (config1) & 0xFF ); fChannelProcessor.SetDeconvolutionTime( (config1>>24) & 0x1 ); - fChannelProcessor.SetUseTimeBinWindow( (config2>>4) & 0x1 ); + fChannelProcessor.SetUseTimeBinWindow( (config2>>8) & 0x1 ); fChannelMerger.SetByPassMerger( (config1>>27) & 0x1 ); fChannelMerger.SetDeconvolution( (config1>>25) & 0x1 ); fChannelMerger.SetMatchDistance( (config2) & 0xF ); + fChannelMerger.SetMatchTimeFollow( (config2>>9) & 0x1 ); fDivisionUnit.SetClusterLowerLimit( (config1>>8) & 0xFFFF ); fDivisionUnit.SetSinglePadSuppression( (config1>>26) & 0x1 ); @@ -210,7 +211,7 @@ void AliHLTTPCHWCFEmulator::CreateConfiguration bool doDeconvTime, bool doDeconvPad, bool doFlowControl, bool doSinglePadSuppression, bool bypassMerger, AliHLTUInt32_t clusterLowerLimit, AliHLTUInt32_t singleSeqLimit, - AliHLTUInt32_t mergerDistance, bool useTimeBinWindow, AliHLTUInt32_t chargeFluctuation, + AliHLTUInt32_t mergerDistance, bool useTimeBinWindow, AliHLTUInt32_t chargeFluctuation, bool useTimeFollow, AliHLTUInt32_t &configWord1, AliHLTUInt32_t &configWord2 ) { @@ -230,4 +231,5 @@ void AliHLTTPCHWCFEmulator::CreateConfiguration configWord2 |= ( (AliHLTUInt32_t)mergerDistance & 0xF ); configWord2 |= ( (AliHLTUInt32_t)chargeFluctuation & 0xF )<<4; configWord2 |= ( (AliHLTUInt32_t)useTimeBinWindow & 0x1 )<<8; + configWord2 |= ( (AliHLTUInt32_t)useTimeFollow & 0x1 )<<9; } diff --git a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulator.h b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulator.h index 6dfe4c0d578..9c90a281ca4 100644 --- a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulator.h +++ b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulator.h @@ -66,13 +66,13 @@ class AliHLTTPCHWCFEmulator ( bool doDeconvTime, bool doDeconvPad, bool doFlowControl, bool doSinglePadSuppression, bool bypassMerger, AliHLTUInt32_t clusterLowerLimit,AliHLTUInt32_t singleSeqLimit, - AliHLTUInt32_t mergerDistance, bool useTimeBinWindow, AliHLTUInt32_t chargeFluctuation, + AliHLTUInt32_t mergerDistance, bool useTimeBinWindow, AliHLTUInt32_t chargeFluctuation, bool useTimeFollow, AliHLTUInt32_t &configWord1, AliHLTUInt32_t &configWord2 ); /** create default configuration word **/ static void CreateDefaultConfiguration( AliHLTUInt32_t &configWord1, AliHLTUInt32_t &configWord2 ){ - CreateConfiguration(0,0,0,1,0,0,0, 3, 1, 0, configWord1, configWord2 ); + CreateConfiguration(0,0,0,1,0,0,0, 3, 1, 0, 1, configWord1, configWord2 ); } private: diff --git a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulatorComponent.cxx b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulatorComponent.cxx index f5fb854c673..98db2aa1dfa 100644 --- a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulatorComponent.cxx +++ b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulatorComponent.cxx @@ -63,6 +63,7 @@ AliHLTTPCHWCFEmulatorComponent::AliHLTTPCHWCFEmulatorComponent() fSingleSeqLimit(0), fMergerDistance(3), fUseTimeBinWindow(1), + fUseTimeFollow(1), fChargeFluctuation(0), fDebug(0), fCFSupport(), @@ -90,6 +91,7 @@ AliHLTTPCHWCFEmulatorComponent::AliHLTTPCHWCFEmulatorComponent(const AliHLTTPCHW fSingleSeqLimit(0), fMergerDistance(3), fUseTimeBinWindow(1), + fUseTimeFollow(1), fChargeFluctuation(0), fDebug(0), fCFSupport(), @@ -216,6 +218,7 @@ void AliHLTTPCHWCFEmulatorComponent::SetDefaultConfiguration() fSingleSeqLimit = 0; fMergerDistance = 3; fUseTimeBinWindow = 1; + fUseTimeFollow = 1; fChargeFluctuation = 0; fDebug = 0; fBenchmark.Reset(); @@ -230,7 +233,7 @@ int AliHLTTPCHWCFEmulatorComponent::ReadConfigurationString( const char* argume int iResult = 0; if ( !arguments ) return iResult; - + cout<<"["<= pTokens->GetEntries() ) ) ) break; + fUseTimeFollow = ( ( TObjString* )pTokens->At( i ) )->GetString().Atoi(); + HLTInfo( "Use of time follow algorithm is set to: %d", fUseTimeFollow ); + continue; + } + if ( argument.CompareTo( "-debug-level" ) == 0 ) { if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break; fDebug = ( ( TObjString* )pTokens->At( i ) )->GetString().Atoi(); @@ -444,7 +454,7 @@ int AliHLTTPCHWCFEmulatorComponent::DoEvent( const AliHLTComponentEventData& evt AliHLTUInt32_t configWord1=0, configWord2=0; AliHLTTPCHWCFEmulator::CreateConfiguration - ( fDoDeconvTime, fDoDeconvPad, fDoFlowControl, fDoSinglePadSuppression, fBypassMerger, fClusterLowerLimit, fSingleSeqLimit, fMergerDistance, fUseTimeBinWindow, fChargeFluctuation, configWord1, configWord2 ); + ( fDoDeconvTime, fDoDeconvPad, fDoFlowControl, fDoSinglePadSuppression, fBypassMerger, fClusterLowerLimit, fSingleSeqLimit, fMergerDistance, fUseTimeBinWindow, fChargeFluctuation, fUseTimeFollow, configWord1, configWord2 ); for ( unsigned long ndx = 0; ndx < evtData.fBlockCnt; ndx++ ) { diff --git a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulatorComponent.h b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulatorComponent.h index 2b1fcde08a3..0559f9c6afb 100644 --- a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulatorComponent.h +++ b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulatorComponent.h @@ -149,6 +149,7 @@ class AliHLTTPCHWCFEmulatorComponent : public AliHLTProcessor AliHLTUInt32_t fSingleSeqLimit; // cut sequences at this charge value AliHLTUInt32_t fMergerDistance; // max. distance in mean time between two pads to be merged bool fUseTimeBinWindow; // use timebin window + bool fUseTimeFollow; // use time follow algorithm for merging pads AliHLTUInt32_t fChargeFluctuation; // allowed charge fluctuation for peak finding Int_t fDebug; // debug level AliHLTTPCHWCFSupport fCFSupport; // !transient diff --git a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFMergerUnit.cxx b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFMergerUnit.cxx index de91b19f573..4023bf01531 100644 --- a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFMergerUnit.cxx +++ b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFMergerUnit.cxx @@ -94,7 +94,7 @@ int AliHLTTPCHWCFMergerUnit::InputStream( const AliHLTTPCHWCFClusterFragment *fr fInput.fSlope = 0; fInput.fLastQ = fInput.fQ; if( fDebug ){ - std::cout<<"Merger: input F: "<fFlag<<" R: "<fRow + std::cout<<"Merger: input Br: "<fBranch<<" F: "<fFlag<<" R: "<fRow <<" Q: "<<(fragment->fQ>>AliHLTTPCHWCFDefinitions::kFixedPoint) <<" P: "<fPad<<" Tmean: "<fTMean; if( fragment->fFlag==1 && fragment->fQ > 0 ){ @@ -201,28 +201,32 @@ const AliHLTTPCHWCFClusterFragment *AliHLTTPCHWCFMergerUnit::OutputStream() } // merge - - while( fSearchStart[ib]fInput.fTMean ){ + + AliHLTTPCHWCFClusterFragment *ret = 0; + + if( fSearchStart[ib]fInput.fTMean ){ AliHLTTPCHWCFClusterFragment &s = fSearchRange[ib][fSearchStart[ib]++]; if( fDeconvolute && s.fSlope && s.fLastQ fInput.fQ ) fInput.fSlope = 1; + if (fInput.fQmax < s.fQmax) fInput.fQmax = s.fQmax; + fInput.fQ += s.fQ; + fInput.fT += s.fT; + fInput.fT2 += s.fT2; + fInput.fP += s.fP; + fInput.fP2 += s.fP2; + fInput.fMC.insert(fInput.fMC.end(), s.fMC.begin(), s.fMC.end()); + if( !fMatchTimeFollow ) fInput.fTMean = s.fTMean; + ret = 0; } - // cout<<"merge search range at "< fInput.fQ ) fInput.fSlope = 1; - if (fInput.fQmax < s.fQmax) fInput.fQmax = s.fQmax; - fInput.fQ += s.fQ; - fInput.fT += s.fT; - fInput.fT2 += s.fT2; - fInput.fP += s.fP; - fInput.fP2 += s.fP2; - fInput.fMC.insert(fInput.fMC.end(), s.fMC.begin(), s.fMC.end()); - if( !fMatchTimeFollow ) fInput.fTMean = s.fTMean; } // insert fInsertRange[ib][fInsertEnd[ib]++] = fInput; fInput.fFlag = 0; - return 0; + return ret; } diff --git a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFPeakFinderUnit.cxx b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFPeakFinderUnit.cxx index 899047aa417..f5e2a3817c8 100644 --- a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFPeakFinderUnit.cxx +++ b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFPeakFinderUnit.cxx @@ -75,9 +75,9 @@ int AliHLTTPCHWCFPeakFinderUnit::Init() int AliHLTTPCHWCFPeakFinderUnit::InputStream( const AliHLTTPCHWCFBunch *bunch ) { // input stream of data - + if( bunch && fDebug ){ - printf("\nHWCF Processor: input bunch F %1d R %3d P %3d NS %2ld:\n", + printf("\nHWCF Peak Finder: input bunch F %1d R %3d P %3d NS %2ld:\n", bunch->fFlag, bunch->fRow, bunch->fPad, bunch->fData.size()); for( unsigned int i=0; ifData.size(); i++ ){ const AliHLTTPCHWCFDigit &d = bunch->fData[i]; @@ -117,12 +117,13 @@ const AliHLTTPCHWCFBunch *AliHLTTPCHWCFPeakFinderUnit::OutputStream() AliHLTUInt32_t n = fOutput.fData.size(); for( AliHLTUInt32_t i=0; i0 ) fOutput.fData[i-1].fPeak = 1; - } - if( slope && q > qLast + fChargeFluctuation ){ // minimum + AliHLTUInt32_t q = fOutput.fData[i].fQ; + if( !slope ){ + if(q + fChargeFluctuation < qLast ){ // peak + slope = 1; + if( i>0 ) fOutput.fData[i-1].fPeak = 1; + } + }else if( q > qLast + fChargeFluctuation ){ // minimum slope = 0; if( i>0 ) fOutput.fData[i-1].fPeak = 2; } diff --git a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFProcessorUnit.cxx b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFProcessorUnit.cxx index e0d9a03e97b..624c4029c36 100644 --- a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFProcessorUnit.cxx +++ b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFProcessorUnit.cxx @@ -88,7 +88,7 @@ int AliHLTTPCHWCFProcessorUnit::InputStream( const AliHLTTPCHWCFBunch *bunch ) bunch->fFlag, bunch->fRow, bunch->fPad, bunch->fData.size()); for( unsigned int i=0; ifData.size(); i++ ){ AliHLTTPCHWCFDigit d = bunch->fData[i]; - printf(" q %2d t %3d ", d.fQ, d.fTime); + printf(" q %2d t %3d peak %2d ", d.fQ, d.fTime, d.fPeak); printf("("); for( int j=0; j<3; j++ ) printf(" {%d,%2.0f}",d.fMC.fClusterID[j].fMCID, d.fMC.fClusterID[j].fWeight ); printf(" )\n"); @@ -135,11 +135,11 @@ const AliHLTTPCHWCFClusterFragment *AliHLTTPCHWCFProcessorUnit::OutputStream() if( fkBunch->fFlag < 1 ) return 0; while( fBunchIndexfData.size() ){ - + AliHLTUInt32_t iStart = fBunchIndex; AliHLTUInt32_t iPeak = fBunchIndex; AliHLTUInt32_t qPeak = 0; - + // find next/best peak for( ; fBunchIndexfData.size(); fBunchIndex++ ){ @@ -147,6 +147,7 @@ const AliHLTTPCHWCFClusterFragment *AliHLTTPCHWCFProcessorUnit::OutputStream() if( d.fPeak != 1 ) continue; if( fDeconvolute ){ iPeak = fBunchIndex; + qPeak = d.fQ; fBunchIndex++; break; } else { @@ -156,26 +157,47 @@ const AliHLTTPCHWCFClusterFragment *AliHLTTPCHWCFProcessorUnit::OutputStream() } } } - - // find next minimum + + if( qPeak == 0 ) return 0; - for( ; fBunchIndexfData.size(); fBunchIndex++ ){ - if( fDeconvolute ){ - if( fkBunch->fData[fBunchIndex].fPeak != 0 ){ - fBunchIndex++; - break; + // find next minimum !!! At the moment the minimum finder is on only when no timebin window set + + if( !fUseTimeBinWindow ){ + for( ; fBunchIndexfData.size(); fBunchIndex++ ){ + if( fDeconvolute ){ + if( fkBunch->fData[fBunchIndex].fPeak != 0 ){ + fBunchIndex++; + break; + } + } + } + } else{ + if( !fDeconvolute ){ + fBunchIndex = fkBunch->fData.size(); + } else { + // find next peak + if( fBunchIndex+1fData.size() && fkBunch->fData[fBunchIndex+1].fPeak==1 ){ + fBunchIndex = fBunchIndex+1; + } else if( fBunchIndex+2fData.size() && fkBunch->fData[fBunchIndex+2].fPeak==1 ){ + fBunchIndex = fBunchIndex+1; + } else if( fBunchIndex+3fData.size() && fkBunch->fData[fBunchIndex+3].fPeak==1 ){ + fBunchIndex = fBunchIndex+2; + } else if( fBunchIndex+1fData.size() ){ + fBunchIndex = fBunchIndex+2; + } else if( fBunchIndexfData.size() ){ + fBunchIndex = fBunchIndex+1; } } } - - AliHLTUInt32_t iEnd = fBunchIndex; + AliHLTUInt32_t iEnd = fBunchIndex; + if( fUseTimeBinWindow ){ if( iPeak > iStart + kHalfTimeBinWindow ) iStart = iPeak - kHalfTimeBinWindow; - if( iEnd > iPeak + kHalfTimeBinWindow ) iEnd = iPeak + kHalfTimeBinWindow; + if( iEnd > iPeak + kHalfTimeBinWindow + 1) iEnd = iPeak + kHalfTimeBinWindow + 1; } - fOutput.fQmax = 0; + fOutput.fQmax = qPeak*fkBunch->fGain; fOutput.fQ = 0; fOutput.fT = 0; fOutput.fT2 = 0; @@ -186,8 +208,7 @@ const AliHLTTPCHWCFClusterFragment *AliHLTTPCHWCFProcessorUnit::OutputStream() for( AliHLTUInt32_t i=iStart; ifData[i]; - AliHLTUInt64_t q = d.fQ*fkBunch->fGain; - if (fOutput.fQmax < q) fOutput.fQmax = q; + AliHLTUInt64_t q = d.fQ*fkBunch->fGain; fOutput.fQ += q; fOutput.fT += q*d.fTime; fOutput.fT2+= q*d.fTime*d.fTime; diff --git a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFSupport.cxx b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFSupport.cxx index fff57bbd281..1cd5077c6a1 100644 --- a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFSupport.cxx +++ b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFSupport.cxx @@ -260,6 +260,7 @@ AliHLTUInt32_t *AliHLTTPCHWCFSupport::ReadMapping( int slice, int patch, const c AliHLTUInt32_t branch = (hwAdd >> 11) & 0x1; rowBranchPadHw[nRead] = (row<<25) | (branch<<24) | (pad<<16) | hwAdd; + nRead++; err = 0; }