]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSOnlineSPDscanAnalyzer.h
Coding violation fixes
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineSPDscanAnalyzer.h
1 #ifndef ALIITSONLINESPDSCANANALYZER_H
2 #define ALIITSONLINESPDSCANANALYZER_H
3 /* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 ////////////////////////////////////////////////////////////
9 // Author: Henrik Tydesjo                                 //
10 // This class is used in the detector algorithm framework //
11 // to process the data stored in special container files  //
12 // (see AliITSOnlineSPDscan). For instance, minimum       //
13 // threshold values can be extracted.                     //
14 ////////////////////////////////////////////////////////////
15
16 #include <TString.h>
17 #include <TH1F.h>
18
19 class AliITSOnlineSPDscan;
20 class AliITSOnlineCalibrationSPDhandler;
21 class TGraph;
22 class TH2F;
23
24 class AliITSOnlineSPDscanAnalyzer {
25
26  public:
27   AliITSOnlineSPDscanAnalyzer(const Char_t *fileName, AliITSOnlineCalibrationSPDhandler *handler, Bool_t readFromGridFile=kFALSE);
28   AliITSOnlineSPDscanAnalyzer(const AliITSOnlineSPDscanAnalyzer& handle);
29   ~AliITSOnlineSPDscanAnalyzer();
30
31   AliITSOnlineSPDscanAnalyzer& operator=(const AliITSOnlineSPDscanAnalyzer& handle);
32
33   Bool_t     IsChipPresent(UInt_t hs, UInt_t chipNr);
34   Bool_t     IsOverWriteSet() const {return fOverWrite;}
35   void       SetCalibHandler(AliITSOnlineCalibrationSPDhandler *handler) {fHandler=handler;}
36   void       SetParam(const Char_t *pname, const Char_t *pval);
37   void       ReadParamsFromLocation(const Char_t *dirName);
38
39   UInt_t     GetType() const {return fType;}
40   UInt_t     GetDacId() const {return fDacId;}
41
42   Int_t      GetDelay(UInt_t hs, UInt_t chipNr);
43   Int_t      GetMinTh(UInt_t hs, UInt_t chipNr);
44   
45   Int_t      GetNrNoisyUnima(UInt_t hs, UInt_t chipNr);
46
47   Bool_t     ProcessUniformity();
48   Bool_t     ProcessDeadPixels();
49   Bool_t     ProcessNoisyPixels();
50
51   Bool_t     ProcessNrTriggers();
52
53   AliITSOnlineSPDscan* GetOnlineScan() {return fScanObj;}
54   UInt_t     GetRouterNr();
55   Bool_t     GetHalfStavePresent(UInt_t hs);
56
57   TGraph*    GetNrTriggersG();
58   TGraph*    GetMeanMultiplicityG(UInt_t hs, UInt_t chipNr);
59   TGraph*    GetHitEventEfficiencyG(UInt_t hs, UInt_t chipNr);
60   TH2F*      GetHitMapTot(UInt_t step);
61   TH2F*      GetHitMapChip(UInt_t step, UInt_t hs, UInt_t chip);
62
63   Float_t    GetTPeff() {return fTPeff;}
64   TH1F*      GetTPeffHS() {return fTPeffHS;}
65   TH1F*      GetTPeffChip(UInt_t hs) {return fTPeffChip[hs];}
66   Float_t    GetDeadPixel() {return fDeadPixel;}
67   TH1F*      GetDeadPixelHS() {return fDeadPixelHS;}
68   TH1F*      GetDeadPixelChip(UInt_t hs) {return fDeadPixelChip[hs];}
69   Float_t    GetNoisyPixel() {return fNoisyPixel;}
70   TH1F*      GetNoisyPixelHS() {return fNoisyPixelHS;}
71   TH1F*      GetNoisyPixelChip(UInt_t hs) {return fNoisyPixelChip[hs];}
72
73  private:
74   UInt_t               fType;           // calib type
75   UInt_t               fDacId;          // dac id
76   TString              fFileName;       // container file name
77   enum                 calibvals{kMINTH,kMEANTH,kDAC,kUNIMA,kNOISE,kDELAY};  // calib types
78
79   AliITSOnlineSPDscan               *fScanObj;  // container obj
80   AliITSOnlineCalibrationSPDhandler *fHandler;  // calib helper obj
81   Bool_t     fbModuleScanned[240];        // is module used in scan?
82
83   TGraph*    fMeanMultiplicity[6][11];   // mean mult graphs
84   TGraph*    fHitEventEfficiency[6][11]; // hit event graphs
85   TGraph*    fTriggers;                  // trigger graph
86
87   // uniformity scan analysis:
88   Float_t    fTPeff;                     // number of good pixels [%] (for full router)
89   TH1F*      fTPeffHS;                   // 6 bin histogram, number good pixels [%] (for each hs)
90   TH1F*      fTPeffChip[6];              // 10 bin histograms, number good pixels [%] (for each chip)
91   Float_t    fDeadPixel;                 // number of dead pixels [%] (for full router)
92   TH1F*      fDeadPixelHS;               // 6 bin histogram, number dead pixels [%] (for each hs)
93   TH1F*      fDeadPixelChip[6];          // 10 bin histograms, number dead pixels [%] (for each chip)
94   Float_t    fNoisyPixel;                // number of 'noisy' pixels [%] (for full router)
95   TH1F*      fNoisyPixelHS;              // 6 bin histogram, number 'noisy' pixels [%] (for each hs)
96   TH1F*      fNoisyPixelChip[6];         // 10 bin histograms, number 'noisy' pixels [%] (for each chip)
97   
98   void       Init(Bool_t readFromGridFile=kFALSE);                     // init
99
100   void       CreateUniformityHistograms(); // method to create all histograms to be filled by 'ProcessUniformity'
101   void       DeleteUniformityHistograms(); // method to delete all histograms used by uniformity scan analysis
102
103   Bool_t     ProcessMeanMultiplicity();  // process mean mult
104   Bool_t     ProcessHitEventEfficiency();// process hit event eff
105
106   Int_t      FindLastMinThDac(UInt_t hs, UInt_t chipNr);  // dac value where fMinIncreaseFromBaseLine reached
107   Int_t      FindClosestLowerStep(Float_t dacValueInput); // step closest (lower) to a dacvalue 
108   Float_t    GetCompareLine(UInt_t step, UInt_t hs, UInt_t chipNr, Float_t basePar2); // line to compare mean mult with
109
110   // dead noisy parameters:
111   Bool_t     fOverWrite;          // overWrite old dead/noisy or just add new ones to it
112   // noise scan parameters:
113   Float_t    fNoiseThreshold;     // ratio of allowed hits/triggers
114   UInt_t     fNoiseMinimumEvents; // minimum events required to find noisy pixels
115   // min th scan parameters:
116   UInt_t     fMinNrStepsBeforeIncrease; // min nr of steps required before fMinIncreaseFromBaseLine reached
117   Float_t    fMinIncreaseFromBaseLine;  // min increase of mean mult from base line
118   UInt_t     fStepDownDacSafe;          // nr of steps down to put threshold result (to be on the safe side)
119   Float_t    fMaxBaseLineLevel;         // maximum value for the base line to compare with
120
121
122
123 };
124
125 #endif