]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONTriggerDisplay.h
Changing once more (hopefully we get it correct this time...) the logic to trig the...
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerDisplay.h
1 #ifndef ALIMUONTRIGGERDISPLAY_H
2 #define ALIMUONTRIGGERDISPLAY_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 // $Id$
7
8 /// \ingroup calib
9 /// \class AliMUONTriggerDisplay
10 /// \brief Converts histograms as a function of strip/board/slat number in human readable histograms
11 ///
12 //  Author Diego Stocco
13
14 // --- ROOT system ---
15
16 #include "TH2.h"
17
18 class TArrayD;
19 class TString;
20
21 class AliMUONTriggerDisplay: public TObject {
22
23 public:
24   AliMUONTriggerDisplay();
25   virtual ~AliMUONTriggerDisplay();
26   
27   /// Display element inidices (strip,board,slat)
28   enum EDisplayType {
29     kDisplayStrips,    ///< Draw strips
30     kDisplayBoards,    ///< Draw boards
31     kDisplaySlats      ///< Draw slats
32   };
33
34   /// Display options inidices
35   enum EDisplayOption {
36     kDefaultDisplay,   ///< Default display
37     kNumbered,         ///< Histogram filled with board numbers
38     kShowZeroes,       ///< Displays strip/board/slat content even if it is 0
39     kNormalizeToArea   ///< Draw input histo divided by element area
40   };
41
42   TH2* GetEmptyDisplayHisto(TString displayHistoName, EDisplayType displayType,
43                             Int_t cathode, Int_t chamber=11,
44                             TString displayHistoTitle="");
45
46   TH2* GetBoardNumberHisto(TString displayHistoName,
47                            Int_t chamber=11,TString displayHistoTitle="");
48   
49   TH2* GetDisplayHistogram(TH1* inputHisto, TString displayHistoName,
50                            EDisplayType displayType, Int_t cathode,
51                            Int_t chamber=11, TString displayHistoTitle="",
52                            EDisplayOption displayOpt=kDefaultDisplay);
53   
54   Bool_t FillDisplayHistogram(TH1* inputHisto, TH2* displayHisto,
55                               EDisplayType displayType, Int_t cathode,
56                               Int_t chamber=11,EDisplayOption displayOpt=kDefaultDisplay);
57   
58 private:
59   Bool_t AddSortedPoint(Float_t currVal, TArrayD& position, const Float_t kResetValue);
60   /// Return index
61   Int_t GetIndex(Int_t chamber, Int_t cathode) { return 2*chamber + cathode;}
62
63   Bool_t InitOrDisplayTriggerInfo(TH1* inoutHisto, TH2* displayHisto,
64                                   EDisplayType displayType,
65                                   Int_t cathode, Int_t chamber,
66                                   TString displayHistoName, TString displayHistoTitle,
67                                   EDisplayOption displayOpt=kDefaultDisplay);
68
69   void FillBins(TH1* inputHisto, TH2* displayHisto,
70                 Int_t iElement1, Int_t iElement2,
71                 Float_t x1, Float_t x2, Float_t y1, Float_t y2,
72                 const Float_t kShiftX, const Float_t kShiftY,
73                 EDisplayOption displayOpt);
74
75   ClassDef(AliMUONTriggerDisplay,0)  // Class for converting trigger histograms
76
77 };
78 #endif