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)
42 const Float_t kASideX[18][5]={
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},
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},
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}};
62 const Float_t kASideY[18][5]={
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},
67 {101.1, 119.4, 163.3, 189.8, 216.4},
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},
76 {-101.1, -119.4, -163.3, -189.8, -216.4},
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}};
82 const Float_t kCSideX[18][5]={
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},
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},
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}};
102 const Float_t kCSideY[18][5]={
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},
107 {101.1, 119.4, 163.3, 189.8, 216.4},
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},
116 {-101.1, -119.4, -163.3, -189.8, -216.4},
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}};
122 const Float_t kIFCrad[5] = {67.2, 64.4, 60.7, 64.4, 67.2};
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};
127 //______________________________________________________________________________________________
129 AliTPCSensorTemp::AliTPCSensorTemp(): AliDCSSensor(),
136 // Standard constructor
139 //______________________________________________________________________________________________
141 AliTPCSensorTemp::AliTPCSensorTemp(const AliTPCSensorTemp& source) :
142 AliDCSSensor(source),
145 fSector(source.fSector),
152 //______________________________________________________________________________________________
154 AliTPCSensorTemp& AliTPCSensorTemp::operator=(const AliTPCSensorTemp& source){
156 // assignment operator
158 if (&source == this) return *this;
159 new (this) AliTPCSensorTemp(source);
163 //______________________________________________________________________________________________
165 TClonesArray * AliTPCSensorTemp::ReadList(const char *fname) {
167 // read values from ascii file
169 TTree * tree = new TTree("asci","asci");
170 tree->ReadFile(fname,"");
171 TClonesArray *arr = ReadTree(tree);
176 //______________________________________________________________________________________________
178 TClonesArray * AliTPCSensorTemp::ReadTree(TTree *tree,
179 const TString& amandaString) {
181 Int_t nentries = tree->GetEntries();
191 //String_t namedtp[100];
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);
203 // firstSensor = (Int_t)tree->GetMinimum("ECha");
204 // lastSensor = (Int_t)tree->GetMaximum("ECha");
206 TClonesArray * array = new TClonesArray("AliTPCSensorTemp",nentries);
208 for (Int_t isensor=0; isensor<nentries; isensor++){
209 AliTPCSensorTemp * temp = new ((*array)[isensor])AliTPCSensorTemp;
210 tree->GetEntry(isensor);
212 temp->SetIdDCS(echa);
213 TString stringID = Form (amandaString.Data(),echa);
214 temp->SetStringID(stringID);
215 if (side[0]=='C') temp->SetSide(1);
216 temp->SetSector(sector);
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);
228 if (temp->GetType()==0){
229 // temp->SetX(TMath::Cos((2*sector+1)*0.1745)*(83+(num+1)*30));
231 temp->SetX(kCSideX[sector][num]);
233 temp->SetX(kASideX[sector][num]);
236 if ((temp->GetType()==1) || (temp->GetType()==4)){
237 temp->SetX(TMath::Cos((2*sector+1)*0.1745)*278);
239 if (temp->GetType()==2) {
240 temp->SetX(TMath::Cos((2*sector+1)*0.1745)*60.7);
242 if (temp->GetType()==3) {
244 temp->SetX(TMath::Cos((2*sector+1)*0.1745)*87.5);
246 temp->SetX(TMath::Cos((2*sector+1)*0.1745)*241.8);
249 if (temp->GetType()==5){
250 temp->SetX(TMath::Cos(sector*0.524+(num+1)*0.131)*kTSrad[num]);
252 if (temp->GetType()==6){
257 if (temp->GetType()==0){
258 // temp->SetY(TMath::Sin((2*sector+1)*0.1745)*(83+(num+1)*30));
260 temp->SetY(kCSideY[sector][num]);
262 temp->SetY(kASideY[sector][num]);
265 if ((temp->GetType()==1) || (temp->GetType()==4)){
266 temp->SetY(TMath::Sin((2*sector+1)*0.1745)*278);
268 if (temp->GetType()==2){
269 temp->SetY(TMath::Sin((2*sector+1)*0.1745)*60.7);
271 if (temp->GetType()==3) {
273 temp->SetY(TMath::Sin((2*sector+1)*0.1745)*87.5);
275 temp->SetY(TMath::Sin((2*sector+1)*0.1745)*241.8);
279 if (temp->GetType()==5){
280 temp->SetY(TMath::Sin(sector*0.524+(num+1)*0.131)*kTSrad[num]);
283 if (temp->GetType()==6){
288 if ((temp->GetType()==0 ||
289 temp->GetType()==4 || temp->GetType()==6) &&
290 temp->GetSide()==0) {
293 if ((temp->GetType()==0 || temp->GetType()==4 ||
294 temp->GetType()==6) && temp->GetSide()==1){
297 if(temp->GetType()==2 && temp->GetSide()==0) {
300 if(temp->GetType()==2 && temp->GetSide()==1) {
304 if(temp->GetType()==3 && temp->GetSide()==0) {
307 if(temp->GetType()==3 && temp->GetSide()==1) {
311 if((temp->GetType()==1 ) && (num==0)) {
314 if((temp->GetType()==1 ) && (num==1)) {
317 if((temp->GetType()==1 ) && (num==2)) {
320 if((temp->GetType()==1 ) && (num==3)) {
323 if((temp->GetType()==1 ) && (num==4)) {
326 if((temp->GetType()==1 ) && (num==5)) {
330 if(temp->GetType()==5 && temp->GetSide()==0) {
331 temp->SetZ(kTSz[num]);
333 if(temp->GetType()==5 && temp->GetSide()==1) {
334 temp->SetZ(-kTSz[num]);