new cuts and tasks added
[u/mrichter/AliRoot.git] / MONITOR / AliMonitorPlot.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15
16 /* $Id$ */
17
18 ///////////////////////////////////////////////////////////////////////////////
19 //                                                                           //
20 //  This is the base class for plots used to monitor the quality of the      //
21 //  recorded data.                                                           //
22 //                                                                           //
23 ///////////////////////////////////////////////////////////////////////////////
24
25
26 #include "AliMonitorPlot.h"
27
28
29 ClassImp(AliMonitorPlot) 
30
31
32 Bool_t  AliMonitorPlot::fgDrawRef = kTRUE;
33 Float_t AliMonitorPlot::fgThreshold = 5.0;
34
35 Color_t AliMonitorPlot::fgColorData = kBlack;
36 Color_t AliMonitorPlot::fgColorRef = kBlue;
37 Color_t AliMonitorPlot::fgColorCompare = kRed;
38
39
40 //_____________________________________________________________________________
41 AliMonitorPlot::AliMonitorPlot() :
42   TNamed(),
43   fDescription(),
44   fNumberOfEvents(0)
45 {
46 // default contructor
47
48 }
49
50 //_____________________________________________________________________________
51 AliMonitorPlot::AliMonitorPlot(const AliMonitorPlot& plot) :
52   TNamed(plot),
53   fDescription(plot.fDescription),
54   fNumberOfEvents(plot.fNumberOfEvents)
55 {
56 // copy constructor
57
58 }
59
60 //_____________________________________________________________________________
61 AliMonitorPlot& AliMonitorPlot::operator =(const AliMonitorPlot& plot)
62 {
63 // assignment operator
64
65   TNamed::operator =(plot);
66   fNumberOfEvents = plot.fNumberOfEvents;
67   return *this;
68 }
69
70 //_____________________________________________________________________________
71 AliMonitorPlot::AliMonitorPlot(const char* name, const char* title) :
72   TNamed(name, title),
73   fDescription(),
74   fNumberOfEvents(0)
75 {
76 // constructor setting name and title
77
78 }
79
80
81
82 //_____________________________________________________________________________
83 void AliMonitorPlot::SetDrawRef(Bool_t drawRef)
84 {
85 // set the flag for drawing the reference plot
86
87   fgDrawRef = drawRef;
88 }
89
90 //_____________________________________________________________________________
91 void AliMonitorPlot::SetThreshold(Float_t threshold)
92 {
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
96
97   fgThreshold = threshold;
98 }
99
100
101 //_____________________________________________________________________________
102 void AliMonitorPlot::DrawEvent(Int_t number)
103 {
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
107
108   if (!GetEvent(number)) return;
109   if (fgDrawRef) ComparePlot();
110   DrawPlot();
111 }
112
113 //_____________________________________________________________________________
114 void AliMonitorPlot::DrawSum(Int_t number)
115 {
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
119
120   if (!GetSum(number)) return;
121   if (fgDrawRef) ComparePlot();
122   DrawPlot();
123 }
124
125 //_____________________________________________________________________________
126 void AliMonitorPlot::DrawRun()
127 {
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
131
132   if (!GetRun()) return;
133   if (fgDrawRef) ComparePlot();
134   DrawPlot();
135 }
136
137
138 //_____________________________________________________________________________
139 Bool_t AliMonitorPlot::CompareEvent(Int_t number)
140 {
141 // compare the normalized monitor plot for the "number"th last event
142 // to the reference plot
143
144   if (!GetEvent(number)) return kTRUE;
145   return ComparePlot();
146 }
147
148 //_____________________________________________________________________________
149 Bool_t AliMonitorPlot::CompareSum(Int_t number)
150 {
151 // compare the normalized monitor plot for the sum of the last 
152 // "number" events to the reference plot
153
154   if (!GetSum(number)) return kTRUE;
155   return ComparePlot();
156 }
157
158 //_____________________________________________________________________________
159 Bool_t AliMonitorPlot::CompareRun()
160 {
161 // compare the normalized monitor plot for all monitored events 
162 // of the current run to the reference plot
163
164   if (!GetRun()) return kTRUE;
165   return ComparePlot();
166 }
167