SSD detactor algorithm and related classes (E. Fragiacomo)
[u/mrichter/AliRoot.git] / ITS / AliITSChannelDaSSD.h
CommitLineData
f67db810 1#ifndef ALIITSCHANNELDASSD_H
2#define ALIITSCHANNELDASSD_H
3
4
5#include <iostream>
6#include "TMath.h"
7#include "TObject.h"
8
9class AliITSChannelDaSSD : public TObject {
10 public :
11 AliITSChannelDaSSD();
12 explicit AliITSChannelDaSSD(const UShort_t stripId);
13 AliITSChannelDaSSD(const UShort_t stripId, const Long_t eventsnumber);
14 AliITSChannelDaSSD(const AliITSChannelDaSSD& strip);
15 AliITSChannelDaSSD& operator = (const AliITSChannelDaSSD& strip);
16 virtual ~AliITSChannelDaSSD();
17
18 UShort_t GetStripId() const { return fStripId; }
19 Long_t GetEventsNumber() const { return fEventsNumber; }
20 Short_t* GetSignal() const { return fSignal; }
21 Short_t* GetSignal(const Long_t eventnumber) const
22 { return (eventnumber < fEventsNumber && fSignal) ? (fSignal+eventnumber) : NULL; }
23
24 Float_t GetPedestal() const { return fPedestal; }
25 Float_t GetNoise() const { return fNoise; }
26 Bool_t CheckNoise() const { return (fNoise < fgkUndefinedValue) ? kTRUE : kFALSE; }
27
28 UChar_t GetFeeOffset() const { return (fPedestal < fgkUndefinedValue) ? (static_cast<UChar_t>(TMath::Nint(fPedestal))) : 0; }
29 UChar_t GetFeeZs() const { return (fNoise < fgkUndefinedValue) ?
30 (static_cast<UChar_t>(fZsThresholdFactor * TMath::Nint(fNoise))) : 0; }
31 Bool_t SetEvenetsNumber(const Long_t eventsnumber);
32 Bool_t SetSignal(const Long_t eventnumber, const Short_t signal);
33 void SetStripId(const UShort_t stripId) { fStripId = stripId; }
34
35 void SetPedestal(Float_t pedestal) { fPedestal = pedestal; }
36 void SetNoise(Float_t noise) { fNoise = noise; }
37 void ClearNoise() { if (fNoise < fgkUndefinedValue) fNoise = fgkUndefinedValue; }
38 void ClearPedestal() { if (fPedestal < fgkUndefinedValue) fPedestal = fgkUndefinedValue; }
39 void ClearSignal() { if (fSignal) for (Int_t i = 0; i < fEventsNumber; i++)
40 fSignal[i] = 0x100 * fgkDefaultSignal + fgkDefaultSignal; }
41 void DeleteSignal() { if (fSignal) { delete [] fSignal; fSignal = NULL; fEventsNumber = 0;} }
42
43 static Short_t GetOverflowConst() { return fgkSignalOverflow; }
44 static Short_t GetUnderflowConst() { return fgkSignalUnderflow; }
45 static Float_t GetUndefinedValue() { return fgkUndefinedValue; }
46
47 protected :
48
49 static const UShort_t fgkMinStripId = 0;
50 static const UShort_t fgkMaxStripId = 1535;
51
52 static const Short_t fgkSignalOverflow = 2047;
53 static const Short_t fgkSignalUnderflow = 2048;
54 static const UShort_t fgkDefaultSignal = 0x7F;
55 static const Float_t fgkUndefinedValue;
56
57 UShort_t fStripId; // channel = strip number within SSD module 0-1535
58 Long_t fEventsNumber; // number of events for fSignal memory allocation
59 Short_t *fSignal; //!
60
61 Float_t fPedestal;
62 Float_t fNoise;
63
64 Float_t fZsThresholdFactor; // factor for zero suppression threshold
65
66 ClassDef(AliITSChannelDaSSD, 1)
67};
68
69#endif