ROOT logo
#ifndef ALIITSONLINESPDPHYSANALYZER_H
#define ALIITSONLINESPDPHYSANALYZER_H
/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

////////////////////////////////////////////////////////////
// Author: Henrik Tydesjo                                 //
// This class is used in the detector algorithm framework //
// to process the data stored in special container files  //
// (see AliITSOnlineSPDphys).                             //
////////////////////////////////////////////////////////////

#include <TString.h>

class AliITSOnlineSPDphys;
class AliITSOnlineCalibrationSPDhandler;
class TGraph;
class TH2F;

class AliITSOnlineSPDphysAnalyzer {

 public:
  AliITSOnlineSPDphysAnalyzer(const Char_t *fileName, AliITSOnlineCalibrationSPDhandler* handler, Bool_t readFromGridFile=kFALSE);
  AliITSOnlineSPDphysAnalyzer(AliITSOnlineSPDphys* physObj, AliITSOnlineCalibrationSPDhandler* handler);
  AliITSOnlineSPDphysAnalyzer(const AliITSOnlineSPDphysAnalyzer& handle);
  ~AliITSOnlineSPDphysAnalyzer();

  AliITSOnlineSPDphysAnalyzer& operator=(const AliITSOnlineSPDphysAnalyzer& handle);

  void       SetCalibHandler(AliITSOnlineCalibrationSPDhandler *handler) {fHandler=handler;}
  void       SetParam(const Char_t *pname, const Char_t *pval);
  void       ReadParamsFromLocation(const Char_t *dirName);

  UInt_t     ProcessDeadPixels();
  UInt_t     ProcessNoisyPixels();
  UInt_t     ProcessNoisyPixels(UInt_t eq, UInt_t nrEvts);

  UInt_t     GetNrEnoughStatChips();
  UInt_t     GetNrDeadChips();
  UInt_t     GetNrInefficientChips();
  UInt_t     GetNrNeedsMoreStatChips();

  AliITSOnlineSPDphys* GetOnlinePhys() {return fPhysObj;}
  UInt_t     GetEqNr() const;
  UInt_t     GetNrEvents() const;

  TH2F*      GetHitMapTot();
  TH2F*      GetPhysicalHitMapTot();
  TH2F*      GetHitMapChip(UInt_t hs, UInt_t chip);

 private:
  TString  fFileName; // container file name
  enum     calibvals{kMINTH,kMEANTH,kDAC,kUNIMA,kNOISE,kDELAY};  // calib types
  AliITSOnlineSPDphys               *fPhysObj; // container obj
  AliITSOnlineCalibrationSPDhandler *fHandler; // calib helper obj
  void     Init(Bool_t readFromGridFile=kFALSE);    // initialization
  void     Exponent(Double_t &val, Int_t &valExp) const;

  UInt_t   fNrEnoughStatChips;    // nr of enough stat chips
  UInt_t   fNrDeadChips;          // nr of dead chips
  UInt_t   fNrInefficientChips;   // nr of inefficient chips

  Double_t fNrEqHits;         // total nr of hits for associated eq
  Bool_t   fbDeadProcessed;   // flag to tell if ProcessDeadPixels has been called

  // dead noisy parameters:
  Double_t fThreshNoisy;       // at what confidence level do we search for noisy
  Double_t fThreshDead;        // at what confidence level do we search for dead
  UInt_t   fMinEventsForNoisy; // min nr of events required to try noisy algorithm
  UInt_t   fMinEventsForDead;  // min nr of events required to try dead algorithm
  Float_t  fDefinitelyNoisyRatio; // if a pixel fires more than this ratio of the events, it must be noisy
  Double_t fMinNrEqHitsForDeadChips; // minimum nr of hits for eq to assign dead chip
  Double_t fRatioToMeanForInefficientChip; // ratio to mean nr of hits per chip to assign ineff. chip
  

};

