]>
Commit | Line | Data |
---|---|---|
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" | |
32 | #include <TH1.h> | |
33 | #include <TH2.h> | |
34 | ||
35 | ||
36 | ClassImp(AliMonitor) | |
37 | ||
38 | ||
39 | //_____________________________________________________________________________ | |
40 | void AliMonitor::CreateBranches(TTree*) | |
41 | { | |
42 | // add branches to the monitor tree | |
43 | // by default no branches are added | |
44 | // this method can be overwritten by derived classes | |
45 | ||
46 | } | |
47 | ||
48 | ||
49 | //_____________________________________________________________________________ | |
50 | AliMonitorHisto* AliMonitor::CreateHisto1(const char* name, const char* title, | |
51 | Int_t xBins, Double_t xMin, Double_t xMax, | |
52 | const char* xTitle, const char* yTitle, | |
53 | AliMonitorHisto::ENorm norm) | |
54 | { | |
55 | // create a 1 dimensional monitor histogram and add it to fFolder | |
56 | ||
57 | TH1F* histo = new TH1F(name, title, xBins, xMin, xMax); | |
58 | histo->SetMarkerStyle(kFullCircle); | |
59 | histo->GetXaxis()->SetTitle(xTitle); | |
60 | histo->GetYaxis()->SetTitle(yTitle); | |
61 | AliMonitorHisto* result = new AliMonitorHisto(histo, norm); | |
62 | fFolder->Add(result); | |
63 | return result; | |
64 | } | |
65 | ||
66 | //_____________________________________________________________________________ | |
67 | AliMonitorHisto* AliMonitor::CreateHisto2(const char* name, const char* title, | |
68 | Int_t xBins, Double_t xMin, Double_t xMax, | |
69 | Int_t yBins, Double_t yMin, Double_t yMax, | |
70 | const char* xTitle, const char* yTitle, | |
71 | const char* zTitle, | |
72 | AliMonitorHisto::ENorm norm) | |
73 | { | |
74 | // create a 2 dimensional monitor histogram and add it to fFolder | |
75 | ||
76 | TH2F* histo = new TH2F(name, title, xBins, xMin, xMax, yBins, yMin, yMax); | |
77 | histo->SetOption("BOX"); | |
78 | histo->GetXaxis()->SetTitle(xTitle); | |
79 | histo->GetYaxis()->SetTitle(yTitle); | |
80 | histo->GetZaxis()->SetTitle(zTitle); | |
81 | AliMonitorHisto* result = new AliMonitorHisto(histo, norm); | |
82 | fFolder->Add(result); | |
83 | return result; | |
84 | } | |
85 | ||
86 | //_____________________________________________________________________________ | |
87 | AliMonitorTrend* AliMonitor::CreateTrend(const char* name, const char* title, | |
88 | const char* label, | |
89 | Double_t min, Double_t max) | |
90 | { | |
91 | // create a trend monitor histogram and add it to fFolder | |
92 | ||
93 | AliMonitorTrend* result = new AliMonitorTrend(name, title, label, min, max); | |
94 | fFolder->Add(result); | |
95 | return result; | |
96 | } | |
97 |