1 // Author: Filimon Roukoutakis
2 /******************************************************************************
3 MOOD - Monitor Of On-line Data and Detector Debugger for ALICE Experiment
4 ******************************************************************************/
9 /******************************************************************************
13 * CAL Module Class; base class for EMCAL and PHOS monitors *
15 * Author: Timo Alho (Jyvaskyla), original version *
16 * [Consultant: D. Silvermyr (ORNL)] *
18 ******************************************************************************/
20 #include "TMBaseModule.h"
25 //This class will handle the pedestal data analysis
26 #include "AliRawReader.h"
27 #include "AliCaloRawStream.h"
28 #include "AliCaloCalibPedestal.h"
30 //TMCalConstants.hh includes all the defaults and GUI layout etc..
31 #include "TMCalConstants.hh"
33 class TMCal: public TMBaseModule {
39 virtual void ConstructGUI(void) {};
40 virtual void ConstructMonitors(void) {};
41 virtual void DestructMonitors(void) {};
42 virtual void DestructGUI(void) {};
43 virtual void InitMonitors(void) {};
44 virtual void MonitorEvent(void);
45 virtual void UpdateMonitors(void);
46 virtual void ResetMonitors(void) {};
47 virtual void PreMonitor(void) {};
48 virtual void PostMonitor(void);
52 AliCaloCalibPedestal::kDetType fDetType; //The detector type for this object
55 enum kTab {kPeds, kPeaks, kPedsDiff, kPeaksDiff, kPedsRatio, kPeaksRatio,
56 kPedsSingle, kPeaksSingle, kPedsDiffSingle, kPeaksDiffSingle, kPedsRatioSingle, kPeaksRatioSingle};
58 int fEvents; //The number of events processed
59 AliCaloCalibPedestal *fPedestals; //The object taking care of pedestal and pedestal-peak profile generation
60 AliRawReader *fRawReader; //The raw data reader
61 AliCaloRawStream *fCaloRawStream; //The object to sort this out to EMCAL/PHOS data
63 /////////////////////////////
66 //Histocanvases. The last one, that is [fgkNumModules] is the single histo display canvas.
67 //This isn't too neat or good programming style, but it does make handling the updates etc simpler and more unified -> less prone to errors
68 TCanvas * fPedsCanvas[fgkMaxModules+1]; //!The pointers to the Ped canvases for the modules
69 TCanvas * fPeaksCanvas[fgkMaxModules+1]; //!The pointers to the Peak canvases for the modules
70 TCanvas * fPedsDiffCanvas[fgkMaxModules+1]; //!The pointers to the Ped difference canvases for the modules
71 TCanvas * fPeaksDiffCanvas[fgkMaxModules+1]; //!The pointers to the Peak difference canvases for the modules
72 TCanvas * fPedsRatioCanvas[fgkMaxModules+1]; //!The pointers to the Ped ratio canvases for the modules
73 TCanvas * fPeaksRatioCanvas[fgkMaxModules+1]; //!The pointers to the Peak ratio anvases for the modules
74 TCanvas * fDeadMapCanvas[fgkMaxModules+1];
76 //Single histo canvases. These hold pointers to the single histo canvases. Note that a copy is in the main canvas arrays above
77 TCanvas * fPedsCanvasSingle; //!
78 TCanvas * fPeaksCanvasSingle; //!
79 TCanvas * fPedsDiffCanvasSingle; //!
80 TCanvas * fPeaksDiffCanvasSingle; //!
81 TCanvas * fPedsRatioCanvasSingle; //!
82 TCanvas * fPeaksRatioCanvasSingle; //!
83 TCanvas * fDeadMapCanvasSingle; //!
85 TGLabel * fDeadCountText;
88 TGCompositeFrame * fPedsTab;
89 TGCompositeFrame * fPeaksTab;
90 TGCompositeFrame * fPedsDiffTab;
91 TGCompositeFrame * fPeaksDiffTab;
92 TGCompositeFrame * fPedsRatioTab;
93 TGCompositeFrame * fPeaksRatioTab;
94 TGCompositeFrame * fDeadMapTab;
96 //The vertical major frames for the multihisto displays in each of the tabs
97 TGCompositeFrame * fPeaksDiffFrame;
98 TGCompositeFrame * fPedsDiffFrame;
99 TGCompositeFrame * fPeaksFrame;
100 TGCompositeFrame * fPedsFrame;
101 TGCompositeFrame * fPeaksRatioFrame;
102 TGCompositeFrame * fPedsRatioFrame;
103 TGCompositeFrame * fDeadMapFrame;
105 //The same for the single histo displays
106 TGCompositeFrame * fPeaksDiffFrameSingle;
107 TGCompositeFrame * fPedsDiffFrameSingle;
108 TGCompositeFrame * fPeaksFrameSingle;
109 TGCompositeFrame * fPedsFrameSingle;
110 TGCompositeFrame * fPeaksRatioFrameSingle;
111 TGCompositeFrame * fPedsRatioFrameSingle;
112 TGCompositeFrame * fDeadMapFrameSingle;
114 //The buttons on the lower panel
115 TGTextButton * fGainButton;
116 TGTextButton * fSingleModeButton;
117 TGNumberEntry * fRunNoEntry;
120 TGVSlider * fPeaksRange;
121 TGVSlider * fPedsRange;
122 TGVSlider * fPeaksDiffRange;
123 TGVSlider * fPedsDiffRange;
124 TGVSlider * fPeaksRatioRange;
125 TGVSlider * fPedsRatioRange;
126 //The range sliders for single module
127 TGVSlider * fPeaksRangeSingle;
128 TGVSlider * fPedsRangeSingle;
129 TGVSlider * fPeaksDiffRangeSingle;
130 TGVSlider * fPedsDiffRangeSingle;
131 TGVSlider * fPeaksRatioRangeSingle;
132 TGVSlider * fPedsRatioRangeSingle;
135 Bool_t fLowGainMode; //Low or high gain to be displayed
136 Bool_t fSingleModule; //If we are in a single module state
137 int fVisibleModule; //The module which is visible, if we're in the single module mode
138 Int_t fDeadMapPalette[AliCaloCalibPedestal::kNumDeadMapStates]; //The palette used for drawing the dead map. See TMCalConstants.hh for the color
139 //definition (which are assigned in the constructor of this class)
140 //The easiest way to define a string constant...
141 #define fgkDeadMapTabName "DeadMap"
142 TPaveText * fDeadMapPaveText;
149 double fMaxPeakRatio;
151 //////////////////////////////
152 //GUI Creation helpers
154 void DrawHistos();//Draw the histos
155 TGCompositeFrame * MakeAllModulesTab(TGCompositeFrame * tab,
156 TCanvas **canvArray, //Array of pointers to the canvases to which the histos have been drawn. MUST be initialized.
157 TGVSlider **slider = 0, //The pointer to the pointer to the slider, which to put the slider to
158 kTab tabId = kPeds, //The tab Id which the slider should give as a parameter when connecting
159 double sliderMin = 0.0, double sliderMax = 0.0, double sliderPos = 0.0 //The range and position of the slider
160 );//The function to create a tab full of histos
162 TGCompositeFrame * MakeSingleModuleTab(TGCompositeFrame * tab,
164 TGVSlider **slider = 0, //The pointer to the pointer to the slider, which to put the slider to
165 kTab tabId = kPeds, //The tab Id which the slider should give as a parameter when connecting
166 double sliderMin = 0.0, double sliderMax = 0.0, double sliderPos = 0.0 //The range and position of the slider
168 void ConstructFullGUI(); //Constructs the GUI with all modules visible
169 void ConstructMenu(UInt_t w); //Constructs the GUI with all modules visible
170 void InitRawReaderAndStream(unsigned int runNo); //Inits the Raw reader and CaloRawStream
171 void SetTitles();//Sets the title of the histos
175 TMCal(const TGWindow *p, UInt_t w, UInt_t h, AliCaloCalibPedestal::kDetType detectorType);
180 void OnModeButton(int button);
181 void OnRange(kTab tab);
182 void OnRunNoChange(Long_t val);
183 void OnTabChange(Int_t Id);//Here we have to set the appropriate palette for the tab
185 ClassDef(TMCal, 1); // Calorimeter Module Base Class