#endif
 AliITSOnlineSPDphysAnalyzer.h:1
 AliITSOnlineSPDphysAnalyzer.h:2
 AliITSOnlineSPDphysAnalyzer.h:3
 AliITSOnlineSPDphysAnalyzer.h:4
 AliITSOnlineSPDphysAnalyzer.h:5
 AliITSOnlineSPDphysAnalyzer.h:6
 AliITSOnlineSPDphysAnalyzer.h:7
 AliITSOnlineSPDphysAnalyzer.h:8
 AliITSOnlineSPDphysAnalyzer.h:9
 AliITSOnlineSPDphysAnalyzer.h:10
 AliITSOnlineSPDphysAnalyzer.h:11
 AliITSOnlineSPDphysAnalyzer.h:12
 AliITSOnlineSPDphysAnalyzer.h:13
 AliITSOnlineSPDphysAnalyzer.h:14
 AliITSOnlineSPDphysAnalyzer.h:15
 AliITSOnlineSPDphysAnalyzer.h:16
 AliITSOnlineSPDphysAnalyzer.h:17
 AliITSOnlineSPDphysAnalyzer.h:18
 AliITSOnlineSPDphysAnalyzer.h:19
 AliITSOnlineSPDphysAnalyzer.h:20
 AliITSOnlineSPDphysAnalyzer.h:21
 AliITSOnlineSPDphysAnalyzer.h:22
 AliITSOnlineSPDphysAnalyzer.h:23
 AliITSOnlineSPDphysAnalyzer.h:24
 AliITSOnlineSPDphysAnalyzer.h:25
 AliITSOnlineSPDphysAnalyzer.h:26
 AliITSOnlineSPDphysAnalyzer.h:27
 AliITSOnlineSPDphysAnalyzer.h:28
 AliITSOnlineSPDphysAnalyzer.h:29
 AliITSOnlineSPDphysAnalyzer.h:30
 AliITSOnlineSPDphysAnalyzer.h:31
 AliITSOnlineSPDphysAnalyzer.h:32
 AliITSOnlineSPDphysAnalyzer.h:33
 AliITSOnlineSPDphysAnalyzer.h:34
 AliITSOnlineSPDphysAnalyzer.h:35
 AliITSOnlineSPDphysAnalyzer.h:36
 AliITSOnlineSPDphysAnalyzer.h:37
 AliITSOnlineSPDphysAnalyzer.h:38
 AliITSOnlineSPDphysAnalyzer.h:39
 AliITSOnlineSPDphysAnalyzer.h:40
 AliITSOnlineSPDphysAnalyzer.h:41
 AliITSOnlineSPDphysAnalyzer.h:42
 AliITSOnlineSPDphysAnalyzer.h:43
 AliITSOnlineSPDphysAnalyzer.h:44
 AliITSOnlineSPDphysAnalyzer.h:45
 AliITSOnlineSPDphysAnalyzer.h:46
 AliITSOnlineSPDphysAnalyzer.h:47
 AliITSOnlineSPDphysAnalyzer.h:48
 AliITSOnlineSPDphysAnalyzer.h:49
 AliITSOnlineSPDphysAnalyzer.h:50
 AliITSOnlineSPDphysAnalyzer.h:51
 AliITSOnlineSPDphysAnalyzer.h:52
 AliITSOnlineSPDphysAnalyzer.h:53
 AliITSOnlineSPDphysAnalyzer.h:54
 AliITSOnlineSPDphysAnalyzer.h:55
 AliITSOnlineSPDphysAnalyzer.h:56
 AliITSOnlineSPDphysAnalyzer.h:57
 AliITSOnlineSPDphysAnalyzer.h:58
 AliITSOnlineSPDphysAnalyzer.h:59
 AliITSOnlineSPDphysAnalyzer.h:60
 AliITSOnlineSPDphysAnalyzer.h:61
 AliITSOnlineSPDphysAnalyzer.h:62
 AliITSOnlineSPDphysAnalyzer.h:63
 AliITSOnlineSPDphysAnalyzer.h:64
 AliITSOnlineSPDphysAnalyzer.h:65
 AliITSOnlineSPDphysAnalyzer.h:66
 AliITSOnlineSPDphysAnalyzer.h:67
 AliITSOnlineSPDphysAnalyzer.h:68
 AliITSOnlineSPDphysAnalyzer.h:69
 AliITSOnlineSPDphysAnalyzer.h:70
 AliITSOnlineSPDphysAnalyzer.h:71
 AliITSOnlineSPDphysAnalyzer.h:72
 AliITSOnlineSPDphysAnalyzer.h:73
 AliITSOnlineSPDphysAnalyzer.h:74
 AliITSOnlineSPDphysAnalyzer.h:75
 AliITSOnlineSPDphysAnalyzer.h:76
 AliITSOnlineSPDphysAnalyzer.h:77
 AliITSOnlineSPDphysAnalyzer.h:78