348f80b7 |
1 | #ifndef ALIITSONLINESDDTP_H |
2 | #define ALIITSONLINESDDTP_H |
3 | |
4 | |
5 | /////////////////////////////////////////////////////////////////// |
6 | // // |
7 | // Class used for SDD Test Pulse analysis // |
8 | // Origin: F.Prino, Torino, prino@to.infn.it // |
9 | // // |
10 | /////////////////////////////////////////////////////////////////// |
11 | |
0e5e647a |
12 | #include "AliITSOnlineSDD.h" |
348f80b7 |
13 | |
e5b2f7f2 |
14 | class TH1F; |
348f80b7 |
15 | class TH2F; |
348f80b7 |
16 | class AliITSOnlineSDDTP : public AliITSOnlineSDD { |
17 | |
18 | public: |
19 | AliITSOnlineSDDTP(); |
979b5a5f |
20 | AliITSOnlineSDDTP(Int_t nddl, Int_t ncarlos, Int_t sid, Float_t xDAC); |
348f80b7 |
21 | virtual ~AliITSOnlineSDDTP(); |
22 | void Reset(); |
23 | void AddEvent(TH2F* hrawd); |
24 | void ValidateAnodes(); |
25 | void ReadBaselines(); |
26 | |
27 | void SetNSigmaGain(Float_t sig=3.){fNSigmaGain=sig;} |
750296dd |
28 | void SetNSigmaNoise(Float_t sig=10.){fNSigmaNoise=sig;} |
3083967f |
29 | Bool_t IsModuleGood()const; |
348f80b7 |
30 | Bool_t IsAnodeGood(Int_t iAnode)const{ return fGoodAnode[iAnode];} |
3083967f |
31 | Float_t GetAnodeBaseline(Int_t iAnode) const{ return fBaseline[iAnode];} |
d8303ac8 |
32 | Int_t GetAnodeEqualizedBaseline(Int_t iAnode) const{ return fEqBaseline[iAnode];} |
33 | Int_t GetAnodeBaselineOffset(Int_t iAnode) const{ return fOffsetBaseline[iAnode];} |
3083967f |
34 | Float_t GetAnodeRawNoise(Int_t iAnode) const{ return fRawNoise[iAnode];} |
35 | Float_t GetAnodeCommonMode(Int_t iAnode) const{ return fCMN[iAnode];} |
36 | Float_t GetAnodeCorrNoise(Int_t iAnode) const{return fCorrNoise[iAnode];} |
750296dd |
37 | Float_t GetTimeBinTPPeak(Int_t iAnode) const{ |
38 | if(fNEvents[iAnode]>0) return fTPPos[iAnode]/fNEvents[iAnode]; |
39 | else return 0; |
40 | } |
41 | Int_t GetNEvents(Int_t iAnode) const {return fNEvents[iAnode];} |
348f80b7 |
42 | Float_t GetChannelGain(Int_t iAnode)const{ |
750296dd |
43 | if(fNEvents[iAnode]>0) return fSumTPPeak[iAnode]/fNEvents[iAnode]/fDAC; |
348f80b7 |
44 | else return 0; |
45 | } |
776c19a3 |
46 | void StatGain(Float_t &mean, Float_t &rms) const; |
e44f571c |
47 | void WriteToASCII(); |
3083967f |
48 | Bool_t WriteToROOT(TFile *fil); |
348f80b7 |
49 | |
e5b2f7f2 |
50 | TH1F* GetBaselineAnodeHisto() const; |
51 | TH1F* GetRawNoiseAnodeHisto() const; |
52 | TH1F* GetCorrNoiseAnodeHisto() const; |
53 | TH1F* GetCMNCoefAnodeHisto() const; |
54 | TH1F* GetGainAnodeHisto() const; |
55 | TH1F* GetStatusAnodeHisto() const; |
56 | |
348f80b7 |
57 | protected: |
58 | |
59 | private: |
750296dd |
60 | Int_t fNEvents[fgkNAnodes]; // number of TP events for given anode |
3083967f |
61 | Float_t fDAC; // Pascal Test Pulse amplitude (DAC units) |
e7610d19 |
62 | Int_t fLowThreshold; // low threshold for zero supp. |
63 | Int_t fHighThreshold; // high threshold for zero supp. |
3083967f |
64 | Bool_t fGoodAnode[fgkNAnodes]; // array of anode quality (1 good, 0 bad) |
beb262b4 |
65 | Float_t fBaseline[fgkNAnodes]; // array of anode baselines |
d8303ac8 |
66 | Int_t fEqBaseline[fgkNAnodes]; // array of anode baselines after equalization |
67 | Int_t fOffsetBaseline[fgkNAnodes]; // array of offsets for baseline equal. |
3083967f |
68 | Float_t fRawNoise[fgkNAnodes]; // array of anode raw noise |
69 | Float_t fCMN[fgkNAnodes]; // common mode noise coeff. |
70 | Float_t fCorrNoise[fgkNAnodes]; // array of anode corrected noise |
beb262b4 |
71 | Float_t fSumTPPeak[fgkNAnodes]; // test pulse amplitude summed over events |
72 | Float_t fTPPos[fgkNAnodes]; // test pulse position |
73 | Float_t fNSigmaGain; // Cut value for gain (n*sigma) |
750296dd |
74 | Float_t fNSigmaNoise; // Threshold for TP signal identification |
d8303ac8 |
75 | ClassDef(AliITSOnlineSDDTP,4); |
348f80b7 |
76 | }; |
77 | #endif |