]>
Commit | Line | Data |
---|---|---|
b1d0c8c5 | 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 | // // | |
18 | // Class for ZDC calibration -> ADC channels mapping // | |
19 | // author: Chiara Oppedisano // | |
20 | // // | |
21 | /////////////////////////////////////////////////////////////// | |
22 | ||
23 | #include "AliZDCChMap.h" | |
24 | ||
25 | ClassImp(AliZDCChMap) | |
26 | ||
27 | //________________________________________________________________ | |
28 | AliZDCChMap::AliZDCChMap(): | |
29 | TNamed() | |
30 | { | |
31 | Reset(); | |
32 | } | |
33 | ||
34 | //________________________________________________________________ | |
35 | AliZDCChMap::AliZDCChMap(const char* name): | |
36 | TNamed() | |
37 | { | |
38 | // Constructor | |
39 | TString namst = "Calib_"; | |
40 | namst += name; | |
41 | SetName(namst.Data()); | |
42 | SetTitle(namst.Data()); | |
43 | Reset(); | |
198f612a | 44 | int const kNModules = 10; |
45 | int const kNChannels = 48; | |
46 | int const kNScChannels = 32; | |
47 | for(Int_t i=0; i<kNModules; i++){ | |
48 | for(Int_t j=0; j<3; j++) fModuleMap[i][j] = 0; | |
49 | } | |
50 | for(Int_t i=0; i<kNChannels; i++){ | |
ba3863d5 | 51 | fADCModule[i] = -1; |
52 | fADCChannel[i] = -1; | |
53 | fDetector[i] = -1; | |
54 | fSector[i] = -1; | |
82dffa48 | 55 | fADCSignalCode[i] = -1; |
aee13a2d | 56 | } |
198f612a | 57 | for(Int_t i=0; i<kNScChannels; i++){ |
ba3863d5 | 58 | fScalerChannel[i] = -1; |
59 | fScDetector[i] = -1; | |
60 | fScSector[i] = -1; | |
82dffa48 | 61 | fScSignalCode[i] = -1; |
62 | // | |
63 | fTDCChannel[i] = -1; | |
64 | fTDCSignalCode[i] = -1; | |
b1d0c8c5 | 65 | } |
66 | ||
67 | ||
68 | } | |
69 | ||
70 | //________________________________________________________________ | |
71 | AliZDCChMap::AliZDCChMap(const AliZDCChMap& calibda) : | |
72 | TNamed(calibda) | |
73 | { | |
74 | // Copy constructor | |
75 | SetName(calibda.GetName()); | |
76 | SetTitle(calibda.GetName()); | |
77 | Reset(); | |
198f612a | 78 | int const kNModules = 10; |
79 | int const kNChannels = 48; | |
80 | int const kNScChannels = 32; | |
81 | for(Int_t i=0; i<kNModules; i++){ | |
82 | for(Int_t j=0; j<3; j++) fModuleMap[i][j] = calibda.GetModuleMap(i,j); | |
83 | } | |
84 | for(int t=0; t<kNChannels; t++){ | |
b1d0c8c5 | 85 | fADCModule[t] = calibda.GetADCModule(t); |
86 | fADCChannel[t] = calibda.GetADCChannel(t); | |
87 | fDetector[t] = calibda.GetDetector(t); | |
88 | fSector[t] = calibda.GetSector(t); | |
82dffa48 | 89 | fADCSignalCode[t] = calibda.GetADCSignalCode(t); |
198f612a | 90 | if(t<kNScChannels){ |
27afc0c8 | 91 | fScalerChannel[t] = calibda.GetScChannel(t); |
92 | fScDetector[t] = calibda.GetScDetector(t); | |
93 | fScSector[t] = calibda.GetScSector(t); | |
82dffa48 | 94 | fScSignalCode[t] = calibda.GetScSignalCode(t); |
95 | // | |
96 | fTDCChannel[t] = calibda.GetTDCChannel(t); | |
97 | fTDCSignalCode[t] = calibda.GetTDCChannel(t); | |
27afc0c8 | 98 | } |
b1d0c8c5 | 99 | } |
100 | } | |
101 | ||
102 | //________________________________________________________________ | |
103 | AliZDCChMap &AliZDCChMap::operator =(const AliZDCChMap& calibda) | |
104 | { | |
105 | // assignment operator | |
106 | SetName(calibda.GetName()); | |
107 | SetTitle(calibda.GetName()); | |
108 | Reset(); | |
198f612a | 109 | int const kNModules = 10; |
110 | int const kNChannels = 48; | |
111 | int const kNScChannels = 32; | |
112 | for(Int_t i=0; i<kNModules; i++){ | |
113 | for(Int_t j=0; j<3; j++) fModuleMap[i][j] = calibda.GetModuleMap(i,j); | |
114 | } | |
115 | for(int t=0; t<kNChannels; t++){ | |
b1d0c8c5 | 116 | fADCModule[t] = calibda.GetADCModule(t); |
117 | fADCChannel[t] = calibda.GetADCChannel(t); | |
118 | fDetector[t] = calibda.GetDetector(t); | |
119 | fSector[t] = calibda.GetSector(t); | |
82dffa48 | 120 | fADCSignalCode[t] = calibda.GetADCSignalCode(t); |
198f612a | 121 | if(t<kNScChannels){ |
27afc0c8 | 122 | fScalerChannel[t] = calibda.GetScChannel(t); |
123 | fScDetector[t] = calibda.GetScDetector(t); | |
124 | fScSector[t] = calibda.GetScSector(t); | |
82dffa48 | 125 | fScSignalCode[t] = calibda.GetScSignalCode(t); |
126 | // | |
127 | fTDCChannel[t] = calibda.GetTDCChannel(t); | |
128 | fTDCSignalCode[t] = calibda.GetTDCChannel(t); | |
27afc0c8 | 129 | } |
b1d0c8c5 | 130 | } |
131 | ||
132 | return *this; | |
133 | } | |
134 | ||
135 | //________________________________________________________________ | |
136 | AliZDCChMap::~AliZDCChMap() | |
137 | { | |
138 | } | |
139 | ||
140 | //________________________________________________________________ | |
141 | void AliZDCChMap::Reset() | |
142 | { | |
143 | // Reset | |
144 | memset(fADCModule,0,48*sizeof(Int_t)); | |
145 | memset(fADCChannel,0,48*sizeof(Int_t)); | |
146 | memset(fDetector,0,48*sizeof(Int_t)); | |
147 | memset(fSector,0,48*sizeof(Int_t)); | |
82dffa48 | 148 | memset(fADCSignalCode,0,48*sizeof(Int_t)); |
27afc0c8 | 149 | memset(fScalerChannel,0,32*sizeof(Int_t)); |
150 | memset(fScDetector,0,32*sizeof(Int_t)); | |
151 | memset(fScSector,0,32*sizeof(Int_t)); | |
82dffa48 | 152 | memset(fScSignalCode,0,32*sizeof(Int_t)); |
153 | memset(fTDCChannel,0,32*sizeof(Int_t)); | |
154 | memset(fTDCSignalCode,0,32*sizeof(Int_t)); | |
b1d0c8c5 | 155 | } |
156 | ||
157 | ||
158 | //________________________________________________________________ | |
159 | void AliZDCChMap::Print(Option_t *) const | |
160 | { | |
161 | // Printing of calibration object | |
11b06725 | 162 | printf("\n\n\t ******************* AliZDCChMap object *******************\n\n"); |
82dffa48 | 163 | for(Int_t i=0; i<10; i++){ |
198f612a | 164 | printf(" ******** GEO %d mod. type %d #ch. %d\n", |
165 | fModuleMap[i][0],fModuleMap[i][1],fModuleMap[i][2]); | |
166 | } | |
82dffa48 | 167 | printf("\n"); |
b1d0c8c5 | 168 | for(Int_t i=0; i<48; i++) |
82dffa48 | 169 | printf(" ADC - mod. %d ch. %d signal %d -> detector %d sector %d\n", |
170 | fADCModule[i], fADCChannel[i], fADCSignalCode[i], fDetector[i], fSector[i]); | |
171 | printf("\n"); | |
172 | for(Int_t i=0; i<32; i++) | |
ba3863d5 | 173 | if(fScalerChannel[i]!=-1) |
82dffa48 | 174 | printf(" SCALER - ch. %d signal %d\n", |
175 | fScalerChannel[i], fScSignalCode[i]); | |
176 | printf("\n"); | |
177 | for(Int_t i=0; i<32; i++) | |
178 | if(fTDCChannel[i]!=-1) | |
179 | printf(" TDC - ch. %d signal %d\n", | |
180 | fTDCChannel[i], fTDCSignalCode[i]); | |
181 | printf("\n\t **********************************************************\n\n"); | |
b1d0c8c5 | 182 | |
183 | } |