Fix for the case of non-existent calibration files
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineSDDCMN.h
CommitLineData
7f347565 1#ifndef ALIITSONLINESDDCMN_H
2#define ALIITSONLINESDDCMN_H
3
4///////////////////////////////////////////////////////////////////
5// //
6// Class used for SDD noise corrected for common mode analysis //
7// Origin: F.Prino, Torino, prino@to.infn.it //
8// //
9///////////////////////////////////////////////////////////////////
10#include "AliITSOnlineSDD.h"
11
4ff6aa93 12class TH1F;
7f347565 13class TH2F;
14class TGraph;
15class AliITSOnlineSDDCMN : public AliITSOnlineSDD {
16
17 public:
18 AliITSOnlineSDDCMN();
979b5a5f 19 AliITSOnlineSDDCMN(Int_t nddl, Int_t ncarlos, Int_t sid);
7f347565 20 virtual ~AliITSOnlineSDDCMN();
21 void Reset();
b34fed4e 22 TH2F* GetCleanEvent(const TH2F* hrawd) const;
7f347565 23 void AddEvent(TH2F* hrawd);
24 void ValidateAnodes();
25 void ReadBaselines();
26
27 void SetMinNoise(Float_t ns=0.001){fMinCorrNoise=ns;}
28 void SetMaxNoise(Float_t ns=9.){fMaxCorrNoise=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{ return fBaseline[iAnode];}
d8303ac8 33 Int_t GetAnodeEqualizedBaseline(Int_t iAnode) const{ return fEqBaseline[iAnode];}
34 Int_t GetAnodeBaselineOffset(Int_t iAnode) const{ return fOffsetBaseline[iAnode];}
7f347565 35 Float_t GetAnodeRawNoise(Int_t iAnode) const{ return fRawNoise[iAnode];}
36 Float_t GetAnodeCommonMode(Int_t iAnode) const{ return fCMN[iAnode];}
37 Float_t GetAnodeCorrNoise(Int_t iAnode) const{
38 if(fNEvents>0) return fSumCorrNoise[iAnode]/fNEvents;
39 else return 0;
40 }
41
beb262b4 42 Float_t CalcMeanNoise() const;
7f347565 43 Int_t GetNEvents() const {return fNEvents;}
4ff6aa93 44
45 TH1F* GetBaselineAnodeHisto() const;
46 TH1F* GetRawNoiseAnodeHisto() const;
47 TH1F* GetCorrNoiseAnodeHisto() const;
e5b2f7f2 48 TH1F* GetCMNCoefAnodeHisto() const;
49 TH1F* GetStatusAnodeHisto() const;
4ff6aa93 50 TH1F* GetBaselineHisto() const;
51 TH1F* GetRawNoiseHisto() const;
52 TH1F* GetCorrNoiseHisto() const;
53
e44f571c 54 void WriteToASCII();
55 Bool_t WriteToROOT(TFile *fil);
7f347565 56
57 protected:
58
59 private:
beb262b4 60 Int_t fNEvents; // number of events
e7610d19 61 Int_t fLowThreshold; // low threshold for zero supp.
62 Int_t fHighThreshold; // high threshold for zero supp.
beb262b4 63 Bool_t fGoodAnode[fgkNAnodes]; // anode quality: good(1) - bad (0)
64 Float_t fBaseline[fgkNAnodes]; // array of anode baselines
d8303ac8 65 Int_t fEqBaseline[fgkNAnodes]; // array of anode baselines after equalization
66 Int_t fOffsetBaseline[fgkNAnodes]; // array of offsets for baseline equal.
beb262b4 67 Float_t fRawNoise[fgkNAnodes]; // array of anode raw noise
68 Float_t fSumCorrNoise[fgkNAnodes]; // corrected noise summed over events
69 Float_t fCMN[fgkNAnodes]; // common mode noise coeff.
70 Float_t fMinCorrNoise; // Cut value for minimum corrected noise
71 Float_t fMaxCorrNoise; // Cut value for maximum corrected noise
72 Float_t fNSigmaNoise; // Cut value for corrected noise (n*sigma)
7f347565 73
e7610d19 74 ClassDef(AliITSOnlineSDDCMN,3);
7f347565 75};
76#endif