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