]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSOnlineSPDfoAnalyzer.h
- AliPhysicsSelection: protected writing of fHistBunchCrossing and fHistTriggerPattern
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineSPDfoAnalyzer.h
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 AliITSOnlineSPDfoInfo;
19
20 class AliITSOnlineSPDfoAnalyzer {
21   
22  public:
23   AliITSOnlineSPDfoAnalyzer(const TString fileName,  Bool_t readFromGridFile=kFALSE);
24   AliITSOnlineSPDfoAnalyzer(const AliITSOnlineSPDfoAnalyzer& foan);
25   ~AliITSOnlineSPDfoAnalyzer();
26   
27   AliITSOnlineSPDfoAnalyzer& operator=(const AliITSOnlineSPDfoAnalyzer& handle);
28   
29   void       Init(Bool_t readFromGridFile=kFALSE);     
30   
31   enum {kNqualityFlags=3};
32   
33   void ReadParamsFromLocation(const Char_t* dirName);
34   Int_t IsSelected(Float_t eff) const;                  // selection quality (0 = best, 1 tight, 2 loose)
35   Int_t Select(const AliITSOnlineSPDfoChip *chip) const;
36   void WriteToFile(TString outputfile);
37   Bool_t IsExisting(TArrayI dacs,Int_t hs, Int_t chip) const;
38   Bool_t CorrectPreVTHChioce(const TH1D *h,Int_t &bin) const;
39   
40   // SETTERS
41   void SetGeneralThresholds(Float_t thre[3]); 
42   void SetParam(const Char_t *pname, const Char_t *pval);
43   void SetNdimensions();
44   void BuildTHnSparse(Int_t ihs, Int_t ichip);
45   void Process();
46   void CheckResults(TString filename, Int_t hs, Int_t ichip, Int_t iqual) const;
47   
48   // GETTERS
49   void GetCanvases(const THnSparse *hn, Int_t ihs, Int_t ichip,Int_t iqual) const;
50   TArrayI ChooseDACValues(Int_t ihs, Int_t ichip) const;
51   TArrayI GetCentralDACS(Int_t qualityflag, Int_t hs, Int_t chip, TH1D **hd) const;
52   AliITSOnlineSPDfo * GetFOHandler() const {return fFOHandler;}
53   
54  private:
55   TString fFileName;
56   Int_t fNdims; // number of dimensions of the histogram (= #DACs in the scan)
57   Int_t *fNbins; //[fNdims]  
58   Double_t *fXmin; //[fNdims]
59   Double_t *fXmax; //[fNdims]  
60   AliITSOnlineSPDfo *fFOHandler;
61   Float_t fGeneralThresholds[3];
62   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]
63   Bool_t fHighOccupancyCheck;
64 };
65
66 #endif
67