]>
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; | |
aee13a2d | 55 | } |
198f612a | 56 | for(Int_t i=0; i<kNScChannels; i++){ |
ba3863d5 | 57 | fScalerChannel[i] = -1; |
58 | fScDetector[i] = -1; | |
59 | fScSector[i] = -1; | |
b1d0c8c5 | 60 | } |
61 | ||
62 | ||
63 | } | |
64 | ||
65 | //________________________________________________________________ | |
66 | AliZDCChMap::AliZDCChMap(const AliZDCChMap& calibda) : | |
67 | TNamed(calibda) | |
68 | { | |
69 | // Copy constructor | |
70 | SetName(calibda.GetName()); | |
71 | SetTitle(calibda.GetName()); | |
72 | Reset(); | |
198f612a | 73 | int const kNModules = 10; |
74 | int const kNChannels = 48; | |
75 | int const kNScChannels = 32; | |
76 | for(Int_t i=0; i<kNModules; i++){ | |
77 | for(Int_t j=0; j<3; j++) fModuleMap[i][j] = calibda.GetModuleMap(i,j); | |
78 | } | |
79 | for(int t=0; t<kNChannels; t++){ | |
b1d0c8c5 | 80 | fADCModule[t] = calibda.GetADCModule(t); |
81 | fADCChannel[t] = calibda.GetADCChannel(t); | |
82 | fDetector[t] = calibda.GetDetector(t); | |
83 | fSector[t] = calibda.GetSector(t); | |
198f612a | 84 | if(t<kNScChannels){ |
27afc0c8 | 85 | fScalerChannel[t] = calibda.GetScChannel(t); |
86 | fScDetector[t] = calibda.GetScDetector(t); | |
87 | fScSector[t] = calibda.GetScSector(t); | |
88 | } | |
b1d0c8c5 | 89 | } |
90 | } | |
91 | ||
92 | //________________________________________________________________ | |
93 | AliZDCChMap &AliZDCChMap::operator =(const AliZDCChMap& calibda) | |
94 | { | |
95 | // assignment operator | |
96 | SetName(calibda.GetName()); | |
97 | SetTitle(calibda.GetName()); | |
98 | Reset(); | |
198f612a | 99 | int const kNModules = 10; |
100 | int const kNChannels = 48; | |
101 | int const kNScChannels = 32; | |
102 | for(Int_t i=0; i<kNModules; i++){ | |
103 | for(Int_t j=0; j<3; j++) fModuleMap[i][j] = calibda.GetModuleMap(i,j); | |
104 | } | |
105 | for(int t=0; t<kNChannels; t++){ | |
b1d0c8c5 | 106 | fADCModule[t] = calibda.GetADCModule(t); |
107 | fADCChannel[t] = calibda.GetADCChannel(t); | |
108 | fDetector[t] = calibda.GetDetector(t); | |
109 | fSector[t] = calibda.GetSector(t); | |
198f612a | 110 | if(t<kNScChannels){ |
27afc0c8 | 111 | fScalerChannel[t] = calibda.GetScChannel(t); |
112 | fScDetector[t] = calibda.GetScDetector(t); | |
113 | fScSector[t] = calibda.GetScSector(t); | |
114 | } | |
b1d0c8c5 | 115 | } |
116 | ||
117 | return *this; | |
118 | } | |
119 | ||
120 | //________________________________________________________________ | |
121 | AliZDCChMap::~AliZDCChMap() | |
122 | { | |
123 | } | |
124 | ||
125 | //________________________________________________________________ | |
126 | void AliZDCChMap::Reset() | |
127 | { | |
128 | // Reset | |
129 | memset(fADCModule,0,48*sizeof(Int_t)); | |
130 | memset(fADCChannel,0,48*sizeof(Int_t)); | |
131 | memset(fDetector,0,48*sizeof(Int_t)); | |
132 | memset(fSector,0,48*sizeof(Int_t)); | |
27afc0c8 | 133 | memset(fScalerChannel,0,32*sizeof(Int_t)); |
134 | memset(fScDetector,0,32*sizeof(Int_t)); | |
135 | memset(fScSector,0,32*sizeof(Int_t)); | |
b1d0c8c5 | 136 | } |
137 | ||
138 | ||
139 | //________________________________________________________________ | |
140 | void AliZDCChMap::Print(Option_t *) const | |
141 | { | |
142 | // Printing of calibration object | |
11b06725 | 143 | printf("\n\n\t ******************* AliZDCChMap object *******************\n\n"); |
198f612a | 144 | for(Int_t i=0; i<9; i++){ |
145 | printf(" ******** GEO %d mod. type %d #ch. %d\n", | |
146 | fModuleMap[i][0],fModuleMap[i][1],fModuleMap[i][2]); | |
147 | } | |
b1d0c8c5 | 148 | for(Int_t i=0; i<48; i++) |
27afc0c8 | 149 | printf(" ADC - mod. %d ch. %d -> detector %d sector %d\n", |
150 | fADCModule[i], fADCChannel[i],fDetector[i], fSector[i]); | |
151 | for(Int_t i=0; i<32; i++) | |
ba3863d5 | 152 | if(fScalerChannel[i]!=-1) |
153 | printf(" SCALER - ch. %d -> detector %d sector %d\n", | |
154 | fScalerChannel[i],fScDetector[i], fScSector[i]); | |
11b06725 | 155 | printf("\n\n\t **********************************************************\n\n"); |
b1d0c8c5 | 156 | |
157 | } |