* This file is property of and copyright by the ALICE HLT Project *
* ALICE Experiment at CERN, All rights reserved. *
* *
- * Primary Authors: Anders Vestbo, Constantin Loizides, Jochen Thaeder *
- * Kenneth Aamodt <kenneth.aamodt@student.uib.no> *
+ * Primary Authors: Kenneth Aamodt, Kalliopi Kanaki *
* for The ALICE HLT Project. *
* *
* Permission to use, copy, modify and distribute this software and its *
**************************************************************************/
/** @file AliHLTTPCClusterFinder.cxx
- @author Anders Vestbo, Constantin Loizides, Jochen Thaeder
- Kenneth Aamodt kenneth.aamodt@student.uib.no
+ @author Kenneth Aamodt, Kalliopi Kanaki
@date
@brief Cluster Finder for the TPC
*/
void InitializePadArray();
Int_t DeInitializePadArray();
Bool_t ComparePads(AliHLTTPCPad *nextPad,AliHLTTPCClusters* candidate,Int_t nextPadToRead);
- private:
+ protected:
/** copy constructor prohibited */
AliHLTTPCClusterFinder(const AliHLTTPCClusterFinder&);
/** assignment operator prohibited */
* This file is property of and copyright by the ALICE HLT Project *
* ALICE Experiment at CERN, All rights reserved. *
* *
- * Primary Authors: Anders Vestbo, Constantin Loizides, Jochen Thaeder *
- * Kenneth Aamodt <kenneth.aamodt@student.uib.no> *
+ * Primary Authors: Kenneth Aamodt <kenneth.aamodt@student.uib.no> *
* for The ALICE HLT Project. *
* *
* Permission to use, copy, modify and distribute this software and its *
**************************************************************************/
/** @file AliHLTTPCKryptonClusterFinder.cxx
- @author Kenneth Aamodt kenneth.aamodt@student.uib.no
+ @author Kenneth Aamodt, Kalliopi Kanaki
@date
@brief Krypton Cluster Finder for the TPC
*/
#include "AliHLTTPCDigitReader.h"
-#include "AliHLTTPCRootTypes.h"
-#include "AliHLTTPCLogging.h"
#include "AliHLTTPCKryptonClusterFinder.h"
-#include "AliHLTTPCDigitData.h"
#include "AliHLTTPCTransform.h"
-#include "AliHLTTPCSpacePointData.h"
-#include "AliHLTTPCMemHandler.h"
-#include "AliHLTTPCPad.h"
-#include <sys/time.h>
#if __GNUC__ >= 3
using namespace std;
ClassImp(AliHLTTPCKryptonClusterFinder)
AliHLTTPCKryptonClusterFinder::AliHLTTPCKryptonClusterFinder()
- :
- fSpacePointData(NULL),
- fDigitReader(NULL),
- fPtr(NULL),
- fSize(0),
- fFirstRow(0),
- fLastRow(0),
- fCurrentRow(0),
- fCurrentSlice(0),
- fCurrentPatch(0),
- fMatch(1),
- fThreshold(10),
- fNClusters(0),
- fMaxNClusters(0),
- fXYErr(0.2),
- fZErr(0.3),
- fVectorInitialized(kFALSE),
- fRowPadVector(),
- fClusters(),
- fTimebinsInBunch(),
- fIndexOfBunchStart(),
- fNumberOfPadsInRow(NULL),
- fNumberOfRows(0),
- fRowOfFirstCandidate(0)
+ : AliHLTTPCClusterFinder(),
+ fTimebinsInBunch(),
+ fIndexOfBunchStart()
{
//constructor
}
-AliHLTTPCKryptonClusterFinder::~AliHLTTPCKryptonClusterFinder()
-{
- //destructor
- if(fVectorInitialized){
- DeInitializePadArray();
- }
- if(fNumberOfPadsInRow){
- delete [] fNumberOfPadsInRow;
- fNumberOfPadsInRow=NULL;
- }
-}
-
-void AliHLTTPCKryptonClusterFinder::InitializePadArray(){
- // see header file for class documentation
-
- if(fCurrentPatch>5||fCurrentPatch<0){
- HLTFatal("Patch is not set");
- return;
- }
-
- HLTDebug("Patch number=%d",fCurrentPatch);
-
- fFirstRow = AliHLTTPCTransform::GetFirstRow(fCurrentPatch);
- fLastRow = AliHLTTPCTransform::GetLastRow(fCurrentPatch);
-
- fNumberOfRows=fLastRow-fFirstRow+1;
- fNumberOfPadsInRow= new UInt_t[fNumberOfRows];
-
- memset( fNumberOfPadsInRow, 0, sizeof(Int_t)*(fNumberOfRows));
-
- for(UInt_t i=0;i<fNumberOfRows;i++){
- fNumberOfPadsInRow[i]=AliHLTTPCTransform::GetNPads(i+fFirstRow);
- AliHLTTPCPadVector tmpRow;
- for(UInt_t j=0;j<fNumberOfPadsInRow[i];j++){
- AliHLTTPCPad *tmpPad = new AliHLTTPCPad(2);
- tmpPad->SetID(i,j);
- tmpRow.push_back(tmpPad);
- }
- fRowPadVector.push_back(tmpRow);
- }
- fVectorInitialized=kTRUE;
-}
-
-Int_t AliHLTTPCKryptonClusterFinder::DeInitializePadArray()
-{
- // see header file for class documentation
- for(UInt_t i=0;i<fNumberOfRows;i++){
- for(UInt_t j=0;j<fNumberOfPadsInRow[i];j++){
- delete fRowPadVector[i][j];
- fRowPadVector[i][j]=NULL;
- }
- fRowPadVector[i].clear();
- }
- fRowPadVector.clear();
- return 1;
-}
-
-void AliHLTTPCKryptonClusterFinder::InitSlice(Int_t slice,Int_t patch,Int_t firstrow, Int_t lastrow,Int_t nmaxpoints)
-{
- //init slice
- fNClusters = 0;
- fMaxNClusters = nmaxpoints;
- fCurrentSlice = slice;
- fCurrentPatch = patch;
- fFirstRow = firstrow;
- fLastRow = lastrow;
-}
-
void AliHLTTPCKryptonClusterFinder::ReBunch(const UInt_t *bunchData , Int_t bunchSize){
fTimebinsInBunch.clear();
fIndexOfBunchStart.clear();
if(!fVectorInitialized){
InitializePadArray();
- }
+ }
fDigitReader->InitBlock(fPtr,fSize,fFirstRow,fLastRow,fCurrentPatch,fCurrentSlice);
}
}
-Bool_t AliHLTTPCKryptonClusterFinder::ComparePads(AliHLTTPCPad *nextPad,AliHLTTPCClusters* cluster,Int_t nextPadToRead){
- //Checking if we have a match on the next pad
- 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){
- cluster->fMean=candidate->fMean;
- cluster->fTotalCharge+=candidate->fTotalCharge;
- cluster->fTime += candidate->fTime;
- cluster->fTime2 += candidate->fTime2;
- cluster->fPad+=candidate->fPad;
- cluster->fPad2=candidate->fPad2;
- cluster->fLastMergedPad=candidate->fPad;
-
- //setting the matched pad to used
- nextPad->fUsedClusterCandidates[candidateNumber]=1;
- nextPadToRead++;
- if(nextPadToRead<(Int_t)fNumberOfPadsInRow[fRowOfFirstCandidate]){
- nextPad=fRowPadVector[fRowOfFirstCandidate][nextPadToRead];
- ComparePads(nextPad,cluster,nextPadToRead);
- }
- else{
- return kFALSE;
- }
- }
- else{
- return kFALSE;
- }
- }
- return kFALSE;
-}
-
-void AliHLTTPCKryptonClusterFinder::FindNormalClusters()
+void AliHLTTPCKryptonClusterFinder::FindRowClusters()
{
// see header file for function documentation
}
if(tmpCluster->fRowNumber==nextCluster->fRowNumber-1){//Checks if the row numbers are ok (next to eachother)
- // if(abs((Int_t)(tmpCluster->fPad/tmpCluster->fTotalCharge) - (Int_t)(nextCluster->fPad/nextCluster->fTotalCharge))<3){ // checks if the pad numbers are ok
if(abs((Int_t)(tmpCluster->fPad) - (Int_t)(nextCluster->fPad))<3){ // checks if the pad numbers are ok
if(abs((Int_t)tmpCluster->fMean-(Int_t)nextCluster->fMean)<2){
tmpCluster->fMean=nextCluster->fMean;
}
}
}
-
-void AliHLTTPCKryptonClusterFinder::PrintClusters()
-{
- // 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("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("TimeError: %d",fClusters[i].fTime2);
- HLTInfo("EndOfCluster:");
- }
-}
* See cxx source for full Copyright notice */
/** @file AliHLTTPCKryptonClusterFinder.h
- @author Anders Vestbo, Constantin Loizides, Jochen Thaeder
- Kenneth Aamodt kenneth.aamodt@student.uib.no
+ @author Kenneth Aamodt kenneth.aamodt@student.uib.no
@date
- @brief Cluster Finder for the TPC
+ @brief Krypton Cluster Finder for the TPC
*/
// see below for class documentation
// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
-#include "AliHLTLogging.h"
-#include "AliHLTTPCPad.h"
+//#include "AliHLTLogging.h"
+//#include "AliHLTTPCPad.h"
+#include "AliHLTTPCClusterFinder.h"
class AliHLTTPCSpacePointData;
class AliHLTTPCDigitReader;
-class AliHLTTPCKryptonClusterFinder : public AliHLTLogging {
+class AliHLTTPCKryptonClusterFinder : public AliHLTTPCClusterFinder {
public:
- struct AliClusterData
- {
- UInt_t fTotalCharge; //tot charge of cluster
- UInt_t fPad; //pad value
- UInt_t fTime; //time value
- ULong64_t fPad2; //for error in XY direction
- ULong64_t fTime2; //for error in Z direction
- UInt_t fMean; //mean in time
- UInt_t fFlags; //different flags
- UInt_t fChargeFalling; //for deconvolution
- UInt_t fLastCharge; //for deconvolution
- UInt_t fLastMergedPad; //dont merge twice per pad
- Int_t fRow; //row value
- };
- typedef struct AliClusterData AliClusterData; //!
-
/** standard constructor */
AliHLTTPCKryptonClusterFinder();
/** destructor */
- virtual ~AliHLTTPCKryptonClusterFinder();
-
- void InitSlice(Int_t slice,Int_t patch,Int_t firstrow, Int_t lastrow,Int_t maxpoints);
+ // virtual ~AliHLTTPCKryptonClusterFinder();
- void SetReader(AliHLTTPCDigitReader* f){fDigitReader = f;}
+ void ReBunch(const UInt_t * bunchData,Int_t bunchSize);
- void PrintClusters();
+ void ReadDataUnsorted(void* ptr,unsigned long size);
- Int_t GetNumberOfClusters() const {return fNClusters;}
+ void FindRowClusters();
- void ReBunch(const UInt_t * bunchData,Int_t bunchSize);
- void ReadDataUnsorted(void* ptr,unsigned long size);
- void FindNormalClusters();
void FindKryptonClusters();
+
void CheckForCandidateOnPreviousPad(AliHLTTPCClusters* tmpCluster);
- void SetPatch(Int_t patch){fCurrentPatch=patch;}
- void InitializePadArray();
- Int_t DeInitializePadArray();
- Bool_t ComparePads(AliHLTTPCPad *nextPad,AliHLTTPCClusters* candidate,Int_t nextPadToRead);
+
+ // Bool_t ComparePads(AliHLTTPCPad *nextPad,AliHLTTPCClusters* candidate,Int_t nextPadToRead);
+
private:
/** copy constructor prohibited */
AliHLTTPCKryptonClusterFinder(const AliHLTTPCKryptonClusterFinder&);
/** assignment operator prohibited */
AliHLTTPCKryptonClusterFinder& operator=(const AliHLTTPCKryptonClusterFinder&);
- AliHLTTPCSpacePointData *fSpacePointData; //! array of space points
- AliHLTTPCDigitReader *fDigitReader; //! reader instance
-
- UChar_t* fPtr; //! pointer to packed block
- unsigned long fSize; //packed block size
-
- Int_t fFirstRow; //first row
- Int_t fLastRow; //last row
- Int_t fCurrentRow; //current active row
- Int_t fCurrentSlice; //current slice
- Int_t fCurrentPatch; //current patch
- Int_t fMatch; //size of match
- UInt_t fThreshold; //Threshold on total charge for krypton cluster
-
- Int_t fNClusters; //number of found clusters
- Int_t fMaxNClusters; //max. number of clusters
- Float_t fXYErr; //fixed error in XY
- Float_t fZErr; //fixed error in Z
-
- Bool_t fVectorInitialized;
-
- typedef vector<AliHLTTPCPad*> AliHLTTPCPadVector;
-
- vector<AliHLTTPCPadVector> fRowPadVector; //! transient
-
- vector<AliHLTTPCClusters> fClusters; //! transient
-
vector<Int_t> fTimebinsInBunch; //! transient
vector<Int_t> fIndexOfBunchStart; //! transient
- UInt_t* fNumberOfPadsInRow; //! transient
-
- UInt_t fNumberOfRows; //! transient
-
- UInt_t fRowOfFirstCandidate;
-
ClassDef(AliHLTTPCKryptonClusterFinder,0) //Fast cluster finder
};
#endif
#include "AliHLTTPCDefinitions.h"
#include "AliCDBEntry.h"
#include "AliCDBManager.h"
+#include "TH1F.h"
#include <cstdlib>
#include <cerrno>
AliHLTTPCKryptonClusterFinderComponent::AliHLTTPCKryptonClusterFinderComponent()
:
- fClusterFinder(NULL),
+ fKryptonClusterFinder(NULL),
fReader(NULL)
{
// see header file for class documentation
{
// see header file for class documentation
tgtList.clear();
- tgtList.push_back(AliHLTTPCDefinitions::fgkClustersDataType);
+ tgtList.push_back(kAliHLTDataTypeHistogram);
return tgtList.size();
}
int AliHLTTPCKryptonClusterFinderComponent::DoInit( int argc, const char** argv )
{
// see header file for class documentation
- if ( fClusterFinder )
+ if ( fKryptonClusterFinder )
return EINPROGRESS;
- fClusterFinder = new AliHLTTPCKryptonClusterFinder();
+ fKryptonClusterFinder = new AliHLTTPCKryptonClusterFinder();
Int_t i = 0;
}
fReader = new AliHLTTPCDigitReaderDecoder();
- fClusterFinder->SetReader(fReader);
+ fKryptonClusterFinder->SetReader(fReader);
return 0;
}
{
// see header file for class documentation
- if ( fClusterFinder )
- delete fClusterFinder;
- fClusterFinder = NULL;
+ if ( fKryptonClusterFinder )
+ delete fKryptonClusterFinder;
+ fKryptonClusterFinder = NULL;
if ( fReader )
delete fReader;
unsigned long ndx;
// == OUTdatatype pointer
- AliHLTTPCClusterData* outPtr;
+ TH1F* outPtr;
AliHLTUInt8_t* outBPtr;
UInt_t offset, mysize, nSize, tSize = 0;
+
+
outBPtr = outputPtr;
- outPtr = (AliHLTTPCClusterData*)outBPtr;
+ outPtr = (TH1F*)outBPtr;
Int_t slice, patch, row[2];
unsigned long maxPoints, realPoints = 0;
+ //warnings!!!
+ nSize=0;
+ realPoints=0;
+ maxPoints=0;
+ //end warnings
+
for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ )
{
iter = blocks+ndx;
row[1] = AliHLTTPCTransform::GetLastRow( patch );
- fClusterFinder->SetPatch(patch);
-
- outPtr = (AliHLTTPCClusterData*)outBPtr;
-
- maxPoints = (size-tSize-sizeof(AliHLTTPCClusterData))/sizeof(AliHLTTPCSpacePointData);
+ fKryptonClusterFinder->SetPatch(patch);
- fClusterFinder->InitSlice( slice, patch, row[0], row[1], maxPoints );
+ fKryptonClusterFinder->InitSlice( slice, patch, row[0], row[1], maxPoints );
- fClusterFinder->ReadDataUnsorted(iter->fPtr, iter->fSize);
+ fKryptonClusterFinder->ReadDataUnsorted(iter->fPtr, iter->fSize);
- fClusterFinder->FindNormalClusters();
+ fKryptonClusterFinder->FindRowClusters();
+
+ fKryptonClusterFinder->FindKryptonClusters();
+
+
- fClusterFinder->FindKryptonClusters();
- realPoints = fClusterFinder->GetNumberOfClusters();
-
-
AliHLTComponentBlockData bd;
FillBlockData( bd );
bd.fOffset = offset;
bd.fSize = mysize;
bd.fSpecification = iter->fSpecification;
- bd.fDataType = AliHLTTPCDefinitions::fgkClustersDataType;
- //AliHLTSubEventDescriptor::FillBlockAttributes( bd.fAttributes );
+ bd.fDataType = kAliHLTDataTypeHistogram;
outputBlocks.push_back( bd );
tSize += mysize;
outBPtr += mysize;
- outPtr = (AliHLTTPCClusterData*)outBPtr;
+ outPtr = (TH1F*)outBPtr;
if ( tSize > size )
* See cxx source for full Copyright notice */
/** @file AliHLTTPCKryptonClusterFinderComponent.h
- @author Timm Steinbeck, Matthias Richter, Jochen Thaeder
+ @author Kenneth Aamodt, Kalliopi Kanaki
@date
- @brief The TPC cluster finder component.
+ @brief The TPC krypton cluster finder component.
*/
// see below for class documentation
/**
* constructor
- * @param mode input type see e.g. @ref kClusterFinderUnpacked
*/
AliHLTTPCKryptonClusterFinderComponent();
/** destructor */
/** assignment operator prohibited */
AliHLTTPCKryptonClusterFinderComponent& operator=(const AliHLTTPCKryptonClusterFinderComponent&);
/** the cluster finder object */
- AliHLTTPCKryptonClusterFinder* fClusterFinder; //!transient
+ AliHLTTPCKryptonClusterFinder* fKryptonClusterFinder; //!transient
/** the reader object for data decoding */
AliHLTTPCDigitReader* fReader; //!transient
ClassDef(AliHLTTPCKryptonClusterFinderComponent, 0)
-
};
#endif