The AliDCSSensor classes were recently upgraded to include start and end time entries...
[u/mrichter/AliRoot.git] / TPC / AliTPCSensorTempArray.cxx
CommitLineData
54472e4f 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// //
19// TPC calibration class for parameters which saved per pad //
20// Authors: Marian Ivanov and Haavard Helstrup //
21// //
22///////////////////////////////////////////////////////////////////////////////
23
24#include "AliTPCSensorTempArray.h"
25
26ClassImp(AliTPCSensorTempArray)
27
28const char kFname[] = "TempSensor.txt";
ffa7e8be 29const char kAmandaString[] = "tpc_temp:PT_%d.Temperature";
54472e4f 30const Int_t kMinGraph = 10; // minimum #points of graph to be fitted
31const Int_t kMinPoints = 10; // minimum number of points per knot in fit
32const Int_t kIter = 10; // number of iterations for spline fit
33const Double_t kMaxDelta = 0.00; // precision parameter for spline fit
34const Int_t kFitReq = 2; // fit requirement, 2 = continuous 2nd derivative
35
36//_____________________________________________________________________________
ffa7e8be 37AliTPCSensorTempArray::AliTPCSensorTempArray():AliDCSSensorArray(),
38 fAmandaString(kAmandaString)
54472e4f 39{
40 //
41 // AliTPCSensorTempArray default constructor
42 //
ffa7e8be 43
54472e4f 44}
45//_____________________________________________________________________________
46AliTPCSensorTempArray::AliTPCSensorTempArray(Int_t prevRun) :
ffa7e8be 47 AliDCSSensorArray(prevRun,"TPC/Calib/Temperature"),
48 fAmandaString(kAmandaString)
54472e4f 49{
50}
51//_____________________________________________________________________________
ffa7e8be 52AliTPCSensorTempArray::AliTPCSensorTempArray(UInt_t startTime, UInt_t endTime,
53 const char *filepath)
54 :AliDCSSensorArray(),
55 fAmandaString(kAmandaString)
54472e4f 56{
57 //
58 // AliTPCSensorTempArray default constructor
59 //
ffa7e8be 60 char *expPath = gSystem->ExpandPathName(filepath);
61 TString filename(expPath);
62 filename.Append('/');
63 filename.Append(kFname);
49dfd67a 64 fSensors = AliTPCSensorTemp::ReadList(filename.Data());
54472e4f 65 fStartTime = TTimeStamp(startTime);
66 fEndTime = TTimeStamp(endTime);
ffa7e8be 67 delete expPath;
54472e4f 68}
69
70//_____________________________________________________________________________
71AliTPCSensorTempArray::AliTPCSensorTempArray(const char *fname) :
ffa7e8be 72 AliDCSSensorArray(),
73 fAmandaString(kAmandaString)
54472e4f 74{
75 //
76 // AliTPCSensorTempArray constructor
77 //
49dfd67a 78 fSensors = AliTPCSensorTemp::ReadList(fname);
54472e4f 79 fSensors->BypassStreamer(kFALSE);
54472e4f 80}
81
82
83//_____________________________________________________________________________
84AliTPCSensorTempArray::AliTPCSensorTempArray(const AliTPCSensorTempArray &c):
ffa7e8be 85 AliDCSSensorArray(c),
86 fAmandaString(c.fAmandaString)
54472e4f 87{
88 //
89 // AliTPCSensorTempArray copy constructor
90 //
91
92}
93
94///_____________________________________________________________________________
95AliTPCSensorTempArray::~AliTPCSensorTempArray()
96{
97 //
98 // AliTPCSensorTempArray destructor
99 //
54472e4f 100}
101
102//_____________________________________________________________________________
103AliTPCSensorTempArray &AliTPCSensorTempArray::operator=(const AliTPCSensorTempArray &c)
104{
105 //
106 // Assignment operator
107 //
108
109 if (this != &c) ((AliTPCSensorTempArray &) c).Copy(*this);
110 return *this;
111
112}
113
114//_____________________________________________________________________________
115void AliTPCSensorTempArray::Copy(TObject &c) const
116{
117 //
118 // Copy function
119 //
120
121 TObject::Copy(c);
122}
123//_____________________________________________________________________________
124void AliTPCSensorTempArray::ReadSensors(const char *fname)
125{
126 //
127 // Read list of temperature sensors from text file
128 //
49dfd67a 129 fSensors = AliTPCSensorTemp::ReadList(fname);
54472e4f 130}
131//_____________________________________________________________________________
132void AliTPCSensorTempArray::SetGraph(TMap *map)
133{
134 //
135 // Read graphs from DCS maps
136 //
ffa7e8be 137 AliDCSSensorArray::SetGraph(map,fAmandaString.Data());
54472e4f 138}
139//_____________________________________________________________________________
140void AliTPCSensorTempArray::MakeSplineFit(TMap *map)
141{
142 //
143 // Make spline fits from DCS maps
144 //
ffa7e8be 145 AliDCSSensorArray::MakeSplineFit(map,fAmandaString.Data());
54472e4f 146}
147
148
149//_____________________________________________________________________________
150TMap* AliTPCSensorTempArray::ExtractDCS(TMap *dcsMap)
151{
152 //
153 // Extract temperature graphs from DCS maps
154 //
155
ffa7e8be 156 TMap *values = AliDCSSensorArray::ExtractDCS(dcsMap,fAmandaString.Data());
54472e4f 157 return values;
158}
159
e4dce695 160//_____________________________________________________________________________
161AliTPCSensorTemp* AliTPCSensorTempArray::GetSensor(Int_t type, Int_t side, Int_t sector, Int_t num)
162{
163 //
164 // Return sensor information for sensor specified by type, side, sector and num
165 //
166 Int_t nsensors = fSensors->GetEntries();
167 for (Int_t isensor=0; isensor<nsensors; isensor++) {
168 AliTPCSensorTemp *entry = (AliTPCSensorTemp*)fSensors->At(isensor);
169 if (entry->GetSide() == side &&
170 entry->GetType() == type &&
171 entry->GetSector() == sector &&
172 entry->GetNum() == num ) return entry;
173 }
174 return 0;
175}
176//_____________________________________________________________________________
49dfd67a 177
e4dce695 178AliTPCSensorTemp* AliTPCSensorTempArray::GetSensor(Int_t IdDCS){
179 return dynamic_cast<AliTPCSensorTemp*>(AliDCSSensorArray::GetSensor(IdDCS));
180}
181//_____________________________________________________________________________
49dfd67a 182
e4dce695 183AliTPCSensorTemp* AliTPCSensorTempArray::GetSensor(Double_t x, Double_t y, Double_t z){
184 return dynamic_cast<AliTPCSensorTemp*>(AliDCSSensorArray::GetSensor(x,y,z));
185}