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