Float_t ftime2=fZErr*fZErr; //fixed given error
-#if UNSORTED
- fCurrentRow=list[j].fRow;
-#endif
+
+ if(fUnsorted){
+ fCurrentRow=list[j].fRow;
+ }
+
if(fCalcerr) { //calc the errors, otherwice take the fixed error
Int_t patch = AliHLTTPCTransform::GetPatch(fCurrentRow);
// or
// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
-#define UNSORTED 0
#include "AliHLTLogging.h"
#include "AliHLTTPCPadArray.h"
void FindClusters();
Int_t GetActivePads(AliHLTTPCPadArray::AliHLTTPCActivePads* activePads,Int_t maxActivePads);
void WriteClusters(Int_t nclusters,AliHLTTPCClusters *list);
-
+ void SetUnsorted(Int_t unsorted){fUnsorted=unsorted;}
+
private:
/** copy constructor prohibited */
AliHLTTPCClusterFinder(const AliHLTTPCClusterFinder&);
AliHLTTPCPadArray * fPadArray; //! transient
+ Int_t fUnsorted; // enable for processing of unsorted digit data
#ifdef do_mc
void GetTrackID(Int_t pad,Int_t time,Int_t *trackID);
#endif
- ClassDef(AliHLTTPCClusterFinder,1) //Fast cluster finder
+ ClassDef(AliHLTTPCClusterFinder,2) //Fast cluster finder
};
#endif
continue;
}
- // -- checking for unsorted clusterfinding
- if ( !strcmp( argv[i], "patch" ) ) {
- fPatch = strtoul( argv[i+1], &cpErr ,0);
- if ( *cpErr ){
- HLTError("Cannot convert patch specifier '%s'. Should be between 0 and 5, 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);
else if(oldRCUFormat!=0){
HLTWarning("Wrong oldrcuformat specifier %d; oldrcuformat set to default(kFALSE)",oldRCUFormat);
}
- if(fUnsorted){
+ if(fUnsorted==1){
fReader->SetUnsorted(kTRUE);
}
fClusterFinder->SetReader(fReader);
fClusterFinder->SetCalcErr( false );
fClusterFinder->SetSignalThreshold(sigthresh);
fClusterFinder->SetNSigmaThreshold(sigmathresh);
- if(fUnsorted&&fPatch>-1&&fPatch<6){
- fPadArray = new AliHLTTPCPadArray(fPatch);
- fPadArray->InitializeVector();
- }
return 0;
}
row[0] = AliHLTTPCTransform::GetFirstRow( patch );
row[1] = AliHLTTPCTransform::GetLastRow( patch );
+ if(fUnsorted){
+ if(fPadArray==NULL){
+ fClusterFinder->SetUnsorted(fUnsorted);
+ fPadArray = new AliHLTTPCPadArray(patch);
+ fPadArray->InitializeVector();
+ }
+ else if(fPadArray->GetPatch()!=patch||fPadArray->GetPatch()==-1){
+ if (GetEventCount()<3) {
+ HLTWarning("pad array not initialized for data of specification 0x%08x, block skipped", iter->fSpecification);
+ } else if ((GetEventCount()%5000)==0) { // assuming 0.5 to 1kHz this gives a message rate of 0.1 to 0.5 Hz
+ HLTWarning("reminder: pad array not initialized for data of specification 0x%08x", iter->fSpecification);
+ }
+ continue;
+ }
+ }
+
outPtr = (AliHLTTPCClusterData*)outBPtr;
maxPoints = (size-tSize-sizeof(AliHLTTPCClusterData))/sizeof(AliHLTTPCSpacePointData);
fClusterFinder->SetPadArray(fPadArray);
-
+ /*
double totalT=0;
struct timeval startT, endT;
gettimeofday( &startT, NULL );
-
+ */
fClusterFinder->ReadDataUnsorted(iter->fPtr, iter->fSize );
-
+ /*
gettimeofday( &endT, NULL );
unsigned long long dt;
dt = endT.tv_sec-startT.tv_sec;
dtd, dtd/1000.0, dtd/1000000.0 );
cout<<endl;
+ */
fClusterFinder->FindClusters();
}
else{
#include "AliRawReaderMemory.h"
#include "AliRawDataHeader.h"
-#if ENABLE_PAD_SORTING
+//#if ENABLE_PAD_SORTING
#include "AliHLTTPCTransform.h"
-#endif // ENABLE_PAD_SORTING
+//#endif // ENABLE_PAD_SORTING
#include "AliHLTStdIncludes.h"
ClassImp(AliHLTTPCDigitReaderPacked)
#if defined(HAVE_ALIRAWDATA) && defined(HAVE_ALITPCRAWSTREAM_H)
AliHLTTPCDigitReaderPacked::AliHLTTPCDigitReaderPacked()
:
-#if ENABLE_PAD_SORTING
+ //#if ENABLE_PAD_SORTING
fCurrentRow(0),
fCurrentPad(0),
fCurrentBin(-1),
fNMaxPads(0),
fNTimeBins(0),
fData(NULL),
-#endif // ENABLE_PAD_SORTING
+ //#endif // ENABLE_PAD_SORTING
fRawMemoryReader(NULL),
fTPCRawStream(NULL),
- fOldRCUFormat(kFALSE)
+ fOldRCUFormat(kFALSE),
+ fUnsorted(kFALSE)
{
fRawMemoryReader = new AliRawReaderMemory;
fTPCRawStream = new AliTPCRawStream( fRawMemoryReader );
-#if ENABLE_PAD_SORTING
+ //#if ENABLE_PAD_SORTING
// get max number of rows
for (Int_t ii=0; ii < 6; ii++)
if (AliHLTTPCTransform::GetNRows(ii) > fNMaxRows)
// init Data array
fData = new Int_t[ fNMaxRows*fNMaxPads*fNTimeBins ];
-#endif // ENABLE_PAD_SORTING
+ //#endif // ENABLE_PAD_SORTING
}
AliHLTTPCDigitReaderPacked::~AliHLTTPCDigitReaderPacked(){
if ( fTPCRawStream )
delete fTPCRawStream;
fTPCRawStream = NULL;
-#if ENABLE_PAD_SORTING
+ //#if ENABLE_PAD_SORTING
if ( fData )
delete [] fData;
fData = NULL;
-#endif // ENABLE_PAD_SORTING
+ //#endif // ENABLE_PAD_SORTING
}
Int_t AliHLTTPCDigitReaderPacked::InitBlock(void* ptr,unsigned long size, Int_t patch, Int_t slice){
if(fOldRCUFormat)
fTPCRawStream->SetOldRCUFormat(kTRUE);
-#if ENABLE_PAD_SORTING
+ if(!fUnsorted){
+ //#if ENABLE_PAD_SORTING
fCurrentRow = 0;
fCurrentPad = 0;
}
}
}
-#endif // ENABLE_PAD_SORTING
-
+ //#endif // ENABLE_PAD_SORTING
+ }
return 0;
}
Bool_t AliHLTTPCDigitReaderPacked::NextSignal(){
Bool_t readvalue = kTRUE;
-#if ENABLE_PAD_SORTING
- while (1) {
+ if(!fUnsorted){//added for test
+ //#if ENABLE_PAD_SORTING
+ while (1) {
fCurrentBin++;
if (fCurrentBin >= fNTimeBins){
fCurrentBin = 0;
}
if (fData[ fCurrentRow*fNMaxPads*fNTimeBins + fCurrentPad*fNTimeBins + fCurrentBin ] != -1) break;
- }
-#else // !ENABLE_PAD_SORTING
- readvalue = fTPCRawStream->Next();
-#endif // ENABLE_PAD_SORTING
+ }
+ }// added for test
+ else{//added for test
+ //#else // !ENABLE_PAD_SORTING
+ readvalue = fTPCRawStream->Next();
+ }//added for test
+ //#endif // ENABLE_PAD_SORTING
return readvalue;
}
Int_t AliHLTTPCDigitReaderPacked::GetRow(){
-#if ENABLE_PAD_SORTING
+ /*#if ENABLE_PAD_SORTING
return (fCurrentRow + fRowOffset);
#else // !ENABLE_PAD_SORTING
return (Int_t) fTPCRawStream->GetRow();
#endif // ENABLE_PAD_SORTING
+ */
+ if(!fUnsorted){
+ return (fCurrentRow + fRowOffset);
+ }
+ else{
+ return (Int_t) fTPCRawStream->GetRow();
+ }
}
int AliHLTTPCDigitReaderPacked::GetPad(){
-#if ENABLE_PAD_SORTING
- return fCurrentPad;
-#else // !ENABLE_PAD_SORTING
- return fTPCRawStream->GetPad();
-#endif // ENABLE_PAD_SORTING
+ /*#if ENABLE_PAD_SORTING
+ return fCurrentPad;
+ #else // !ENABLE_PAD_SORTING
+ return fTPCRawStream->GetPad();
+ #endif // ENABLE_PAD_SORTING
+ */
+ if(!fUnsorted){
+ return fCurrentPad;
+ }
+ else{
+ return fTPCRawStream->GetPad();
+ }
}
Int_t AliHLTTPCDigitReaderPacked::GetSignal(){
-#if ENABLE_PAD_SORTING
- return fData[ fCurrentRow*fNMaxPads*fNTimeBins+ fCurrentPad*fNTimeBins + fCurrentBin ];
-#else // !ENABLE_PAD_SORTING
- return fTPCRawStream->GetSignal();
-#endif // ENABLE_PAD_SORTING
+ /*
+ #if ENABLE_PAD_SORTING
+ return fData[ fCurrentRow*fNMaxPads*fNTimeBins+ fCurrentPad*fNTimeBins + fCurrentBin ];
+ #else // !ENABLE_PAD_SORTING
+ return fTPCRawStream->GetSignal();
+ #endif // ENABLE_PAD_SORTING
+ */
+ if(!fUnsorted){
+ return fData[ fCurrentRow*fNMaxPads*fNTimeBins+ fCurrentPad*fNTimeBins + fCurrentBin ];
+ }
+ else{
+ return fTPCRawStream->GetSignal();
+ }
}
Int_t AliHLTTPCDigitReaderPacked::GetTime(){
-#if ENABLE_PAD_SORTING
- return fCurrentBin;
-#else // !ENABLE_PAD_SORTING
- return fTPCRawStream->GetTime();
-#endif // ENABLE_PAD_SORTING
+ /*
+ #if ENABLE_PAD_SORTING
+ return fCurrentBin;
+ #else // !ENABLE_PAD_SORTING
+ return fTPCRawStream->GetTime();
+ #endif // ENABLE_PAD_SORTING
+ */
+ if(!fUnsorted){
+ return fCurrentBin;
+ }
+ else{
+ return fTPCRawStream->GetTime();
+ }
}
#endif //defined(HAVE_ALIRAWDATA) && defined(HAVE_ALITPCRAWSTREAM_H)
@brief A digit reader implementation for simulated, packed TPC 'raw' data.
*/
-#define ENABLE_PAD_SORTING 1
+//#define ENABLE_PAD_SORTING 1
#include "AliHLTTPCDigitReader.h"
/**
* @class AliHLTTPCDigitReaderPacked
* A digit reader implementation for simulated, packed TPC 'raw' data.
- * Includes reordering of the pads if @ref ENABLE_PAD_SORTING is 1.
+ * Includes reordering of the pads by default, sorting (and time and
+ * memory consuming intermediate storing of the data) can be disabled
+ * by @ref SetUnsorted(kTRUE).
* @ingroup alihlt_tpc
*/
class AliHLTTPCDigitReaderPacked : public AliHLTTPCDigitReader{
*/
Int_t InitBlock(void* ptr,ULong_t size, Int_t patch, Int_t slice);
void SetOldRCUFormat(bool oldrcuformat){fOldRCUFormat=oldrcuformat;}
+ void SetUnsorted(bool unsorted){fUnsorted=unsorted;}
Bool_t NextSignal();
Int_t GetRow();
Int_t GetPad();
AliHLTTPCDigitReaderPacked& operator=(const AliHLTTPCDigitReaderPacked&);
// Initialize AliROOT TPC raw stream parsing class
- AliRawReaderMemory *fRawMemoryReader;
+ AliRawReaderMemory *fRawMemoryReader; //!transient
- AliTPCRawStream *fTPCRawStream;
+ AliTPCRawStream *fTPCRawStream; //!transient
-#if ENABLE_PAD_SORTING
- Int_t fCurrentRow;
- Int_t fCurrentPad;
- Int_t fCurrentBin;
+ //#if ENABLE_PAD_SORTING
+ Int_t fCurrentRow; //!transient
+ Int_t fCurrentPad; //!transient
+ Int_t fCurrentBin; //!transient
- Int_t fRowOffset;
- Int_t fNRows;
+ Int_t fRowOffset; //!transient
+ Int_t fNRows; //!transient
- Int_t fNMaxRows;
- Int_t fNMaxPads;
- Int_t fNTimeBins;
+ Int_t fNMaxRows; //!transient
+ Int_t fNMaxPads; //!transient
+ Int_t fNTimeBins; //!transient
Int_t *fData;
-#endif // ENABLE_PAD_SORTING
+ //#endif // ENABLE_PAD_SORTING
- Bool_t fOldRCUFormat;
+ Bool_t fOldRCUFormat; //!transient
+ Bool_t fUnsorted; //!transient
- ClassDef(AliHLTTPCDigitReaderPacked, 0)
+ ClassDef(AliHLTTPCDigitReaderPacked, 1)
};
{
// see header file for class documentation
+ if(fSizeOfSignalPositionArray<2){
+ return;
+ }
+
if(fNSigmaThreshold>0){
ZeroSuppress(fNSigmaThreshold);
}
*/
void SetPatch(Int_t patch);
+ /**
+ * Get the patch number.
+ */
+ Int_t GetPatch(){return fPatch;}
+
/**
* Set the digit reader.
*/