]>
Commit | Line | Data |
---|---|---|
06810de6 | 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<2;det++){ | |
51 | for(Int_t smn=0;smn<24;smn++) { | |
52 | for(Int_t row=0;row<96;row++) { | |
53 | for(Int_t col=0;col<96;col++) { | |
54 | fGainFact[det][smn][row][col]=calibda.GetGainFact(det,smn,row,col); | |
55 | } | |
56 | } | |
57 | } | |
58 | } | |
59 | } | |
60 | // ----------------------------------------------------------------- // | |
61 | AliPMDCalibData &AliPMDCalibData::operator =(const AliPMDCalibData& calibda) | |
62 | { | |
63 | //asignment operator | |
64 | SetName(calibda.GetName()); | |
65 | SetTitle(calibda.GetName()); | |
66 | Reset(); | |
67 | for(Int_t det=0;det<2;det++){ | |
68 | for(Int_t smn=0;smn<24;smn++) { | |
69 | for(Int_t row=0;row<96;row++) { | |
70 | for(Int_t col=0;col<96;col++) { | |
71 | fGainFact[det][smn][row][col]=calibda.GetGainFact(det,smn,row,col); | |
72 | } | |
73 | } | |
74 | } | |
75 | } | |
76 | return *this; | |
77 | } | |
78 | // ----------------------------------------------------------------- // | |
79 | AliPMDCalibData::~AliPMDCalibData() | |
80 | { | |
81 | //destructor | |
82 | } | |
83 | // ----------------------------------------------------------------- // | |
84 | void AliPMDCalibData::Reset() | |
85 | { | |
86 | //memset(fgainfact ,1,2*24*96*96*sizeof(Float_t)); | |
87 | for(Int_t det=0;det<2;det++){ | |
88 | for(Int_t smn=0;smn<24;smn++) { | |
89 | for(Int_t row=0;row<96;row++) { | |
90 | for(Int_t col=0;col<96;col++) { | |
91 | fGainFact[det][smn][row][col]=1.0; | |
92 | } | |
93 | } | |
94 | } | |
95 | } | |
96 | } | |
97 | // ----------------------------------------------------------------- // | |
98 | Float_t AliPMDCalibData:: GetGainFact(Int_t det, Int_t smn, Int_t row, Int_t col) const | |
99 | { | |
100 | return fGainFact[det][smn][row][col]; | |
101 | } | |
102 | // ----------------------------------------------------------------- // | |
103 | void AliPMDCalibData::SetGainFact(Int_t det, Int_t smn, Int_t row, Int_t col, Float_t gain) | |
104 | { | |
105 | fGainFact[det][smn][row][col]= gain; | |
106 | } | |
107 | ||
108 | // ----------------------------------------------------------------- // | |
109 | void AliPMDCalibData::Print(Option_t *) const | |
110 | { | |
111 | printf("\n ######gain factors for each cells are ####\n"); | |
112 | for(Int_t det=0;det<2;det++) | |
113 | { | |
114 | for(Int_t smn=0;smn<24;smn++) | |
115 | { | |
116 | for(Int_t row=0;row<96;row++) | |
117 | { | |
118 | for(Int_t col=0;col<96; col++) | |
119 | { | |
120 | printf("%4.1f",fGainFact[det][smn][row][col]); | |
121 | } | |
122 | printf("\n"); | |
123 | } | |
124 | } | |
125 | } | |
126 | } |