#ifndef ALIHLTTPCPAD_H
#define ALIHLTTPCPAD_H
-/* This file is property of and copyright by the ALICE HLT Project *
- * ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
+//* This file is property of and copyright by the ALICE HLT Project *
+//* ALICE Experiment at CERN, All rights reserved. *
+//* See cxx source for full Copyright notice *
/** @file AliHLTTPCPad.h
@author Matthias Richter
@brief Container Class for TPC Pads.
*/
-// see below for class documentation
-// or
-// refer to README to build package
-// or
-// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
-
#include "AliHLTLogging.h"
#include "AliHLTTPCClusters.h"
+#include "AliHLTTPCDigitReader.h"
+#include "TH1F.h"
#include <vector>
+class AliHLTTPCDigitData;
+
typedef Int_t AliHLTTPCSignal_t;
+
/**
* @class AliHLTTPCPad
* The class is a container for the raw ADC data of one TPCS pad. In order to
/** standard constructor */
AliHLTTPCPad();
+ /**
+ * Constructor
+ * @param dummy dummy determines if one need the raw data. If a dummy number is given, the pad object will be initialized without using memory for raw data
+ */
+ AliHLTTPCPad(Int_t dummy);
+
/**
* Constructor
* @param offset The number of bins to ignore at the beginning
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 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
/**
* Get the row number.
+ * @return Row number
*/
Int_t GetRowNumber() const {return fRowNo;}
/**
- * Get the pad number.
+ * Get the pad number on the row.
+ * @return Pad number on row
*/
Int_t GetPadNumber() const {return fPadNo;}
*/
Int_t GetSize() const {return fNofBins;}
+ /*
+ * Clears the vector of cluster candidates.
+ */
+ void ClearCandidates();
+
/**
* Set the data array to -1
*/
void SetDataToDefault();
+
/**
* Stores the signal in the data array, stores the timebin number of the signal,
* and increments a counter.
+ * @param bin Timebin nuber of signal
+ * @param signal Size of signal
*/
void SetDataSignal(Int_t bin,Int_t signal);
/**
* Returns the signal in the specified bin
+ * @param bin Timebin number
+ * @return Signal in the given timebin
*/
Int_t GetDataSignal(Int_t bin) const;
* The method is checked with 2006 cosmics data, and it looks good.
* If you want to use the threshold approach you HAVE to set nSigma=-1 and threshold>0. For example: If you want all signals
* 30 adc counts above threshold you should call the function like this: ZeroSuppress(-1,30)
- * @param nSigma Specify nSigma above threshold default=3
- * @param threshold Specify what adc threshold above average default=20 (remember to give nSigma=-1 if you want to use this approach)
- * @param reqMinPoint Required minimum number of points to do zerosuppression default AliHLTTPCTransform::GetNTimeBins/2 (1024/2).
- * @param beginTime Lowest timebin value. Gating grid causes some problems in the first timebins. default= 50
- * @param endTime Highest timebin value. Default AliHLTTPCTransform::GetNTimeBins-1
+ * @param nRMS Specify nRMS threshold
+ * @param threshold Specify what adc threshold above average (remember to give nRMS=-1 if you want to use this approach)
+ * @param reqMinPoint Required minimum number of points to do zerosuppression default AliHLTTPCTransform::GetNTimeBins/2 (1024/2).
+ * @param beginTime Lowest timebin value. Gating grid causes some problems in the first timebins.
+ * @param endTime Highest timebin value.
+ * @param timebinsLeft Timebins to include left of the signals above threshold (to include tails)
+ * @param timebinsRight Timebins to include right of the signals above threshold (to include tails)
+ * @param valueBelowAverage The number of adc-counts below the average value. (sometimes there can be useful to also add some signals below average for your signals, especially when there is a lot of noise) It means that more of the tails of the signal is added.
+ * @param speedup Do not the full zero suppression but terminate if it is clear wheter the channel has some signal or not.
+ */
+ void ZeroSuppress(Double_t nRMS,Int_t threshold,Int_t reqMinPoint,Int_t beginTime,Int_t endTime,Int_t timebinsLeft, Int_t timebinsRight, Int_t valueBelowAverage, bool speedup=false);
+
+ /**
+ * Bool method which returns the timein number of the first signal and number of consecutive signals, used together with GetPointer(bin) to access data
+ * @param time Refernence to timebin number
+ * @param bunchSize Refernence to number of consecutive signals
+ * @return True if there are more signals
+ */
+ Bool_t GetNextGoodSignal(Int_t &time,Int_t &bunchSize);
+
+ /**
+ * Returns number of signals added
+ * @return Number of signals
*/
- void ZeroSuppress(Double_t nSigma,Int_t threshold,Int_t reqMinPoint,Int_t beginTime,Int_t endTime);
+ UInt_t GetNAddedSignals(){return fSizeOfSignalPositionArray;}
/**
- * Finds the cluster candidate. If atleast two signals in the data array are neighbours
- * they are stored in a cluster candidate vector.
+ * Returns the pointer to the first data signal
+ * @param bin Timebin number
+ * @return pointer to data signal in bin
*/
- void FindClusterCandidates();
+ UInt_t* GetPointer(Int_t bin){return (UInt_t*)&fDataSignals[bin]; }
+
/**
- * Prints the raw data og this pad.
+ * Adds cluster candidate to the fClusterCandidates.
*/
- void PrintRawData();
+ void AddClusterCandidate(const AliHLTTPCClusters& candidate);
- /**
- * Set the Signal Threshold
+ /**
+ * Adds the digits belonging to the candidate.
*/
- void SetSignalThreshold(Int_t i){fSignalThreshold=i;}
+ void AddCandidateDigits(const vector<AliHLTTPCDigitData>& candidateDigits);
+
/**
- * Set the nSigma threshold
+ * Returns the digit vector belonging to the candidate
*/
- void SetNSigmaThreshold(Double_t i){fNSigmaThreshold=i;}
+ vector<AliHLTTPCDigitData> *GetCandidateDigits(Int_t candidateIndex);
+ void ClearCandidateDigits(){fCandidateDigitsVector.clear();}
+
+ /**
+ * Prints the raw data og this pad.
+ */
+ void PrintRawData();
/**
* Vector of cluster candidates
/**
* Vector of used clustercandidates, used so one do not use candidates multiple times
*/
- vector<Int_t> fUsedClusterCandidates; //! transient
-
+ vector<Int_t> fUsedClusterCandidates; //! transient
+ Bool_t fSelectedPad; //! transient
+ AliHLTUInt16_t fHWAddress; //! transient
+
private:
/** copy constructor prohibited */
AliHLTTPCPad(const AliHLTTPCPad&);
* Array containing info on which bins have signals
*/
Int_t *fSignalPositionArray; //! transient
+
+ /** Size of signals in fSignalPositionArray */
Int_t fSizeOfSignalPositionArray; //! transient
+
+ /** Number of good signals sent (good signals is signals surviving ZeroSuppression) */
+ Int_t fNGoodSignalsSent;
- Double_t fNSigmaThreshold; //! transient
- Double_t fSignalThreshold; //! transient
+ vector<vector<AliHLTTPCDigitData> > fCandidateDigitsVector;
- ClassDef(AliHLTTPCPad, 3)
+ ClassDef(AliHLTTPCPad, 7)
};
#endif // ALIHLTTPCPAD_H