1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 **************************************************************************/
18 ////////////////////////////////////////////////////////////////////////////
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 //
25 // W. Monange (w.monange@gsi.de) //
27 ////////////////////////////////////////////////////////////////////////////
29 #include <TObjArray.h>
30 #include <TClonesArray.h>
32 #include "AliTRDSensorArray.h"
33 #include "AliTRDSensor.h"
35 ClassImp(AliTRDSensorArray)
37 //_____________________________________________________________________________
38 AliTRDSensorArray::AliTRDSensorArray()
44 // Default constructor
49 //_____________________________________________________________________________
50 AliTRDSensorArray::AliTRDSensorArray(const char *amanda
51 , const char *storeName
53 , TClonesArray * const trdSensor)
56 ,fStoreName(storeName)
59 // Constructor set fMinGraph to 0, fValCut to 0, fDiffCut to 0
66 Int_t entries = fSensors->GetEntriesFast();
68 for(Int_t k = 0; k < entries; k++){
69 TString name (Form(amanda, k));
70 //printf("name is %s of %d\n",(const char*)name,k);
71 ((AliDCSSensor *) fSensors->UncheckedAt(k))->SetStringID(name);
75 TString name (amanda);
76 //printf("name is %s\n",(const char*)name);
77 ((AliDCSSensor *) fSensors->UncheckedAt(0))->SetStringID(name);
82 //_____________________________________________________________________________
83 AliTRDSensorArray::AliTRDSensorArray(const AliTRDSensorArray & source)
84 :AliDCSSensorArray(source)
85 ,fAmanda(source.fAmanda)
86 ,fStoreName(source.fStoreName)
92 fSensors = source.fSensors;
99 //_____________________________________________________________________________
100 AliTRDSensorArray::~AliTRDSensorArray()
108 //_____________________________________________________________________________
109 AliTRDSensorArray &AliTRDSensorArray::operator=(const AliTRDSensorArray &source)
112 // Assignment operator
115 if (&source == this) return *this;
116 new (this) AliTRDSensorArray (source);
121 //_____________________________________________________________________________
122 TObjArray *AliTRDSensorArray::GetList()
125 // Return TObjArray with a list of AliTRDSensorArray corresponding to each
129 TObjArray * list = new TObjArray (20);
130 list->SetOwner (kTRUE);
131 AliTRDSensorArray * aH = 0x0;
133 // generic list of sensors
134 TClonesArray listSensor540 ("AliTRDSensor", 540);
135 TClonesArray listSensor2 ("AliTRDSensor", 2);
136 TClonesArray listSensor1 ("AliTRDSensor", 1);
137 listSensor540.SetOwner (kTRUE);
138 listSensor2.SetOwner (kTRUE);
139 listSensor1.SetOwner (kTRUE);
140 for (Int_t i = 0; i < 540; i++) {
141 new(listSensor540[i]) AliTRDSensor (i, 0, 0, 0);
143 for (Int_t i = 0; i < 2; i++)
144 new(listSensor2[i]) AliTRDSensor (i, 0, 0, 0);
145 new(listSensor1[0]) AliTRDSensor (0, 0, 0, 0);
148 // now create and populate
149 aH = new AliTRDSensorArray ("trd_chamberStatus%03d", "trd_chamberStatus",
150 0.5, (TClonesArray*)listSensor540.Clone ());
153 aH = new AliTRDSensorArray ("trd_goofieHv", "trd_goofieHv",
154 -1, (TClonesArray*)listSensor1.Clone ());
156 aH = new AliTRDSensorArray ("trd_goofiePeakPos%02d", "trd_goofiePeakPos",
157 -1, (TClonesArray*)listSensor2.Clone ());
159 aH = new AliTRDSensorArray ("trd_goofiePeakArea%02d","trd_goofiePeakArea",
160 -1, (TClonesArray*)listSensor2.Clone ());
162 aH = new AliTRDSensorArray ("trd_goofieTemp%02d", "trd_goofieTemp",
163 -1, (TClonesArray*)listSensor2.Clone ());
165 aH = new AliTRDSensorArray ("trd_goofiePressure", "trd_goofiePressure",
166 -1, (TClonesArray*)listSensor1.Clone ());
168 aH = new AliTRDSensorArray ("trd_goofieVelocity", "trd_goofieVelocity",
169 -1, (TClonesArray*)listSensor1.Clone ());
171 aH = new AliTRDSensorArray ("trd_goofieGain%02d", "trd_goofieGain",
172 -1, (TClonesArray*)listSensor2.Clone ());
174 aH = new AliTRDSensorArray ("trd_goofieCO2", "trd_goofieCO2",
175 -1, (TClonesArray*)listSensor1.Clone ());
177 aH = new AliTRDSensorArray ("trd_goofieN2", "trd_goofieN2",
178 -1, (TClonesArray*)listSensor1.Clone ());
180 aH = new AliTRDSensorArray ("trd_gasO2", "trd_gasO2",
181 -1, (TClonesArray*)listSensor1.Clone ());
183 aH = new AliTRDSensorArray ("trd_gasH2O", "trd_gasH2O",
184 -1, (TClonesArray*)listSensor1.Clone ());
186 aH = new AliTRDSensorArray ("trd_gasCO2", "trd_gasCO2",
187 -1, (TClonesArray*)listSensor1.Clone ());
189 aH = new AliTRDSensorArray ("trd_gasOverpressure", "trd_gasOverpressure",
190 -1, (TClonesArray*)listSensor1.Clone ());
192 aH = new AliTRDSensorArray ("trd_envTemp%03d", "trd_envTemp",
193 -1, (TClonesArray*)listSensor540.Clone ());
195 aH = new AliTRDSensorArray ("trd_hvAnodeImon%03d", "trd_hvAnodeImon",
196 -1, (TClonesArray*)listSensor540.Clone ());
198 aH = new AliTRDSensorArray ("trd_hvDriftImon%03d", "trd_hvDriftImon",
199 -1, (TClonesArray*)listSensor540.Clone ());
201 aH = new AliTRDSensorArray ("trd_hvAnodeUmon%03d", "trd_hvAnodeUmon",
202 -1, (TClonesArray*)listSensor540.Clone ());
204 aH = new AliTRDSensorArray ("trd_hvDriftUmon%03d", "trd_hvDriftUmon",
205 -1, (TClonesArray*)listSensor540.Clone ());
211 //_____________________________________________________________________________
212 TMap* AliTRDSensorArray::ExtractDCS(TMap *dcsMap)
215 // Return Tmap with TGraph inside corresponding to values in dcsMap
218 return AliDCSSensorArray::ExtractDCS(dcsMap);
221 //_____________________________________________________________________________
222 void AliTRDSensorArray::SetGraph(TMap *map)
225 // Assign list of TGraph to the current instance
228 AliDCSSensorArray::SetGraph(map);
231 //_____________________________________________________________________________
232 Int_t AliTRDSensorArray::GetNGraph() const
235 // Return the number of TGraph
239 Int_t nsensors = fSensors->GetEntries();
241 for (Int_t isensor = 0; isensor < nsensors; isensor++) {
242 AliDCSSensor *entry = (AliDCSSensor*)fSensors->At(isensor);
243 if (entry->GetGraph () != 0x0)