]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ACORDE/AliACORDECalibModule.cxx
Memory leak cured. Use TClonesArray::Delete() if stored objects allocate memory.
[u/mrichter/AliRoot.git] / ACORDE / AliACORDECalibModule.cxx
CommitLineData
51a69132 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
17
18
19///////////////////////////////////////////////////////////////////////////////
20// //
21// class for ACORDE calibration //
22// Pedro Gonzalez Zamora pedro.gonzalez@fcfm.buap.mx //
23// Irais Bautista Guzman irais@fcfm.buap.mx //
24// Arturo Fernandez Tellez afernan@cern.ch //
25// //
26///////////////////////////////////////////////////////////////////////////////
27
28
29#include "AliACORDECalibModule.h"
30#include "AliACORDEDataModule.h"
31#include "AliLog.h"
32#include <TCanvas.h>
33
34
35ClassImp(AliACORDECalibModule)
36
37
38//________________________________________________________________
39
40AliACORDECalibModule::AliACORDECalibModule():
41TObject(),
42fHRate(0x0)
43{
44
45
46 // Default constructor
47 for(int i=0;i<kNmodules;i++)
48 fModule[i]=0x0;
49
50
51}
52//________________________________________________________________
53AliACORDECalibModule::AliACORDECalibModule(const AliACORDECalibModule &calibdata):
54TObject(),
55fHRate(calibdata.fHRate)
56{
57 //copy constructor
58
59 for (Int_t i=0;i<kNmodules;i++)
60 {
61 fModule[i]=calibdata.fModule[i];
62
63 }
64
65
66}
67//_______________________________________________________________
68AliACORDECalibModule& AliACORDECalibModule:: operator=(const AliACORDECalibModule & calibdata)
69{
70//assignment operator
71 for(Int_t i=0;i<kNmodules;i++)
72 {
73 this->fModule[i]=calibdata.GetModule(i);
74
75 }
76
77 this->fHRate=calibdata.fHRate;
78
79 return *this;
80}
81
82
83
84//________________________________________________________________
85AliACORDECalibModule::~AliACORDECalibModule()
86{
87
88 // Destructor
89
90}
91
92
93//________________________________________________________________
94void AliACORDECalibModule::SetModule(Int_t module,Float_t value,Bool_t status,const char* name)
95{
96
97 fModule[module] = new AliACORDEDataModule(value,status,name);
98 //Set values for each module
99}
100//________________________________________________________________
101void AliACORDECalibModule::SetModuleRate(Int_t module, Float_t value)
102{
103 // Set RATE value
104
105 fModule[module]->SetRate(value);
106}
107//________________________________________________________________
108
109Float_t AliACORDECalibModule::GetModuleRate(Int_t module)
110{
111
112 return fModule[module]->GetRate();
113}
114//________________________________________________________________
115
116void AliACORDECalibModule::Create_Histo()
117{
118 //Create histogram of modules rates actual values
119
120
121 fHRate = new TH1F("fHRate","RATES PER MODULE",60,0,60);
122
123
124 for(int i=0;i<kNmodules;i++)
125 fHRate->Fill(i,fModule[i]->GetRate());
126
127}
128//_____________________________________________________________________
129void AliACORDECalibModule::Draw(const Option_t* /*option*/) //Draw the Histogram RATE_MODULE
130{
131 TCanvas *c1 = new TCanvas
132 ("RATES","RATES PER MODULE",200,10,700,500);
133 c1->cd();
134 fHRate->Draw();
135}
136
137//______________________________________________________________________
138void AliACORDECalibModule::Print_Module() // Print the status and rates for each module
139{
140
141
142 for(int module=0;module<kNmodules;module++)
143 AliInfo(Form("%s con rate %f Status %d \n",fModule[module]->GetName(),fModule[module]->GetRate(),fModule[module]->GetStatus()));
144
145}