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 **************************************************************************/
18 #include "AliCDBEntry.h"
20 #include "AliPMDPedestal.h"
23 ClassImp(AliPMDPedestal)
25 AliPMDPedestal::AliPMDPedestal()
27 // Default constructor
30 // ----------------------------------------------------------------- //
31 AliPMDPedestal::AliPMDPedestal(const char* name)
34 TString namst = "Pedestal_";
36 SetName(namst.Data());
37 SetTitle(namst.Data());
41 // ----------------------------------------------------------------- //
42 AliPMDPedestal::AliPMDPedestal(const AliPMDPedestal &pedestal) :
46 SetName(pedestal.GetName());
47 SetTitle(pedestal.GetName());
49 for(Int_t det = 0; det < kDet; det++)
51 for(Int_t smn = 0; smn < kModule; smn++)
53 for(Int_t row = 0; row < kRow; row++)
55 for(Int_t col = 0; col < kCol; col++)
57 fPedMeanRms[det][smn][row][col] =
58 pedestal.GetPedMeanRms(det,smn,row,col);
64 // ----------------------------------------------------------------- //
65 AliPMDPedestal &AliPMDPedestal::operator =(const AliPMDPedestal &pedestal)
68 SetName(pedestal.GetName());
69 SetTitle(pedestal.GetName());
71 for(Int_t det = 0; det < kDet; det++)
73 for(Int_t smn = 0; smn < kModule; smn++)
75 for(Int_t row = 0; row < kRow; row++)
77 for(Int_t col = 0; col < kCol; col++)
79 fPedMeanRms[det][smn][row][col] =
80 pedestal.GetPedMeanRms(det,smn,row,col);
87 // ----------------------------------------------------------------- //
88 AliPMDPedestal::~AliPMDPedestal()
92 // ----------------------------------------------------------------- //
93 void AliPMDPedestal::Reset()
95 //memset(fgainfact ,1,2*24*96*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 Int_t mean1 = (Int_t) (mean*10.);
107 Int_t rms1 = (Int_t) (rms*10.);
108 fPedMeanRms[det][smn][row][col] = mean1*100 + rms1;
114 // ----------------------------------------------------------------- //
115 Int_t AliPMDPedestal:: GetPedMeanRms(Int_t det, Int_t smn, Int_t row, Int_t col) const
117 return fPedMeanRms[det][smn][row][col];
119 // ----------------------------------------------------------------- //
121 void AliPMDPedestal::SetPedMeanRms(Int_t det, Int_t smn, Int_t row,
122 Int_t col,Float_t pedmean, Float_t pedrms)
124 Int_t mean1 = (Int_t) (pedmean*10.);
125 Int_t rms1 = (Int_t) (pedrms*10.);
126 fPedMeanRms[det][smn][row][col] = mean1*100 + rms1;
128 // ----------------------------------------------------------------- //
129 void AliPMDPedestal::Print(Option_t *) const
131 printf("\n ###### Pedestal values for each cells are ####\n");
132 for(Int_t det = 0; det < kDet; det++)
134 for(Int_t smn = 0; smn < kModule; smn++)
136 for(Int_t row = 0; row < kRow; row++)
138 for(Int_t col = 0; col < kCol; col++)
140 printf("Pedestal[%d,%d,%d,%d]= %d \n",det,smn,row,col,
141 fPedMeanRms[det][smn][row][col]);
149 // ----------------------------------------------------------------- //