Line data Source code
1 : #ifndef ALIITSONLINESPDFOANALYZER_H
2 : #define ALIITSONLINESPDFOANALYZER_H
3 : /* Copyright(c) 2008-2010, ALICE Experiment at CERN, All rights reserved. *
4 : * See cxx source for full Copyright notice */
5 :
6 : /* $Id$ */
7 : ////////////////////////////////////////////////////////////////
8 : // Author: A. Mastroserio //
9 : // This class is used within the detector algorithm framework //
10 : // to analyze FO scan data. It intends to find the best DAC //
11 : // values to get the best FO trigger efficiency //
12 : ////////////////////////////////////////////////////////////////
13 :
14 : class THnSparse;
15 : class TObject;
16 : class TArrayI;
17 : class AliITSOnlineSPDfo;
18 : class AliITSOnlineSPDfoChip;
19 : class AliITSOnlineSPDfoInfo;
20 :
21 : class AliITSOnlineSPDfoAnalyzer {
22 :
23 : public:
24 : AliITSOnlineSPDfoAnalyzer(const TString fileName, Bool_t readFromGridFile=kFALSE);
25 : AliITSOnlineSPDfoAnalyzer(const AliITSOnlineSPDfoAnalyzer& foan);
26 : ~AliITSOnlineSPDfoAnalyzer();
27 :
28 : AliITSOnlineSPDfoAnalyzer& operator=(const AliITSOnlineSPDfoAnalyzer& handle);
29 :
30 : void Init(Bool_t readFromGridFile=kFALSE);
31 :
32 : enum {kNqualityFlags=3};
33 :
34 : void ReadParamsFromLocation(const Char_t* dirName);
35 : Int_t IsSelected(Float_t eff) const; // selection quality (0 = best, 1 tight, 2 loose)
36 : Int_t Select(const AliITSOnlineSPDfoChip *chip) const;
37 : void WriteToFile(TString outputfile);
38 : Bool_t IsExisting(TArrayI dacs,Int_t hs, Int_t chip) const;
39 : Bool_t CorrectPreVTHChioce(const TH1D *h,Int_t &bin) const;
40 :
41 : // SETTERS
42 : void SetGeneralThresholds(Float_t thre[3]);
43 : void SetParam(const Char_t *pname, const Char_t *pval);
44 : void SetNdimensions();
45 : void BuildTHnSparse(Int_t ihs, Int_t ichip);
46 : void Process();
47 : void CheckResults(TString filename, Int_t hs, Int_t ichip, Int_t iqual) const;
48 :
49 : // GETTERS
50 : void GetCanvases(const THnSparse *hn, Int_t ihs, Int_t ichip,Int_t iqual) const;
51 : TArrayI ChooseDACValues(Int_t ihs, Int_t ichip) const;
52 : TArrayI GetCentralDACS(Int_t qualityflag, Int_t hs, Int_t chip, TH1D **hd) const;
53 0 : AliITSOnlineSPDfo * GetFOHandler() const {return fFOHandler;}
54 :
55 : private:
56 : TString fFileName;
57 : Int_t fNdims; // number of dimensions of the histogram (= #DACs in the scan)
58 : Int_t *fNbins; //[fNdims]
59 : Double_t *fXmin; //[fNdims]
60 : Double_t *fXmax; //[fNdims]
61 : AliITSOnlineSPDfo *fFOHandler;
62 : Float_t fGeneralThresholds[3];
63 : THnSparse *fNh[3][6][10]; // N-dim histo per chip per half sector per quality flag [0= exact, 1 = within 0.01, 2 = within 0.05]
64 : Bool_t fHighOccupancyCheck;
65 : };
66 :
67 : #endif
68 :
|