Skip to content

Commit

Permalink
Pull in all HWCF emulator modifications from v5-08-20
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrohr authored and dberzano committed Feb 7, 2017
1 parent e20d167 commit 5af4899
Show file tree
Hide file tree
Showing 12 changed files with 235 additions and 31 deletions.
2 changes: 1 addition & 1 deletion HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFDataTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct AliHLTTPCHWCFClusterFragment
AliHLTUInt32_t fPad; // pad number
bool fBranch; // 0 - pad belongs to branch A, 1 - pad belongs to branch B
bool fBorder; // is the pad at the border of its branch
AliHLTUInt64_t fQmax; // total charge, fixed point integer
AliHLTUInt64_t fQmax; // max charge, fixed point integer
AliHLTUInt64_t fQ; // total charge, fixed point integer
AliHLTUInt64_t fT; // sum of time*charge , fixed point integer
AliHLTUInt64_t fP; // sum of pad*charge , fixed point integer
Expand Down
17 changes: 15 additions & 2 deletions HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFDivisionUnit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

AliHLTTPCHWCFDivisionUnit::AliHLTTPCHWCFDivisionUnit()
:
fSinglePadSuppression(1), fClusterLowerLimit(0), fTagDeconvolutedClusters(0), fkInput(0),fOutput(), fDebug(0), fDebugNtuple(0),fDebugFile(0)
fSinglePadSuppression(1), fClusterLowerLimit(0), fClusterQMaxLowerLimit(0), fTagDeconvolutedClusters(0), fkInput(0),fOutput(), fDebug(0), fDebugNtuple(0),fDebugFile(0)
{
//constructor
}
Expand All @@ -53,7 +53,7 @@ AliHLTTPCHWCFDivisionUnit::~AliHLTTPCHWCFDivisionUnit()

AliHLTTPCHWCFDivisionUnit::AliHLTTPCHWCFDivisionUnit(const AliHLTTPCHWCFDivisionUnit&)
:
fSinglePadSuppression(1),fClusterLowerLimit(0),fTagDeconvolutedClusters(0), fkInput(0),fOutput(), fDebug(0), fDebugNtuple(0), fDebugFile(0)
fSinglePadSuppression(1),fClusterLowerLimit(0),fClusterQMaxLowerLimit(0),fTagDeconvolutedClusters(0), fkInput(0),fOutput(), fDebug(0), fDebugNtuple(0), fDebugFile(0)
{
}

Expand Down Expand Up @@ -115,6 +115,7 @@ const AliHLTTPCHWCFCluster *AliHLTTPCHWCFDivisionUnit::OutputStream()
if( fkInput->fQ==0 ) return 0;
if( fSinglePadSuppression && fkInput->fQ==fkInput->fLastQ && !fkInput->fBorder ) return 0;
if( fkInput->fQ < fClusterLowerLimit ) return 0;
if (fClusterQMaxLowerLimit && ((fkInput->fQmax)&0x7FFFFF) < fClusterQMaxLowerLimit) return 0;

AliHLTFloat32_t q = fkInput->fQ;

Expand Down Expand Up @@ -143,6 +144,18 @@ const AliHLTTPCHWCFCluster *AliHLTTPCHWCFDivisionUnit::OutputStream()
if( fkInput->fNDeconvolutedTime>0 ) fOutput.fQ += (0x1 << 30 );
}
break;
case 3:
if( fkInput->fIsDeconvolutedPad ) fOutput.fQ += (0x1 << 31 );

{//Generate final deconvolute time flag
int deconTimeFlag = 0;
if (fkInput->fNPads <= 2 && fkInput->fNDeconvolutedTime > 0) deconTimeFlag = 1;
else if (fkInput->fConsecutiveTimeDeconvolution >= 2) deconTimeFlag = 1;
else if (fkInput->fNDeconvolutedTime > fkInput->fNPads / 2) deconTimeFlag = 1;
fOutput.fQ += (deconTimeFlag << 30 );
}
break;

default:
HLTError("Unknown HW cluster tagging option %d",fTagDeconvolutedClusters);
}
Expand Down
6 changes: 5 additions & 1 deletion HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFDivisionUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ class AliHLTTPCHWCFDivisionUnit :public AliHLTLogging
void SetClusterLowerLimit( AliHLTUInt32_t val ){
fClusterLowerLimit = val << AliHLTTPCHWCFDefinitions::kFixedPoint;
}
void SetClusterQMaxLowerLimit( AliHLTUInt32_t val){
fClusterQMaxLowerLimit = val << AliHLTTPCHWCFDefinitions::kFixedPoint;
}

