Bug fix
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineSDDBase.h
CommitLineData
348f80b7 1#ifndef ALIITSONLINESDDBASE_H
2#define ALIITSONLINESDDBASE_H
3
4///////////////////////////////////////////////////////////////////
5// //
6// Class used for SDD baseline and noise analysis //
7// Origin: F.Prino, Torino, prino@to.infn.it //
8// //
9///////////////////////////////////////////////////////////////////
0e5e647a 10#include "AliITSOnlineSDD.h"
11#include <TMath.h>
348f80b7 12
13class TH2F;
14class TGraph;
15class AliITSOnlineSDDBase : public AliITSOnlineSDD {
16
17 public:
18 AliITSOnlineSDDBase();
19 AliITSOnlineSDDBase(Int_t mod, Int_t sid);
20 virtual ~AliITSOnlineSDDBase();
21 void Reset();
22 void AddEvent(TH2F* hrawd);
23 void ValidateAnodes();
24
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
31 Bool_t IsAnodeGood(Int_t iAnode)const{ return fGoodAnode[iAnode];}
32 Float_t GetAnodeBaseline(Int_t iAnode) const{
33 if(fNEvents>0) return fSumBaseline[iAnode]/fNEvents;
34 else return 0;
35 }
d8303ac8 36 Float_t GetMinimumBaseline() const;
348f80b7 37 Float_t GetAnodeRawNoise(Int_t iAnode) const{
38 if(fNEvents>0) return TMath::Sqrt(fSumRawNoise[iAnode]/fNEvents-TMath::Power(GetAnodeBaseline(iAnode),2));
39
40 else return 0;
41 }
42
beb262b4 43 Float_t CalcMeanRawNoise() const;
348f80b7 44 Float_t GetAnodeCommonMode(Int_t iAnode) const{
45 if(fNEvents>0) return fSumCMN[iAnode]/fNEvents;
46 else return 0;
47 }
48 Int_t GetNEvents() const {return fNEvents;}
e44f571c 49 void WriteToASCII();
348f80b7 50
51 protected:
52
53 private:
beb262b4 54 Int_t fNEvents; // number of events
55 Bool_t fGoodAnode[fgkNAnodes]; // anode quality: good(1) - bad (0)
56 Float_t fSumBaseline[fgkNAnodes]; // baseline summed over events
57 Float_t fSumRawNoise[fgkNAnodes]; // noise summed over events
58 Float_t fSumCMN[fgkNAnodes]; // common mode noise coeff.
59 Float_t fMinBaseline; // Cut value for minimum baseline
60 Float_t fMaxBaseline; // Cut value for maximum baseline
61 Float_t fMinRawNoise; // Cut value for minimum noise
62 Float_t fMaxRawNoise; // Cut value for maximum noise
63 Float_t fNSigmaNoise; // Cut value for noise (n*sigma)
348f80b7 64
65 ClassDef(AliITSOnlineSDDBase,1);
66};
67#endif