]> git.uio.no Git - u/mrichter/AliRoot.git/blob - AD/AliADCalibData.cxx
consolidate zero-length arrays (aka struct hack)
[u/mrichter/AliRoot.git] / AD / AliADCalibData.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: AliADCalibData.cxx,                                            */
17
18
19 #include "AliADCalibData.h"
20 #include "TList.h"
21 #include "TCanvas.h"
22
23 ClassImp(AliADCalibData)
24
25
26 //________________________________________________________________
27 AliADCalibData::AliADCalibData()
28 {
29         for (Int_t imod = 0; imod < 60; imod++)
30         {
31                 fEfficiencies[imod]=0.;
32                 fRates[imod]=0.;
33                 fModulesActivity[imod]=0.;
34         } 
35 }
36
37 //________________________________________________________________
38 void AliADCalibData::Reset()
39 {
40   
41 }
42
43 //________________________________________________________________
44 AliADCalibData::AliADCalibData(const char* name) :
45   TNamed()
46 {
47   TString namst = "Calib_";
48   namst += name;
49   SetName(namst.Data());
50   SetTitle(namst.Data());
51
52 }
53
54 //________________________________________________________________
55 AliADCalibData::AliADCalibData(const AliADCalibData& calibda) :
56   TNamed(calibda)
57 {
58 // copy constructor
59
60   SetName(calibda.GetName());
61   SetTitle(calibda.GetName());
62   
63   // there are 60 modules. Note that number of first module is 1 (one)
64   for(int t=0; t<60; t++) 
65   {
66         fEfficiencies[t] =calibda.GetEfficiency(t);
67         fRates[t] = calibda.GetRate(t);
68         fModulesActivity[t] = calibda.GetModuleActivity(t);
69   }
70 }
71 //_______________________________________________________________
72 void AliADCalibData::Draw(Option_t *)
73 {
74  
75
76   //fHits->Draw();
77
78  
79 }
80 //________________________________________________________________
81 AliADCalibData &AliADCalibData::operator =(const AliADCalibData& calibda)
82 {
83 // assignment operator
84
85   SetName(calibda.GetName());
86   SetTitle(calibda.GetName());
87   // there are 60 modules. Note that number of first module is 1 (one)
88   for(int t=0; t<60; t++) 
89   {
90         fEfficiencies[t] =calibda.GetEfficiency(t);
91         fRates[t] = calibda.GetRate(t);
92         fModulesActivity[t] = calibda.GetModuleActivity(t);
93   }
94   return *this;
95 }
96 //_______________________________________________________________
97 /*void AliADCalibData::AddHisto(TH1D *fHist)
98 {
99     
100
101
102  = (TH1D*)fHist->Clone("hnew");
103
104      
105    
106  
107 }
108 */
109
110 //________________________________________________________________
111 AliADCalibData::~AliADCalibData()
112 {
113   
114 }
115
116                                                                                    
117
118 //________________________________________________________________
119 void AliADCalibData::SetEfficiencies(Float_t* Eff)
120 {
121   // there are 60 modules. Note that number of first module is 1 (one)
122   if(Eff) for(int t=0; t<60; t++) fEfficiencies[t] = Eff[t];
123   else for(int t=0; t<60; t++) fEfficiencies[t] = 0.0;
124 }
125
126 void AliADCalibData::SetRates(Float_t* Rt)
127 {
128    if(Rt) for (int t=0;t<60; t++) fRates[t] = Rt[t];
129 else for (int t=0;t<60; t++) fRates[t] = 0.0;
130 }
131
132 void AliADCalibData::SetModulesActivity(Float_t* Mac)
133 {
134         if(Mac) for (int t=0;t<60;t++) fModulesActivity[t] = Mac[t];
135         else for (int t=0;t<60;t++) fModulesActivity[t] = 0.0;
136 }
137