Line data Source code
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 : //
17 : #include "TNamed.h"
18 : #include "AliCDBEntry.h"
19 : //#include "AliPMD.h"
20 : #include "AliPMDPedestal.h"
21 :
22 :
23 12 : ClassImp(AliPMDPedestal)
24 :
25 3 : AliPMDPedestal::AliPMDPedestal()
26 15 : {
27 : // Default constructor
28 3 : Reset();
29 6 : }
30 : // ----------------------------------------------------------------- //
31 0 : AliPMDPedestal::AliPMDPedestal(const char* name)
32 0 : {
33 : //constructor
34 0 : TString namst = "Pedestal_";
35 0 : namst += name;
36 0 : SetName(namst.Data());
37 0 : SetTitle(namst.Data());
38 0 : Reset();
39 :
40 0 : }
41 : // ----------------------------------------------------------------- //
42 : AliPMDPedestal::AliPMDPedestal(const AliPMDPedestal &pedestal) :
43 0 : TNamed(pedestal)
44 0 : {
45 : // copy constructor
46 0 : SetName(pedestal.GetName());
47 0 : SetTitle(pedestal.GetName());
48 0 : Reset();
49 0 : for(Int_t det = 0; det < kDet; det++)
50 : {
51 0 : for(Int_t smn = 0; smn < kModule; smn++)
52 : {
53 0 : for(Int_t row = 0; row < kRow; row++)
54 : {
55 0 : for(Int_t col = 0; col < kCol; col++)
56 : {
57 0 : fPedMeanRms[det][smn][row][col] =
58 0 : pedestal.GetPedMeanRms(det,smn,row,col);
59 : }
60 : }
61 : }
62 : }
63 0 : }
64 : // ----------------------------------------------------------------- //
65 : AliPMDPedestal &AliPMDPedestal::operator =(const AliPMDPedestal &pedestal)
66 : {
67 : //asignment operator
68 0 : SetName(pedestal.GetName());
69 0 : SetTitle(pedestal.GetName());
70 0 : Reset();
71 0 : for(Int_t det = 0; det < kDet; det++)
72 : {
73 0 : for(Int_t smn = 0; smn < kModule; smn++)
74 : {
75 0 : for(Int_t row = 0; row < kRow; row++)
76 : {
77 0 : for(Int_t col = 0; col < kCol; col++)
78 : {
79 0 : fPedMeanRms[det][smn][row][col] =
80 0 : pedestal.GetPedMeanRms(det,smn,row,col);
81 : }
82 : }
83 : }
84 : }
85 0 : return *this;
86 : }
87 : // ----------------------------------------------------------------- //
88 : AliPMDPedestal::~AliPMDPedestal()
89 0 : {
90 : //destructor
91 0 : }
92 : // ----------------------------------------------------------------- //
93 : void AliPMDPedestal::Reset()
94 : {
95 : //memset(fgainfact ,1,2*24*96*96*sizeof(Float_t));
96 : Float_t mean = 0.0;
97 : Float_t rms = 0.0;
98 21 : for(Int_t det = 0; det < kDet; det++)
99 : {
100 300 : for(Int_t smn = 0; smn < kModule; smn++)
101 : {
102 14112 : for(Int_t row = 0; row < kRow; row++)
103 : {
104 1340928 : for(Int_t col = 0; col < kCol; col++)
105 : {
106 : Int_t mean1 = (Int_t) (mean*10.);
107 : Int_t rms1 = (Int_t) (rms*10.);
108 663552 : fPedMeanRms[det][smn][row][col] = mean1*100 + rms1;
109 : }
110 : }
111 : }
112 : }
113 3 : }
114 : // ----------------------------------------------------------------- //
115 : Int_t AliPMDPedestal:: GetPedMeanRms(Int_t det, Int_t smn, Int_t row, Int_t col) const
116 : {
117 1162 : return fPedMeanRms[det][smn][row][col];
118 : }
119 : // ----------------------------------------------------------------- //
120 :
121 : void AliPMDPedestal::SetPedMeanRms(Int_t det, Int_t smn, Int_t row,
122 : Int_t col,Float_t pedmean, Float_t pedrms)
123 : {
124 0 : Int_t mean1 = (Int_t) (pedmean*10.);
125 0 : Int_t rms1 = (Int_t) (pedrms*10.);
126 0 : fPedMeanRms[det][smn][row][col] = mean1*100 + rms1;
127 0 : }
128 : // ----------------------------------------------------------------- //
129 : void AliPMDPedestal::Print(Option_t *) const
130 : {
131 0 : printf("\n ###### Pedestal values for each cells are ####\n");
132 0 : for(Int_t det = 0; det < kDet; det++)
133 : {
134 0 : for(Int_t smn = 0; smn < kModule; smn++)
135 : {
136 0 : for(Int_t row = 0; row < kRow; row++)
137 : {
138 0 : for(Int_t col = 0; col < kCol; col++)
139 : {
140 0 : printf("Pedestal[%d,%d,%d,%d]= %d \n",det,smn,row,col,
141 0 : fPedMeanRms[det][smn][row][col]);
142 :
143 : }
144 0 : printf("\n");
145 : }
146 : }
147 : }
148 0 : }
149 : // ----------------------------------------------------------------- //
|