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() : TNamed()
48 //_____________________________________________________________________________
49 AliMonitorPlot::AliMonitorPlot(const AliMonitorPlot& plot) :
54 fNumberOfEvents = plot.fNumberOfEvents;
57 //_____________________________________________________________________________
58 AliMonitorPlot& AliMonitorPlot::operator =(const AliMonitorPlot& plot)
60 // assignment operator
62 TNamed::operator =(plot);
63 fNumberOfEvents = plot.fNumberOfEvents;
67 //_____________________________________________________________________________
68 AliMonitorPlot::AliMonitorPlot(const char* name, const char* title) :
71 // constructor setting name and title
78 //_____________________________________________________________________________
79 void AliMonitorPlot::SetDrawRef(Bool_t drawRef)
81 // set the flag for drawing the reference plot
86 //_____________________________________________________________________________
87 void AliMonitorPlot::SetThreshold(Float_t threshold)
89 // set the threshold in standard deviations for the comparison
90 // to the reference plot.
91 // no comparison is performed, if the threshold is <= 0
93 fgThreshold = threshold;
97 //_____________________________________________________________________________
98 void AliMonitorPlot::DrawEvent(Int_t number)
100 // draw the normalized monitor plot together with the reference
101 // plot and the comparison plot (if available)
102 // for the "number"th last event
104 if (!GetEvent(number)) return;
105 if (fgDrawRef) ComparePlot();
109 //_____________________________________________________________________________
110 void AliMonitorPlot::DrawSum(Int_t number)
112 // draw the normalized monitor plot together with the reference
113 // plot and the comparison plot (if available)
114 // for the sum of the last "number" events
116 if (!GetSum(number)) return;
117 if (fgDrawRef) ComparePlot();
121 //_____________________________________________________________________________
122 void AliMonitorPlot::DrawRun()
124 // draw the normalized monitor plot together with the reference
125 // plot and the comparison plot (if available)
126 // for all monitored events of the current run
128 if (!GetRun()) return;
129 if (fgDrawRef) ComparePlot();
134 //_____________________________________________________________________________
135 Bool_t AliMonitorPlot::CompareEvent(Int_t number)
137 // compare the normalized monitor plot for the "number"th last event
138 // to the reference plot
140 if (!GetEvent(number)) return kTRUE;
141 return ComparePlot();
144 //_____________________________________________________________________________
145 Bool_t AliMonitorPlot::CompareSum(Int_t number)
147 // compare the normalized monitor plot for the sum of the last
148 // "number" events to the reference plot
150 if (!GetSum(number)) return kTRUE;
151 return ComparePlot();
154 //_____________________________________________________________________________
155 Bool_t AliMonitorPlot::CompareRun()
157 // compare the normalized monitor plot for all monitored events
158 // of the current run to the reference plot
160 if (!GetRun()) return kTRUE;
161 return ComparePlot();