/** set tagging of deconvoluted clusters
**/
Expand All @@ -70,7 +73,8 @@ class AliHLTTPCHWCFDivisionUnit :public AliHLTLogging
AliHLTTPCHWCFDivisionUnit& operator=(const AliHLTTPCHWCFDivisionUnit&);

bool fSinglePadSuppression; // suppress not merged clusters
AliHLTUInt64_t fClusterLowerLimit; // lower charge limit for clusters
AliHLTUInt64_t fClusterLowerLimit; // lower total charge limit for clusters
AliHLTUInt64_t fClusterQMaxLowerLimit; // lower maximum charge limit for clusters
AliHLTUInt32_t fTagDeconvolutedClusters; // way to tag deconvoluted clusters
// 0: no tagging
// 1: tag pad, tag time if one of the time sequences is deconvoluted
Expand Down
6 changes: 6 additions & 0 deletions HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ class AliHLTTPCHWCFEmulator
void SetProcessingRCU2Data( bool b ){ fChannelExtractor.SetRCU2Flag( b ); }

void SetNoiseSuppression(int ns) {fPeakFinderUnit.SetNoiseSuppression(ns);}
void SetNoiseSuppressionMinimum(int ns) {fPeakFinderUnit.SetNoiseSuppressionMinimum(ns);}
void SetNoiseSuppressionNeighbor(int n) {fPeakFinderUnit.SetNoiseSuppressionNeighbor(n);}
void SetSmoothing(int s) {fPeakFinderUnit.SetSmoothing(s);}
void SetSmoothingThreshold(int s) {fPeakFinderUnit.SetSmoothingThreshold(s);}
void SetClusterQMaxLowerLimit(int l) {fDivisionUnit.SetClusterQMaxLowerLimit(l);}
void SetImprovedDeconvolution(int d) {fChannelProcessor.SetImprovedDeconvolution(d);}

private:

