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(const char* name, const char* title) :
61 // constructor setting name and title
68 //_____________________________________________________________________________
69 void AliMonitorPlot::SetDrawRef(Bool_t drawRef)
71 // set the flag for drawing the reference plot
76 //_____________________________________________________________________________
77 void AliMonitorPlot::SetThreshold(Float_t threshold)
79 // set the threshold in standard deviations for the comparison
80 // to the reference plot.
81 // no comparison is performed, if the threshold is <= 0
83 fgThreshold = threshold;
87 //_____________________________________________________________________________
88 void AliMonitorPlot::DrawEvent(Int_t number)
90 // draw the normalized monitor plot together with the reference
91 // plot and the comparison plot (if available)
92 // for the "number"th last event
94 if (!GetEvent(number)) return;
95 if (fgDrawRef) ComparePlot();
99 //_____________________________________________________________________________
100 void AliMonitorPlot::DrawSum(Int_t number)
102 // draw the normalized monitor plot together with the reference
103 // plot and the comparison plot (if available)
104 // for the sum of the last "number" events
106 if (!GetSum(number)) return;
107 if (fgDrawRef) ComparePlot();
111 //_____________________________________________________________________________
112 void AliMonitorPlot::DrawRun()
114 // draw the normalized monitor plot together with the reference
115 // plot and the comparison plot (if available)
116 // for all monitored events of the current run
118 if (!GetRun()) return;
119 if (fgDrawRef) ComparePlot();
124 //_____________________________________________________________________________
125 Bool_t AliMonitorPlot::CompareEvent(Int_t number)
127 // compare the normalized monitor plot for the "number"th last event
128 // to the reference plot
130 if (!GetEvent(number)) return kTRUE;
131 return ComparePlot();
134 //_____________________________________________________________________________
135 Bool_t AliMonitorPlot::CompareSum(Int_t number)
137 // compare the normalized monitor plot for the sum of the last
138 // "number" events to the reference plot
140 if (!GetSum(number)) return kTRUE;
141 return ComparePlot();
144 //_____________________________________________________________________________
145 Bool_t AliMonitorPlot::CompareRun()
147 // compare the normalized monitor plot for all monitored events
148 // of the current run to the reference plot
150 if (!GetRun()) return kTRUE;
151 return ComparePlot();