]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSOnlineSDDTP.h
Fix of parsing bug related to the reading of the calib header. Added consistency...
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineSDDTP.h
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 TH2F;
15 class AliITSOnlineSDDTP : public AliITSOnlineSDD {
16
17  public:
18   AliITSOnlineSDDTP();
19   AliITSOnlineSDDTP(Int_t mod, Int_t sid,Float_t xDAC);
20   virtual ~AliITSOnlineSDDTP();
21   void Reset();
22   void AddEvent(TH2F* hrawd);
23   void ValidateAnodes();
24   void ReadBaselines();
25
26   void SetNSigmaGain(Float_t sig=3.){fNSigmaGain=sig;}
27   void SetNSigmaNoise(Float_t sig=10.){fNSigmaNoise=sig;}
28   Bool_t IsModuleGood()const;
29   Bool_t IsAnodeGood(Int_t iAnode)const{ return fGoodAnode[iAnode];}
30   Float_t GetAnodeBaseline(Int_t iAnode) const{ return fBaseline[iAnode];}
31   Float_t GetAnodeRawNoise(Int_t iAnode) const{ return fRawNoise[iAnode];}
32   Float_t GetAnodeCommonMode(Int_t iAnode) const{ return fCMN[iAnode];}
33   Float_t GetAnodeCorrNoise(Int_t iAnode) const{return fCorrNoise[iAnode];}
34   Float_t GetTimeBinTPPeak(Int_t iAnode) const{    
35     if(fNEvents[iAnode]>0) return fTPPos[iAnode]/fNEvents[iAnode];
36     else return 0;
37   }
38   Int_t GetNEvents(Int_t iAnode) const {return fNEvents[iAnode];}
39   Float_t GetChannelGain(Int_t iAnode)const{
40     if(fNEvents[iAnode]>0) return fSumTPPeak[iAnode]/fNEvents[iAnode]/fDAC;
41     else return 0;
42   }
43   void StatGain(Float_t &mean, Float_t  &rms);
44   void WriteToASCII();
45   Bool_t WriteToROOT(TFile *fil);
46
47  protected:
48
49  private:
50   Int_t fNEvents[fgkNAnodes];      // number of TP events for given anode
51   Float_t fDAC;                    // Pascal Test Pulse amplitude (DAC units)
52   Bool_t fGoodAnode[fgkNAnodes];   // array of anode quality (1 good, 0 bad) 
53   Float_t fBaseline[fgkNAnodes];   // array of anode baselines
54   Float_t fRawNoise[fgkNAnodes];   // array of anode raw noise
55   Float_t fCMN[fgkNAnodes];        // common mode noise coeff.
56   Float_t fCorrNoise[fgkNAnodes];  // array of anode corrected noise
57   Float_t fSumTPPeak[fgkNAnodes];  // test pulse amplitude summed over events
58   Float_t fTPPos[fgkNAnodes];      // test pulse position
59   Float_t fNSigmaGain;             // Cut value for gain (n*sigma)
60   Float_t fNSigmaNoise;            // Threshold for TP signal identification
61   ClassDef(AliITSOnlineSDDTP,3);
62 };
63 #endif