Expand Down
76 changes: 74 additions & 2 deletions HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulatorComponent.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// $Id$
// $Id
//****************************************************************************
//* This file is property of and copyright by the ALICE HLT Project *
//* ALICE Experiment at CERN, All rights reserved. *
Expand Down Expand Up @@ -55,19 +55,26 @@ AliHLTTPCHWCFEmulatorComponent::AliHLTTPCHWCFEmulatorComponent()
AliHLTProcessor(),
fDoDeconvTime(0),
fDoDeconvPad(0),
fImprovedDeconvolution(0),
fDoMC(0),
fDoFlowControl(0),
fDoSinglePadSuppression(0),
fBypassMerger(0),
fClusterLowerLimit(0),
fClusterQMaxLowerLimit(0),
fSingleSeqLimit(0),
fMergerDistance(0),
fUseTimeBinWindow(0),
fUseTimeFollow(0),
fChargeFluctuation(0),
fTagDeconvolutedClusters(0),
fProcessingRCU2Data(0),
fUseGain(0),
fNoiseSuppression(0),
fNoiseSuppressionMinimum(0),
fNoiseSuppressionNeighbor(0),
fSmoothing(0),
fSmoothingThreshold(0),
fIORatioCorrection(1.),
fDebug(0),
fForceOutputBufferSize(0),
Expand All @@ -90,19 +97,26 @@ AliHLTTPCHWCFEmulatorComponent::AliHLTTPCHWCFEmulatorComponent(const AliHLTTPCHW
AliHLTProcessor(),
fDoDeconvTime(0),
fDoDeconvPad(0),
fImprovedDeconvolution(0),
fDoMC(0),
fDoFlowControl(0),
fDoSinglePadSuppression(0),
fBypassMerger(0),
fClusterLowerLimit(0),
fClusterQMaxLowerLimit(0),
fSingleSeqLimit(0),
fMergerDistance(0),
fUseTimeBinWindow(0),
fUseTimeFollow(0),
fChargeFluctuation(0),
fTagDeconvolutedClusters(0),
fProcessingRCU2Data(0),
fUseGain(0),
fNoiseSuppression(0),
fNoiseSuppressionMinimum(0),
fNoiseSuppressionNeighbor(0),
fSmoothing(0),
fSmoothingThreshold(0),
fIORatioCorrection(1.),
fDebug(0),
fForceOutputBufferSize(0),
Expand Down Expand Up @@ -240,13 +254,15 @@ void AliHLTTPCHWCFEmulatorComponent::SetDefaultConfiguration()
fDoSinglePadSuppression = 0;
fBypassMerger = 0;
fClusterLowerLimit = 10;
fClusterQMaxLowerLimit = 0;
fSingleSeqLimit = 0;
fMergerDistance = 4;
fUseTimeBinWindow = 1;
fUseTimeFollow = 1;
fChargeFluctuation = 0;
fTagDeconvolutedClusters = 0;
fProcessingRCU2Data = 0;
fUseGain = 1;
fDebug = 0;
fEnableTempBuffer = true;
fBenchmark.Reset();
Expand Down Expand Up @@ -289,6 +305,13 @@ int AliHLTTPCHWCFEmulatorComponent::ReadConfigurationString( const char* argume
continue;
}

if ( argument.CompareTo( "-improved-deconvolution" ) == 0 ) {
if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break;
fImprovedDeconvolution = ( ( TObjString* )pTokens->At( i ) )->GetString().Atoi();
HLTInfo( "Improved deconvolution is set to: %d", fImprovedDeconvolution );
continue;
}

if ( argument.CompareTo( "-deconvolute" ) == 0 ) {
if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break;
fDoDeconvTime = ( ( TObjString* )pTokens->At( i ) )->GetString().Atoi();
Expand Down Expand Up @@ -333,6 +356,13 @@ int AliHLTTPCHWCFEmulatorComponent::ReadConfigurationString( const char* argume
continue;
}

if ( argument.CompareTo( "-cluster-qmax-lower-limit" ) == 0 ) {
if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break;
fClusterQMaxLowerLimit = ( ( TObjString* )pTokens->At( i ) )->GetString().Atoi();
HLTInfo( "Cluster qmax lower limit is set to: %d", fClusterQMaxLowerLimit );
continue;
}

if ( argument.CompareTo( "-single-sequence-limit" ) == 0 ) {
if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break;
fSingleSeqLimit = ( ( TObjString* )pTokens->At( i ) )->GetString().Atoi();
Expand Down Expand Up @@ -369,6 +399,34 @@ int AliHLTTPCHWCFEmulatorComponent::ReadConfigurationString( const char* argume
continue;
}

if ( argument.CompareTo( "-noise-suppression-for-minima" ) == 0 ) {
if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break;
fNoiseSuppressionMinimum = ( ( TObjString* )pTokens->At( i ) )->GetString().Atoi();
HLTInfo( "Noise Suppression for minimum finder is set to: %d", fNoiseSuppressionMinimum );
continue;
}

if ( argument.CompareTo( "-noise-suppression-neighbor" ) == 0 ) {
if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break;
fNoiseSuppressionNeighbor = ( ( TObjString* )pTokens->At( i ) )->GetString().Atoi();
HLTInfo( "Noise Suppression neighbor parameter is set to: %d", fNoiseSuppressionNeighbor );
continue;
}

if ( argument.CompareTo( "-smoothing" ) == 0 ) {
if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break;
fSmoothing = ( ( TObjString* )pTokens->At( i ) )->GetString().Atoi();
HLTInfo( "Smoothing parameter is set to: %d", fSmoothing );
continue;
}

if ( argument.CompareTo( "-smoothing-threshold" ) == 0 ) {
if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break;
fSmoothingThreshold = ( ( TObjString* )pTokens->At( i ) )->GetString().Atoi();
HLTInfo( "Smoothing Threshold parameter is set to: %d", fSmoothingThreshold );
continue;
}

if ( argument.CompareTo( "-use-time-follow" ) == 0 ) {
if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break;
fUseTimeFollow = ( ( TObjString* )pTokens->At( i ) )->GetString().Atoi();
Expand Down Expand Up @@ -396,8 +454,15 @@ int AliHLTTPCHWCFEmulatorComponent::ReadConfigurationString( const char* argume
HLTInfo( "Processing RCU2 data flag is set to: %d", fProcessingRCU2Data );
continue;
}

if ( argument.CompareTo( "-use-gain" ) == 0 ) {
if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break;
fUseGain = ( ( TObjString* )pTokens->At( i ) )->GetString().Atoi();
HLTInfo( "Gain Correction flag is set to: %d", fUseGain );
continue;
}

if ( argument.CompareTo( "-temp-buffer" ) == 0 ) {
if ( argument.CompareTo( "-temp-buffer" ) == 0 ) {
if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break;
fEnableTempBuffer = ( ( TObjString* )pTokens->At( i ) )->GetString().Atoi();
HLTInfo( "Temporary buffer set to: %d", fEnableTempBuffer );
Expand Down Expand Up @@ -483,6 +548,7 @@ int AliHLTTPCHWCFEmulatorComponent::Configure( const char* cdbEntry, const char*

fCFSupport.UnloadMapping();
fCFSupport.SetProcessingRCU2Data( fProcessingRCU2Data );
fCFSupport.SetUseGain( fUseGain );

return iResult1 ? iResult1 : ( iResult2 ? iResult2 : iResult3 );
}
Expand Down Expand Up @@ -629,6 +695,12 @@ int AliHLTTPCHWCFEmulatorComponent::DoEvent( const AliHLTComponentEventData& evt
fCFEmulator.SetTagDeconvolutedClusters(fTagDeconvolutedClusters);
fCFEmulator.SetProcessingRCU2Data(fProcessingRCU2Data);
fCFEmulator.SetNoiseSuppression(fNoiseSuppression);
fCFEmulator.SetNoiseSuppressionMinimum(fNoiseSuppressionMinimum);
fCFEmulator.SetNoiseSuppressionNeighbor(fNoiseSuppressionNeighbor);
fCFEmulator.SetSmoothing(fSmoothing);
fCFEmulator.SetSmoothingThreshold(fSmoothingThreshold);
fCFEmulator.SetClusterQMaxLowerLimit(fClusterQMaxLowerLimit);
fCFEmulator.SetImprovedDeconvolution(fImprovedDeconvolution);

int err = fCFEmulator.FindClusters(rawEvent, rawEventSize32,
outClusters, clustersSize32,
Expand Down
9 changes: 8 additions & 1 deletion HLT/TPCLib/HWCFemulator/AliHLTTPCHWCFEmulatorComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,26 @@ class AliHLTTPCHWCFEmulatorComponent : public AliHLTProcessor

Bool_t fDoDeconvTime; // flag to deconvolute in time direction
Bool_t fDoDeconvPad; // flag to deconvolute in pad direction
Bool_t fImprovedDeconvolution; // flat to perform improved deconvolution in time direction
Bool_t fDoMC; // flag to provide MC labels
Bool_t fDoFlowControl; // flag to control the data
Bool_t fDoSinglePadSuppression; // flag for single pad suppression
Bool_t fBypassMerger; // flag to bypass cluster merging between pads
AliHLTUInt32_t fClusterLowerLimit; // cut clusters at this total charge value
AliHLTUInt32_t fClusterQMaxLowerLimit; // cut clusters at this max charge value
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
bool fNoiseSuppression; // Slightly modified algorithm for peak and minimum finding aimed to suppress noise
int fNoiseSuppression; // Slightly modified algorithm for peak finding aimed to suppress noise
int fNoiseSuppressionMinimum; // Slightly modified algorithm for minimum finding aimed to suppress noise
int fNoiseSuppressionNeighbor; // Consider next neighbor as peak/neighbor during peak finder with noise suppression
int fSmoothing; //Smoothing parameter for peak finder
int fSmoothingThreshold; //Threshold when to flag peaks / minima without smoothing
AliHLTUInt32_t fChargeFluctuation; // allowed charge fluctuation for peak finding
AliHLTUInt32_t fTagDeconvolutedClusters; // tag deconvoluted dclusters
Bool_t fProcessingRCU2Data; // processing of RCU2 data - no split in two input branches
Bool_t fUseGain; // Use gain correction factor from OCDB
Double_t fIORatioCorrection; // multiplier for data size ratio Output/Input
Int_t fDebug; // debug level
size_t fForceOutputBufferSize; //!
Expand Down
Loading

0 comments on commit 5af4899

Please sign in to comment.