1 /***************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
19 #include "AliCDBEntry.h"
21 #include "AliPMDCalibData.h"
24 ClassImp(AliPMDCalibData)
26 AliPMDCalibData::AliPMDCalibData()
28 // Default constructor
31 // ----------------------------------------------------------------- //
32 AliPMDCalibData::AliPMDCalibData(const char* name)
35 TString namst = "Calib_";
37 SetName(namst.Data());
38 SetTitle(namst.Data());
42 // ----------------------------------------------------------------- //
43 AliPMDCalibData::AliPMDCalibData(const AliPMDCalibData& calibda) :
47 SetName(calibda.GetName());
48 SetTitle(calibda.GetName());
50 for(Int_t det = 0; det < kDet; det++)
52 for(Int_t smn = 0; smn < kModule; smn++)
54 for(Int_t row = 0; row < kRow; row++)
56 for(Int_t col = 0; col < kCol; col++)
58 fGainFact[det][smn][row][col] =
59 calibda.GetGainFact(det,smn,row,col);
65 // ----------------------------------------------------------------- //
66 AliPMDCalibData &AliPMDCalibData::operator =(const AliPMDCalibData& calibda)
69 SetName(calibda.GetName());
70 SetTitle(calibda.GetName());
72 for(Int_t det = 0; det < kDet; det++)
74 for(Int_t smn = 0; smn < kModule; smn++)
76 for(Int_t row = 0; row < kRow; row++)
78 for(Int_t col = 0; col < kCol; col++)
80 fGainFact[det][smn][row][col] =
81 calibda.GetGainFact(det,smn,row,col);
88 // ----------------------------------------------------------------- //
89 AliPMDCalibData::~AliPMDCalibData()
93 // ----------------------------------------------------------------- //
94 void AliPMDCalibData::Reset()
96 //memset(fgainfact ,1,2*24*48*96*sizeof(Float_t));
98 for(Int_t det = 0; det < kDet; det++)
100 for(Int_t smn = 0; smn < kModule; smn++)
102 for(Int_t row = 0; row < kRow; row++)
104 for(Int_t col = 0; col < kCol; col++)
106 fGainFact[det][smn][row][col] = -1.;
112 // ----------------------------------------------------------------- //
113 Float_t AliPMDCalibData:: GetGainFact(Int_t det, Int_t smn, Int_t row, Int_t col) const
115 return fGainFact[det][smn][row][col];
117 // ----------------------------------------------------------------- //
118 void AliPMDCalibData::SetGainFact(Int_t det, Int_t smn, Int_t row, Int_t col, Float_t gain)
120 fGainFact[det][smn][row][col]= gain;
123 // ----------------------------------------------------------------- //
124 void AliPMDCalibData::Print(Option_t *) const
126 printf("\n ######gain factors for each cells are ####\n");
127 for(Int_t det = 0; det < kDet; det++)
129 for(Int_t smn = 0; smn < kModule; smn++)
131 for(Int_t row = 0; row < kRow; row++)
133 for(Int_t col = 0; col < kCol; col++)
135 printf("Gain[%d,%d,%d,%d]= %4.1f \n",det,smn,row,col,
136 fGainFact[det][smn][row][col]);