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 the creation and filling of monitor //
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. //
28 ///////////////////////////////////////////////////////////////////////////////
31 #include "AliMonitor.h"
32 #include "AliMonitorTrend.h"
41 //_____________________________________________________________________________
42 AliMonitor::AliMonitor()
47 //_____________________________________________________________________________
48 AliMonitor::AliMonitor(const AliMonitor& monitor) :
51 Fatal("AliMonitor", "copy constructor not implemented");
54 //_____________________________________________________________________________
55 AliMonitor& AliMonitor::operator = (const AliMonitor& /*monitor*/)
57 Fatal("operator =", "assignment operator not implemented");
61 //_____________________________________________________________________________
62 void AliMonitor::CreateBranches(TTree*)
64 // add branches to the monitor tree
65 // by default no branches are added
66 // this method can be overwritten by derived classes
71 //_____________________________________________________________________________
72 AliMonitorHisto* 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)
77 // create a 1 dimensional monitor histogram and add it to fFolder
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);
88 //_____________________________________________________________________________
89 AliMonitorHisto* 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,
94 AliMonitorHisto::ENorm norm)
96 // create a 2 dimensional monitor histogram and add it to fFolder
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);
108 //_____________________________________________________________________________
109 AliMonitorTrend* AliMonitor::CreateTrend(const char* name, const char* title,
111 Double_t min, Double_t max)
113 // create a trend monitor histogram and add it to fFolder
115 AliMonitorTrend* result = new AliMonitorTrend(name, title, label, min, max);
116 fFolder->Add(result);