- Added functionality: deconvolution in pad and time direction.
- bugfix: Qmax is updated in the clusters. Unsorted reading of data is now default
- timebin range by component arguments
- component arguments according to convention and code cleanup
// cluster finder components
cf.Form("TPC-CF_%02d_%d", slice, part);
- handler->CreateConfiguration(cf.Data(), "TPCClusterFinderUnpacked", publisher.Data(), "pp-run timebins 446");
+ handler->CreateConfiguration(cf.Data(), "TPCClusterFinderUnpacked", publisher.Data(), "-timebins 446 -sorted");
if (trackerInput.Length()>0) trackerInput+=" ";
trackerInput+=cf;
}
#include "AliHLTTPCLogging.h"
#include "AliHLTTPCClusterFinder.h"
#include "AliHLTTPCDigitData.h"
-#include "AliHLTTPCTransform.h"
#include "AliHLTTPCSpacePointData.h"
#include "AliHLTTPCMemHandler.h"
#include "AliHLTTPCPad.h"
fDigitReader(NULL),
fPtr(NULL),
fSize(0),
- fDeconvTime(kTRUE),
- fDeconvPad(kTRUE),
+ fDeconvTime(kFALSE),
+ fDeconvPad(kFALSE),
fStdout(kFALSE),
fCalcerr(kTRUE),
fRawSP(kFALSE),
fCurrentPatch(0),
fMatch(1),
fThreshold(10),
- fSignalThreshold(-1),
- fNSigmaThreshold(0),
fNClusters(0),
fMaxNClusters(0),
fXYErr(0.2),
fNumberOfPadsInRow(NULL),
fNumberOfRows(0),
fRowOfFirstCandidate(0),
- fDoPadSelection(kFALSE)
+ fDoPadSelection(kFALSE),
+ fFirstTimeBin(0),
+ fLastTimeBin(AliHLTTPCTransform::GetNTimeBins()),
+ fTotalChargeOfPreviousClusterCandidate(0),
+ fChargeOfCandidatesFalling(kFALSE)
{
//constructor
}
bins.
*/
Int_t gatingGridOffset=50;
+ if(fFirstTimeBin>0){
+ gatingGridOffset=fFirstTimeBin;
+ }
AliHLTTPCPad baseline(gatingGridOffset, AliHLTTPCTransform::GetNTimeBins());
// just to make later conversion to a list of objects easier
AliHLTTPCPad* pCurrentPad=NULL;
- if (fSignalThreshold>=0) {
+ /*
+ if (fSignalThreshold>=0) {
pCurrentPad=&baseline;
baseline.SetThreshold(fSignalThreshold);
}
-
+ */
while ( readValue!=0 && iResult>=0){ // Reads through all digits in block
iResult=0;
}
fSpacePointData[counter].fX = xyz[0];
- fSpacePointData[counter].fY = xyz[1];
+ // fSpacePointData[counter].fY = xyz[1];
+ if(fCurrentSlice<18){
+ fSpacePointData[counter].fY = xyz[1];
+ }
+ else{
+ fSpacePointData[counter].fY = -1*xyz[1];
+ }
fSpacePointData[counter].fZ = xyz[2];
-
+
} else {
fSpacePointData[counter].fX = fCurrentRow;
fSpacePointData[counter].fY = fpad;
fSpacePointData[counter].fSigmaY2 = fpad2;
fSpacePointData[counter].fSigmaZ2 = ftime2;
+ fSpacePointData[counter].fMaxQ = list[j].fQMax;
+
fSpacePointData[counter].fUsed = kFALSE; // only used / set in AliHLTTPCDisplay
fSpacePointData[counter].fTrackN = -1; // only used / set in AliHLTTPCDisplay
UInt_t row=fDigitReader->GetRow();
UInt_t pad=fDigitReader->GetPad();
- fRowPadVector[row][pad]->ClearCandidates();
while(fDigitReader->NextBunch()){
if(fDigitReader->GetBunchSize()>1){//to remove single timebin values, this will have to change at some point
- const UInt_t *bunchData= fDigitReader->GetSignals();
UInt_t time = fDigitReader->GetTime();
- AliHLTTPCClusters candidate;
- for(Int_t i=0;i<fDigitReader->GetBunchSize();i++){
- candidate.fTotalCharge+=bunchData[i];
- candidate.fTime += time*bunchData[i];
- candidate.fTime2 += time*time*bunchData[i];
- time++;
+ if((Int_t)time>=fFirstTimeBin && (Int_t)time+fDigitReader->GetBunchSize()<=fLastTimeBin){
+ const UInt_t *bunchData= fDigitReader->GetSignals();
+ AliHLTTPCClusters candidate;
+ for(Int_t i=0;i<fDigitReader->GetBunchSize();i++){
+ candidate.fTotalCharge+=bunchData[i];
+ candidate.fTime += time*bunchData[i];
+ candidate.fTime2 += time*time*bunchData[i];
+ if(bunchData[i]>candidate.fQMax){
+ candidate.fQMax=bunchData[i];
+ }
+ time++;
+ }
+ if(candidate.fTotalCharge>0){
+ candidate.fMean=candidate.fTime/candidate.fTotalCharge;
+ candidate.fPad=candidate.fTotalCharge*pad;
+ candidate.fPad2=candidate.fPad*pad;
+ candidate.fLastMergedPad=pad;
+ candidate.fRowNumber=row+fDigitReader->GetRowOffset();
+ }
+ fRowPadVector[row][pad]->AddClusterCandidate(candidate);
}
- if(candidate.fTotalCharge>0){
- candidate.fMean=candidate.fTime/candidate.fTotalCharge;
- candidate.fPad=candidate.fTotalCharge*pad;
- candidate.fPad2=candidate.fPad*pad;
- candidate.fLastMergedPad=pad;
- candidate.fRowNumber=row+fDigitReader->GetRowOffset();
+ }
+ }
+ }
+}
+
+void AliHLTTPCClusterFinder::ReadDataUnsortedDeconvoluteTime(void* ptr,unsigned long size)
+{
+ //set input pointer
+ fPtr = (UChar_t*)ptr;
+ fSize = size;
+
+ if(!fVectorInitialized){
+ InitializePadArray();
+ }
+
+ fDigitReader->InitBlock(fPtr,fSize,fFirstRow,fLastRow,fCurrentPatch,fCurrentSlice);
+
+ while(fDigitReader->NextChannel()){
+ UInt_t row=fDigitReader->GetRow();
+ UInt_t pad=fDigitReader->GetPad();
+
+ while(fDigitReader->NextBunch()){
+ if(fDigitReader->GetBunchSize()>1){//to remove single timebin values, this will have to change at some point
+ UInt_t time = fDigitReader->GetTime();
+ if((Int_t)time>=fFirstTimeBin && (Int_t)time+fDigitReader->GetBunchSize()<=fLastTimeBin){
+ Int_t indexInBunchData=0;
+ Bool_t moreDataInBunch=kFALSE;
+ UInt_t prevSignal=0;
+ Bool_t signalFalling=kFALSE;
+ const UInt_t *bunchData= fDigitReader->GetSignals();
+ do{
+ AliHLTTPCClusters candidate;
+ for(Int_t i=indexInBunchData;i<fDigitReader->GetBunchSize();i++){
+ // Checks if one need to deconvolute the signals
+ if(bunchData[i]>prevSignal && signalFalling==kTRUE){
+ if(i<fDigitReader->GetBunchSize()-1){ // means there are more than one signal left in the bunch
+ moreDataInBunch=kTRUE;
+ prevSignal=0;
+ }
+ break;
+ }
+
+ // Checks if the signal is 0, then quit processing the data.
+ if(bunchData[i]==0 && i<fDigitReader->GetBunchSize()-1){//means we have 0 data fom the rcu, might happen depending on the configuration settings
+ moreDataInBunch=kTRUE;
+ prevSignal=0;
+ break;
+ }
+
+ if(prevSignal>bunchData[i]){//means the peak of the signal has been reached and deconvolution will happen if the signal rise again.
+ signalFalling=kTRUE;
+ }
+ candidate.fTotalCharge+=bunchData[i];
+ candidate.fTime += time*bunchData[i];
+ candidate.fTime2 += time*time*bunchData[i];
+ if(bunchData[i]>candidate.fQMax){
+ candidate.fQMax=bunchData[i];
+ }
+
+ prevSignal=bunchData[i];
+ time++;
+ indexInBunchData++;
+ }
+ if(candidate.fTotalCharge>0){
+ candidate.fMean=candidate.fTime/candidate.fTotalCharge;
+ candidate.fPad=candidate.fTotalCharge*pad;
+ candidate.fPad2=candidate.fPad*pad;
+ candidate.fLastMergedPad=pad;
+ candidate.fRowNumber=row+fDigitReader->GetRowOffset();
+ }
+ fRowPadVector[row][pad]->AddClusterCandidate(candidate);
+ if(indexInBunchData<fDigitReader->GetBunchSize()-1){
+ moreDataInBunch=kFALSE;
+ }
+ }while(moreDataInBunch);
}
- fRowPadVector[row][pad]->AddClusterCandidate(candidate);
}
}
}
for(UInt_t candidateNumber=0;candidateNumber<nextPad->fClusterCandidates.size();candidateNumber++){
AliHLTTPCClusters *candidate =&nextPad->fClusterCandidates[candidateNumber];
if(cluster->fMean-candidate->fMean==1 || candidate->fMean-cluster->fMean==1 || cluster->fMean-candidate->fMean==0){
+ if(fDeconvPad){
+ if(candidate->fTotalCharge<fTotalChargeOfPreviousClusterCandidate){//peak is reached
+ fChargeOfCandidatesFalling=kTRUE;
+ }
+ if(candidate->fTotalCharge>fTotalChargeOfPreviousClusterCandidate && fChargeOfCandidatesFalling==kTRUE){//we have deconvolution
+ return kFALSE;
+ }
+ }
cluster->fMean=candidate->fMean;
cluster->fTotalCharge+=candidate->fTotalCharge;
cluster->fTime += candidate->fTime;
cluster->fPad+=candidate->fPad;
cluster->fPad2=candidate->fPad2;
cluster->fLastMergedPad=candidate->fPad;
-
- //cout<<"Adding "<<candidate->fTotalCharge<<" to the pad "<<nextPad->GetPadNumber()<<" row: "<<nextPad->GetRowNumber()<<" HWAddress: "<<(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(nextPad->GetRowNumber(),nextPad->GetPadNumber())<<endl;
-
+ if(candidate->fQMax>cluster->fQMax){
+ cluster->fQMax=candidate->fQMax;
+ }
+
if(fDoPadSelection){
- UInt_t rowNo = nextPad->GetRowNumber();
- UInt_t padNo = nextPad->GetPadNumber();
- if(padNo-1>0){
- fRowPadVector[rowNo][padNo-2]->fSelectedPad=kTRUE;
- fRowPadVector[rowNo][padNo-2]->fHWAddress=(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo-2);
- }
- fRowPadVector[rowNo][padNo-1]->fSelectedPad=kTRUE;// quick solution to set the first pad to selected
- fRowPadVector[rowNo][padNo-1]->fHWAddress=(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo-1);
- fRowPadVector[rowNo][padNo]->fSelectedPad=kTRUE;
- fRowPadVector[rowNo][padNo]->fHWAddress=(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo);
- /* if(padNo+1<(Int_t)fNumberOfPadsInRow[fRowOfFirstCandidate]){
- fRowPadVector[rowNo][padNo]->fSelectedPad=kTRUE;
- fRowPadVector[rowNo][padNo]->fHWAddress=(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo);
- }*/
- // cout<<"We have an active pad in row: "<<rowNo<<" pad: "<<padNo<<" hwadd: "<<(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo)<<endl;
+ UInt_t rowNo = nextPad->GetRowNumber();
+ UInt_t padNo = nextPad->GetPadNumber();
+ if(padNo-1>0){
+ fRowPadVector[rowNo][padNo-2]->fSelectedPad=kTRUE;
+ fRowPadVector[rowNo][padNo-2]->fHWAddress=(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo-2);
+ }
+ fRowPadVector[rowNo][padNo-1]->fSelectedPad=kTRUE;// quick solution to set the first pad to selected
+ fRowPadVector[rowNo][padNo-1]->fHWAddress=(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo-1);
+ fRowPadVector[rowNo][padNo]->fSelectedPad=kTRUE;
+ fRowPadVector[rowNo][padNo]->fHWAddress=(AliHLTUInt16_t)fDigitReader->GetAltroBlockHWaddr(rowNo,padNo);
}
//setting the matched pad to used
if(fRowPadVector[row][pad]->fSelectedPad){
if(counter<maxHWadd){
hwaddlist[counter]=(AliHLTUInt16_t)fRowPadVector[row][pad]->fHWAddress;
- //cout<<"Filling the f.. hardwareaddress: "<<fRowPadVector[row][pad]->fHWAddress<<endl;
counter++;
}
else{
}
tmpCandidate=&tmpPad->fClusterCandidates[candidate];
UInt_t tmpTotalCharge=tmpCandidate->fTotalCharge;
+
ComparePads(fRowPadVector[row][pad+1],tmpCandidate,pad+1);
if(tmpCandidate->fTotalCharge>tmpTotalCharge){
//we have a cluster
// see header file for class documentation
for(size_t i=0;i<fClusters.size();i++){
HLTInfo("Cluster number: %d",i);
- HLTInfo("Row: %d \t Pad: %d",fClusters[i].fRowNumber,fClusters[i].fFirstPad);
+ HLTInfo("Row: %d \t Pad: %d",fClusters[i].fRowNumber,fClusters[i].fPad/fClusters[i].fTotalCharge);
HLTInfo("Total Charge: %d",fClusters[i].fTotalCharge);
HLTInfo("fPad: %d",fClusters[i].fPad);
HLTInfo("PadError: %d",fClusters[i].fPad2);
- HLTInfo("TimeMean: %d",fClusters[i].fTime);
+ HLTInfo("TimeMean: %d",fClusters[i].fTime/fClusters[i].fTotalCharge);
HLTInfo("TimeError: %d",fClusters[i].fTime2);
HLTInfo("EndOfCluster:");
}
}
fSpacePointData[counter].fX = xyz[0];
- fSpacePointData[counter].fY = xyz[1];
+ // fSpacePointData[counter].fY = xyz[1];
+ if(fCurrentSlice<18){
+ fSpacePointData[counter].fY = xyz[1];
+ }
+ else{
+ fSpacePointData[counter].fY = -1*xyz[1];
+ }
fSpacePointData[counter].fZ = xyz[2];
} else {
fSpacePointData[counter].fSigmaY2 = fpad2;
fSpacePointData[counter].fSigmaZ2 = ftime2;
+ fSpacePointData[counter].fMaxQ = list[j].fQMax;
+
fSpacePointData[counter].fUsed = kFALSE; // only used / set in AliHLTTPCDisplay
fSpacePointData[counter].fTrackN = -1; // only used / set in AliHLTTPCDisplay
#include "AliHLTLogging.h"
#include <vector>
+#include "AliHLTTPCTransform.h"
class AliHLTTPCPad;
class AliHLTTPCSpacePointData;
UInt_t fLastCharge; //for deconvolution
UInt_t fLastMergedPad; //dont merge twice per pad
Int_t fRow; //row value
+ UInt_t fQMax; //qmax
};
typedef struct AliClusterData AliClusterData; //!
void SetXYError(Float_t f) {fXYErr=f;}
void SetZError(Float_t f) {fZErr=f;}
void SetDeconv(Bool_t f) {fDeconvPad=f; fDeconvTime=f;}
+ void SetDeconvPad(Bool_t f) {fDeconvPad=f;}
+ void SetDeconvTime(Bool_t f) {fDeconvTime=f;}
void SetThreshold(UInt_t i) {fThreshold=i;}
void SetOccupancyLimit(Float_t f) {fOccupancyLimit=f;}
- void SetSignalThreshold(Int_t i) {fSignalThreshold=i;}
- void SetNSigmaThreshold(Double_t d) {fNSigmaThreshold=d;}
void SetMatchWidth(UInt_t i) {fMatch=i;}
void SetSTDOutput(Bool_t f=kFALSE) {fStdout=f;}
void SetCalcErr(Bool_t f=kTRUE) {fCalcerr=f;}
//----------------------------------Methods for the new unsorted way of reading data ----------
void ReadDataUnsorted(void* ptr,unsigned long size);
+ void ReadDataUnsortedDeconvoluteTime(void* ptr,unsigned long size);
void FindClusters();
void WriteClusters(Int_t nclusters,AliHLTTPCClusters *list);
void SetUnsorted(Int_t unsorted){fUnsorted=unsorted;}
void SetDoPadSelection(Bool_t input){fDoPadSelection=input;}
Int_t FillHWAddressList(AliHLTUInt16_t *hwaddlist, Int_t maxHWAddress);
+
+ void UpdateLastTimeBin(){fLastTimeBin=AliHLTTPCTransform::GetNTimeBins();}
+
+ void SetLastTimeBin(Int_t ltb){fLastTimeBin=ltb;}
+
+ void SetFirstTimeBin(Int_t ftb){fFirstTimeBin=ftb;}
vector<AliHLTUInt16_t> fClustersHWAddressVector; //! transient
UChar_t* fPtr; //! pointer to packed block
unsigned long fSize; //packed block size
- Bool_t fDeconvTime; //deconv in time direction
+ Bool_t fDeconvTime; //deconv in time direction
Bool_t fDeconvPad; //deconv in pad direction
Bool_t fStdout; //have print out in write clusters
Bool_t fCalcerr; //calculate centroid sigmas
Int_t fCurrentPatch; //current patch
Int_t fMatch; //size of match
UInt_t fThreshold; //threshold for clusters
- /** threshold for zero suppression (applied per bin) */
- Int_t fSignalThreshold;// see above
- /** threshold for zero suppression 2007 December run */
- Double_t fNSigmaThreshold; // see above
Int_t fNClusters; //number of found clusters
Int_t fMaxNClusters; //max. number of clusters
Float_t fXYErr; //fixed error in XY
Int_t fUnsorted; // enable for processing of unsorted digit data
Bool_t fVectorInitialized;
- //typedef vector<AliHLTTPCPad*> AliHLTTPCPadVector;
-
- //vector<AliHLTTPCPadVector> fRowPadVector; //! transient
-
vector<AliHLTTPCClusters> fClusters; //! transient
UInt_t* fNumberOfPadsInRow; //! transient
Bool_t fDoPadSelection; //! transient
+ Int_t fFirstTimeBin; //! transient
+
+ Int_t fLastTimeBin; //! transient
+
+ UInt_t fTotalChargeOfPreviousClusterCandidate; //! transient
+
+ Bool_t fChargeOfCandidatesFalling; //! transient
+
#ifdef do_mc
void GetTrackID(Int_t pad,Int_t time,Int_t *trackID);
#endif
- ClassDef(AliHLTTPCClusterFinder,5) //Fast cluster finder
+ ClassDef(AliHLTTPCClusterFinder,6) //Fast cluster finder
};
#endif
:
fClusterFinder(NULL),
fReader(NULL),
- fClusterDeconv(true),
+ fDeconvTime(kFALSE),
+ fDeconvPad(kFALSE),
+ fClusterDeconv(false),
fXYClusterError(-1),
fZClusterError(-1),
fModeSwitch(mode),
- fUnsorted(0),
+ fUnsorted(1),
fPatch(0),
- fGetActivePads(0)
+ fGetActivePads(0),
+ fFirstTimeBin(-1),
+ fLastTimeBin(-1)
{
// see header file for class documentation
// or
fClusterFinder = new AliHLTTPCClusterFinder();
- Int_t sigthresh = -1;
- Double_t sigmathresh= -1;
+ // Int_t sigthresh = -1;
+ // Double_t sigmathresh= -1;
Float_t occulimit = 1.0;
- Int_t oldRCUFormat=0;
+ // Int_t oldRCUFormat=0;
// Data Format version numbers:
// 0: RCU Data format as delivered during TPC commissioning, pads/padrows are sorted, RCU trailer is one 32 bit word.
// 1: As 0, but pads/padrows are delivered "as is", without sorting
while ( i < argc ) {
- // -- raw reader mode option
- if ( !strcmp( argv[i], "rawreadermode" ) ) {
- if ( argc <= i+1 ) {
- Logging( kHLTLogError, "HLT::TPCClusterFinder::DoInit", "Missing rawreadermode", "Raw Reader Mode not specified" );
- return ENOTSUP;
+
+
+ // -- deconvolute-time option
+ if ( !strcmp( argv[i], "-deconvolute-time" ) ) {
+ fDeconvTime = kTRUE;
+ i++;
+ continue;
+ }
+
+ // -- deconvolute-pad option
+ if ( !strcmp( argv[i], "-deconvolute-pad" ) ) {
+ fDeconvPad = kTRUE;
+ i++;
+ continue;
+ }
+
+ // -- number of timebins (default 1024)
+ if (!strcmp( argv[i], "-timebins") || !strcmp( argv[i], "timebins" )){
+ TString parameter(argv[i+1]);
+ parameter.Remove(TString::kLeading, ' '); // remove all blanks
+ if (parameter.IsDigit()) {
+ AliHLTTPCTransform::SetNTimeBins(parameter.Atoi());
+ HLTInfo("number of timebins set to %d, zbin=%f", AliHLTTPCTransform::GetNTimeBins(), AliHLTTPCTransform::GetZWidth());
+ fClusterFinder->UpdateLastTimeBin();
+ } else {
+ HLTError("Cannot timebin specifier '%s'.", argv[i+1]);
+ return EINVAL;
+ }
+ if(!strcmp( argv[i], "timebins")){
+ HLTWarning("Argument 'timebins' is old, please switch to new argument naming convention (-timebins). The timebins argument will still work, but please change anyway.");
}
+ i+=2;
+ continue;
+ }
- Logging( kHLTLogWarning, "HLT::TPCClusterFinder::DoInit", "parameter rawreadermode is deprecated", "argument scan" );
+ // -first-timebin (default 0)
+ if ( !strcmp( argv[i], "-first-timebin" ) ) {
+ TString parameter(argv[i+1]);
+ parameter.Remove(TString::kLeading, ' '); // remove all blanks
+ if (parameter.IsDigit()){
+ fFirstTimeBin=parameter.Atoi();
+ HLTDebug("fFirstTimeBin set to %d",fFirstTimeBin);
+ }
+ else {
+ HLTError("Cannot -first-timebin specifier '%s'. Not a number.", argv[i+1]);
+ return EINVAL;
+ }
+ i+=2;
+ continue;
+ }
- i += 2;
+ // -last-timebin (default 1024)
+ if ( !strcmp( argv[i], "-last-timebin" ) ) {
+ TString parameter(argv[i+1]);
+ parameter.Remove(TString::kLeading, ' '); // remove all blanks
+ if (parameter.IsDigit()){
+ fLastTimeBin=parameter.Atoi();
+ HLTDebug("fLastTimeBin set to %d",fLastTimeBin);
+ }
+ else {
+ HLTError("Cannot -last-timebin specifier '%s'. Not a number.", argv[i+1]);
+ return EINVAL;
+ }
+ i+=2;
continue;
}
- // -- pp run option
- if ( !strcmp( argv[i], "pp-run" ) ) {
- fClusterDeconv = false;
+ // -- unsorted option
+ if ( !strcmp( argv[i], "-sorted" ) ) {
+ fUnsorted=0;
i++;
continue;
}
- // -- zero suppression threshold
- if ( !strcmp( argv[i], "adc-threshold" ) ) {
- sigthresh = strtoul( argv[i+1], &cpErr ,0);
- if ( *cpErr ) {
- HLTError("Cannot convert threshold specifier '%s'.", argv[i+1]);
+
+ // -- checking for active pads, used in 2007 December run
+ if ( !strcmp( argv[i], "-active-pads" ) || !strcmp( argv[i], "activepads" ) ) {
+ if(!strcmp( argv[i], "activepads" )){
+ HLTWarning("Please change to new component argument naming scheme and use '-active-pads' instead of 'active-pads'");
+ }
+ fGetActivePads = strtoul( argv[i+1], &cpErr ,0);
+ if ( *cpErr ){
+ HLTError("Cannot convert activepads specifier '%s'. Should be 0(off) or 1(on), must be integer", argv[i+1]);
return EINVAL;
}
i+=2;
}
// -- pad occupancy limit
- if ( !strcmp( argv[i], "occupancy-limit" ) ) {
+ if ( !strcmp( argv[i], "-occupancy-limit" ) || !strcmp( argv[i], "occupancy-limit" ) ) {
+ if(!strcmp( argv[i], "occupancy-limit" )){
+ HLTWarning("Please switch to new component argument naming convention, use '-occupancy-limit' instead of 'occupancy-limit'");
+ }
occulimit = strtod( argv[i+1], &cpErr);
if ( *cpErr ) {
HLTError("Cannot convert occupancy specifier '%s'.", argv[i+1]);
return EINVAL;
}
+ if(fModeSwitch!=kClusterFinderPacked){
+ HLTWarning("Argument '-occupancy-limit' is only used with -sorted set and with the TPCClusterFinderPacked , argument is deprecated");
+ }
i+=2;
continue;
}
- // -- number of timebins (default 1024)
- if ( !strcmp( argv[i], "timebins" ) ) {
- TString parameter(argv[i+1]);
- parameter.Remove(TString::kLeading, ' '); // remove all blanks
- if (parameter.IsDigit()) {
- AliHLTTPCTransform::SetNTimeBins(parameter.Atoi());
- HLTInfo("number of timebins set to %d, zbin=%f", AliHLTTPCTransform::GetNTimeBins(), AliHLTTPCTransform::GetZWidth());
- } else {
- HLTError("Cannot timebin specifier '%s'.", argv[i+1]);
+
+ // -- raw reader mode option
+ if ( !strcmp( argv[i], "rawreadermode" ) ) {
+ if ( argc <= i+1 ) {
+ Logging( kHLTLogError, "HLT::TPCClusterFinder::DoInit", "Missing rawreadermode", "Raw Reader Mode not specified. rawreadermode is no longer a valid argument and will be deprecated even if rawreadermode is specified." );
+ return ENOTSUP;
+ }
+
+ HLTWarning("Argument 'rawreadermode' is deprecated");
+
+ i += 2;
+ continue;
+ }
+
+
+ // -- pp-run option
+ if ( !strcmp( argv[i], "pp-run") ) {
+ HLTWarning("Argument 'pp-run' is obsolete, deconvolution is swiched off in both time and pad directions by default.");
+ fClusterDeconv = false;
+ i++;
+ continue;
+ }
+
+ // -- zero suppression threshold
+ if ( !strcmp( argv[i], "adc-threshold" ) ) {
+ strtoul( argv[i+1], &cpErr ,0);
+ if ( *cpErr ) {
+ HLTError("Cannot convert threshold specifier '%s'.", argv[i+1]);
return EINVAL;
}
+ HLTWarning("'adc-threshold' is no longer a valid argument, please use TPCZeroSuppression component if you want to zerosuppress data.");
i+=2;
continue;
}
+
// -- checking for rcu format
if ( !strcmp( argv[i], "oldrcuformat" ) ) {
- oldRCUFormat = strtoul( argv[i+1], &cpErr ,0);
+ strtoul( argv[i+1], &cpErr ,0);
if ( *cpErr ){
HLTError("Cannot convert oldrcuformat specifier '%s'. Should be 0(off) or 1(on), must be integer", argv[i+1]);
return EINVAL;
}
+ HLTWarning("Argument 'oldrcuformat' is deprecated.");
i+=2;
continue;
}
- // -- checking for unsorted clusterfinding
+ // -- checking for unsorted clusterfinding (default 1)
if ( !strcmp( argv[i], "unsorted" ) ) {
fUnsorted = strtoul( argv[i+1], &cpErr ,0);
if ( *cpErr ){
HLTError("Cannot convert unsorted specifier '%s'. Should be 0(off) or 1(on), must be integer", argv[i+1]);
return EINVAL;
}
- i+=2;
- continue;
- }
-
- // -- checking for active pads, used in 2007 December run
- if ( !strcmp( argv[i], "activepads" ) ) {
- fGetActivePads = strtoul( argv[i+1], &cpErr ,0);
- if ( *cpErr ){
- HLTError("Cannot convert activepads specifier '%s'. Should be 0(off) or 1(on), must be integer", argv[i+1]);
- return EINVAL;
- }
+ HLTWarning("Argument 'unsorted' is old and does not follow the new argument naming convention. A change has been made, and the clusterfinder will read the data unsorted by default. For sorted reading, please use '-sorted' as argument. (unsorted 0 will do the same job, but please change anyway.)");
i+=2;
continue;
}
// -- checking for nsigma-threshold, used in 2007 December run in ZeroSuppression
if ( !strcmp( argv[i], "nsigma-threshold" ) ) {
- sigmathresh = strtoul( argv[i+1], &cpErr ,0);
+ strtoul( argv[i+1], &cpErr ,0);
if ( *cpErr ){
HLTError("Cannot convert nsigma-threshold specifier '%s'. Must be integer", argv[i+1]);
return EINVAL;
}
i+=2;
+ HLTWarning("Argument 'nsigma-threshold' argument is obsolete.");
continue;
}
}
+ //Checking for conflicting arguments
+ if(fClusterDeconv){
+ if(fDeconvPad==kTRUE || fDeconvTime==kTRUE){
+ HLTWarning("Conflicting arguments: argument 'pp-run' will be ignored.");
+ }
+ }
+ if(occulimit!=1.0 && fUnsorted){
+ HLTWarning("Argument 'occupancy-limit' is deprecated when doing unsorted data reading.");
+ }
+ if(fGetActivePads==kTRUE && fUnsorted==kFALSE){
+ HLTWarning("Argument '-active-pads' only work with unsorted data reading. Active pads list will not be produced.");
+ }
+
+
// Choose reader
if (fModeSwitch==kClusterFinderPacked) {
HLTDebug("using AliHLTTPCDigitReaderPacked");
fReader = new AliHLTTPCDigitReaderPacked();
- if(oldRCUFormat==1){
+ /*
+ if(oldRCUFormat==1){
fReader->SetOldRCUFormat(kTRUE);
- }
- else if(oldRCUFormat!=0){
+ }
+ else if(oldRCUFormat!=0){
HLTWarning("Wrong oldrcuformat specifier %d; oldrcuformat set to default(kFALSE)",oldRCUFormat);
- }
+ }
+ */
if(fUnsorted==1){
fReader->SetUnsorted(kTRUE);
}
else
fClusterFinder->SetOccupancyLimit(1.0);
- // Variables to setup the Clusterfinder
- // TODO: this sounds strange and has to be verified; is the cluster finder not working when
- // fClusterDeconv = false ?
- fClusterDeconv = true;
- fXYClusterError = -1;
- fZClusterError = -1;
-
-
- fClusterFinder->SetDeconv( fClusterDeconv );
+
+ fClusterFinder->SetDeconv(fClusterDeconv);
+ fClusterFinder->SetDeconvPad(fDeconvPad);
+ fClusterFinder->SetDeconvTime(fDeconvPad);
fClusterFinder->SetXYError( fXYClusterError );
fClusterFinder->SetZError( fZClusterError );
- if ( (fXYClusterError>0) && (fZClusterError>0) )
+ if ( (fXYClusterError>0) && (fZClusterError>0) ){
fClusterFinder->SetCalcErr( false );
- fClusterFinder->SetSignalThreshold(sigthresh);
- fClusterFinder->SetNSigmaThreshold(sigmathresh);
+ }
+ // fClusterFinder->SetSignalThreshold(sigthresh);
+ // fClusterFinder->SetNSigmaThreshold(sigmathresh);
+
+ if(fFirstTimeBin>0){
+ fClusterFinder->SetFirstTimeBin(fFirstTimeBin);
+ }
+ if(fLastTimeBin>0 && fLastTimeBin>fFirstTimeBin && fLastTimeBin<=AliHLTTPCTransform::GetNTimeBins()){
+ fClusterFinder->SetLastTimeBin(fLastTimeBin);
+ }
return 0;
}
if(fGetActivePads){
fClusterFinder->SetDoPadSelection(kTRUE);
}
-
- fClusterFinder->ReadDataUnsorted(iter->fPtr, iter->fSize);
+
+ if(fDeconvTime){
+ fClusterFinder->ReadDataUnsortedDeconvoluteTime(iter->fPtr, iter->fSize);
+ }
+ else{
+ fClusterFinder->ReadDataUnsorted(iter->fPtr, iter->fSize);
+ }
fClusterFinder->FindClusters();
}
* Implementation of the cluster finder component.
* The component implements the interface methods of the @ref AliHLTProcessor.
* The actual cluster finding algorithm is implemented in @ref AliHLTTPCClusterFinder.
- * The component can handle unpacked and packed data of different formats via the
- * AliHLTTPCDigitReader implementations. Two components are registered, the
- * TPCClusterFinderUnpacked and the TPCClusterFinderPacked. The latter one can
- * instantiate different digit readers depending on the arguments.
+ * Two components are registered, TPCClusterFinderPacked and TPCClusterFinderDecoder.
+ * TPCClusterFinderDecoder use the AliTPCRawStream class for decoding of the data, while TPCClusterFinderDecoder
+ * use the AliAltroDecoder for decoding the data.
+ *
+ * TPCClusterFinderDecoder is the fastest of the two, this is due to that the AliAltroDecoder
+ * returns data in a bunch format. A bunch consist of consecutive signals.
+ * TPCClusterFinderPacked first have to read the data one by one, which means that row, pad and
+ * time signals have to be compared between each new digit, which leads to a slower alorithm.
*
- * The component has the following component arguments:
- * - adc-threshold ADC count threshold for zero suppression, if <0 the base line
- * calculation and subtraction is switched off
- * - pp-run set parameters specific to a pp run; currently this switches
- * cluster deconvolution off for pp runs (not true for unsorted reading)
- * - unsorted if 1 the data will be read unsorted in to a PadArray object. This should
- * only be done on patch level since it use a lot of memory
- * - patch specify on which patch to resd the data unsorted
+ * Component ID: \b TPCClusterFinderDecoder and TPCClusterFinderPacked <br>
+ * Library: \b libAliHLTTPC
+ *
+ * Mandatory arguments: <br>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ *
+ * Optional arguments: <br>
+ * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
+ * \li -deconvolute-time <br>
+ * Turns on deconvolution in the time direction.
+ * \li -deconvolute-pad <br>
+ * Turns on deconvolution in the pad direction.
+ * \li -timebins <br>
+ * Sets the number of timebins (446 for simulated data, and 1024 for real data) Default:1024
+ * \li -first-timebin <br>
+ * First timebin taken into consideration when reading the data.
+ * \li -last-timebin <br>
+ * Last timebin taken into consideration when reading the data.
+ * \li -sorted <br>
+ * Switch off unsorted reading of data. Equivalent to the old argument unsorted 0.
+ * \li -active-pads <br>
+ * Switch off unsorted reading of data. Equivalent to the old argument unsorted 0.
+ * \li -occupancy-limit <br>
+ * Set the occupancy limit for the sorted clusterfinding.
+ *
+ *
+ * Obsolete arguments: <br>
+ * \li occupancy-limit <br>
+ * \li rawreadermode <br>
+ * \li pp-run <br>
+ * \li adc-threshold <br>
+ * \li oldrcuformat <br>
+ * \li unsorted <br>
+ * \li nsigma-threshold <br>
*
* @ingroup alihlt_tpc_components
*/
/** the reader object for data decoding */
AliHLTTPCDigitReader* fReader; //!transient
- bool fClusterDeconv; //!transient
- float fXYClusterError; //!transient
+ /** flag to deconvolute in time direction */
+ Bool_t fDeconvTime; //!transient
+
+ /** flag to deconvolute in pad direction */
+ Bool_t fDeconvPad; //!transient
+ /** flag to switch on/off deconvolution in pad and time directions (used by sorted clusterfinding method) */
+ bool fClusterDeconv; //!transient
+ /** Error in xy of cluster */
+ float fXYClusterError; //!transient
+ /** Error in Z direction of cluster */
float fZClusterError; //!transient
/**
* switch to indicated the reader
* use fModeSwitch = 1 for unpacked inputtype "gkUnpackedRawDataType"
* use fModeSwitch = 2 for packed inputtype "gkDDLPackedRawDataType" with new digit reader
*/
- Int_t fModeSwitch; // see above
+ Int_t fModeSwitch; // see above
/*
* Reads the data the new unsorted way if true
Int_t fPatch; //!transient
/*
- * Switch to specify if one ship out a list of active pads.
- * Used for the 2007 December run.
+ * Switch to specify if one ship out a list of active pads (pads conected to a cluster).
*/
Int_t fGetActivePads; //!transient
- ClassDef(AliHLTTPCClusterFinderComponent, 4)
+ /** First timebin taken into account when reading the data */
+ Int_t fFirstTimeBin; //!transient
+
+ /** Last timebin taken in to account when reading the data */
+ Int_t fLastTimeBin; //!transient
+
+ ClassDef(AliHLTTPCClusterFinderComponent, 5)
};
#endif
-// @(#) $Id$
-
-/**************************************************************************
- * This file is property of and copyright by the ALICE HLT Project *
- * ALICE Experiment at CERN, All rights reserved. *
- * *
- * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
- * Kenneth Aamodt <Kenneth.aamodt@ift.uib.no> *
- * for The ALICE HLT Project. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
+// $Id$
+
+//**************************************************************************
+//* This file is property of and copyright by the ALICE HLT Project *
+//* ALICE Experiment at CERN, All rights reserved. *
+//* *
+//* Primary Authors: Timm Steinbeck, Matthias Richter *
+//* Developers: Kenneth Aamodt <kenneth.aamodt@student.uib.no> *
+//* for The ALICE HLT Project. *
+//* *
+//* Permission to use, copy, modify and distribute this software and its *
+//* documentation strictly for non-commercial purposes is hereby granted *
+//* without fee, provided that the above copyright notice appears in all *
+//* copies and that both the copyright notice and this permission notice *
+//* appear in the supporting documentation. The authors make no claims *
+//* about the suitability of this software for any purpose. It is *
+//* provided "as is" without express or implied warranty. *
+//**************************************************************************
/** @file AliHLTTPCPad.cxx
@author Matthias Richter, Kenneth Aamodt
@brief Container Class for TPC Pads.
*/
-// see header file for class documentation
-// or
-// refer to README to build package
-// or
-// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
-
#if __GNUC__>= 3
using namespace std;
#endif
fDataSignals(NULL),
fSignalPositionArray(NULL),
fSizeOfSignalPositionArray(0),
- fNGoodSignalsSent(0),
- fNSigmaThreshold(0),
- fSignalThreshold(0)
+ fNGoodSignalsSent(0)
{
// see header file for class documentation
// or
fDataSignals(NULL),
fSignalPositionArray(NULL),
fSizeOfSignalPositionArray(0),
- fNGoodSignalsSent(0),
- fNSigmaThreshold(0),
- fSignalThreshold(0)
+ fNGoodSignalsSent(0)
{
// see header file for class documentation
// or
fDataSignals(NULL),
fSignalPositionArray(NULL),
fSizeOfSignalPositionArray(0),
- fNGoodSignalsSent(0),
- fNSigmaThreshold(0),
- fSignalThreshold(0)
+ fNGoodSignalsSent(0)
{
// see header file for class documentation
}
*/
void PrintRawData();
- /**
- * Set the Signal Threshold
- */
- void SetSignalThreshold(Int_t i){fSignalThreshold=i;}
-
- /**
- * Set the nSigma threshold
- */
- void SetNSigmaThreshold(Double_t i){fNSigmaThreshold=i;}
-
/**
* Vector of cluster candidates
*/
/** Number of good signals sent (good signals is signals surviving ZeroSuppression) */
Int_t fNGoodSignalsSent;
- /** Number of sigma threshold for the ZeroSuppression */
- Double_t fNSigmaThreshold; //! transient
-
- /** Signal threshold for the ZeroSuppression */
- Double_t fSignalThreshold; //! transient
-
- ClassDef(AliHLTTPCPad, 5)
+ ClassDef(AliHLTTPCPad, 6)
};
#endif // ALIHLTTPCPAD_H
* The reconstruction is done from the TPC digits.
*
* The output is written to an ESD file either using the TPCEsdWriter (an
- * AliFileWriter) or the TPCEsdConverter with an attached EsdCollector.
+ * AliHLTFileWriter) or the TPCEsdConverter with an attached EsdCollector.
*
* Matthias.Richter@ift.uib.no
*/
// cluster finder components
cf.Form("CF_%02d_%d", slice, part);
- AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinderUnpacked", publisher.Data(), "pp-run timebins 446");
+ AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinderUnpacked", publisher.Data(), "-timebins 446 -sorted");
if (trackerInput.Length()>0) trackerInput+=" ";
trackerInput+=cf;
}
// cluster finder components
cf.Form("CF_%02d_%d", slice, part);
- AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinderUnpacked", publisher.Data(), "pp-run timebins 446");
+ AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinderUnpacked", publisher.Data(), "-timebins 446 -sorted");
if (trackerInput.Length()>0) trackerInput+=" ";
trackerInput+=cf;
}
* aliroot -b -q rec-hlt-tpc.C'("input.root")'
* </pre>
*
+ * By the second parameter the digit reader can be chosen, default is
+ * AliHLTTPCDigitReaderPacked (=false). Set to true to use
+ * AliHLTTPCDigitReaderDecoder
+ *
* In the first section, an analysis chain is defined. The scale of the
* chain can be defined by choosing the range of sectors and partitions.
*
* @ingroup alihlt_tpc
* @author Matthias.Richter@ift.uib.no
*/
-void rec_hlt_tpc(const char* input="./")
+void rec_hlt_tpc(const char* input="./", bool bUseClusterFinderDecoder=false)
{
if (!input) {
cerr << "please specify input or run without arguments" << endl;
gSystem->Load("libHLTrec.so");
AliHLTSystem* gHLT=AliHLTReconstructorBase::GetInstance();
- // choose between ClusterFinderDecoder (true) and ClusterFinderPacked (false)
- bool bUseClusterFinderDecoder=false;
-
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// define the analysis chain to be run
int iMinPart=0;
int iMaxPart=5;
TString writerInput;
+ TString mergerInput;
for (int slice=iMinSlice; slice<=iMaxSlice; slice++) {
TString trackerInput;
for (int part=iMinPart; part<=iMaxPart; part++) {
// cluster finder components
cf.Form("CF_%02d_%d", slice, part);
if (bUseClusterFinderDecoder) {
- AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinderDecoder", publisher.Data(), "pp-run timebins 446 unsorted 1");
+ AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinderDecoder", publisher.Data(), "-timebins 446");
} else {
- AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinderPacked", publisher.Data(), "pp-run timebins 446 rawreadermode 4");
+ AliHLTConfiguration cfconf(cf.Data(), "TPCClusterFinderPacked", publisher.Data(), "-timebins 446 -sorted");
}
if (trackerInput.Length()>0) trackerInput+=" ";
trackerInput+=cf;
AliHLTConfiguration trackerconf(tracker.Data(), "TPCSliceTracker", trackerInput.Data(), "-pp-run -bfield 0.5");
if (writerInput.Length()>0) writerInput+=" ";
writerInput+=tracker;
+ if (mergerInput.Length()>0) mergerInput+=" ";
+ mergerInput+=tracker;
}
- // the writer configuration
- AliHLTConfiguration fwconf("sink1", "FileWriter" , writerInput.Data(), "-specfmt=_%d -subdir=out_%d -blcknofmt=_0x%x -idfmt=_0x%08x");
+ // specify whether to write all blocks separately or merge the tracks
+ // and convert to ESD
+ bool writeBlocks=false;
+
+ if (writeBlocks) {
+ // the writer configuration
+ AliHLTConfiguration fwconf("sink1", "FileWriter" , writerInput.Data(), "-specfmt=_%d -subdir=out_%d -blcknofmt=_0x%x -idfmt=_0x%08x");
+ } else {
+ // GlobalMerger component
+ AliHLTConfiguration mergerconf("globalmerger","TPCGlobalMerger",mergerInput.Data(),"");
+
+ // the esd converter configuration
+ AliHLTConfiguration esdcconf("esd-converter", "TPCEsdConverter" , "globalmerger", "-tree");
+
+ // the root file writer configuration
+ AliHLTConfiguration sink("sink1", "EsdCollector" , "esd-converter", "-directory hlt-tpc");
+ }
///////////////////////////////////////////////////////////////////////////////////////////////////
//