]>
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"; | |
9b1892d3 | 30 | |
31 | //_____________________________________________________________________________ | |
32 | AliTPCSensorPressureArray::AliTPCSensorPressureArray():AliDCSSensorArray(), | |
33 | fAmandaString(kAmandaString) | |
34 | { | |
35 | // | |
36 | // AliTPCSensorPressureArray default constructor | |
37 | // | |
38 | ||
39 | } | |
40 | //_____________________________________________________________________________ | |
41 | AliTPCSensorPressureArray::AliTPCSensorPressureArray(Int_t prevRun) : | |
42 | AliDCSSensorArray(prevRun,"TPC/Calib/Pressure"), | |
43 | fAmandaString(kAmandaString) | |
44 | { | |
45 | } | |
46 | //_____________________________________________________________________________ | |
47 | AliTPCSensorPressureArray::AliTPCSensorPressureArray(UInt_t startTime, UInt_t endTime, | |
48 | const char *filepath) | |
49 | :AliDCSSensorArray(), | |
50 | fAmandaString(kAmandaString) | |
51 | { | |
52 | // | |
53 | // AliTPCSensorPressureArray default constructor | |
54 | // | |
55 | char *expPath = gSystem->ExpandPathName(filepath); | |
56 | TString filename(expPath); | |
57 | filename.Append('/'); | |
58 | filename.Append(kFname); | |
49dfd67a | 59 | fSensors = AliTPCSensorPressure::ReadList(filename.Data()); |
9b1892d3 | 60 | fStartTime = TTimeStamp(startTime); |
61 | fEndTime = TTimeStamp(endTime); | |
62 | delete expPath; | |
63 | } | |
64 | ||
65 | //_____________________________________________________________________________ | |
66 | AliTPCSensorPressureArray::AliTPCSensorPressureArray(const char *fname) : | |
67 | AliDCSSensorArray(), | |
68 | fAmandaString(kAmandaString) | |
69 | { | |
70 | // | |
71 | // AliTPCSensorPressureArray constructor | |
72 | // | |
49dfd67a | 73 | fSensors = AliTPCSensorPressure::ReadList(fname); |
9b1892d3 | 74 | fSensors->BypassStreamer(kFALSE); |
75 | } | |
76 | ||
77 | ||
78 | //_____________________________________________________________________________ | |
79 | AliTPCSensorPressureArray::AliTPCSensorPressureArray(const AliTPCSensorPressureArray &c): | |
80 | AliDCSSensorArray(c), | |
81 | fAmandaString(c.fAmandaString) | |
82 | { | |
83 | // | |
84 | // AliTPCSensorPressureArray copy constructor | |
85 | // | |
86 | ||
87 | } | |
88 | ||
89 | ///_____________________________________________________________________________ | |
90 | AliTPCSensorPressureArray::~AliTPCSensorPressureArray() | |
91 | { | |
92 | // | |
93 | // AliTPCSensorPressureArray destructor | |
94 | // | |
95 | } | |
96 | ||
97 | //_____________________________________________________________________________ | |
98 | AliTPCSensorPressureArray &AliTPCSensorPressureArray::operator=(const AliTPCSensorPressureArray &c) | |
99 | { | |
100 | // | |
101 | // Assignment operator | |
102 | // | |
103 | ||
104 | if (this != &c) ((AliTPCSensorPressureArray &) c).Copy(*this); | |
105 | return *this; | |
106 | ||
107 | } | |
108 | ||
109 | //_____________________________________________________________________________ | |
110 | void AliTPCSensorPressureArray::Copy(TObject &c) const | |
111 | { | |
112 | // | |
113 | // Copy function | |
114 | // | |
115 | ||
116 | TObject::Copy(c); | |
117 | } | |
118 | //_____________________________________________________________________________ | |
119 | void AliTPCSensorPressureArray::ReadSensors(const char *fname) | |
120 | { | |
121 | // | |
122 | // Read list of temperature sensors from text file | |
123 | // | |
49dfd67a | 124 | fSensors = AliTPCSensorPressure::ReadList(fname); |
9b1892d3 | 125 | } |
126 | //_____________________________________________________________________________ | |
127 | void AliTPCSensorPressureArray::SetGraph(TMap *map) | |
128 | { | |
129 | // | |
130 | // Read graphs from DCS maps | |
131 | // | |
132 | AliDCSSensorArray::SetGraph(map,fAmandaString.Data()); | |
133 | } | |
134 | //_____________________________________________________________________________ | |
135 | void AliTPCSensorPressureArray::MakeSplineFit(TMap *map) | |
136 | { | |
137 | // | |
138 | // Make spline fits from DCS maps | |
139 | // | |
140 | AliDCSSensorArray::MakeSplineFit(map,fAmandaString.Data()); | |
141 | } | |
142 | ||
143 | ||
144 | //_____________________________________________________________________________ | |
145 | TMap* AliTPCSensorPressureArray::ExtractDCS(TMap *dcsMap) | |
146 | { | |
147 | // | |
148 | // Extract temperature graphs from DCS maps | |
149 | // | |
150 | ||
151 | TMap *values = AliDCSSensorArray::ExtractDCS(dcsMap,fAmandaString.Data()); | |
152 | return values; | |
153 | } | |
154 | ||
155 | //_____________________________________________________________________________ | |
156 | AliTPCSensorPressure* AliTPCSensorPressureArray::GetSensor(Int_t type, Int_t side, Int_t sector, Int_t num) | |
157 | { | |
158 | // | |
159 | // Return sensor information for sensor specified by type, side, sector and num | |
160 | // | |
161 | Int_t nsensors = fSensors->GetEntries(); | |
162 | for (Int_t isensor=0; isensor<nsensors; isensor++) { | |
163 | AliTPCSensorPressure *entry = (AliTPCSensorPressure*)fSensors->At(isensor); | |
164 | if (entry->GetSide() == side && | |
165 | entry->GetType() == type && | |
166 | entry->GetSector() == sector && | |
167 | entry->GetNum() == num ) return entry; | |
168 | } | |
169 | return 0; | |
170 | } | |
171 | //_____________________________________________________________________________ | |
172 | AliTPCSensorPressure* AliTPCSensorPressureArray::GetSensor(Int_t IdDCS){ | |
173 | return dynamic_cast<AliTPCSensorPressure*>(AliDCSSensorArray::GetSensor(IdDCS)); | |
174 | } | |
175 | //_____________________________________________________________________________ | |
176 | AliTPCSensorPressure* AliTPCSensorPressureArray::GetSensor(Double_t x, Double_t y, Double_t z){ | |
177 | return dynamic_cast<AliTPCSensorPressure*>(AliDCSSensorArray::GetSensor(x,y,z)); | |
178 | } |