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