1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // This is the base class for plots used to monitor the quality of the //
23 ///////////////////////////////////////////////////////////////////////////////
26 #include "AliMonitorPlot.h"
29 ClassImp(AliMonitorPlot)
32 Bool_t AliMonitorPlot::fgDrawRef = kTRUE;
33 Float_t AliMonitorPlot::fgThreshold = 5.0;
35 Color_t AliMonitorPlot::fgColorData = kBlack;
36 Color_t AliMonitorPlot::fgColorRef = kBlue;
37 Color_t AliMonitorPlot::fgColorCompare = kRed;
40 //_____________________________________________________________________________
41 AliMonitorPlot::AliMonitorPlot() :
50 //_____________________________________________________________________________
51 AliMonitorPlot::AliMonitorPlot(const AliMonitorPlot& plot) :
53 fDescription(plot.fDescription),
54 fNumberOfEvents(plot.fNumberOfEvents)
60 //_____________________________________________________________________________
61 AliMonitorPlot& AliMonitorPlot::operator =(const AliMonitorPlot& plot)
63 // assignment operator
65 TNamed::operator =(plot);
66 fNumberOfEvents = plot.fNumberOfEvents;
70 //_____________________________________________________________________________
71 AliMonitorPlot::AliMonitorPlot(const char* name, const char* title) :
76 // constructor setting name and title
82 //_____________________________________________________________________________
83 void AliMonitorPlot::SetDrawRef(Bool_t drawRef)
85 // set the flag for drawing the reference plot
90 //_____________________________________________________________________________
91 void AliMonitorPlot::SetThreshold(Float_t threshold)
93 // set the threshold in standard deviations for the comparison
94 // to the reference plot.
95 // no comparison is performed, if the threshold is <= 0
97 fgThreshold = threshold;
101 //_____________________________________________________________________________
102 void AliMonitorPlot::DrawEvent(Int_t number)
104 // draw the normalized monitor plot together with the reference
105 // plot and the comparison plot (if available)
106 // for the "number"th last event
108 if (!GetEvent(number)) return;
109 if (fgDrawRef) ComparePlot();
113 //_____________________________________________________________________________
114 void AliMonitorPlot::DrawSum(Int_t number)
116 // draw the normalized monitor plot together with the reference
117 // plot and the comparison plot (if available)
118 // for the sum of the last "number" events
120 if (!GetSum(number)) return;
121 if (fgDrawRef) ComparePlot();
125 //_____________________________________________________________________________
126 void AliMonitorPlot::DrawRun()
128 // draw the normalized monitor plot together with the reference
129 // plot and the comparison plot (if available)
130 // for all monitored events of the current run
132 if (!GetRun()) return;
133 if (fgDrawRef) ComparePlot();
138 //_____________________________________________________________________________
139 Bool_t AliMonitorPlot::CompareEvent(Int_t number)
141 // compare the normalized monitor plot for the "number"th last event
142 // to the reference plot
144 if (!GetEvent(number)) return kTRUE;
145 return ComparePlot();
148 //_____________________________________________________________________________
149 Bool_t AliMonitorPlot::CompareSum(Int_t number)
151 // compare the normalized monitor plot for the sum of the last
152 // "number" events to the reference plot
154 if (!GetSum(number)) return kTRUE;
155 return ComparePlot();
158 //_____________________________________________________________________________
159 Bool_t AliMonitorPlot::CompareRun()
161 // compare the normalized monitor plot for all monitored events
162 // of the current run to the reference plot
164 if (!GetRun()) return kTRUE;
165 return ComparePlot();