]>
Commit | Line | Data |
---|---|---|
9b1892d3 | 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 pressure sensors // | |
20 | // Authors: Marian Ivanov and Haavard Helstrup // | |
21 | // // | |
22 | /////////////////////////////////////////////////////////////////////////////// | |
23 | ||
24 | #include "AliTPCSensorPressureArray.h" | |
25 | ||
26 | ClassImp(AliTPCSensorPressureArray) | |
27 | ||
28 | const char kFname[] = "PressureSensor.txt"; | |
29 | const char kAmandaString[] = "system:gcs-ALITPC-ALITPC-AnalogInput-0%d.ProcessInput.PosSt"; | |
30 | const Int_t kMinGraph = 10; // minimum #points of graph to be fitted | |
31 | const Int_t kMinPoints = 10; // minimum number of points per knot in fit | |
32 | const Int_t kIter = 10; // number of iterations for spline fit | |
33 | const Double_t kMaxDelta = 0.00; // precision parameter for spline fit | |
34 | const Int_t kFitReq = 2; // fit requirement, 2 = continuous 2nd derivative | |
35 | ||
36 | //_____________________________________________________________________________ | |
37 | AliTPCSensorPressureArray::AliTPCSensorPressureArray():AliDCSSensorArray(), | |
38 | fAmandaString(kAmandaString) | |
39 | { | |
40 | // | |
41 | // AliTPCSensorPressureArray default constructor | |
42 | // | |
43 | ||
44 | } | |
45 | //_____________________________________________________________________________ | |
46 | AliTPCSensorPressureArray::AliTPCSensorPressureArray(Int_t prevRun) : | |
47 | AliDCSSensorArray(prevRun,"TPC/Calib/Pressure"), | |
48 | fAmandaString(kAmandaString) | |
49 | { | |
50 | } | |
51 | //_____________________________________________________________________________ | |
52 | AliTPCSensorPressureArray::AliTPCSensorPressureArray(UInt_t startTime, UInt_t endTime, | |
53 | const char *filepath) | |
54 | :AliDCSSensorArray(), | |
55 | fAmandaString(kAmandaString) | |
56 | { | |
57 | // | |
58 | // AliTPCSensorPressureArray default constructor | |
59 | // | |
60 | char *expPath = gSystem->ExpandPathName(filepath); | |
61 | TString filename(expPath); | |
62 | filename.Append('/'); | |
63 | filename.Append(kFname); | |
64 | fSensors = AliTPCSensorPressure::ReadListInd(filename.Data(),fFirstSensor,fLastSensor); | |
65 | fStartTime = TTimeStamp(startTime); | |
66 | fEndTime = TTimeStamp(endTime); | |
67 | delete expPath; | |
68 | } | |
69 | ||
70 | //_____________________________________________________________________________ | |
71 | AliTPCSensorPressureArray::AliTPCSensorPressureArray(const char *fname) : | |
72 | AliDCSSensorArray(), | |
73 | fAmandaString(kAmandaString) | |
74 | { | |
75 | // | |
76 | // AliTPCSensorPressureArray constructor | |
77 | // | |
78 | fSensors = AliTPCSensorPressure::ReadListInd(fname,fFirstSensor,fLastSensor); | |
79 | fSensors->BypassStreamer(kFALSE); | |
80 | } | |
81 | ||
82 | ||
83 | //_____________________________________________________________________________ | |
84 | AliTPCSensorPressureArray::AliTPCSensorPressureArray(const AliTPCSensorPressureArray &c): | |
85 | AliDCSSensorArray(c), | |
86 | fAmandaString(c.fAmandaString) | |
87 | { | |
88 | // | |
89 | // AliTPCSensorPressureArray copy constructor | |
90 | // | |
91 | ||
92 | } | |
93 | ||
94 | ///_____________________________________________________________________________ | |
95 | AliTPCSensorPressureArray::~AliTPCSensorPressureArray() | |
96 | { | |
97 | // | |
98 | // AliTPCSensorPressureArray destructor | |
99 | // | |
100 | } | |
101 | ||
102 | //_____________________________________________________________________________ | |
103 | AliTPCSensorPressureArray &AliTPCSensorPressureArray::operator=(const AliTPCSensorPressureArray &c) | |
104 | { | |
105 | // | |
106 | // Assignment operator | |
107 | // | |
108 | ||
109 | if (this != &c) ((AliTPCSensorPressureArray &) c).Copy(*this); | |
110 | return *this; | |
111 | ||
112 | } | |
113 | ||
114 | //_____________________________________________________________________________ | |
115 | void AliTPCSensorPressureArray::Copy(TObject &c) const | |
116 | { | |
117 | // | |
118 | // Copy function | |
119 | // | |
120 | ||
121 | TObject::Copy(c); | |
122 | } | |
123 | //_____________________________________________________________________________ | |
124 | void AliTPCSensorPressureArray::ReadSensors(const char *fname) | |
125 | { | |
126 | // | |
127 | // Read list of temperature sensors from text file | |
128 | // | |
129 | fSensors = AliTPCSensorPressure::ReadListInd(fname,fFirstSensor,fLastSensor); | |
130 | } | |
131 | //_____________________________________________________________________________ | |
132 | void AliTPCSensorPressureArray::SetGraph(TMap *map) | |
133 | { | |
134 | // | |
135 | // Read graphs from DCS maps | |
136 | // | |
137 | AliDCSSensorArray::SetGraph(map,fAmandaString.Data()); | |
138 | } | |
139 | //_____________________________________________________________________________ | |
140 | void AliTPCSensorPressureArray::MakeSplineFit(TMap *map) | |
141 | { | |
142 | // | |
143 | // Make spline fits from DCS maps | |
144 | // | |
145 | AliDCSSensorArray::MakeSplineFit(map,fAmandaString.Data()); | |
146 | } | |
147 | ||
148 | ||
149 | //_____________________________________________________________________________ | |
150 | TMap* AliTPCSensorPressureArray::ExtractDCS(TMap *dcsMap) | |
151 | { | |
152 | // | |
153 | // Extract temperature graphs from DCS maps | |
154 | // | |
155 | ||
156 | TMap *values = AliDCSSensorArray::ExtractDCS(dcsMap,fAmandaString.Data()); | |
157 | return values; | |
158 | } | |
159 | ||
160 | //_____________________________________________________________________________ | |
161 | AliTPCSensorPressure* AliTPCSensorPressureArray::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 | AliTPCSensorPressure *entry = (AliTPCSensorPressure*)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 | //_____________________________________________________________________________ | |
177 | AliTPCSensorPressure* AliTPCSensorPressureArray::GetSensor(Int_t IdDCS){ | |
178 | return dynamic_cast<AliTPCSensorPressure*>(AliDCSSensorArray::GetSensor(IdDCS)); | |
179 | } | |
180 | //_____________________________________________________________________________ | |
181 | AliTPCSensorPressure* AliTPCSensorPressureArray::GetSensor(Double_t x, Double_t y, Double_t z){ | |
182 | return dynamic_cast<AliTPCSensorPressure*>(AliDCSSensorArray::GetSensor(x,y,z)); | |
183 | } |