]>
Commit | Line | Data |
---|---|---|
54472e4f | 1 | /************************************************************************** |
2 | * Copyright(c) 2006-07, 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 | // // | |
19 | // Class describing TPC temperature sensors (including pointers to graphs/fits// | |
20 | // Authors: Marian Ivanov, Haavard Helstrup and Martin Siska // | |
21 | // // | |
22 | //////////////////////////////////////////////////////////////////////////////// | |
23 | ||
24 | // Running instructions: | |
25 | /* | |
26 | TClonesArray * arr = AliTPCSensorTemp::ReadList("TempSensor.txt"); | |
27 | TFile f("TempSensors.root","RECREATE"); | |
28 | TTree * tree = new TTree("TempSensor", "TempSensor"); | |
29 | tree->Branch("Temp",&arr); | |
30 | tree->Fill(); | |
31 | tree->Write(); | |
32 | ||
33 | */ | |
34 | // | |
35 | ||
67a165ed | 36 | |
54472e4f | 37 | #include "AliTPCSensorTemp.h" |
ee256dfd | 38 | ClassImp(AliTPCSensorTemp) |
54472e4f | 39 | |
67a165ed | 40 | |
54472e4f | 41 | |
e4dce695 | 42 | const Float_t kASideX[18][5]={ |
49dfd67a | 43 | { 99.56, 117.59, 160.82, 186.92, 213.11}, |
44 | { 87.56, 103.4, 141.42, 164.37, 187.41}, | |
45 | { 64.99, 76.75, 104.97, 122.00, 139.1}, | |
46 | { 34.58, 40.84, 55.85, 64.92, 74.01}, | |
47 | { 0, 0, 0, 0, 0}, | |
48 | {-34.58, -40.84, -55.85, -64.92, -74.01}, | |
49 | {-64.99, -76.75, -104.97, -122.0, -139.1}, | |
50 | {-87.56, -103.4, -141.42, -164.37, -187.41}, | |
51 | {-99.56, -117.59, -160.82, -186.92, -213.11}, | |
52 | {-99.56, -117.59, -160.82, -186.92, -213.11}, | |
53 | {-87.56, -103.4, -141.42, -164.37, -187.41}, | |
54 | {-64.99, -76.75, -104.97, -122, -139.1}, | |
55 | {-34.58, -40.84, -55.85, -64.92, -74.01}, | |
56 | { 0, 0, 0, 0, 0}, | |
57 | { 34.58, 40.84, 55.85, 64.92, 74.01}, | |
58 | { 64.99, 76.75, 104.97, 122, 139.1}, | |
59 | { 87.56, 103.4, 141.42, 164.37, 187.41}, | |
60 | { 99.56, 117.59, 160.82, 186.92, 213.11}}; | |
e4dce695 | 61 | |
62 | const Float_t kASideY[18][5]={ | |
49dfd67a | 63 | { 17.56, 20.73, 28.36, 32.96, 37.58}, |
64 | { 50.55, 59.7, 81.65, 94.9, 108.2}, | |
65 | { 77.45, 91.47, 125.1, 145.4, 165.77}, | |
66 | { 95.0, 112.3, 153.45, 178.35, 203.35}, | |
e4dce695 | 67 | {101.1, 119.4, 163.3, 189.8, 216.4}, |
49dfd67a | 68 | { 95.0, 112.2, 153.45, 178.35, 203.35}, |
69 | { 77.45, 91.47, 125.1, 145.4, 165.77}, | |
70 | { 50.55, 59.7, 81.65, 94.9, 108.2}, | |
71 | { 17.56, 20.73, 28.36, 32.96, 37.58}, | |
72 | {-17.56, -20.73, -28.36, -32.96, -37.58}, | |
73 | {-50.55, -59.7, -81.65, -94.9, -108.2}, | |
74 | {-77.45, -91.47, -125.1, -145.4, -165.77}, | |
75 | {-95.0, -112.2, -153.45, -178.35, -203.35}, | |
67a165ed | 76 | {-101.1, -119.4, -163.3, -189.8, -216.4}, |
49dfd67a | 77 | {-95.0, -112.2, -153.45, -178.35, -203.35}, |
78 | {-77.45, -91.47, -125.1, -145.4, -165.77}, | |
79 | {-50.55, -59.7, -81.65, -94.9, -108.2}, | |
80 | {-17.56, -20.73, -28.36, -32.96, -37.58}}; | |
e4dce695 | 81 | |
82 | const Float_t kCSideX[18][5]={ | |
49dfd67a | 83 | { 99.56, 117.59, 160.82, 186.92, 213.11}, |
84 | { 87.56, 103.4, 141.42, 164.37, 187.41}, | |
85 | { 64.99, 76.75, 104.97, 122, 139.1}, | |
86 | { 34.58, 40.84, 55.85, 64.92, 74.01}, | |
87 | { 0, 0, 0, 0, 0}, | |
88 | {-34.58, -40.84, -55.85, -64.92, -74.01}, | |
89 | {-64.99, -76.75, -104.97, -122, -139.1}, | |
90 | {-87.56, -103.4, -141.42, -164.37, -187.41}, | |
91 | {-99.56, -117.59, -160.82, -186.92, -213.11}, | |
92 | {-99.56, -117.59, -160.82, -186.92, -213.11}, | |
93 | {-87.56, -103.4, -141.42, -164.37, -187.41}, | |
94 | {-64.99, -76.75, -104.97, -122, -139.1}, | |
95 | {-34.58, -40.84, -55.85, -64.92, -74.01}, | |
96 | { 0, 0, 0, 0, 0}, | |
97 | { 34.58, 40.84, 55.85, 64.92, 74.01}, | |
98 | { 64.99, 76.75, 104.97, 122, 139.1}, | |
99 | { 87.56, 103.4, 141.42, 164.37, 187.41}, | |
100 | { 99.56, 117.59, 160.82, 186.92, 213.11}}; | |
e4dce695 | 101 | |
102 | const Float_t kCSideY[18][5]={ | |
49dfd67a | 103 | { 17.56, 20.73, 28.36, 32.96, 37.58}, |
104 | { 50.55, 59.7, 81.65, 94.9, 108.2}, | |
105 | { 77.45, 91.47, 125.1, 145.4, 165.77}, | |
106 | { 95.0, 112.2, 153.54, 178.35, 203.35}, | |
e4dce695 | 107 | {101.1, 119.4, 163.3, 189.8, 216.4}, |
49dfd67a | 108 | { 95.0, 112.2, 153.45, 178.35, 203.35}, |
109 | { 77.45, 91.47, 125.1, 145.4, 165.77}, | |
110 | { 50.55, 59.7, 81.65, 94.9, 108.2}, | |
111 | { 17.56, 20.73, 28.36, 32.96, 37.58}, | |
112 | {-17.56, -20.73, -28.36, -32.96, -37.58}, | |
113 | {-50.55, -59.7, -81.56, -94.9, -108.2}, | |
114 | {-77.45, -91.47, -125.1, -145.4, -165.77}, | |
115 | {-95.0, -112.2, -153.45, -178.35, -203.35}, | |
67a165ed | 116 | {-101.1, -119.4, -163.3, -189.8, -216.4}, |
49dfd67a | 117 | {-95.0, -112.2, -153.45, -178.35, -203.35}, |
118 | {-77.45, -91.47, -125.1, -145.4, -165.77}, | |
119 | {-50.55, -59.7, -81.65, -94.9, -108.2}, | |
120 | {-17.56, -20.73, -28.36, -32.96, -37.58}}; | |
e4dce695 | 121 | |
122 | const Float_t kIFCrad[5] = {67.2, 64.4, 60.7, 64.4, 67.2}; | |
123 | ||
49dfd67a | 124 | const Float_t kTSrad[4] = {67.2, 61.5, 67.2, 61.5}; |
125 | const Float_t kTSz[4] = {240.0, 90.0, 240.0, 90.0}; | |
e4dce695 | 126 | |
24938b4c | 127 | //______________________________________________________________________________________________ |
e4dce695 | 128 | |
54472e4f | 129 | AliTPCSensorTemp::AliTPCSensorTemp(): AliDCSSensor(), |
130 | fType(0), | |
131 | fSide(0), | |
132 | fSector(0), | |
133 | fNum(0) | |
134 | { | |
135 | // | |
136 | // Standard constructor | |
137 | // | |
138 | } | |
24938b4c | 139 | //______________________________________________________________________________________________ |
54472e4f | 140 | |
141 | AliTPCSensorTemp::AliTPCSensorTemp(const AliTPCSensorTemp& source) : | |
142 | AliDCSSensor(source), | |
143 | fType(source.fType), | |
144 | fSide(source.fSide), | |
145 | fSector(source.fSector), | |
146 | fNum(source.fNum) | |
147 | ||
148 | // | |
149 | // Copy constructor | |
150 | // | |
151 | { } | |
24938b4c | 152 | //______________________________________________________________________________________________ |
54472e4f | 153 | |
154 | AliTPCSensorTemp& AliTPCSensorTemp::operator=(const AliTPCSensorTemp& source){ | |
155 | // | |
156 | // assignment operator | |
157 | // | |
158 | if (&source == this) return *this; | |
159 | new (this) AliTPCSensorTemp(source); | |
160 | ||
161 | return *this; | |
162 | } | |
24938b4c | 163 | //______________________________________________________________________________________________ |
54472e4f | 164 | |
49dfd67a | 165 | TClonesArray * AliTPCSensorTemp::ReadList(const char *fname) { |
54472e4f | 166 | // |
167 | // read values from ascii file | |
168 | // | |
169 | TTree * tree = new TTree("asci","asci"); | |
170 | tree->ReadFile(fname,""); | |
24938b4c | 171 | TClonesArray *arr = ReadTree(tree); |
172 | delete tree; | |
173 | return arr; | |
174 | } | |
175 | ||
176 | //______________________________________________________________________________________________ | |
177 | ||
67a165ed | 178 | TClonesArray * AliTPCSensorTemp::ReadTree(TTree *tree, |
179 | const TString& amandaString) { | |
54472e4f | 180 | |
181 | Int_t nentries = tree->GetEntries(); | |
182 | Int_t sensor=0; | |
183 | Int_t sector=0; | |
184 | char type[100]; | |
185 | char side[100]; | |
186 | Int_t num=0; | |
187 | Int_t echa=0; | |
188 | //Double_t x=0; | |
189 | //Double_t y=0; | |
190 | //Double_t z=0; | |
191 | //String_t namedtp[100]; | |
192 | ||
193 | tree->SetBranchAddress("Sensor",&sensor); | |
194 | tree->SetBranchAddress("Type",&type); | |
195 | tree->SetBranchAddress("Side",&side); | |
196 | tree->SetBranchAddress("Sec",§or); | |
197 | tree->SetBranchAddress("Num",&num); | |
198 | tree->SetBranchAddress("ECha",&echa); | |
199 | //tree->SetBranchAddress("X",&x); | |
200 | //tree->SetBranchAddress("Y",&y); | |
201 | //tree->SetBranchAddress("Z",&z); | |
202 | ||
49dfd67a | 203 | // firstSensor = (Int_t)tree->GetMinimum("ECha"); |
204 | // lastSensor = (Int_t)tree->GetMaximum("ECha"); | |
54472e4f | 205 | |
206 | TClonesArray * array = new TClonesArray("AliTPCSensorTemp",nentries); | |
207 | ||
208 | for (Int_t isensor=0; isensor<nentries; isensor++){ | |
209 | AliTPCSensorTemp * temp = new ((*array)[isensor])AliTPCSensorTemp; | |
210 | tree->GetEntry(isensor); | |
211 | temp->SetId(sensor); | |
212 | temp->SetIdDCS(echa); | |
67a165ed | 213 | TString stringID = Form (amandaString.Data(),echa); |
24938b4c | 214 | temp->SetStringID(stringID); |
54472e4f | 215 | if (side[0]=='C') temp->SetSide(1); |
216 | temp->SetSector(sector); | |
217 | temp->SetNum(num); | |
218 | //temp->SetType(type); | |
219 | if (bcmp(type,"ROC",3)==0) temp->SetType(0); | |
220 | if (bcmp(type,"OFC",3)==0) temp->SetType(1); | |
221 | if (bcmp(type,"IFC",3)==0) temp->SetType(2); | |
222 | if (bcmp(type,"TPC",3)==0) temp->SetType(3); | |
223 | if (bcmp(type,"ELM",3)==0) temp->SetType(4); | |
224 | if (bcmp(type,"TS",2)==0) temp->SetType(5); | |
225 | if (bcmp(type,"COOL",3)==0)temp->SetType(6); | |
226 | //temp->SetX(x); | |
227 | ||
228 | if (temp->GetType()==0){ | |
e4dce695 | 229 | // temp->SetX(TMath::Cos((2*sector+1)*0.1745)*(83+(num+1)*30)); |
230 | if (side[0]=='C') { | |
231 | temp->SetX(kCSideX[sector][num]); | |
232 | } else { | |
233 | temp->SetX(kASideX[sector][num]); | |
234 | } | |
54472e4f | 235 | } |
236 | if ((temp->GetType()==1) || (temp->GetType()==4)){ | |
e4dce695 | 237 | temp->SetX(TMath::Cos((2*sector+1)*0.1745)*278); |
54472e4f | 238 | } |
49dfd67a | 239 | if (temp->GetType()==2) { |
240 | temp->SetX(TMath::Cos((2*sector+1)*0.1745)*60.7); | |
241 | } | |
242 | if (temp->GetType()==3) { | |
243 | if (num==0) { | |
244 | temp->SetX(TMath::Cos((2*sector+1)*0.1745)*87.5); | |
245 | } else { | |
246 | temp->SetX(TMath::Cos((2*sector+1)*0.1745)*241.8); | |
247 | } | |
248 | } | |
249 | if (temp->GetType()==5){ | |
250 | temp->SetX(TMath::Cos(sector*0.524+(num+1)*0.131)*kTSrad[num]); | |
54472e4f | 251 | } |
49dfd67a | 252 | if (temp->GetType()==6){ |
54472e4f | 253 | temp->SetX(0); |
254 | } | |
255 | ||
256 | //temp->SetY(y); | |
257 | if (temp->GetType()==0){ | |
e4dce695 | 258 | // temp->SetY(TMath::Sin((2*sector+1)*0.1745)*(83+(num+1)*30)); |
259 | if (side[0]=='C') { | |
260 | temp->SetY(kCSideY[sector][num]); | |
261 | } else { | |
262 | temp->SetY(kASideY[sector][num]); | |
263 | } | |
54472e4f | 264 | } |
265 | if ((temp->GetType()==1) || (temp->GetType()==4)){ | |
e4dce695 | 266 | temp->SetY(TMath::Sin((2*sector+1)*0.1745)*278); |
54472e4f | 267 | } |
49dfd67a | 268 | if (temp->GetType()==2){ |
269 | temp->SetY(TMath::Sin((2*sector+1)*0.1745)*60.7); | |
270 | } | |
271 | if (temp->GetType()==3) { | |
272 | if (num==0) { | |
273 | temp->SetY(TMath::Sin((2*sector+1)*0.1745)*87.5); | |
274 | } else { | |
275 | temp->SetY(TMath::Sin((2*sector+1)*0.1745)*241.8); | |
276 | } | |
277 | } | |
278 | ||
279 | if (temp->GetType()==5){ | |
280 | temp->SetY(TMath::Sin(sector*0.524+(num+1)*0.131)*kTSrad[num]); | |
54472e4f | 281 | } |
49dfd67a | 282 | |
283 | if (temp->GetType()==6){ | |
54472e4f | 284 | temp->SetY(0); |
285 | } | |
49dfd67a | 286 | |
54472e4f | 287 | //temp->SetZ(z); |
49dfd67a | 288 | if ((temp->GetType()==0 || |
289 | temp->GetType()==4 || temp->GetType()==6) && | |
290 | temp->GetSide()==0) { | |
291 | temp->SetZ(250); | |
292 | } | |
293 | if ((temp->GetType()==0 || temp->GetType()==4 || | |
294 | temp->GetType()==6) && temp->GetSide()==1){ | |
295 | temp->SetZ(-250); | |
296 | } | |
297 | if(temp->GetType()==2 && temp->GetSide()==0) { | |
298 | temp->SetZ(52.4); | |
299 | } | |
300 | if(temp->GetType()==2 && temp->GetSide()==1) { | |
301 | temp->SetZ(-52.4); | |
302 | } | |
303 | ||
304 | if(temp->GetType()==3 && temp->GetSide()==0) { | |
305 | temp->SetZ(247); | |
54472e4f | 306 | } |
49dfd67a | 307 | if(temp->GetType()==3 && temp->GetSide()==1) { |
308 | temp->SetZ(-247); | |
54472e4f | 309 | } |
49dfd67a | 310 | |
311 | if((temp->GetType()==1 ) && (num==0)) { | |
e4dce695 | 312 | temp->SetZ(240); |
54472e4f | 313 | } |
49dfd67a | 314 | if((temp->GetType()==1 ) && (num==1)) { |
e4dce695 | 315 | temp->SetZ(168.4); |
54472e4f | 316 | } |
49dfd67a | 317 | if((temp->GetType()==1 ) && (num==2)) { |
e4dce695 | 318 | temp->SetZ(51); |
54472e4f | 319 | } |
49dfd67a | 320 | if((temp->GetType()==1 ) && (num==3)) { |
e4dce695 | 321 | temp->SetZ(-51); |
54472e4f | 322 | } |
49dfd67a | 323 | if((temp->GetType()==1 ) && (num==4)) { |
e4dce695 | 324 | temp->SetZ(-168.4); |
54472e4f | 325 | } |
49dfd67a | 326 | if((temp->GetType()==1 ) && (num==5)) { |
e4dce695 | 327 | temp->SetZ(-240); |
54472e4f | 328 | } |
49dfd67a | 329 | |
330 | if(temp->GetType()==5 && temp->GetSide()==0) { | |
331 | temp->SetZ(kTSz[num]); | |
332 | } | |
333 | if(temp->GetType()==5 && temp->GetSide()==1) { | |
334 | temp->SetZ(-kTSz[num]); | |
335 | } | |
336 | ||
337 | ||
54472e4f | 338 | } |
54472e4f | 339 | return array; |
340 | } |