From ee4d1bf04831a4e38cacc8bd83db409edef7f878 Mon Sep 17 00:00:00 2001 From: sgorbuno Date: Thu, 11 Aug 2011 23:03:20 +0000 Subject: [PATCH] timebin window introduced --- .../HWCFemulator/AliHLTTPCHWCFEmulator.cxx | 7 ++- .../HWCFemulator/AliHLTTPCHWCFEmulator.h | 4 +- .../AliHLTTPCHWCFEmulatorComponent.cxx | 16 +++++- .../AliHLTTPCHWCFEmulatorComponent.h | 1 + .../AliHLTTPCHWCFProcessorUnit.cxx | 56 ++++++++++--------- .../HWCFemulator/AliHLTTPCHWCFProcessorUnit.h | 8 +++ 6 files changed, 60 insertions(+), 32 deletions(-) diff --git a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulator.cxx b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulator.cxx index 31f0afb5c5d..718125a136e 100644 --- a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulator.cxx +++ b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulator.cxx @@ -83,6 +83,8 @@ void AliHLTTPCHWCFEmulator::Init( const AliHLTUInt32_t *mapping, AliHLTUInt32_t fDivisionUnit.SetClusterLowerLimit( (config1>>8) & 0xFFFF ); fChannelProcessor.SetSingleSeqLimit( (config1) & 0xFF ); fChannelMerger.SetMatchDistance( (config2) & 0xF ); + fChannelProcessor.SetTimeBinWindow( (config2>>4) & 0xFF ); + fChannelProcessor.SetDebugLevel(fDebug); fChannelMerger.SetDebugLevel(fDebug); @@ -195,8 +197,8 @@ void AliHLTTPCHWCFEmulator::CreateConfiguration ( bool doDeconvTime, bool doDeconvPad, bool doFlowControl, bool doSinglePadSuppression, bool bypassMerger, - AliHLTUInt32_t clusterLowerLimit, AliHLTUInt32_t singleSeqLimit, AliHLTUInt32_t mergerDistance, - + AliHLTUInt32_t clusterLowerLimit, AliHLTUInt32_t singleSeqLimit, + AliHLTUInt32_t mergerDistance, AliHLTUInt32_t timeBinWindow, AliHLTUInt32_t &configWord1, AliHLTUInt32_t &configWord2 ) { @@ -214,4 +216,5 @@ void AliHLTTPCHWCFEmulator::CreateConfiguration configWord1 |= ( (AliHLTUInt32_t)singleSeqLimit & 0xFF ); configWord2 |= ( (AliHLTUInt32_t)mergerDistance & 0xF ); + configWord2 |= ( (AliHLTUInt32_t)timeBinWindow & 0xFF )<<4; } diff --git a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulator.h b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulator.h index e57ea476a4e..5529384f569 100644 --- a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulator.h +++ b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulator.h @@ -65,13 +65,13 @@ class AliHLTTPCHWCFEmulator ( bool doDeconvTime, bool doDeconvPad, bool doFlowControl, bool doSinglePadSuppression, bool bypassMerger, AliHLTUInt32_t clusterLowerLimit,AliHLTUInt32_t singleSeqLimit, - AliHLTUInt32_t mergerDistance, + AliHLTUInt32_t mergerDistance, AliHLTUInt32_t timeBinWindow, 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, configWord1, configWord2 ); + CreateConfiguration(0,0,0,1,0,0,0, 3, 5, configWord1, configWord2 ); } private: diff --git a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulatorComponent.cxx b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulatorComponent.cxx index bc6fcd605d0..336f4542439 100644 --- a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulatorComponent.cxx +++ b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulatorComponent.cxx @@ -61,6 +61,7 @@ AliHLTTPCHWCFEmulatorComponent::AliHLTTPCHWCFEmulatorComponent() fClusterLowerLimit(0), fSingleSeqLimit(0), fMergerDistance(3), + fTimeBinWindow(5), fDebug(0), fCFSupport(), fCFEmulator(), @@ -86,6 +87,7 @@ AliHLTTPCHWCFEmulatorComponent::AliHLTTPCHWCFEmulatorComponent(const AliHLTTPCHW fClusterLowerLimit(0), fSingleSeqLimit(0), fMergerDistance(3), + fTimeBinWindow(5), fDebug(0), fCFSupport(), fCFEmulator(), @@ -143,7 +145,7 @@ void AliHLTTPCHWCFEmulatorComponent::GetOutputDataSize( unsigned long& constBase // see header file for class documentation // XXX TODO: Find more realistic values. constBase = 0; - inputMultiplier = (6 * 0.7); + inputMultiplier = (6 * 0.4); } @@ -210,6 +212,7 @@ void AliHLTTPCHWCFEmulatorComponent::SetDefaultConfiguration() fClusterLowerLimit = 0; fSingleSeqLimit = 0; fMergerDistance = 3; + fTimeBinWindow = 250; fDebug = 0; fBenchmark.Reset(); fBenchmark.SetTimer(0,"total"); @@ -306,7 +309,14 @@ int AliHLTTPCHWCFEmulatorComponent::ReadConfigurationString( const char* argume HLTInfo( "Merger distance is set to: %d", fMergerDistance ); continue; } - + + if ( argument.CompareTo( "-timebin-window" ) == 0 ) { + if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break; + fTimeBinWindow = ( ( TObjString* )pTokens->At( i ) )->GetString().Atoi(); + HLTInfo( "TimeBin window is set to: %d", fTimeBinWindow ); + continue; + } + if ( argument.CompareTo( "-debug-level" ) == 0 ) { if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break; fDebug = ( ( TObjString* )pTokens->At( i ) )->GetString().Atoi(); @@ -423,7 +433,7 @@ int AliHLTTPCHWCFEmulatorComponent::DoEvent( const AliHLTComponentEventData& evt AliHLTUInt32_t configWord1=0, configWord2=0; AliHLTTPCHWCFEmulator::CreateConfiguration - ( fDoDeconvTime, fDoDeconvPad, fDoFlowControl, fDoSinglePadSuppression, fBypassMerger, fClusterLowerLimit, fSingleSeqLimit, fMergerDistance, configWord1, configWord2 ); + ( fDoDeconvTime, fDoDeconvPad, fDoFlowControl, fDoSinglePadSuppression, fBypassMerger, fClusterLowerLimit, fSingleSeqLimit, fMergerDistance, fTimeBinWindow, 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 cf57cae76f7..f470f133b52 100644 --- a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulatorComponent.h +++ b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulatorComponent.h @@ -148,6 +148,7 @@ class AliHLTTPCHWCFEmulatorComponent : public AliHLTProcessor AliHLTUInt8_t fClusterLowerLimit; // cut clusters at this charge value AliHLTUInt8_t fSingleSeqLimit; // cut sequences at this charge value AliHLTUInt8_t fMergerDistance; // max. distance in mean time between two pads to be merged + AliHLTUInt8_t fTimeBinWindow; // timebin window Int_t fDebug; // debug level AliHLTTPCHWCFSupport fCFSupport; // !transient AliHLTTPCHWCFEmulator fCFEmulator; // !transient diff --git a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFProcessorUnit.cxx b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFProcessorUnit.cxx index 686a2052779..a0021eab33a 100644 --- a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFProcessorUnit.cxx +++ b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFProcessorUnit.cxx @@ -37,6 +37,7 @@ AliHLTTPCHWCFProcessorUnit::AliHLTTPCHWCFProcessorUnit() fBunchIndex(0), fDeconvolute(0), fSingleSeqLimit(0), + fTimeBinWindow(5), fDebug(0) { //constructor @@ -56,6 +57,7 @@ AliHLTTPCHWCFProcessorUnit::AliHLTTPCHWCFProcessorUnit(const AliHLTTPCHWCFProces fBunchIndex(0), fDeconvolute(0), fSingleSeqLimit(0), + fTimeBinWindow(5), fDebug(0) { // dummy @@ -108,7 +110,7 @@ const AliHLTTPCHWCFClusterFragment *AliHLTTPCHWCFProcessorUnit::OutputStream() fOutput.fRow = fkBunch->fRow; fOutput.fPad = fkBunch->fPad; fOutput.fBranch = fkBunch->fBranch; - fOutput.fBorder = fkBunch->fBorder; + fOutput.fBorder = fkBunch->fBorder; fOutput.fQmax = 0; fOutput.fQ = 0; fOutput.fT = 0; @@ -130,37 +132,41 @@ const AliHLTTPCHWCFClusterFragment *AliHLTTPCHWCFProcessorUnit::OutputStream() if( fkBunch->fFlag < 1 ) return 0; - if( fBunchIndex >= fkBunch->fData.size() || fkBunch->fTime < fBunchIndex ) return 0; AliHLTInt32_t bunchTime0 = fkBunch->fTime - fBunchIndex; AliHLTInt32_t bunchTime = bunchTime0; - AliHLTUInt64_t qLast = 0; + AliHLTUInt32_t qArrStart = fBunchIndex, qArrEnd = qArrStart; + AliHLTUInt32_t qLast = 0; bool slope = 0; AliHLTUInt32_t length = 0; - for( ; fBunchIndexfData.size() && bunchTime>=0; fBunchIndex++, bunchTime--, length++ ){ - AliHLTUInt64_t q = fkBunch->fData[fBunchIndex]*fkBunch->fGain; - if( fDeconvolute && slope && q>qLast ){ - //cout<<"deconvolution time!!!"<fTime - fBunchIndex; - qLast = 0; - slope = 0; - length = 0; - } else { - break; - } + + for( ; qArrEndfData.size() && bunchTime>=0; qArrEnd++, bunchTime--, length++ ){ + AliHLTUInt32_t q = fkBunch->fData[qArrEnd]; + if( ( slope && length+1 >= fTimeBinWindow ) || + ( fDeconvolute && slope && q>qLast ) ){ // split the cluster + qArrEnd++; + break; + } + + if( q fTimeBinWindow/2 ){ + length = fTimeBinWindow/2; + qArrStart = qArrEnd - length; + } + slope = 1; } - if( qfTime - fBunchIndex; + bunchTime = bunchTime0; + length = 0; + + for( ; fBunchIndexfData[fBunchIndex]*fkBunch->fGain; if (fOutput.fQmax < q) fOutput.fQmax = q; fOutput.fQ += q; fOutput.fT += q*bunchTime; @@ -170,8 +176,8 @@ const AliHLTTPCHWCFClusterFragment *AliHLTTPCHWCFProcessorUnit::OutputStream() if( fBunchIndexfMC.size() ){ fOutput.fMC.push_back(fkBunch->fMC[fBunchIndex]); } - } - + } + fOutput.fTMean = (AliHLTUInt64_t)( (bunchTime0 + bunchTime + 1)/2 ); if( length==1 && fOutput.fQ < fSingleSeqLimit ) return 0; diff --git a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFProcessorUnit.h b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFProcessorUnit.h index 9a238aead66..dc18bb33444 100644 --- a/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFProcessorUnit.h +++ b/HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFProcessorUnit.h @@ -41,6 +41,13 @@ class AliHLTTPCHWCFProcessorUnit fSingleSeqLimit = val << AliHLTTPCHWCFDefinitions::kFixedPoint; } + /** max. size of the cluster in time bins + */ + void SetTimeBinWindow( AliHLTUInt32_t val ){ + fTimeBinWindow = val>=1 ?val/2*2+1 :1; + } + + /** initialise */ int Init(); @@ -63,6 +70,7 @@ class AliHLTTPCHWCFProcessorUnit AliHLTUInt32_t fBunchIndex; // index in bunch bool fDeconvolute; // do deconvolution in time direction AliHLTUInt64_t fSingleSeqLimit; // lower charge limit for isolated signals + AliHLTUInt32_t fTimeBinWindow; // max. size of the cluster in time bins int fDebug; // debug level }; -- 2.39.3