propagate cluster error parametrization
[u/mrichter/AliRoot.git] / TRD / AliTRDSensorArray.cxx
CommitLineData
cd4fc278 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
35ClassImp(AliTRDSensorArray)
36
37//_____________________________________________________________________________
38AliTRDSensorArray::AliTRDSensorArray () :
39 AliDCSSensorArray (),
40 fAmanda (""),
41 fStoreName ("")
42
43{
44 //default constructor
45
46}
47
48
49
50//_____________________________________________________________________________
51AliTRDSensorArray::AliTRDSensorArray (const char * amanda,
52 const char * storeName,
53 Float_t /*diffCut*/,
54 TClonesArray * trdSensor) :
55 AliDCSSensorArray (),
56 fAmanda (amanda),
57 fStoreName (storeName)
58
59{
60 //constructor set fMinGraph to 0, fValCut to 0, fDiffCut to 0
61 fSensors = trdSensor;
62 fMinGraph = 0;
63 fValCut = -1;
64 fDiffCut = -1;
2ff01398 65 Int_t entries = fSensors->GetEntriesFast();
66 if(entries > 1){
67 for(Int_t k = 0; k < entries; k++){
68 TString name (Form(amanda, k));
e83f456c 69 //printf("name is %s of %d\n",(const char*)name,k);
2ff01398 70 ((AliDCSSensor *) fSensors->UncheckedAt(k))->SetStringID(name);
71 }
72 }
73 else{
74 TString name (amanda);
e83f456c 75 //printf("name is %s\n",(const char*)name);
2ff01398 76 ((AliDCSSensor *) fSensors->UncheckedAt(0))->SetStringID(name);
77 }
78
cd4fc278 79}
80
81//_____________________________________________________________________________
82AliTRDSensorArray::AliTRDSensorArray (const AliTRDSensorArray & source) :
6e5d4cb2 83 AliDCSSensorArray(source),
cd4fc278 84 fAmanda (source.fAmanda),
85 fStoreName (source.fStoreName)
86
87{
88 // copy constructor
89 fSensors = source.fSensors;
90 fMinGraph = 0;
91 fValCut = -1;
92 fDiffCut = -1;
93}
94
95
96//_____________________________________________________________________________
97AliTRDSensorArray:: ~AliTRDSensorArray ()
98{
99 //
100 // Destructor
101 //
102
103}
104
105//_____________________________________________________________________________
106AliTRDSensorArray & AliTRDSensorArray::operator=(const AliTRDSensorArray & source)
107{
108 //
109 // Assignment operator
110 //
111
112 if (&source == this) return *this;
113 new (this) AliTRDSensorArray (source);
114
115 return *this;
116}
117
118//_____________________________________________________________________________
119TObjArray * AliTRDSensorArray::GetList ()
120{
121 // return TObjArray with a list of AliTRDSensorArray corresponding to each
122 // group of sensor
123
124 TObjArray * list = new TObjArray (22);
125 list->SetOwner (kTRUE);
126 AliTRDSensorArray * aH = 0x0;
127
128 // generic list of sensors
129 TClonesArray listSensor540 ("AliTRDSensor", 540);
130 TClonesArray listSensor2 ("AliTRDSensor", 2);
131 TClonesArray listSensor1 ("AliTRDSensor", 1);
132 listSensor540.SetOwner (kTRUE);
133 listSensor2.SetOwner (kTRUE);
134 listSensor1.SetOwner (kTRUE);
135 for (Int_t i = 0; i < 540; i++) {
136 new(listSensor540[i]) AliTRDSensor (i, 0, 0, 0);
137 }
138 for (Int_t i = 0; i < 2; i++)
139 new(listSensor2[i]) AliTRDSensor (i, 0, 0, 0);
140 new(listSensor1[0]) AliTRDSensor (0, 0, 0, 0);
141
142
143 // now create and populate
144 aH = new AliTRDSensorArray ("trd_chamberStatus%03d", "trd_chamberStatus",
2ff01398 145 0.5, (TClonesArray*)listSensor540.Clone ());
cd4fc278 146 list->Add (aH);
147
cd4fc278 148 aH = new AliTRDSensorArray ("trd_goofieHv", "trd_goofieHv",
2ff01398 149 -1, (TClonesArray*)listSensor1.Clone ());
cd4fc278 150 list->Add (aH);
151 aH = new AliTRDSensorArray ("trd_goofiePeakPos%02d", "trd_goofiePeakPos",
2ff01398 152 -1, (TClonesArray*)listSensor2.Clone ());
cd4fc278 153 list->Add (aH);
154 aH = new AliTRDSensorArray ("trd_goofiePeakArea%02d","trd_goofiePeakArea",
2ff01398 155 -1, (TClonesArray*)listSensor2.Clone ());
cd4fc278 156 list->Add (aH);
157 aH = new AliTRDSensorArray ("trd_goofieTemp%02d", "trd_goofieTemp",
2ff01398 158 -1, (TClonesArray*)listSensor2.Clone ());
cd4fc278 159 list->Add (aH);
160 aH = new AliTRDSensorArray ("trd_goofiePressure", "trd_goofiePressure",
2ff01398 161 -1, (TClonesArray*)listSensor1.Clone ());
cd4fc278 162 list->Add (aH);
163 aH = new AliTRDSensorArray ("trd_goofieVelocity", "trd_goofieVelocity",
2ff01398 164 -1, (TClonesArray*)listSensor1.Clone ());
cd4fc278 165 list->Add (aH);
166 aH = new AliTRDSensorArray ("trd_goofieGain%02d", "trd_goofieGain",
2ff01398 167 -1, (TClonesArray*)listSensor2.Clone ());
cd4fc278 168 list->Add (aH);
169 aH = new AliTRDSensorArray ("trd_goofieCO2", "trd_goofieCO2",
2ff01398 170 -1, (TClonesArray*)listSensor1.Clone ());
cd4fc278 171 list->Add (aH);
172 aH = new AliTRDSensorArray ("trd_goofieN2", "trd_goofieN2",
2ff01398 173 -1, (TClonesArray*)listSensor1.Clone ());
cd4fc278 174 list->Add (aH);
175 aH = new AliTRDSensorArray ("trd_gasO2", "trd_gasO2",
2ff01398 176 -1, (TClonesArray*)listSensor1.Clone ());
cd4fc278 177 list->Add (aH);
178 aH = new AliTRDSensorArray ("trd_gasH2O", "trd_gasH2O",
2ff01398 179 -1, (TClonesArray*)listSensor1.Clone ());
cd4fc278 180 list->Add (aH);
e83f456c 181 aH = new AliTRDSensorArray ("trd_gasCO2", "trd_gasCO2",
182 -1, (TClonesArray*)listSensor1.Clone ());
183 list->Add (aH);
cd4fc278 184 aH = new AliTRDSensorArray ("trd_gasOverpressure", "trd_gasOverpressure",
2ff01398 185 -1, (TClonesArray*)listSensor1.Clone ());
cd4fc278 186 list->Add (aH);
187 aH = new AliTRDSensorArray ("trd_envTemp%03d", "trd_envTemp",
2ff01398 188 -1, (TClonesArray*)listSensor540.Clone ());
cd4fc278 189 list->Add (aH);
190 aH = new AliTRDSensorArray ("trd_hvAnodeImon%03d", "trd_hvAnodeImon",
2ff01398 191 -1, (TClonesArray*)listSensor540.Clone ());
cd4fc278 192 list->Add (aH);
193 aH = new AliTRDSensorArray ("trd_hvDriftImon%03d", "trd_hvDriftImon",
2ff01398 194 -1, (TClonesArray*)listSensor540.Clone ());
cd4fc278 195 list->Add (aH);
196 aH = new AliTRDSensorArray ("trd_hvAnodeUmon%03d", "trd_hvAnodeUmon",
2ff01398 197 -1, (TClonesArray*)listSensor540.Clone ());
cd4fc278 198 list->Add (aH);
199 aH = new AliTRDSensorArray ("trd_hvDriftUmon%03d", "trd_hvDriftUmon",
2ff01398 200 -1, (TClonesArray*)listSensor540.Clone ());
cd4fc278 201 list->Add (aH);
202 aH = new AliTRDSensorArray ("trd_adcClkPhase", "trd_adcClkPhase",
2ff01398 203 -1, (TClonesArray*)listSensor1.Clone ());
cd4fc278 204 list->Add (aH);
205
206 return list;
207}
208
209//_____________________________________________________________________________
210TMap* AliTRDSensorArray::ExtractDCS(TMap *dcsMap)
211{
212 //Return Tmap with TGraph inside corresponding to values in dcsMap
5cee8265 213 return AliDCSSensorArray::ExtractDCS (dcsMap);
cd4fc278 214}
215
216//_____________________________________________________________________________
217void AliTRDSensorArray::SetGraph (TMap * map)
218{
219 // assigne list of TGraph to the current instance
5cee8265 220 AliDCSSensorArray::SetGraph (map);
cd4fc278 221}
222
223
224//_____________________________________________________________________________
225Int_t AliTRDSensorArray::GetNGraph () const
226{
227 // return the number of TGraph
228 Int_t nGraph = 0;
229 Int_t nsensors = fSensors->GetEntries();
230
231 for (Int_t isensor = 0; isensor < nsensors; isensor++) {
232 AliDCSSensor *entry = (AliDCSSensor*)fSensors->At(isensor);
233 if (entry->GetGraph () != 0x0)
234 nGraph ++;
235 }
236 return nGraph;
237}
238
239