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");
27 TFile f("TempSensors.root","RECREATE");
28 TTree * tree = new TTree("TempSensor", "TempSensor");
29 tree->Branch("Temp",&arr);
37 #include "AliTPCSensorTemp.h"
38 ClassImp(AliTPCSensorTemp)
41 const Float_t kASideX[18][5]={
42 { 99.56, 117.59, 160.82, 186.92, 213.11},
43 { 87.56, 103.4, 141.42, 164.37, 187.41},
44 { 64.99, 76.75, 104.97, 122.00, 139.1},
45 { 34.58, 40.84, 55.85, 64.92, 74.01},
47 {-34.58, -40.84, -55.85, -64.92, -74.01},
48 {-64.99, -76.75, -104.97, -122.0, -139.1},
49 {-87.56, -103.4, -141.42, -164.37, -187.41},
50 {-99.56, -117.59, -160.82, -186.92, -213.11},
51 {-99.56, -117.59, -160.82, -186.92, -213.11},
52 {-87.56, -103.4, -141.42, -164.37, -187.41},
53 {-64.99, -76.75, -104.97, -122, -139.1},
54 {-34.58, -40.84, -55.85, -64.92, -74.01},
56 { 34.58, 40.84, 55.85, 64.92, 74.01},
57 { 64.99, 76.75, 104.97, 122, 139.1},
58 { 87.56, 103.4, 141.42, 164.37, 187.41},
59 { 99.56, 117.59, 160.82, 186.92, 213.11}};
61 const Float_t kASideY[18][5]={
62 { 17.56, 20.73, 28.36, 32.96, 37.58},
63 { 50.55, 59.7, 81.65, 94.9, 108.2},
64 { 77.45, 91.47, 125.1, 145.4, 165.77},
65 { 95.0, 112.3, 153.45, 178.35, 203.35},
66 {101.1, 119.4, 163.3, 189.8, 216.4},
67 { 95.0, 112.2, 153.45, 178.35, 203.35},
68 { 77.45, 91.47, 125.1, 145.4, 165.77},
69 { 50.55, 59.7, 81.65, 94.9, 108.2},
70 { 17.56, 20.73, 28.36, 32.96, 37.58},
71 {-17.56, -20.73, -28.36, -32.96, -37.58},
72 {-50.55, -59.7, -81.65, -94.9, -108.2},
73 {-77.45, -91.47, -125.1, -145.4, -165.77},
74 {-95.0, -112.2, -153.45, -178.35, -203.35},
75 {-101.1, -119.4, -163.3, -189.8, -216.4},
76 {-95.0, -112.2, -153.45, -178.35, -203.35},
77 {-77.45, -91.47, -125.1, -145.4, -165.77},
78 {-50.55, -59.7, -81.65, -94.9, -108.2},
79 {-17.56, -20.73, -28.36, -32.96, -37.58}};
81 const Float_t kCSideX[18][5]={
82 { 99.56, 117.59, 160.82, 186.92, 213.11},
83 { 87.56, 103.4, 141.42, 164.37, 187.41},
84 { 64.99, 76.75, 104.97, 122, 139.1},
85 { 34.58, 40.84, 55.85, 64.92, 74.01},
87 {-34.58, -40.84, -55.85, -64.92, -74.01},
88 {-64.99, -76.75, -104.97, -122, -139.1},
89 {-87.56, -103.4, -141.42, -164.37, -187.41},
90 {-99.56, -117.59, -160.82, -186.92, -213.11},
91 {-99.56, -117.59, -160.82, -186.92, -213.11},
92 {-87.56, -103.4, -141.42, -164.37, -187.41},
93 {-64.99, -76.75, -104.97, -122, -139.1},
94 {-34.58, -40.84, -55.85, -64.92, -74.01},
96 { 34.58, 40.84, 55.85, 64.92, 74.01},
97 { 64.99, 76.75, 104.97, 122, 139.1},
98 { 87.56, 103.4, 141.42, 164.37, 187.41},
99 { 99.56, 117.59, 160.82, 186.92, 213.11}};
101 const Float_t kCSideY[18][5]={
102 { 17.56, 20.73, 28.36, 32.96, 37.58},
103 { 50.55, 59.7, 81.65, 94.9, 108.2},
104 { 77.45, 91.47, 125.1, 145.4, 165.77},
105 { 95.0, 112.2, 153.54, 178.35, 203.35},
106 {101.1, 119.4, 163.3, 189.8, 216.4},
107 { 95.0, 112.2, 153.45, 178.35, 203.35},
108 { 77.45, 91.47, 125.1, 145.4, 165.77},
109 { 50.55, 59.7, 81.65, 94.9, 108.2},
110 { 17.56, 20.73, 28.36, 32.96, 37.58},
111 {-17.56, -20.73, -28.36, -32.96, -37.58},
112 {-50.55, -59.7, -81.56, -94.9, -108.2},
113 {-77.45, -91.47, -125.1, -145.4, -165.77},
114 {-95.0, -112.2, -153.45, -178.35, -203.35},
115 {-101.1, -119.4, -163.3, -189.8, -216.4},
116 {-95.0, -112.2, -153.45, -178.35, -203.35},
117 {-77.45, -91.47, -125.1, -145.4, -165.77},
118 {-50.55, -59.7, -81.65, -94.9, -108.2},
119 {-17.56, -20.73, -28.36, -32.96, -37.58}};
121 const Float_t kIFCrad[5] = {67.2, 64.4, 60.7, 64.4, 67.2};
123 const Float_t kTSrad[4] = {67.2, 61.5, 67.2, 61.5};
124 const Float_t kTSz[4] = {240.0, 90.0, 240.0, 90.0};
127 AliTPCSensorTemp::AliTPCSensorTemp(): AliDCSSensor(),
134 // Standard constructor
138 AliTPCSensorTemp::AliTPCSensorTemp(const AliTPCSensorTemp& source) :
139 AliDCSSensor(source),
142 fSector(source.fSector),
150 AliTPCSensorTemp& AliTPCSensorTemp::operator=(const AliTPCSensorTemp& source){
152 // assignment operator
154 if (&source == this) return *this;
155 new (this) AliTPCSensorTemp(source);
162 TClonesArray * AliTPCSensorTemp::ReadList(const char *fname) {
164 // read values from ascii file
166 TTree * tree = new TTree("asci","asci");
167 tree->ReadFile(fname,"");
169 Int_t nentries = tree->GetEntries();
179 //String_t namedtp[100];
181 tree->SetBranchAddress("Sensor",&sensor);
182 tree->SetBranchAddress("Type",&type);
183 tree->SetBranchAddress("Side",&side);
184 tree->SetBranchAddress("Sec",§or);
185 tree->SetBranchAddress("Num",&num);
186 tree->SetBranchAddress("ECha",&echa);
187 //tree->SetBranchAddress("X",&x);
188 //tree->SetBranchAddress("Y",&y);
189 //tree->SetBranchAddress("Z",&z);
191 // firstSensor = (Int_t)tree->GetMinimum("ECha");
192 // lastSensor = (Int_t)tree->GetMaximum("ECha");
194 TClonesArray * array = new TClonesArray("AliTPCSensorTemp",nentries);
196 for (Int_t isensor=0; isensor<nentries; isensor++){
197 AliTPCSensorTemp * temp = new ((*array)[isensor])AliTPCSensorTemp;
198 tree->GetEntry(isensor);
200 temp->SetIdDCS(echa);
201 if (side[0]=='C') temp->SetSide(1);
202 temp->SetSector(sector);
204 //temp->SetType(type);
205 if (bcmp(type,"ROC",3)==0) temp->SetType(0);
206 if (bcmp(type,"OFC",3)==0) temp->SetType(1);
207 if (bcmp(type,"IFC",3)==0) temp->SetType(2);
208 if (bcmp(type,"TPC",3)==0) temp->SetType(3);
209 if (bcmp(type,"ELM",3)==0) temp->SetType(4);
210 if (bcmp(type,"TS",2)==0) temp->SetType(5);
211 if (bcmp(type,"COOL",3)==0)temp->SetType(6);
214 if (temp->GetType()==0){
215 // temp->SetX(TMath::Cos((2*sector+1)*0.1745)*(83+(num+1)*30));
217 temp->SetX(kCSideX[sector][num]);
219 temp->SetX(kASideX[sector][num]);
222 if ((temp->GetType()==1) || (temp->GetType()==4)){
223 temp->SetX(TMath::Cos((2*sector+1)*0.1745)*278);
225 if (temp->GetType()==2) {
226 temp->SetX(TMath::Cos((2*sector+1)*0.1745)*60.7);
228 if (temp->GetType()==3) {
230 temp->SetX(TMath::Cos((2*sector+1)*0.1745)*87.5);
232 temp->SetX(TMath::Cos((2*sector+1)*0.1745)*241.8);
235 if (temp->GetType()==5){
236 temp->SetX(TMath::Cos(sector*0.524+(num+1)*0.131)*kTSrad[num]);
238 if (temp->GetType()==6){
243 if (temp->GetType()==0){
244 // temp->SetY(TMath::Sin((2*sector+1)*0.1745)*(83+(num+1)*30));
246 temp->SetY(kCSideY[sector][num]);
248 temp->SetY(kASideY[sector][num]);
251 if ((temp->GetType()==1) || (temp->GetType()==4)){
252 temp->SetY(TMath::Sin((2*sector+1)*0.1745)*278);
254 if (temp->GetType()==2){
255 temp->SetY(TMath::Sin((2*sector+1)*0.1745)*60.7);
257 if (temp->GetType()==3) {
259 temp->SetY(TMath::Sin((2*sector+1)*0.1745)*87.5);
261 temp->SetY(TMath::Sin((2*sector+1)*0.1745)*241.8);
265 if (temp->GetType()==5){
266 temp->SetY(TMath::Sin(sector*0.524+(num+1)*0.131)*kTSrad[num]);
269 if (temp->GetType()==6){
274 if ((temp->GetType()==0 ||
275 temp->GetType()==4 || temp->GetType()==6) &&
276 temp->GetSide()==0) {
279 if ((temp->GetType()==0 || temp->GetType()==4 ||
280 temp->GetType()==6) && temp->GetSide()==1){
283 if(temp->GetType()==2 && temp->GetSide()==0) {
286 if(temp->GetType()==2 && temp->GetSide()==1) {
290 if(temp->GetType()==3 && temp->GetSide()==0) {
293 if(temp->GetType()==3 && temp->GetSide()==1) {
297 if((temp->GetType()==1 ) && (num==0)) {
300 if((temp->GetType()==1 ) && (num==1)) {
303 if((temp->GetType()==1 ) && (num==2)) {
306 if((temp->GetType()==1 ) && (num==3)) {
309 if((temp->GetType()==1 ) && (num==4)) {
312 if((temp->GetType()==1 ) && (num==5)) {
316 if(temp->GetType()==5 && temp->GetSide()==0) {
317 temp->SetZ(kTSz[num]);
319 if(temp->GetType()==5 && temp->GetSide()==1) {
320 temp->SetZ(-kTSz[num]);