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 */
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 ////////////////////////////////////////////////////////////
19 class AliITSOnlineSPDscan;
20 class AliITSOnlineCalibrationSPDhandler;
24 class AliITSOnlineSPDscanAnalyzer {
27 AliITSOnlineSPDscanAnalyzer(const Char_t *fileName, AliITSOnlineCalibrationSPDhandler *handler, Bool_t readFromGridFile=kFALSE);
28 AliITSOnlineSPDscanAnalyzer(const AliITSOnlineSPDscanAnalyzer& handle);
29 ~AliITSOnlineSPDscanAnalyzer();
31 AliITSOnlineSPDscanAnalyzer& operator=(const AliITSOnlineSPDscanAnalyzer& handle);
33 Bool_t IsChipPresent(UInt_t hs, UInt_t chipNr);
34 Bool_t IsOverWriteSet() const {return fOverWrite;}
35 void SetCalibHandler(AliITSOnlineCalibrationSPDhandler * const handler) {fHandler=handler;}
36 void SetParam(const Char_t *pname, const Char_t *pval);
37 void ReadParamsFromLocation(const Char_t *dirName);
39 UInt_t GetType() const {return fType;}
40 UInt_t GetDacId() const {return fDacId;}
42 Int_t GetDelay(UInt_t hs, UInt_t chipNr);
43 Int_t GetMinTh(UInt_t hs, UInt_t chipNr);
44 Int_t GetMeanTh(UInt_t hs, UInt_t chipNr);
46 Int_t GetNrNoisyUnima(UInt_t hs, UInt_t chipNr);
48 Bool_t ProcessUniformity();
49 Bool_t ProcessDeadPixels();
50 Bool_t ProcessNoisyPixels();
52 Bool_t ProcessNrTriggers();
54 AliITSOnlineSPDscan* GetOnlineScan() const {return fScanObj;}
56 Bool_t GetHalfStavePresent(UInt_t hs);
58 TGraph* GetNrTriggersG();
59 TGraph* GetMeanMultiplicityG(UInt_t hs, UInt_t chipNr);
60 TGraph* GetHitEventEfficiencyG(UInt_t hs, UInt_t chipNr);
61 TH2F* GetHitMapTot(UInt_t step);
62 TH2F* GetHitMapChip(UInt_t step, UInt_t hs, UInt_t chip);
64 Float_t GetTPeff() const {return fTPeff;}
65 TH1F* GetTPeffHS() const {return fTPeffHS;}
66 TH1F* GetTPeffChip(UInt_t hs) const {return fTPeffChip[hs];}
67 Float_t GetDeadPixel() const {return fDeadPixel;}
68 TH1F* GetDeadPixelHS() const {return fDeadPixelHS;}
69 TH1F* GetDeadPixelChip(UInt_t hs) const {return fDeadPixelChip[hs];}
70 Float_t GetNoisyPixel() const {return fNoisyPixel;}
71 TH1F* GetNoisyPixelHS() const {return fNoisyPixelHS;}
72 TH1F* GetNoisyPixelChip(UInt_t hs) const {return fNoisyPixelChip[hs];}
75 UInt_t fType; // calib type
76 UInt_t fDacId; // dac id
77 TString fFileName; // container file name
78 enum calibvals{kMINTH,kMEANTH,kDAC,kUNIMA,kNOISE,kDELAY}; // calib types
80 AliITSOnlineSPDscan *fScanObj; // container obj
81 AliITSOnlineCalibrationSPDhandler *fHandler; // calib helper obj
82 Bool_t fbModuleScanned[240]; // is module used in scan?
84 TGraph* fMeanMultiplicity[6][11]; // mean mult graphs
85 TGraph* fHitEventEfficiency[6][11]; // hit event graphs
86 TGraph* fTriggers; // trigger graph
88 // uniformity scan analysis:
89 Float_t fTPeff; // number of good pixels [%] (for full router)
90 TH1F* fTPeffHS; // 6 bin histogram, number good pixels [%] (for each hs)
91 TH1F* fTPeffChip[6]; // 10 bin histograms, number good pixels [%] (for each chip)
92 Float_t fDeadPixel; // number of dead pixels [%] (for full router)
93 TH1F* fDeadPixelHS; // 6 bin histogram, number dead pixels [%] (for each hs)
94 TH1F* fDeadPixelChip[6]; // 10 bin histograms, number dead pixels [%] (for each chip)
95 Float_t fNoisyPixel; // number of 'noisy' pixels [%] (for full router)
96 TH1F* fNoisyPixelHS; // 6 bin histogram, number 'noisy' pixels [%] (for each hs)
97 TH1F* fNoisyPixelChip[6]; // 10 bin histograms, number 'noisy' pixels [%] (for each chip)
99 void Init(Bool_t readFromGridFile=kFALSE); // init
101 void CreateUniformityHistograms(); // method to create all histograms to be filled by 'ProcessUniformity'
102 void DeleteUniformityHistograms(); // method to delete all histograms used by uniformity scan analysis
104 Bool_t ProcessMeanMultiplicity(); // process mean mult
105 Bool_t ProcessHitEventEfficiency();// process hit event eff
107 Int_t FindLastMinThDac(UInt_t hs, UInt_t chipNr); // dac value where fMinIncreaseFromBaseLine reached
108 Int_t FindClosestLowerStep(Float_t dacValueInput); // step closest (lower) to a dacvalue
109 Float_t GetCompareLine(UInt_t step, UInt_t hs, UInt_t chipNr, Float_t basePar2); // line to compare mean mult with
111 // dead noisy parameters:
112 Bool_t fOverWrite; // overWrite old dead/noisy or just add new ones to it
113 // noise scan parameters:
114 Float_t fNoiseThreshold; // ratio of allowed hits/triggers
115 UInt_t fNoiseMinimumEvents; // minimum events required to find noisy pixels
116 // min th scan parameters:
117 UInt_t fMinNrStepsBeforeIncrease; // min nr of steps required before fMinIncreaseFromBaseLine reached
118 Float_t fMinIncreaseFromBaseLine; // min increase of mean mult from base line
119 UInt_t fStepDownDacSafe; // nr of steps down to put threshold result (to be on the safe side)
120 Float_t fMaxBaseLineLevel; // maximum value for the base line to compare with