Line data Source code
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 :
12 : #include "AliITSOnlineSDD.h"
13 :
14 : class TH1F;
15 : class TH2F;
16 0 : class AliITSOnlineSDDTP : public AliITSOnlineSDD {
17 :
18 : public:
19 : AliITSOnlineSDDTP();
20 : AliITSOnlineSDDTP(Int_t nddl, Int_t ncarlos, Int_t sid, Float_t xDAC);
21 : virtual ~AliITSOnlineSDDTP();
22 : void Reset();
23 : void AddEvent(TH2F* hrawd);
24 : void ValidateAnodes();
25 : void ReadBaselines();
26 :
27 0 : void SetValidationOption(Int_t opt){fValidateOption=opt;}
28 0 : void SetMinGain(Float_t ming=0.001){fMinGain=ming;}
29 0 : void SetMaxGain(Float_t maxg=99.){fMaxGain=maxg;}
30 0 : void SetMaxRelDiffForValid(Double_t reld=0.3){fToleranceGain=reld;}
31 0 : void SetMaxNSigmaForValid(Float_t sig=3.){fNSigmaGain=sig;}
32 0 : void SetNSigmaNoise(Float_t sig=10.){fNSigmaNoise=sig;}
33 : Bool_t IsModuleGood()const;
34 0 : Bool_t IsAnodeGood(Int_t iAnode)const{ return fGoodAnode[iAnode];}
35 0 : Float_t GetAnodeBaseline(Int_t iAnode) const{ return fBaseline[iAnode];}
36 0 : Int_t GetAnodeEqualizedBaseline(Int_t iAnode) const{ return fEqBaseline[iAnode];}
37 0 : Int_t GetAnodeBaselineOffset(Int_t iAnode) const{ return fOffsetBaseline[iAnode];}
38 0 : Float_t GetAnodeRawNoise(Int_t iAnode) const{ return fRawNoise[iAnode];}
39 0 : Float_t GetAnodeCommonMode(Int_t iAnode) const{ return fCMN[iAnode];}
40 0 : Float_t GetAnodeCorrNoise(Int_t iAnode) const{return fCorrNoise[iAnode];}
41 : Float_t GetTimeBinTPPeak(Int_t iAnode) const{
42 0 : if(fNEvents[iAnode]>0) return fTPPos[iAnode]/fNEvents[iAnode];
43 0 : else return 0;
44 0 : }
45 0 : Int_t GetNEvents(Int_t iAnode) const {return fNEvents[iAnode];}
46 : Float_t GetChannelGain(Int_t iAnode)const{
47 0 : if(fNEvents[iAnode]>0) return fSumTPPeak[iAnode]/fNEvents[iAnode]/fDAC;
48 0 : else return 0;
49 0 : }
50 : void StatGain(Float_t &mean, Float_t &rms) const;
51 : void WriteToASCII();
52 : Bool_t WriteToROOT(TFile *fil);
53 :
54 : TH1F* GetBaselineAnodeHisto() const;
55 : TH1F* GetRawNoiseAnodeHisto() const;
56 : TH1F* GetCorrNoiseAnodeHisto() const;
57 : TH1F* GetCMNCoefAnodeHisto() const;
58 : TH1F* GetGainAnodeHisto() const;
59 : TH1F* GetStatusAnodeHisto() const;
60 :
61 : protected:
62 :
63 : private:
64 : Int_t fNEvents[fgkNAnodes]; // number of TP events for given anode
65 : Float_t fDAC; // Pascal Test Pulse amplitude (DAC units)
66 : Int_t fLowThreshold; // low threshold for zero supp.
67 : Int_t fHighThreshold; // high threshold for zero supp.
68 : Bool_t fGoodAnode[fgkNAnodes]; // array of anode quality (1 good, 0 bad)
69 : Float_t fBaseline[fgkNAnodes]; // array of anode baselines
70 : Int_t fEqBaseline[fgkNAnodes]; // array of anode baselines after equalization
71 : Int_t fOffsetBaseline[fgkNAnodes]; // array of offsets for baseline equal.
72 : Float_t fRawNoise[fgkNAnodes]; // array of anode raw noise
73 : Float_t fCMN[fgkNAnodes]; // common mode noise coeff.
74 : Float_t fCorrNoise[fgkNAnodes]; // array of anode corrected noise
75 : Float_t fSumTPPeak[fgkNAnodes]; // test pulse amplitude summed over events
76 : Float_t fTPPos[fgkNAnodes]; // test pulse position
77 : Int_t fValidateOption; // Option to check for good gain
78 : Float_t fMinGain; // minimum acceptable gain
79 : Float_t fMaxGain; // maximum acceptable gain
80 : Float_t fNSigmaGain; // Cut value for gain (n*sigma)
81 : Float_t fToleranceGain; // Cut value for gain (percent from mean)
82 : Float_t fNSigmaNoise; // Threshold for TP signal identification
83 116 : ClassDef(AliITSOnlineSDDTP,5);
84 : };
85 : #endif
|