]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSOnlineSPDphysAnalyzer.h
Little numerical protection
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineSPDphysAnalyzer.h
1 #ifndef ALIITSONLINESPDPHYSANALYZER_H
2 #define ALIITSONLINESPDPHYSANALYZER_H
3 /* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 ////////////////////////////////////////////////////////////
7 // Author: Henrik Tydesjo                                 //
8 // This class is used in the detector algorithm framework //
9 // to process the data stored in special container files  //
10 // (see AliITSOnlineSPDphys).                             //
11 ////////////////////////////////////////////////////////////
12
13 #include <TString.h>
14
15 class AliITSOnlineSPDphys;
16 class AliITSOnlineCalibrationSPDhandler;
17 class TGraph;
18 class TH2F;
19
20 class AliITSOnlineSPDphysAnalyzer {
21
22  public:
23   AliITSOnlineSPDphysAnalyzer(const Char_t *fileName, AliITSOnlineCalibrationSPDhandler* handler, Bool_t readFromGridFile=kFALSE);
24   AliITSOnlineSPDphysAnalyzer(AliITSOnlineSPDphys* physObj, AliITSOnlineCalibrationSPDhandler* handler);
25   AliITSOnlineSPDphysAnalyzer(const AliITSOnlineSPDphysAnalyzer& handle);
26   ~AliITSOnlineSPDphysAnalyzer();
27
28   AliITSOnlineSPDphysAnalyzer& operator=(const AliITSOnlineSPDphysAnalyzer& handle);
29
30   void       SetCalibHandler(AliITSOnlineCalibrationSPDhandler *handler) {fHandler=handler;}
31   void       SetParam(const Char_t *pname, const Char_t *pval);
32   void       ReadParamsFromLocation(const Char_t *dirName);
33
34   UInt_t     ProcessDeadPixels();
35   UInt_t     ProcessNoisyPixels();
36   UInt_t     ProcessNoisyPixels(UInt_t eq, UInt_t nrEvts);
37
38   UInt_t     GetNrEnoughStatChips();
39   UInt_t     GetNrDeadChips();
40   UInt_t     GetNrInefficientChips();
41   UInt_t     GetNrNeedsMoreStatChips();
42
43   AliITSOnlineSPDphys* GetOnlinePhys() {return fPhysObj;}
44   UInt_t     GetEqNr() const;
45   UInt_t     GetNrEvents() const;
46
47   TH2F*      GetHitMapTot();
48   TH2F*      GetPhysicalHitMapTot();
49   TH2F*      GetHitMapChip(UInt_t hs, UInt_t chip);
50
51  private:
52   TString  fFileName; // container file name
53   enum     calibvals{kMINTH,kMEANTH,kDAC,kUNIMA,kNOISE,kDELAY};  // calib types
54   AliITSOnlineSPDphys               *fPhysObj; // container obj
55   AliITSOnlineCalibrationSPDhandler *fHandler; // calib helper obj
56   void     Init(Bool_t readFromGridFile=kFALSE);    // initialization
57   void     Exponent(Double_t &val, Int_t &valExp) const;
58
59   UInt_t   fNrEnoughStatChips;    // nr of enough stat chips
60   UInt_t   fNrDeadChips;          // nr of dead chips
61   UInt_t   fNrInefficientChips;   // nr of inefficient chips
62
63   Double_t fNrEqHits;         // total nr of hits for associated eq
64   Bool_t   fbDeadProcessed;   // flag to tell if ProcessDeadPixels has been called
65
66   // dead noisy parameters:
67   Double_t fThreshNoisy;       // at what confidence level do we search for noisy
68   Double_t fThreshDead;        // at what confidence level do we search for dead
69   UInt_t   fMinEventsForNoisy; // min nr of events required to try noisy algorithm
70   UInt_t   fMinEventsForDead;  // min nr of events required to try dead algorithm
71   Float_t  fDefinitelyNoisyRatio; // if a pixel fires more than this ratio of the events, it must be noisy
72   Double_t fMinNrEqHitsForDeadChips; // minimum nr of hits for eq to assign dead chip
73   Double_t fRatioToMeanForInefficientChip; // ratio to mean nr of hits per chip to assign ineff. chip
74   
75
76 };
77
78 #endif