X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=HLT%2FTPCLib%2FAliHLTTPCPad.h;h=bc52eb781f2f2c9826b4130e088be58d96014dbd;hb=887a0bd90d64d1aa465845d3816eb6dea1064508;hp=5f1867c938a7851e449c66778a6e41caccc842b9;hpb=2a083ac4a12be2e438501cd150f0e1ce6d45e8a6;p=u%2Fmrichter%2FAliRoot.git diff --git a/HLT/TPCLib/AliHLTTPCPad.h b/HLT/TPCLib/AliHLTTPCPad.h index 5f1867c938a..bc52eb781f2 100644 --- a/HLT/TPCLib/AliHLTTPCPad.h +++ b/HLT/TPCLib/AliHLTTPCPad.h @@ -1,10 +1,11 @@ // -*- Mode: C++ -*- // @(#) $Id$ -#ifndef ALIHLTPAD_H -#define ALIHLTPAD_H -/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full Copyright notice */ +#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 * /** @file AliHLTTPCPad.h @author Matthias Richter @@ -13,9 +14,13 @@ */ #include "AliHLTLogging.h" +#include "AliHLTTPCClusters.h" +#include "TH1F.h" +#include typedef Int_t AliHLTTPCSignal_t; + /** * @class AliHLTTPCPad * The class is a container for the raw ADC data of one TPCS pad. In order to @@ -29,10 +34,16 @@ typedef Int_t AliHLTTPCSignal_t; * @ingroup alihlt_tpc */ class AliHLTTPCPad : public AliHLTLogging { - public: +public: /** 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 @@ -41,13 +52,27 @@ class AliHLTTPCPad : public AliHLTLogging { */ AliHLTTPCPad(Int_t offset, Int_t nofBins); - /** not a valid copy constructor, defined according to effective C++ style */ - AliHLTTPCPad(const AliHLTTPCPad&); - /** not a valid assignment op, but defined according to effective C++ style */ - AliHLTTPCPad& operator=(const AliHLTTPCPad&); /** standard destructor */ virtual ~AliHLTTPCPad(); + + 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 + }; + + typedef struct AliClusterData AliClusterData; //! + + /** * Set the address the pad. * The address consists of row and pad number. @@ -58,11 +83,13 @@ class AliHLTTPCPad : public AliHLTLogging { /** * 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;} @@ -86,7 +113,7 @@ class AliHLTTPCPad : public AliHLTLogging { * Calculate the base line from the current event data. * Only available within an event cycle.
* The calculation requires a minimum number of bins which contribute - * to the sum, which can be specified by @param reqMinCount. The base line + * to the sum, which can be specified by \e reqMinCount. The base line * calculation will also be skipped if the number of contributing bins is * less than half of the total number of time bins. * @param reqMinCount the minimum number of bins contributing to the sum @@ -223,9 +250,112 @@ class AliHLTTPCPad : public AliHLTLogging { * Get the size (number of time bins) of the pad * @return number of bins */ - Int_t GetSize() const {return fNofBins;} + 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; + + /** + * Zerosuppression where one can choose wether one want to cut on sigma(default 3) or a given adc threshold above baseline + * It works like this: Finds the signals above baseline+threshold, it then looks to the right of the signals adding the + * the signal below threshold but over the average. It stops when the adc value rises (since you should expect a fall) + * or if the signal in that bin is below average. It now does the same thing to the left. + * This is a very timeconsuming approach(but good), and will likely only be used only for cosmics and laser. + * If you use sigma approach you can give as input n sigma or stick with default=3. For channels with very large signals + * the (value-average)² is not calculated when value-average>50. This is due to sigma shooting sky high for only a few values. + * 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 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. + */ + 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); + + /** + * Returns the next signal which survived the ZeroSuppression + * @param time Refernence to timebin number + * @param signal Refernence to signal + * @return True if there are more signals + */ + Bool_t GetNextGoodSignal(Int_t &time,Int_t &signal); + + /** + * 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,Int_t dummy); + + /** + * Returns number of signals added + * @return Number of signals + */ + UInt_t GetNAddedSignals(){return fSizeOfSignalPositionArray;} + + /** + * Returns the pointer to the first data signal + * @param bin Timebin number + * @return pointer to data signal in bin + */ + UInt_t* GetPointer(Int_t bin){return (UInt_t*)&fDataSignals[bin]; } + + /** + * Adds cluster candidate to the fClusterCandidates. + */ + void AddClusterCandidate(AliHLTTPCClusters candidate); + + /** + * Prints the raw data og this pad. + */ + void PrintRawData(); + + /** + * Vector of cluster candidates + */ + vector fClusterCandidates; //! transient + + /** + * Vector of used clustercandidates, used so one do not use candidates multiple times + */ + vector fUsedClusterCandidates; //! transient + Bool_t fSelectedPad; //! transient + AliHLTUInt16_t fHWAddress; //! transient + private: + /** copy constructor prohibited */ + AliHLTTPCPad(const AliHLTTPCPad&); + /** assignment operator prohibited */ + AliHLTTPCPad& operator=(const AliHLTTPCPad&); + /** * Add a value to the base line calculation. * The value is been added to the sum if it exceeds the current base line @@ -270,6 +400,22 @@ class AliHLTTPCPad : public AliHLTLogging { /** The raw data history */ AliHLTTPCSignal_t* fpRawData; //! transient - ClassDef(AliHLTTPCPad, 0) + /** + * Array containing the data + */ + AliHLTTPCSignal_t* fDataSignals; //! transient + + /** + * 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; + + ClassDef(AliHLTTPCPad, 6) }; -#endif +#endif // ALIHLTTPCPAD_H