corrections to obey coding conventions
[u/mrichter/AliRoot.git] / MONITOR / AliMonitor.cxx
CommitLineData
04fa961a 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 the creation and filling of monitor //
21// histograms. //
22// Derived classes have to implement the methods CreateHistos and //
23// FillHistos. CreateHistos has to create the monitor histograms, put //
24// them into a new folder and add this folder to the given root folder. //
25// FillHistos has to fill the data of the current event into the created //
26// monitor histograms. //
27// //
28///////////////////////////////////////////////////////////////////////////////
29
30
31#include "AliMonitor.h"
c4bd737c 32#include "AliMonitorTrend.h"
33#include <TFolder.h>
04fa961a 34#include <TH1.h>
35#include <TH2.h>
36
37
38ClassImp(AliMonitor)
39
40
c4bd737c 41//_____________________________________________________________________________
42AliMonitor::AliMonitor()
43{
44 fFolder = NULL;
45}
46
47//_____________________________________________________________________________
48AliMonitor::AliMonitor(const AliMonitor& monitor) :
49 TObject(monitor)
50{
51 Fatal("AliMonitor", "copy constructor not implemented");
52}
53
54//_____________________________________________________________________________
55AliMonitor& AliMonitor::operator = (const AliMonitor& /*monitor*/)
56{
57 Fatal("operator =", "assignment operator not implemented");
58 return *this;
59}
60
04fa961a 61//_____________________________________________________________________________
62void AliMonitor::CreateBranches(TTree*)
63{
64// add branches to the monitor tree
65// by default no branches are added
66// this method can be overwritten by derived classes
67
68}
69
70
71//_____________________________________________________________________________
72AliMonitorHisto* AliMonitor::CreateHisto1(const char* name, const char* title,
73 Int_t xBins, Double_t xMin, Double_t xMax,
74 const char* xTitle, const char* yTitle,
75 AliMonitorHisto::ENorm norm)
76{
77// create a 1 dimensional monitor histogram and add it to fFolder
78
79 TH1F* histo = new TH1F(name, title, xBins, xMin, xMax);
80 histo->SetMarkerStyle(kFullCircle);
81 histo->GetXaxis()->SetTitle(xTitle);
82 histo->GetYaxis()->SetTitle(yTitle);
83 AliMonitorHisto* result = new AliMonitorHisto(histo, norm);
84 fFolder->Add(result);
85 return result;
86}
87
88//_____________________________________________________________________________
89AliMonitorHisto* AliMonitor::CreateHisto2(const char* name, const char* title,
90 Int_t xBins, Double_t xMin, Double_t xMax,
91 Int_t yBins, Double_t yMin, Double_t yMax,
92 const char* xTitle, const char* yTitle,
93 const char* zTitle,
94 AliMonitorHisto::ENorm norm)
95{
96// create a 2 dimensional monitor histogram and add it to fFolder
97
98 TH2F* histo = new TH2F(name, title, xBins, xMin, xMax, yBins, yMin, yMax);
99 histo->SetOption("BOX");
100 histo->GetXaxis()->SetTitle(xTitle);
101 histo->GetYaxis()->SetTitle(yTitle);
102 histo->GetZaxis()->SetTitle(zTitle);
103 AliMonitorHisto* result = new AliMonitorHisto(histo, norm);
104 fFolder->Add(result);
105 return result;
106}
107
108//_____________________________________________________________________________
109AliMonitorTrend* AliMonitor::CreateTrend(const char* name, const char* title,
110 const char* label,
111 Double_t min, Double_t max)
112{
113// create a trend monitor histogram and add it to fFolder
114
115 AliMonitorTrend* result = new AliMonitorTrend(name, title, label, min, max);
116 fFolder->Add(result);
117 return result;
118}
119