]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PMD/AliPMDCalibData.cxx
online hot channels introduced
[u/mrichter/AliRoot.git] / PMD / AliPMDCalibData.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 // Author : Z. Ahmed
17 //
18 #include "TNamed.h"
19 #include "AliCDBEntry.h"
20 #include "AliPMD.h"
21 #include "AliPMDCalibData.h"
22
23
24 ClassImp(AliPMDCalibData)
25
26 AliPMDCalibData::AliPMDCalibData()
27 {
28   // Default constructor
29   Reset();
30 }
31 // ----------------------------------------------------------------- //
32 AliPMDCalibData::AliPMDCalibData(const char* name)
33 {
34   //constructor
35   TString namst = "Calib_";
36   namst += name;
37   SetName(namst.Data());
38   SetTitle(namst.Data());
39   Reset();
40   
41 }
42 // ----------------------------------------------------------------- //
43 AliPMDCalibData::AliPMDCalibData(const AliPMDCalibData& calibda) :
44   TNamed(calibda)
45 {
46   // copy constructor
47   SetName(calibda.GetName());
48   SetTitle(calibda.GetName());
49   Reset();
50   for(Int_t det = 0; det < kDet; det++)
51   {
52       for(Int_t smn = 0; smn < kModule; smn++)
53       {
54           for(Int_t row = 0; row < kRow; row++)
55           {
56               for(Int_t col = 0; col < kCol; col++)
57               {
58                   fGainFact[det][smn][row][col] = 
59                       calibda.GetGainFact(det,smn,row,col);
60               }
61           }
62       }
63   }
64 }
65 // ----------------------------------------------------------------- //
66 AliPMDCalibData &AliPMDCalibData::operator =(const AliPMDCalibData& calibda)
67 {
68   //asignment operator
69   SetName(calibda.GetName());
70   SetTitle(calibda.GetName());
71   Reset();
72   for(Int_t det = 0; det < kDet; det++)
73   {
74       for(Int_t smn = 0; smn < kModule; smn++)
75       {
76           for(Int_t row = 0; row < kRow; row++)
77           {
78               for(Int_t col = 0; col < kCol; col++)
79               {
80                   fGainFact[det][smn][row][col] = 
81                       calibda.GetGainFact(det,smn,row,col);
82               }
83           }
84       }
85   }
86   return *this;
87 }
88 // ----------------------------------------------------------------- //
89 AliPMDCalibData::~AliPMDCalibData()
90 {
91   //destructor
92 }
93 // ----------------------------------------------------------------- //
94 void AliPMDCalibData::Reset()
95 {
96   //memset(fgainfact ,1,2*24*48*96*sizeof(Float_t));
97
98   for(Int_t det = 0; det < kDet; det++)
99   {
100       for(Int_t smn = 0; smn < kModule; smn++)
101       {
102           for(Int_t row = 0; row < kRow; row++)
103           {
104               for(Int_t col = 0; col < kCol; col++)
105               {
106                   fGainFact[det][smn][row][col] = -1.;
107               }
108           }
109       }
110   }
111 }
112 // ----------------------------------------------------------------- //
113 Float_t AliPMDCalibData:: GetGainFact(Int_t det, Int_t smn, Int_t row, Int_t col) const
114 {
115   return fGainFact[det][smn][row][col];
116 }
117 // ----------------------------------------------------------------- //
118 void AliPMDCalibData::SetGainFact(Int_t det, Int_t smn, Int_t row, Int_t col, Float_t gain)
119 {
120   fGainFact[det][smn][row][col]= gain;
121 }
122
123 // ----------------------------------------------------------------- //
124 void AliPMDCalibData::Print(Option_t *) const
125 {
126   printf("\n ######gain factors for each cells are ####\n");
127   for(Int_t det = 0; det < kDet; det++)
128     {
129       for(Int_t smn = 0; smn < kModule; smn++)
130         {
131           for(Int_t row = 0; row < kRow; row++)
132             {
133               for(Int_t col = 0; col < kCol; col++)
134                 {
135                   printf("Gain[%d,%d,%d,%d]= %4.1f \n",det,smn,row,col,
136                          fGainFact[det][smn][row][col]);
137                 }
138               printf("\n");
139             }
140         }
141     }
142 }