]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSOnlineSDDBTP.h
Bug fix. Missing {} that was causing a false information message that the trigger...
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineSDDBTP.h
1 #ifndef ALIITSONLINESDDBTP_H
2 #define ALIITSONLINESDDBTP_H
3
4 ///////////////////////////////////////////////////////////////////
5 //                                                               //
6 // Class used for SDD baseline, noise and gain analysis          //
7 // Origin: F.Prino, Torino, prino@to.infn.it                     //
8 //                                                               //
9 ///////////////////////////////////////////////////////////////////
10 #include "AliITSOnlineSDD.h"
11 #include "TMath.h"
12
13 class TH2F;
14 class TGraph;
15 class AliITSOnlineSDDBTP : public AliITSOnlineSDD {
16
17  public:
18   AliITSOnlineSDDBTP();
19   AliITSOnlineSDDBTP(Int_t mod, Int_t sid);
20   virtual ~AliITSOnlineSDDBTP();
21   void Reset();
22   void AddBaseEvent(TH2F* hrawd);
23   void AddTPEvent(TH2F* hrawd, Float_t xDAC);
24   void ValidateAnodes();
25   void SetMinBaseline(Float_t bas=10.){fMinBaseline=bas;}
26   void SetMaxBaseline(Float_t bas=150.){fMaxBaseline=bas;}
27   void SetMinRawNoise(Float_t ns=0.001){fMinRawNoise=ns;}
28   void SetMaxRawNoise(Float_t ns=9.){fMaxRawNoise=ns;}
29   void SetNSigmaNoise(Float_t ns=4.){fNSigmaNoise=ns;}
30   void SetNSigmaGain(Float_t sig=3.){fNSigmaGain=sig;}
31   Bool_t IsAnodeGood(Int_t iAnode)const{ return fGoodAnode[iAnode];}
32   Float_t GetAnodeBaseline(Int_t iAnode) const{
33     if(fNBaseEvents>0) return fSumBaseline[iAnode]/fNBaseEvents;
34     else return 0;
35   }
36   Float_t GetAnodeRawNoise(Int_t iAnode) const{
37     if(fNBaseEvents>0) return TMath::Sqrt(fSumRawNoise[iAnode]/fNBaseEvents-TMath::Power(GetAnodeBaseline(iAnode),2));
38     
39     else return 0;
40   }
41   Float_t CalcMeanRawNoise() const;
42   void StatGain(Float_t &mean, Float_t  &rms);
43   Float_t GetAnodeCommonMode(Int_t iAnode) const{
44     if(fNBaseEvents>0) return fSumCMN[iAnode]/fNBaseEvents;
45     else return 0;
46   }
47   Float_t GetChannelGain(Int_t iAnode)const{
48     if(fNTPEvents>0) return fSumTPPeak[iAnode]/fNTPEvents;
49     else return 0;
50   }
51   Int_t GetNBaseEvents() const {return fNBaseEvents;}
52   Int_t GetNTPEvents() const {return fNTPEvents;}
53   void WriteToASCII();
54
55  protected:
56
57  private:
58
59   Int_t fNBaseEvents;                // number of "empty" events
60   Int_t fNTPEvents;                  // number of "Test Pulse" events
61   Bool_t fGoodAnode[fgkNAnodes];     // anode quality: good(1) - bad (0)
62   Float_t fSumBaseline[fgkNAnodes];  // baseline summed over events
63   Float_t fSumRawNoise[fgkNAnodes];  // noise summed over events
64   Float_t fSumCMN[fgkNAnodes];       // common mode noise coeff.
65   Float_t fSumTPPeak[fgkNAnodes];    // Test Pulse ampl. summed over events
66   Float_t fTPPos[fgkNAnodes];        // Test pulse peak position
67   Float_t fMinBaseline;              // Cut value for minimum baseline
68   Float_t fMaxBaseline;              // Cut value for maximum baseline
69   Float_t fMinRawNoise;              // Cut value for minimum noise
70   Float_t fMaxRawNoise;              // Cut value for maximum noise
71   Float_t fNSigmaNoise;              // Cut value for noise (n*sigma)
72   Float_t fNSigmaGain;               // Cut value for gain (n*sigma)
73
74   ClassDef(AliITSOnlineSDDBTP,1);
75 };
76 #endif