Line data Source code
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: AliACORDECalibData.cxx, */
17 :
18 :
19 : #include "AliACORDECalibData.h"
20 : #include "TList.h"
21 : #include "TCanvas.h"
22 :
23 12 : ClassImp(AliACORDECalibData)
24 :
25 :
26 : //________________________________________________________________
27 3 : AliACORDECalibData::AliACORDECalibData():
28 3 : fHits(0),
29 3 : fTHits(0),
30 3 : fMultiHits(0),
31 3 : fTMultiHits(0)
32 15 : {
33 366 : for (Int_t imod = 0; imod < 60; imod++)
34 : {
35 180 : fEfficiencies[imod]=0.;
36 180 : fRates[imod]=0.;
37 180 : fModulesActivity[imod]=0.;
38 : }
39 6 : }
40 :
41 : //________________________________________________________________
42 : void AliACORDECalibData::Reset()
43 : {
44 :
45 0 : }
46 :
47 : //________________________________________________________________
48 : AliACORDECalibData::AliACORDECalibData(const char* name) :
49 0 : TNamed(),
50 0 : fHits(0),
51 0 : fTHits(0),
52 0 : fMultiHits(0),
53 0 : fTMultiHits(0)
54 0 : {
55 0 : TString namst = "Calib_";
56 0 : namst += name;
57 0 : SetName(namst.Data());
58 0 : SetTitle(namst.Data());
59 :
60 0 : }
61 :
62 : //________________________________________________________________
63 : AliACORDECalibData::AliACORDECalibData(const AliACORDECalibData& calibda) :
64 0 : TNamed(calibda),
65 0 : fHits(0),
66 0 : fTHits(0),
67 0 : fMultiHits(0),
68 0 : fTMultiHits(0)
69 0 : {
70 : // copy constructor
71 :
72 0 : SetName(calibda.GetName());
73 0 : SetTitle(calibda.GetName());
74 :
75 : // there are 60 modules. Note that number of first module is 1 (one)
76 0 : for(int t=0; t<60; t++)
77 : {
78 0 : fEfficiencies[t] =calibda.GetEfficiency(t+1);
79 0 : fRates[t] = calibda.GetRate(t+1);
80 0 : fModulesActivity[t] = calibda.GetModuleActivity(t+1);
81 : }
82 0 : }
83 : //_______________________________________________________________
84 : void AliACORDECalibData::Draw(Option_t *)
85 : {
86 :
87 :
88 : //fHits->Draw();
89 :
90 :
91 :
92 : TCanvas *ch;
93 0 : TString canvasHistoName="Histos";
94 0 : ch=new TCanvas(canvasHistoName,canvasHistoName,20,20,600,600);
95 0 : ch->Divide(2,2);
96 0 : ch->cd(1);
97 0 : fHits->Draw();
98 0 : ch->cd(2);
99 0 : fTHits->Draw();
100 0 : ch->cd(3);
101 0 : fMultiHits->Draw();
102 0 : ch->cd(4);
103 0 : fTMultiHits->Draw();
104 :
105 :
106 0 : }
107 : //________________________________________________________________
108 : AliACORDECalibData &AliACORDECalibData::operator =(const AliACORDECalibData& calibda)
109 : {
110 : // assignment operator
111 :
112 0 : SetName(calibda.GetName());
113 0 : SetTitle(calibda.GetName());
114 : // there are 60 modules. Note that number of first module is 1 (one)
115 0 : for(int t=0; t<60; t++)
116 : {
117 0 : fEfficiencies[t] =calibda.GetEfficiency(t+1);
118 0 : fRates[t] = calibda.GetRate(t+1);
119 0 : fModulesActivity[t] = calibda.GetModuleActivity(t+1);
120 : }
121 0 : return *this;
122 : }
123 : //_______________________________________________________________
124 : /*void AliACORDECalibData::AddHisto(TH1D *fHist)
125 : {
126 :
127 :
128 :
129 : = (TH1D*)fHist->Clone("hnew");
130 :
131 :
132 :
133 :
134 : }
135 : */
136 :
137 : //________________________________________________________________
138 : AliACORDECalibData::~AliACORDECalibData()
139 0 : {
140 :
141 0 : }
142 :
143 :
144 :
145 : //________________________________________________________________
146 : void AliACORDECalibData::SetEfficiencies(Float_t* Eff)
147 : {
148 : // there are 60 modules. Note that number of first module is 1 (one)
149 0 : if(Eff) for(int t=0; t<60; t++) fEfficiencies[t] = Eff[t];
150 0 : else for(int t=0; t<60; t++) fEfficiencies[t] = 0.0;
151 0 : }
152 :
153 : void AliACORDECalibData::SetRates(Float_t* Rt)
154 : {
155 0 : if(Rt) for (int t=0;t<60; t++) fRates[t] = Rt[t];
156 0 : else for (int t=0;t<60; t++) fRates[t] = 0.0;
157 0 : }
158 :
159 : void AliACORDECalibData::SetModulesActivity(Float_t* Mac)
160 : {
161 0 : if(Mac) for (int t=0;t<60;t++) fModulesActivity[t] = Mac[t];
162 0 : else for (int t=0;t<60;t++) fModulesActivity[t] = 0.0;
163 0 : }
164 :
|