1 /**************************************************************************
2 * Copyright(c) 2006-07, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 ////////////////////////////////////////////////////////////////////////////////
19 // Class describing TPC temperature sensors (including pointers to graphs/fits//
20 // Authors: Marian Ivanov, Haavard Helstrup and Martin Siska //
22 ////////////////////////////////////////////////////////////////////////////////
24 // Running instructions:
26 TClonesArray * arr = AliTPCSensorTemp::ReadList("TempSensor.txt","tpc_PT_%d.Temperature");
27 TFile f("TempSensors.root","RECREATE");
28 TTree * tree = new TTree("TempSensor", "TempSensor");
29 tree->Branch("Temp",&arr);
38 #include "AliTPCSensorTemp.h"
39 ClassImp(AliTPCSensorTemp)
43 const Float_t kASideX[18][5]={
44 { 99.56, 117.59, 160.82, 186.92, 213.11},
45 { 87.56, 103.4, 141.42, 164.37, 187.41},
46 { 64.99, 76.75, 104.97, 122.00, 139.1},
47 { 34.58, 40.84, 55.85, 64.92, 74.01},
49 {-34.58, -40.84, -55.85, -64.92, -74.01},
50 {-64.99, -76.75, -104.97, -122.0, -139.1},
51 {-87.56, -103.4, -141.42, -164.37, -187.41},
52 {-99.56, -117.59, -160.82, -186.92, -213.11},
53 {-99.56, -117.59, -160.82, -186.92, -213.11},
54 {-87.56, -103.4, -141.42, -164.37, -187.41},
55 {-64.99, -76.75, -104.97, -122, -139.1},
56 {-34.58, -40.84, -55.85, -64.92, -74.01},
58 { 34.58, 40.84, 55.85, 64.92, 74.01},
59 { 64.99, 76.75, 104.97, 122, 139.1},
60 { 87.56, 103.4, 141.42, 164.37, 187.41},
61 { 99.56, 117.59, 160.82, 186.92, 213.11}};
63 const Float_t kASideY[18][5]={
64 { 17.56, 20.73, 28.36, 32.96, 37.58},
65 { 50.55, 59.7, 81.65, 94.9, 108.2},
66 { 77.45, 91.47, 125.1, 145.4, 165.77},
67 { 95.0, 112.3, 153.45, 178.35, 203.35},
68 {101.1, 119.4, 163.3, 189.8, 216.4},
69 { 95.0, 112.2, 153.45, 178.35, 203.35},
70 { 77.45, 91.47, 125.1, 145.4, 165.77},
71 { 50.55, 59.7, 81.65, 94.9, 108.2},
72 { 17.56, 20.73, 28.36, 32.96, 37.58},
73 {-17.56, -20.73, -28.36, -32.96, -37.58},
74 {-50.55, -59.7, -81.65, -94.9, -108.2},
75 {-77.45, -91.47, -125.1, -145.4, -165.77},
76 {-95.0, -112.2, -153.45, -178.35, -203.35},
77 {-101.1, -119.4, -163.3, -189.8, -216.4},
78 {-95.0, -112.2, -153.45, -178.35, -203.35},
79 {-77.45, -91.47, -125.1, -145.4, -165.77},
80 {-50.55, -59.7, -81.65, -94.9, -108.2},
81 {-17.56, -20.73, -28.36, -32.96, -37.58}};
83 const Float_t kCSideX[18][5]={
84 { 99.56, 117.59, 160.82, 186.92, 213.11},
85 { 87.56, 103.4, 141.42, 164.37, 187.41},
86 { 64.99, 76.75, 104.97, 122, 139.1},
87 { 34.58, 40.84, 55.85, 64.92, 74.01},
89 {-34.58, -40.84, -55.85, -64.92, -74.01},
90 {-64.99, -76.75, -104.97, -122, -139.1},
91 {-87.56, -103.4, -141.42, -164.37, -187.41},
92 {-99.56, -117.59, -160.82, -186.92, -213.11},
93 {-99.56, -117.59, -160.82, -186.92, -213.11},
94 {-87.56, -103.4, -141.42, -164.37, -187.41},
95 {-64.99, -76.75, -104.97, -122, -139.1},
96 {-34.58, -40.84, -55.85, -64.92, -74.01},
98 { 34.58, 40.84, 55.85, 64.92, 74.01},
99 { 64.99, 76.75, 104.97, 122, 139.1},
100 { 87.56, 103.4, 141.42, 164.37, 187.41},
101 { 99.56, 117.59, 160.82, 186.92, 213.11}};
103 const Float_t kCSideY[18][5]={
104 { 17.56, 20.73, 28.36, 32.96, 37.58},
105 { 50.55, 59.7, 81.65, 94.9, 108.2},
106 { 77.45, 91.47, 125.1, 145.4, 165.77},
107 { 95.0, 112.2, 153.54, 178.35, 203.35},
108 {101.1, 119.4, 163.3, 189.8, 216.4},
109 { 95.0, 112.2, 153.45, 178.35, 203.35},
110 { 77.45, 91.47, 125.1, 145.4, 165.77},
111 { 50.55, 59.7, 81.65, 94.9, 108.2},
112 { 17.56, 20.73, 28.36, 32.96, 37.58},
113 {-17.56, -20.73, -28.36, -32.96, -37.58},
114 {-50.55, -59.7, -81.56, -94.9, -108.2},
115 {-77.45, -91.47, -125.1, -145.4, -165.77},
116 {-95.0, -112.2, -153.45, -178.35, -203.35},
117 {-101.1, -119.4, -163.3, -189.8, -216.4},
118 {-95.0, -112.2, -153.45, -178.35, -203.35},
119 {-77.45, -91.47, -125.1, -145.4, -165.77},
120 {-50.55, -59.7, -81.65, -94.9, -108.2},
121 {-17.56, -20.73, -28.36, -32.96, -37.58}};
123 const Float_t kIFCrad[5] = {67.2, 64.4, 60.7, 64.4, 67.2};
125 const Float_t kTSrad[4] = {67.2, 61.5, 67.2, 61.5};
126 const Float_t kTSz[4] = {240.0, 90.0, 240.0, 90.0};
128 //______________________________________________________________________________________________
130 AliTPCSensorTemp::AliTPCSensorTemp(): AliDCSSensor(),
137 // Standard constructor
140 //______________________________________________________________________________________________
142 AliTPCSensorTemp::AliTPCSensorTemp(const AliTPCSensorTemp& source) :
143 AliDCSSensor(source),
146 fSector(source.fSector),
153 //______________________________________________________________________________________________
155 AliTPCSensorTemp& AliTPCSensorTemp::operator=(const AliTPCSensorTemp& source){
157 // assignment operator
159 if (&source == this) return *this;
160 new (this) AliTPCSensorTemp(source);
164 //______________________________________________________________________________________________
166 TClonesArray * AliTPCSensorTemp::ReadList(const char *fname,
167 const TString& amandaString) {
169 // read values from ascii file
171 TTree * tree = new TTree("asci","asci");
172 tree->ReadFile(fname,"");
173 TClonesArray *arr = ReadTree(tree, amandaString);
178 //______________________________________________________________________________________________
180 TClonesArray * AliTPCSensorTemp::ReadTree(TTree *tree,
181 const TString& amandaString) {
183 Int_t nentries = tree->GetEntries();
193 //String_t namedtp[100];
195 tree->SetBranchAddress("Sensor",&sensor);
196 tree->SetBranchAddress("Type",&type);
197 tree->SetBranchAddress("Side",&side);
198 tree->SetBranchAddress("Sec",§or);
199 tree->SetBranchAddress("Num",&num);
200 tree->SetBranchAddress("ECha",&echa);
201 //tree->SetBranchAddress("X",&x);
202 //tree->SetBranchAddress("Y",&y);
203 //tree->SetBranchAddress("Z",&z);
205 // firstSensor = (Int_t)tree->GetMinimum("ECha");
206 // lastSensor = (Int_t)tree->GetMaximum("ECha");
208 TClonesArray * array = new TClonesArray("AliTPCSensorTemp",nentries);
210 for (Int_t isensor=0; isensor<nentries; isensor++){
211 AliTPCSensorTemp * temp = new ((*array)[isensor])AliTPCSensorTemp;
212 tree->GetEntry(isensor);
214 temp->SetIdDCS(echa);
215 TString stringID = Form (amandaString.Data(),echa);
216 temp->SetStringID(stringID);
217 if (side[0]=='C') temp->SetSide(1);
218 temp->SetSector(sector);
220 //temp->SetType(type);
221 if (bcmp(type,"ROC",3)==0) temp->SetType(0);
222 if (bcmp(type,"OFC",3)==0) temp->SetType(1);
223 if (bcmp(type,"IFC",3)==0) temp->SetType(2);
224 if (bcmp(type,"TPC",3)==0) temp->SetType(3);
225 if (bcmp(type,"ELM",3)==0) temp->SetType(4);
226 if (bcmp(type,"TS",2)==0) temp->SetType(5);
227 if (bcmp(type,"COOL",3)==0)temp->SetType(6);
230 if (temp->GetType()==0){
231 // temp->SetX(TMath::Cos((2*sector+1)*0.1745)*(83+(num+1)*30));
233 temp->SetX(kCSideX[sector][num]);
235 temp->SetX(kASideX[sector][num]);
238 if ((temp->GetType()==1) || (temp->GetType()==4)){
239 temp->SetX(TMath::Cos((2*sector+1)*0.1745)*278);
241 if (temp->GetType()==2) {
242 temp->SetX(TMath::Cos((2*sector+1)*0.1745)*60.7);
244 if (temp->GetType()==3) {
246 temp->SetX(TMath::Cos((2*sector+1)*0.1745)*87.5);
248 temp->SetX(TMath::Cos((2*sector+1)*0.1745)*241.8);
251 if (temp->GetType()==5){
252 temp->SetX(TMath::Cos(sector*0.524+(num+1)*0.131)*kTSrad[num]);
254 if (temp->GetType()==6){
259 if (temp->GetType()==0){
260 // temp->SetY(TMath::Sin((2*sector+1)*0.1745)*(83+(num+1)*30));
262 temp->SetY(kCSideY[sector][num]);
264 temp->SetY(kASideY[sector][num]);
267 if ((temp->GetType()==1) || (temp->GetType()==4)){
268 temp->SetY(TMath::Sin((2*sector+1)*0.1745)*278);
270 if (temp->GetType()==2){
271 temp->SetY(TMath::Sin((2*sector+1)*0.1745)*60.7);
273 if (temp->GetType()==3) {
275 temp->SetY(TMath::Sin((2*sector+1)*0.1745)*87.5);
277 temp->SetY(TMath::Sin((2*sector+1)*0.1745)*241.8);
281 if (temp->GetType()==5){
282 temp->SetY(TMath::Sin(sector*0.524+(num+1)*0.131)*kTSrad[num]);
285 if (temp->GetType()==6){
290 if ((temp->GetType()==0 ||
291 temp->GetType()==4 || temp->GetType()==6) &&
292 temp->GetSide()==0) {
295 if ((temp->GetType()==0 || temp->GetType()==4 ||
296 temp->GetType()==6) && temp->GetSide()==1){
299 if(temp->GetType()==2 && temp->GetSide()==0) {
302 if(temp->GetType()==2 && temp->GetSide()==1) {
306 if(temp->GetType()==3 && temp->GetSide()==0) {
309 if(temp->GetType()==3 && temp->GetSide()==1) {
313 if((temp->GetType()==1 ) && (num==0)) {
316 if((temp->GetType()==1 ) && (num==1)) {
319 if((temp->GetType()==1 ) && (num==2)) {
322 if((temp->GetType()==1 ) && (num==3)) {
325 if((temp->GetType()==1 ) && (num==4)) {
328 if((temp->GetType()==1 ) && (num==5)) {
332 if(temp->GetType()==5 && temp->GetSide()==0) {
333 temp->SetZ(kTSz[num]);
335 if(temp->GetType()==5 && temp->GetSide()==1) {
336 temp->SetZ(-kTSz[num]);