Line data Source code
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 : /* $Id$ */
17 :
18 : ////////////////////////////////////////////////////////////////////////////
19 : // //
20 : // This class perform operation on DCS Sensor //
21 : // The configuration of each sensor is included inside this class //
22 : // Use the methode GetList to get all the configuration //
23 : // //
24 : // Author: //
25 : // W. Monange (w.monange@gsi.de) //
26 : // //
27 : ////////////////////////////////////////////////////////////////////////////
28 :
29 : #include <TObjArray.h>
30 : #include <TClonesArray.h>
31 :
32 : #include "AliTRDSensorArray.h"
33 : #include "AliTRDSensor.h"
34 :
35 48 : ClassImp(AliTRDSensorArray)
36 :
37 : //_____________________________________________________________________________
38 : AliTRDSensorArray::AliTRDSensorArray()
39 38 : :AliDCSSensorArray()
40 38 : ,fAmanda("")
41 38 : ,fStoreName("")
42 190 : {
43 : //
44 : // Default constructor
45 : //
46 :
47 76 : }
48 :
49 : //_____________________________________________________________________________
50 : AliTRDSensorArray::AliTRDSensorArray(const char *amanda
51 : , const char *storeName
52 : , Float_t /*diffCut*/
53 : , TClonesArray * const trdSensor)
54 0 : :AliDCSSensorArray()
55 0 : ,fAmanda(amanda)
56 0 : ,fStoreName(storeName)
57 0 : {
58 : //
59 : // Constructor set fMinGraph to 0, fValCut to 0, fDiffCut to 0
60 : //
61 :
62 0 : fSensors = trdSensor;
63 0 : fMinGraph = 0;
64 0 : fValCut = -1;
65 0 : fDiffCut = -1;
66 0 : Int_t entries = fSensors->GetEntriesFast();
67 0 : if(entries > 1){
68 0 : for(Int_t k = 0; k < entries; k++){
69 0 : TString name (Form(amanda, k));
70 : //printf("name is %s of %d\n",(const char*)name,k);
71 0 : ((AliDCSSensor *) fSensors->UncheckedAt(k))->SetStringID(name);
72 0 : }
73 0 : }
74 : else{
75 0 : TString name (amanda);
76 : //printf("name is %s\n",(const char*)name);
77 0 : ((AliDCSSensor *) fSensors->UncheckedAt(0))->SetStringID(name);
78 0 : }
79 :
80 0 : }
81 :
82 : //_____________________________________________________________________________
83 : AliTRDSensorArray::AliTRDSensorArray(const AliTRDSensorArray & source)
84 0 : :AliDCSSensorArray(source)
85 0 : ,fAmanda(source.fAmanda)
86 0 : ,fStoreName(source.fStoreName)
87 0 : {
88 : //
89 : // Copy constructor
90 : //
91 :
92 0 : fSensors = source.fSensors;
93 0 : fMinGraph = 0;
94 0 : fValCut = -1;
95 0 : fDiffCut = -1;
96 :
97 0 : }
98 :
99 : //_____________________________________________________________________________
100 : AliTRDSensorArray::~AliTRDSensorArray()
101 0 : {
102 : //
103 : // Destructor
104 : //
105 :
106 0 : }
107 :
108 : //_____________________________________________________________________________
109 : AliTRDSensorArray &AliTRDSensorArray::operator=(const AliTRDSensorArray &source)
110 : {
111 : //
112 : // Assignment operator
113 : //
114 :
115 0 : if (&source == this) return *this;
116 0 : new (this) AliTRDSensorArray (source);
117 :
118 0 : return *this;
119 0 : }
120 :
121 : //_____________________________________________________________________________
122 : TObjArray *AliTRDSensorArray::GetList()
123 : {
124 : //
125 : // Return TObjArray with a list of AliTRDSensorArray corresponding to each
126 : // group of sensor
127 : //
128 :
129 0 : TObjArray * list = new TObjArray (23);
130 0 : list->SetOwner (kTRUE);
131 : AliTRDSensorArray * aH = 0x0;
132 :
133 : // generic list of sensors
134 0 : TClonesArray listSensor540 ("AliTRDSensor", 540);
135 0 : TClonesArray listSensor2 ("AliTRDSensor", 2);
136 0 : TClonesArray listSensor1 ("AliTRDSensor", 1);
137 0 : listSensor540.SetOwner (kTRUE);
138 0 : listSensor2.SetOwner (kTRUE);
139 0 : listSensor1.SetOwner (kTRUE);
140 0 : for (Int_t i = 0; i < 540; i++) {
141 0 : new(listSensor540[i]) AliTRDSensor (i, 0, 0, 0);
142 : }
143 0 : for (Int_t i = 0; i < 2; i++)
144 0 : new(listSensor2[i]) AliTRDSensor (i, 0, 0, 0);
145 0 : new(listSensor1[0]) AliTRDSensor (0, 0, 0, 0);
146 :
147 :
148 : // now create and populate
149 0 : aH = new AliTRDSensorArray ("trd_chamberStatus%03d", "trd_chamberStatus",
150 0 : 0.5, (TClonesArray*)listSensor540.Clone ());
151 0 : list->Add (aH);
152 :
153 0 : aH = new AliTRDSensorArray ("trd_goofieHv", "trd_goofieHv",
154 0 : -1, (TClonesArray*)listSensor1.Clone ());
155 0 : list->Add (aH);
156 0 : aH = new AliTRDSensorArray ("trd_goofiePeakPos%02d", "trd_goofiePeakPos",
157 0 : -1, (TClonesArray*)listSensor2.Clone ());
158 0 : list->Add (aH);
159 0 : aH = new AliTRDSensorArray ("trd_goofiePeakArea%02d","trd_goofiePeakArea",
160 0 : -1, (TClonesArray*)listSensor2.Clone ());
161 0 : list->Add (aH);
162 0 : aH = new AliTRDSensorArray ("trd_goofieTemp%02d", "trd_goofieTemp",
163 0 : -1, (TClonesArray*)listSensor2.Clone ());
164 0 : list->Add (aH);
165 0 : aH = new AliTRDSensorArray ("trd_goofiePressure", "trd_goofiePressure",
166 0 : -1, (TClonesArray*)listSensor1.Clone ());
167 0 : list->Add (aH);
168 0 : aH = new AliTRDSensorArray ("trd_goofieVelocity", "trd_goofieVelocity",
169 0 : -1, (TClonesArray*)listSensor1.Clone ());
170 0 : list->Add (aH);
171 0 : aH = new AliTRDSensorArray ("trd_goofieGain%02d", "trd_goofieGain",
172 0 : -1, (TClonesArray*)listSensor2.Clone ());
173 0 : list->Add (aH);
174 0 : aH = new AliTRDSensorArray ("trd_goofieCO2", "trd_goofieCO2",
175 0 : -1, (TClonesArray*)listSensor1.Clone ());
176 0 : list->Add (aH);
177 0 : aH = new AliTRDSensorArray ("trd_goofieN2", "trd_goofieN2",
178 0 : -1, (TClonesArray*)listSensor1.Clone ());
179 0 : list->Add (aH);
180 0 : aH = new AliTRDSensorArray ("trd_gasO2", "trd_gasO2",
181 0 : -1, (TClonesArray*)listSensor1.Clone ());
182 0 : list->Add (aH);
183 0 : aH = new AliTRDSensorArray ("trd_gasH2O", "trd_gasH2O",
184 0 : -1, (TClonesArray*)listSensor1.Clone ());
185 0 : list->Add (aH);
186 0 : aH = new AliTRDSensorArray ("trd_gasCO2", "trd_gasCO2",
187 0 : -1, (TClonesArray*)listSensor1.Clone ());
188 0 : list->Add (aH);
189 0 : aH = new AliTRDSensorArray ("trd_gasOverpressure", "trd_gasOverpressure",
190 0 : -1, (TClonesArray*)listSensor1.Clone ());
191 0 : list->Add (aH);
192 0 : aH = new AliTRDSensorArray ("trd_envTemp%03d", "trd_envTemp",
193 0 : -1, (TClonesArray*)listSensor540.Clone ());
194 0 : list->Add (aH);
195 0 : aH = new AliTRDSensorArray ("trd_hvAnodeImon%03d", "trd_hvAnodeImon",
196 0 : -1, (TClonesArray*)listSensor540.Clone ());
197 0 : list->Add (aH);
198 0 : aH = new AliTRDSensorArray ("trd_hvDriftImon%03d", "trd_hvDriftImon",
199 0 : -1, (TClonesArray*)listSensor540.Clone ());
200 0 : list->Add (aH);
201 0 : aH = new AliTRDSensorArray ("trd_hvAnodeUmon%03d", "trd_hvAnodeUmon",
202 0 : -1, (TClonesArray*)listSensor540.Clone ());
203 0 : list->Add (aH);
204 0 : aH = new AliTRDSensorArray ("trd_hvDriftUmon%03d", "trd_hvDriftUmon",
205 0 : -1, (TClonesArray*)listSensor540.Clone ());
206 0 : list->Add (aH);
207 0 : aH = new AliTRDSensorArray ("trd_gaschromatographXe", "trd_gaschromatographXe",
208 0 : -1, (TClonesArray*)listSensor1.Clone ());
209 0 : list->Add (aH);
210 0 : aH = new AliTRDSensorArray ("trd_gaschromatographCO2", "trd_gaschromatographCO2",
211 0 : -1, (TClonesArray*)listSensor1.Clone ());
212 0 : list->Add (aH);
213 0 : aH = new AliTRDSensorArray ("trd_gaschromatographN2", "trd_gaschromatographN2",
214 0 : -1, (TClonesArray*)listSensor1.Clone ());
215 0 : list->Add (aH);
216 :
217 : return list;
218 0 : }
219 :
220 : //_____________________________________________________________________________
221 : TMap* AliTRDSensorArray::ExtractDCS(TMap *dcsMap)
222 : {
223 : //
224 : // Return Tmap with TGraph inside corresponding to values in dcsMap
225 : //
226 :
227 0 : return AliDCSSensorArray::ExtractDCS(dcsMap);
228 : }
229 :
230 : //_____________________________________________________________________________
231 : void AliTRDSensorArray::SetGraph(TMap *map)
232 : {
233 : //
234 : // Assign list of TGraph to the current instance
235 : //
236 :
237 0 : AliDCSSensorArray::SetGraph(map);
238 0 : }
239 :
240 : //_____________________________________________________________________________
241 : Int_t AliTRDSensorArray::GetNGraph() const
242 : {
243 : //
244 : // Return the number of TGraph
245 : //
246 :
247 : Int_t nGraph = 0;
248 0 : Int_t nsensors = fSensors->GetEntries();
249 :
250 0 : for (Int_t isensor = 0; isensor < nsensors; isensor++) {
251 0 : AliDCSSensor *entry = (AliDCSSensor*)fSensors->At(isensor);
252 0 : if (entry->GetGraph () != 0x0)
253 0 : nGraph ++;
254 : }
255 0 : return nGraph;
256 : }
257 :
258 :
|