]>
Commit | Line | Data |
---|---|---|
6b36d985 | 1 | /*************************************************************************\r |
2 | * * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *\r | |
3 | * * *\r | |
4 | * * Author: The ALICE Off-line Project. *\r | |
5 | * * Contributors are mentioned in the code where appropriate. *\r | |
6 | * * *\r | |
7 | * * Permission to use, copy, modify and distribute this software and its *\r | |
8 | * * documentation strictly for non-commercial purposes is hereby granted *\r | |
9 | * * without fee, provided that the above copyright notice appears in all *\r | |
10 | * * copies and that both the copyright notice and this permission notice *\r | |
11 | * * appear in the supporting documentation. The authors make no claims *\r | |
12 | * * about the suitability of this software for any purpose. It is *\r | |
13 | * * provided "as is" without express or implied warranty. *\r | |
14 | * **************************************************************************/\r | |
15 | \r | |
16 | /* $Id: AliTRDSaxHandler.cxx 26327 2008-06-02 15:36:18Z cblume $ */\r | |
17 | \r | |
18 | ////////////////////////////////////////////////////////////////////////////\r | |
19 | // //\r | |
20 | // The SAX XML file handler used in the preprocessor //\r | |
21 | // //\r | |
22 | // Author: //\r | |
23 | // Frederick Kramer (kramer@ikf.uni-frankfurt.de) //\r | |
24 | // //\r | |
25 | ////////////////////////////////////////////////////////////////////////////\r | |
26 | \r | |
6b36d985 | 27 | #include <TList.h>\r |
28 | #include <TXMLAttr.h>\r | |
6b36d985 | 29 | #include <TObjArray.h>\r |
dc48fccf | 30 | #include <TMath.h>\r |
6b36d985 | 31 | \r |
32 | #include "AliLog.h"\r | |
33 | \r | |
34 | #include "AliTRDSaxHandler.h"\r | |
35 | #include "AliTRDgeometry.h"\r | |
36 | \r | |
37 | #include "Cal/AliTRDCalDCS.h"\r | |
75bbe3c8 | 38 | #include "Cal/AliTRDCalDCSGTUTgu.h"\r |
6b36d985 | 39 | #include "Cal/AliTRDCalDCSFEE.h"\r |
40 | #include "Cal/AliTRDCalDCSPTR.h"\r | |
41 | #include "Cal/AliTRDCalDCSGTU.h"\r | |
42 | \r | |
43 | ClassImp(AliTRDSaxHandler)\r | |
6af58a56 | 44 | \r |
6b36d985 | 45 | //_____________________________________________________________________________\r |
46 | AliTRDSaxHandler::AliTRDSaxHandler()\r | |
47 | :TObject()\r | |
48 | ,fHandlerStatus(0)\r | |
49 | ,fNDCSPTR(0)\r | |
50 | ,fNDCSGTU(0)\r | |
51 | ,fFEEArr(new TObjArray(540))\r | |
52 | ,fPTRArr(new TObjArray(6))\r | |
6b36d985 | 53 | ,fSystem(0)\r |
6af58a56 | 54 | ,fInsideRstate(0)\r |
6b36d985 | 55 | ,fCurrentSM(0)\r |
56 | ,fCurrentStack(0)\r | |
6af58a56 | 57 | ,fCurrentROB(-1)\r |
58 | ,fCurrentMCM(-1)\r | |
3821ce70 | 59 | ,fCurrentADC(-1)\r |
6b36d985 | 60 | ,fContent(0)\r |
61 | ,fDCSFEEObj(0)\r | |
62 | ,fDCSPTRObj(0)\r | |
63 | ,fDCSGTUObj(0)\r | |
64 | ,fCalDCSObj(new AliTRDCalDCS())\r | |
3821ce70 | 65 | ,fLevel1Tag(-2)\r |
66 | ,fLevel2Tag(-2)\r | |
67 | ,fInsideBoardInfo(false)\r | |
68 | ,fTmu(0)\r | |
69 | ,fCtpOpc(0)\r | |
70 | ,fSegment(0)\r | |
71 | ,fBoardInfo(0)\r | |
6b36d985 | 72 | {\r |
73 | //\r | |
74 | // AliTRDSaxHandler default constructor\r | |
75 | //\r | |
76 | fFEEArr->SetOwner();\r | |
77 | fPTRArr->SetOwner();\r | |
6b36d985 | 78 | }\r |
79 | \r | |
80 | //_____________________________________________________________________________\r | |
81 | AliTRDSaxHandler::AliTRDSaxHandler(const AliTRDSaxHandler &sh)\r | |
82 | :TObject(sh)\r | |
83 | ,fHandlerStatus(0)\r | |
84 | ,fNDCSPTR(0)\r | |
85 | ,fNDCSGTU(0)\r | |
86 | ,fFEEArr(0)\r | |
87 | ,fPTRArr(0)\r | |
6b36d985 | 88 | ,fSystem(0)\r |
6af58a56 | 89 | ,fInsideRstate(0)\r |
6b36d985 | 90 | ,fCurrentSM(0)\r |
91 | ,fCurrentStack(0)\r | |
6af58a56 | 92 | ,fCurrentROB(-1)\r |
93 | ,fCurrentMCM(-1)\r | |
3821ce70 | 94 | ,fCurrentADC(-1)\r |
6b36d985 | 95 | ,fContent(0)\r |
96 | ,fDCSFEEObj(0)\r | |
97 | ,fDCSPTRObj(0)\r | |
98 | ,fDCSGTUObj(0)\r | |
99 | ,fCalDCSObj(0)\r | |
3821ce70 | 100 | ,fLevel1Tag(-2)\r |
101 | ,fLevel2Tag(-2)\r | |
102 | ,fInsideBoardInfo(false)\r | |
103 | ,fTmu(0)\r | |
104 | ,fCtpOpc(0)\r | |
105 | ,fSegment(0)\r | |
106 | ,fBoardInfo(0)\r | |
6b36d985 | 107 | {\r |
108 | //\r | |
109 | // AliTRDSaxHandler copy constructor\r | |
110 | //\r | |
111 | }\r | |
112 | \r | |
113 | //_____________________________________________________________________________\r | |
114 | AliTRDSaxHandler &AliTRDSaxHandler::operator=(const AliTRDSaxHandler &sh)\r | |
115 | {\r | |
116 | //\r | |
117 | // Assignment operator\r | |
118 | //\r | |
119 | if (&sh == this) return *this;\r | |
120 | \r | |
121 | new (this) AliTRDSaxHandler(sh);\r | |
122 | return *this;\r | |
123 | }\r | |
124 | \r | |
125 | //_____________________________________________________________________________\r | |
126 | AliTRDSaxHandler::~AliTRDSaxHandler()\r | |
127 | {\r | |
128 | //\r | |
129 | // AliTRDSaxHandler destructor\r | |
130 | //\r | |
131 | \r | |
132 | if (fFEEArr) {\r | |
133 | delete fFEEArr;\r | |
134 | fFEEArr = 0x0;\r | |
135 | }\r | |
136 | if (fPTRArr) {\r | |
137 | delete fPTRArr;\r | |
138 | fPTRArr = 0x0;\r | |
139 | }\r | |
3821ce70 | 140 | if (fDCSGTUObj) {\r |
141 | delete fDCSGTUObj;\r | |
142 | fDCSGTUObj = 0x0;\r | |
6b36d985 | 143 | }\r |
144 | if (fCalDCSObj) {\r | |
145 | delete fCalDCSObj;\r | |
146 | fCalDCSObj = 0x0;\r | |
147 | }\r | |
148 | \r | |
149 | }\r | |
150 | \r | |
151 | //_____________________________________________________________________________\r | |
152 | AliTRDCalDCS* AliTRDSaxHandler::GetCalDCSObj()\r | |
153 | {\r | |
154 | // put the arrays in the global calibration object and return this\r | |
6b36d985 | 155 | fCalDCSObj->SetFEEArr(fFEEArr);\r |
156 | fCalDCSObj->SetPTRArr(fPTRArr);\r | |
3821ce70 | 157 | fCalDCSObj->SetGTUObj(fDCSGTUObj);\r |
6b36d985 | 158 | return fCalDCSObj;\r |
159 | }\r | |
160 | \r | |
161 | //_____________________________________________________________________________\r | |
162 | void AliTRDSaxHandler::OnStartDocument()\r | |
163 | {\r | |
164 | // if something should happen right at the beginning of the\r | |
165 | // XML document, this must happen here\r | |
166 | }\r | |
167 | \r | |
168 | //_____________________________________________________________________________\r | |
169 | void AliTRDSaxHandler::OnEndDocument()\r | |
170 | {\r | |
171 | // if something should happen at the end of the XML document\r | |
172 | // this must be done here\r | |
173 | }\r | |
174 | \r | |
3821ce70 | 175 | //_____________________________________________________________________________\r |
176 | bool AliTRDSaxHandler::CompareString(TString str, const char *str2)\r | |
177 | {\r | |
178 | // compre strings, ignoring case\r | |
179 | return !(bool)str.CompareTo(str2,str.kIgnoreCase);\r | |
180 | // returns true if they are the same, else false\r | |
181 | }\r | |
182 | \r | |
183 | \r | |
6b36d985 | 184 | //_____________________________________________________________________________\r |
185 | void AliTRDSaxHandler::OnStartElement(const char *name, const TList *attributes)\r | |
186 | {\r | |
187 | // when a new XML element is found, it is processed here\r | |
3821ce70 | 188 | fContent = ""; // Technically <p> This <em>is</em> ok but would be a problem here</p>\r |
6b36d985 | 189 | Int_t dcsId = 0;\r |
3821ce70 | 190 | TString tagName = name;\r |
6b36d985 | 191 | TString dcsTitle = "";\r |
192 | \r | |
193 | // set the current system if necessary\r | |
3821ce70 | 194 | if (CompareString(tagName, "FEE")) fSystem = kInsideFEE;\r |
195 | if (CompareString(tagName, "PTR")) fSystem = kInsidePTR;\r | |
196 | if (CompareString(tagName, "GTU")) {\r | |
197 | fSystem = kInsideGTU;\r | |
198 | fDCSGTUObj = new AliTRDCalDCSGTU(tagName,tagName);\r | |
199 | }\r | |
200 | \r | |
201 | if (fSystem == kInsideGTU) {\r | |
202 | // cout << "Start: " << tagName << " " << fLevel1Tag << " " << fLevel2Tag << " " << fInsideBoardInfo << "\n";\r | |
203 | if (CompareString(tagName, "tgu")) fLevel1Tag = kInsideTgu;\r | |
204 | if (CompareString(tagName, "board_info")) {\r | |
205 | fInsideBoardInfo = true;\r | |
206 | fBoardInfo = new AliTRDCalDCSGTUBoardInfo(tagName,tagName);\r | |
207 | }\r | |
208 | if (CompareString(tagName(0,tagName.Length()-3), "segment")) { \r | |
209 | fSegment = new AliTRDCalDCSGTUSegment(tagName,tagName);\r | |
210 | fSegment->SetId(TString(tagName(8,2)).Atoi());\r | |
211 | fLevel1Tag = kInsideSegment;\r | |
212 | }\r | |
213 | if (fLevel1Tag == kInsideTgu) {\r | |
214 | if (CompareString(tagName, "ctp_opc")) fCtpOpc = new AliTRDCalDCSGTUCtpOpc(tagName,tagName);\r | |
215 | } else if (fLevel1Tag == kInsideSegment) {\r | |
216 | if (CompareString(tagName, "smu")) {\r | |
217 | fLevel2Tag = kInsideSmu;\r | |
218 | }\r | |
219 | if (CompareString(tagName(0,3), "tmu")) {\r | |
220 | fTmu = new AliTRDCalDCSGTUTmu(tagName,tagName);\r | |
221 | fTmu->SetId(TString(tagName(4,2)).Atoi());\r | |
222 | fLevel2Tag = kInsideTmu;\r | |
223 | }\r | |
224 | }\r | |
225 | } else if (fSystem == kInsideFEE) {\r | |
226 | if (CompareString(tagName, "gaintbl")) fLevel1Tag = kInsideGainTable;\r | |
227 | }\r | |
228 | \r | |
6b36d985 | 229 | \r |
6af58a56 | 230 | // set if we are inside rstate \r |
231 | // (in principle not necessary - just to be more safe against stupid tags)\r | |
3821ce70 | 232 | if (CompareString(tagName, "rstate")) fInsideRstate = 1;\r |
6af58a56 | 233 | \r |
6b36d985 | 234 | // get the attributes of the element\r |
235 | TXMLAttr *attr;\r | |
236 | TIter next(attributes);\r | |
237 | while ((attr = (TXMLAttr*) next())) {\r | |
238 | TString attribName = attr->GetName();\r | |
3821ce70 | 239 | TString attribValue = attr->GetValue();\r |
240 | if (fSystem == kInsideFEE && fLevel1Tag == kInsideNone) {\r | |
241 | if (CompareString(attribName, "id") && CompareString(tagName, "DCS")) {\r | |
242 | dcsTitle = name;\r | |
243 | dcsId = atoi(attr->GetValue());\r | |
244 | }\r | |
245 | if (CompareString(attribName, "roc") && CompareString(tagName, "ack")) {\r | |
246 | if (attribValue.Atoi() != fDCSFEEObj->GetDCSid())\r | |
247 | fDCSFEEObj->SetStatusBit(3); // consistency check\r | |
248 | }\r | |
249 | if (CompareString(attribName, "rob") && CompareString(tagName, "ro-board") && (fInsideRstate == 1)) {\r | |
250 | fCurrentROB = attribValue.Atoi();\r | |
251 | }\r | |
252 | if (CompareString(attribName, "mcm") && CompareString(tagName, "m") && (fInsideRstate == 1)) {\r | |
253 | fCurrentMCM = attribValue.Atoi();\r | |
254 | }\r | |
255 | if (CompareString(attribName, "sm") && CompareString(tagName, "DCS")) {\r | |
256 | fCurrentSM = attribValue.Atoi(); // only for GTU/PTR\r | |
257 | }\r | |
258 | if (CompareString(attribName, "id") && CompareString(tagName, "STACK")) {// hmmmm not exist?\r | |
259 | fCurrentStack = attribValue.Atoi(); // only for GTU/PTR\r | |
260 | }\r | |
261 | } else if (fSystem == kInsideFEE && fLevel1Tag == kInsideGainTable) {\r | |
262 | if (CompareString(tagName, "roc") && CompareString(attribName, "type")) fDCSFEEObj->SetGainTableRocType(attribValue);\r | |
263 | if (CompareString(tagName, "roc") && CompareString(attribName, "serial")) fDCSFEEObj->SetGainTableRocSerial(attribValue.Atoi());\r | |
264 | if (CompareString(tagName, "mcm") && CompareString(attribName, "rob")) fCurrentROB = attribValue.Atoi();\r | |
265 | if (CompareString(tagName, "mcm") && CompareString(attribName, "pos")) fCurrentMCM = attribValue.Atoi();\r | |
266 | if (CompareString(tagName, "adc") && CompareString(attribName, "id")) fCurrentADC = attribValue.Atoi();\r | |
267 | \r | |
268 | } else if (fSystem == kInsideGTU && fLevel1Tag == kInsideNone) {\r | |
269 | if (CompareString(tagName, "publisher")) {\r | |
270 | if (CompareString(attribName, "at")) fDCSGTUObj->SetSORFlag(attribValue.Atoi());\r | |
271 | if (CompareString(attribName, "serial")) fDCSGTUObj->SetSerial(attribValue.Atoi());\r | |
272 | if (CompareString(attribName, "runnr")) fDCSGTUObj->SetRunNumber(attribValue.Atoi());\r | |
273 | }\r | |
274 | } else if (fSystem == kInsideGTU && fLevel1Tag == kInsideTgu) {\r | |
275 | if (CompareString(tagName, "from")) {\r | |
276 | if (CompareString(attribName, "at")) fDCSGTUObj->GetTgu()->SetFromSORFlag(attribValue.Atoi());\r | |
277 | if (CompareString(attribName, "runnr")) fDCSGTUObj->GetTgu()->SetFromRunNumber(attribValue.Atoi());\r | |
278 | if (CompareString(attribName, "child")) fDCSGTUObj->GetTgu()->SetFromChild(attribValue.Atoi());\r | |
279 | }\r | |
280 | if (CompareString(tagName, "segmentmask") && CompareString(attribName, "value")) fDCSGTUObj->GetTgu()->SetSegmentMask(attribValue);\r | |
281 | if (CompareString(tagName, "busymask") && CompareString(attribName, "value")) fDCSGTUObj->GetTgu()->SetBusyMask(attribValue);\r | |
282 | if (CompareString(tagName, "contribmask") && CompareString(attribName, "value")) fDCSGTUObj->GetTgu()->SetContribMask(attribValue);\r | |
283 | \r | |
284 | if (CompareString(tagName, "ctp_opc") && CompareString(attribName, "id")) fCtpOpc->SetId(attribValue.Atoi());\r | |
285 | if (CompareString(tagName, "ctp_opc") && CompareString(attribName, "opcode")) fCtpOpc->SetOpcode(attribValue.Atoi());\r | |
286 | if (CompareString(tagName, "ctp_opc") && CompareString(attribName, "direction")) fCtpOpc->SetDirection(attribValue.Atoi());\r | |
287 | if (CompareString(tagName, "ctp_opc") && CompareString(attribName, "inverted")) fCtpOpc->SetInverted(attribValue.Atoi());\r | |
288 | if (CompareString(tagName, "ctp_opc") && CompareString(attribName, "delay")) fCtpOpc->SetDelay(attribValue.Atoi());\r | |
289 | if (CompareString(tagName, "ctp_opc") && CompareString(attribName, "connected")) fCtpOpc->SetConnected(attribValue.Atoi());\r | |
290 | \r | |
291 | } else if (fSystem == kInsideGTU && fLevel1Tag == kInsideSegment) {\r | |
292 | if (CompareString(tagName, "from")) {\r | |
293 | if (CompareString(attribName, "at")) fSegment->SetFromSORFlag(attribValue.Atoi());\r | |
294 | if (CompareString(attribName, "runnr")) fSegment->SetFromRunNumber(attribValue.Atoi());\r | |
295 | if (CompareString(attribName, "child")) fSegment->SetFromChild(attribValue.Atoi());\r | |
296 | }\r | |
297 | if (fLevel2Tag == kInsideSmu) {\r | |
298 | if (CompareString(tagName, "stackmask") && CompareString(attribName, "value")) fSegment->SetSmuStackMask(attribValue);\r | |
299 | if (CompareString(tagName, "tracklets") && CompareString(attribName, "send")) fSegment->SetSmuTracklets(attribValue.Atoi());\r | |
300 | if (CompareString(tagName, "tracks") && CompareString(attribName, "send")) fSegment->SetSmuTracks(attribValue.Atoi());\r | |
301 | if (CompareString(tagName, "idelay") && CompareString(attribName, "value")) fSegment->SetSmuIdelay(attribValue.Atoi());\r | |
302 | if (CompareString(tagName, "ttc_emulator") && CompareString(attribName, "enable")) fSegment->SetSmuTtcEmulatorEnable(attribValue.Atoi());\r | |
303 | \r | |
304 | if (CompareString(tagName, "trigger_window") && CompareString(attribName, "l1_low")) \r | |
305 | fSegment->SetSmuTriggerWindowL1Low(attribValue.Atoi());\r | |
306 | if (CompareString(tagName, "trigger_window") && CompareString(attribName, "l1_high")) \r | |
307 | fSegment->SetSmuTriggerWindowL1High(attribValue.Atoi());\r | |
308 | if (CompareString(tagName, "trigger_window") && CompareString(attribName, "l2_low")) \r | |
309 | fSegment->SetSmuTriggerWindowL2Low(attribValue.Atoi());\r | |
310 | if (CompareString(tagName, "trigger_window") && CompareString(attribName, "l2_high")) \r | |
311 | fSegment->SetSmuTriggerWindowL2High(attribValue.Atoi());\r | |
312 | \r | |
313 | } else if (fLevel2Tag == kInsideTmu) {\r | |
314 | if (CompareString(tagName, "linkmask") && CompareString(attribName, "value")) fTmu->SetLinkMask(attribValue);\r | |
315 | if (CompareString(tagName, "pattern_generator") && CompareString(attribName, "enable")) \r | |
316 | fTmu->SetPatternGeneratorEnable(attribValue.Atoi());\r | |
317 | if (CompareString(tagName, "pattern_generator") && CompareString(attribName, "datawords")) \r | |
318 | fTmu->SetPatternGeneratorDataWords(attribValue.Atoi());\r | |
319 | if (CompareString(tagName, "pattern_generator") && CompareString(attribName, "trackletwords")) \r | |
320 | fTmu->SetPatternGeneratorTrackletWords(attribValue.Atoi());\r | |
321 | }\r | |
6b36d985 | 322 | }\r |
3821ce70 | 323 | \r |
324 | if (fInsideBoardInfo) {\r | |
325 | // cout << tagName << ": " << attribName << "=" << attribValue << "\n";\r | |
326 | if (CompareString(tagName, "board_info") && CompareString(attribName, "board_id")) fBoardInfo->SetId(attribValue);\r | |
327 | if (CompareString(tagName, "board_info") && CompareString(attribName, "design_type")) fBoardInfo->SetType(attribValue.Atoi());\r | |
328 | if (CompareString(tagName, "board_info") && CompareString(attribName, "pci_ga")) fBoardInfo->SetPciGa(attribValue.Atoi());\r | |
329 | if (CompareString(tagName, "hardware") && CompareString(attribName, "date")) fBoardInfo->SetHwDate(attribValue);\r | |
330 | if (CompareString(tagName, "hardware") && CompareString(attribName, "rev")) fBoardInfo->SetHwRev(attribValue.Atoi());\r | |
331 | if (CompareString(tagName, "hardware") && CompareString(attribName, "clean")) fBoardInfo->SetHwClean(attribValue.Atoi());\r | |
332 | if (CompareString(tagName, "software") && CompareString(attribName, "date")) fBoardInfo->SetSwDate(attribValue);\r | |
333 | if (CompareString(tagName, "software") && CompareString(attribName, "rev")) fBoardInfo->SetSwRev(attribValue.Atoi());\r | |
334 | if (CompareString(tagName, "software") && CompareString(attribName, "clean")) fBoardInfo->SetSwClean(attribValue.Atoi());\r | |
6b36d985 | 335 | }\r |
336 | }\r | |
337 | \r | |
338 | // if there is a new DCS element put it in the correct array\r | |
3821ce70 | 339 | if (CompareString(tagName, "DCS")) {\r |
6b36d985 | 340 | if (fSystem == kInsideFEE) {\r |
341 | fDCSFEEObj = new AliTRDCalDCSFEE(name,dcsTitle);\r | |
342 | fDCSFEEObj->SetDCSid(dcsId);\r | |
343 | }\r | |
344 | if (fSystem == kInsidePTR) {\r | |
3821ce70 | 345 | // fDCSPTRObj = new AliTRDCalDCSPTR(name,dcsTitle);\r |
346 | // fDCSPTRObj->SetDCSid(dcsId);\r | |
6b36d985 | 347 | }\r |
348 | if (fSystem == kInsideGTU) {\r | |
3821ce70 | 349 | // fDCSGTUObj = new AliTRDCalDCSGTU(name,dcsTitle);\r |
350 | // fDCSGTUObj->SetDCSid(dcsId);\r | |
6b36d985 | 351 | }\r |
352 | }\r | |
353 | }\r | |
354 | \r | |
355 | //_____________________________________________________________________________\r | |
356 | void AliTRDSaxHandler::OnEndElement(const char *name)\r | |
357 | {\r | |
358 | // do everything that needs to be done when an end tag of an element is found\r | |
3821ce70 | 359 | TString tagName = name;\r |
6b36d985 | 360 | \r |
361 | // if done with this DCS board, put it in the correct array\r | |
362 | // no check for </ack> necessary since this check is done during XML validation\r | |
3821ce70 | 363 | if (CompareString(tagName, "DCS")) {\r |
6b36d985 | 364 | if (fSystem == kInsideFEE) {\r |
365 | Int_t detID = 0;\r | |
366 | if (fDCSFEEObj->GetStatusBit() == 0) {\r | |
367 | // if there were no errors (StatusBit==0) the following should match\r | |
368 | detID = fDCSFEEObj->GetDCSid();\r | |
369 | AliTRDgeometry aliGeo;\r | |
370 | Int_t calDetID = aliGeo.GetDetector(fDCSFEEObj->GetLayer(),\r | |
371 | fDCSFEEObj->GetStack(),\r | |
372 | fDCSFEEObj->GetSM());\r | |
373 | if (detID != calDetID) fDCSFEEObj->SetStatusBit(4);\r | |
374 | } else {\r | |
375 | // if the dcs board didn't properly respond, don't compare\r | |
376 | detID = fDCSFEEObj->GetDCSid();\r | |
377 | }\r | |
378 | fFEEArr->AddAt(fDCSFEEObj,detID);\r | |
379 | }\r | |
380 | if (fSystem == kInsidePTR) {\r | |
381 | fPTRArr->AddAt(fDCSPTRObj,fNDCSPTR);\r | |
382 | fNDCSPTR++;\r | |
383 | }\r | |
3821ce70 | 384 | // if (fSystem == kInsideGTU) {\r |
385 | // fGTUArr->AddAt(fDCSGTUObj,fNDCSGTU);\r | |
386 | // fNDCSGTU++;\r | |
387 | // }\r | |
6b36d985 | 388 | fCurrentSM = 99; // 99 for no SM set\r |
389 | fDCSFEEObj = 0; // just to be sure\r | |
390 | return;\r | |
391 | }\r | |
392 | \r | |
3821ce70 | 393 | // done with this stack? \r |
394 | if (CompareString(tagName, "STACK")) {// TODO: errrrm ???? always 99?\r | |
6b36d985 | 395 | fCurrentStack = 99; // 99 for no stack set\r |
396 | }\r | |
397 | \r | |
6af58a56 | 398 | // outside of rstate again?\r |
3821ce70 | 399 | if (CompareString(tagName, "rstate")) {\r |
6af58a56 | 400 | fInsideRstate = 0;\r |
401 | fCurrentROB = -1;\r | |
402 | fCurrentMCM = -1;\r | |
403 | }\r | |
3821ce70 | 404 | if (CompareString(tagName, "ro-board")) fCurrentROB = -1;\r |
6af58a56 | 405 | \r |
6b36d985 | 406 | // store informations of the FEE DCS-Board\r |
407 | if (fSystem == kInsideFEE) {\r | |
3821ce70 | 408 | if (CompareString(tagName, "DNR")) fDCSFEEObj->SetStatusBit(fContent.Atoi());\r |
409 | if (CompareString(tagName, "CFGNME")) fDCSFEEObj->SetConfigName(fContent);\r | |
410 | if (CompareString(tagName, "CFGTAG")) fDCSFEEObj->SetConfigTag(fContent.Atoi());\r | |
411 | if (CompareString(tagName, "CFGVRSN")) fDCSFEEObj->SetConfigVersion(fContent);\r | |
412 | if (CompareString(tagName, "NTB")) fDCSFEEObj->SetNumberOfTimeBins(fContent.Atoi());\r | |
413 | if (CompareString(tagName, "SM-ID")) fDCSFEEObj->SetSM(fContent.Atoi());\r | |
414 | if (CompareString(tagName, "STACK-ID")) fDCSFEEObj->SetStack(fContent.Atoi());\r | |
415 | if (CompareString(tagName, "LAYER-ID")) fDCSFEEObj->SetLayer(fContent.Atoi());\r | |
416 | if (CompareString(tagName, "SINGLEHITTHRES")) fDCSFEEObj->SetSingleHitThres(fContent.Atoi());\r | |
417 | if (CompareString(tagName, "THRPADCLSTHRS")) fDCSFEEObj->SetThreePadClustThres(fContent.Atoi());\r | |
418 | if (CompareString(tagName, "SELNOZS")) fDCSFEEObj->SetSelectiveNoZS(fContent.Atoi());\r | |
419 | if (CompareString(tagName, "FASTSTATNOISE")) fDCSFEEObj->SetFastStatNoise(fContent.Atoi());\r | |
420 | if (CompareString(tagName, "FILTWEIGHT")) fDCSFEEObj->SetTCFilterWeight(fContent.Atoi());\r | |
421 | if (CompareString(tagName, "FILTSHRTDCYPRM")) fDCSFEEObj->SetTCFilterShortDecPar(fContent.Atoi());\r | |
422 | if (CompareString(tagName, "FILTLNGDCYPRM")) fDCSFEEObj->SetTCFilterLongDecPar(fContent.Atoi());\r | |
423 | if (CompareString(tagName, "FLTR")) fDCSFEEObj->SetFilterType(fContent);\r | |
424 | if (CompareString(tagName, "READOUTPAR")) fDCSFEEObj->SetReadoutParam(fContent);\r | |
425 | if (CompareString(tagName, "TESTPATTERN")) fDCSFEEObj->SetTestPattern(fContent);\r | |
426 | if (CompareString(tagName, "TRCKLTMODE")) fDCSFEEObj->SetTrackletMode(fContent);\r | |
427 | if (CompareString(tagName, "TRCKLTDEF")) fDCSFEEObj->SetTrackletDef(fContent);\r | |
428 | if (CompareString(tagName, "TRIGGERSETUP")) fDCSFEEObj->SetTriggerSetup(fContent);\r | |
429 | if (CompareString(tagName, "ADDOPTIONS")) fDCSFEEObj->SetAddOptions(fContent);\r | |
430 | if (CompareString(tagName, "gaintbl")) {\r | |
431 | fLevel1Tag = kInsideNone;\r | |
432 | fCurrentROB = -1;\r | |
433 | fCurrentMCM = -1;\r | |
434 | fCurrentADC = -1;\r | |
435 | }\r | |
436 | if (fLevel1Tag == kInsideGainTable) {\r | |
437 | if (CompareString(tagName, "name")) fDCSFEEObj->SetGainTableName(fContent);\r | |
438 | if (CompareString(tagName, "desc")) fDCSFEEObj->SetGainTableDesc(fContent);\r | |
439 | if (CompareString(tagName, "adcdac")) fDCSFEEObj->SetGainTableAdcdac(fCurrentROB, fCurrentMCM, fContent.Atoi());\r | |
440 | if (CompareString(tagName, "fgfn")) fDCSFEEObj->SetGainTableFgfn(fCurrentROB, fCurrentMCM, fCurrentADC, fContent.Atoi());\r | |
441 | if (CompareString(tagName, "fgan")) fDCSFEEObj->SetGainTableFgan(fCurrentROB, fCurrentMCM, fCurrentADC, fContent.Atoi());\r | |
442 | }\r | |
6af58a56 | 443 | if (fInsideRstate == 1) {\r |
444 | if (fCurrentROB>=0 && fCurrentMCM>=0) {\r | |
3821ce70 | 445 | if (CompareString(tagName, "gsm")) fDCSFEEObj->SetMCMGlobalState(fCurrentROB, fCurrentMCM, fContent.Atoi());\r |
446 | if (CompareString(tagName, "ni")) fDCSFEEObj->SetMCMStateNI(fCurrentROB, fCurrentMCM, fContent.Atoi());\r | |
447 | if (CompareString(tagName, "ev")) fDCSFEEObj->SetMCMEventCnt(fCurrentROB, fCurrentMCM, fContent.Atoi());\r | |
448 | if (CompareString(tagName, "ptrg")) fDCSFEEObj->SetMCMPtCnt(fCurrentROB, fCurrentMCM, fContent.Atoi());\r | |
449 | }\r | |
450 | }\r | |
451 | }\r | |
452 | \r | |
453 | if (fSystem == kInsideGTU) {\r | |
454 | // cout << "Close: " << tagName << " " << fLevel1Tag << " " << fLevel2Tag << " " << fInsideBoardInfo << "\n";\r | |
455 | \r | |
456 | // if (CompareString(tagName, "run")) { \r | |
457 | // fDCSGTUObj->SetSORFlag(TString(fContent(fContent.Length()-1,1)).Atoi());\r | |
458 | // fDCSGTUObj->SetRunNumber(TString(fContent(0,fContent.Length()-2)).Atoi());\r | |
459 | // }\r | |
460 | // if (CompareString(tagName, "serial")) fDCSGTUObj->SetSerial(fContent.Atoi());\r | |
461 | if (CompareString(tagName, "board_info")) {\r | |
462 | fInsideBoardInfo = false;\r | |
463 | if (fLevel1Tag == kInsideTgu) fDCSGTUObj->GetTgu()->SetBoardInfo(fBoardInfo);\r | |
464 | if (fLevel1Tag == kInsideSegment && fLevel2Tag == kInsideSmu) fSegment->SetSmuBoardInfo(fBoardInfo);\r | |
465 | if (fLevel1Tag == kInsideSegment && fLevel2Tag == kInsideTmu) fTmu->SetBoardInfo(fBoardInfo);\r | |
466 | }\r | |
467 | if (CompareString(tagName, "dnr")) fDCSGTUObj->SetDNR(fContent.Atoi());\r | |
468 | if (CompareString(tagName, "tgu")) fLevel1Tag = kInsideNone;\r | |
469 | if (CompareString(tagName(0,tagName.Length()-3), "segment")) { \r | |
470 | fDCSGTUObj->GetSegmentArray()->Add(fSegment);\r | |
471 | fLevel1Tag = kInsideNone;\r | |
472 | }\r | |
473 | if (fLevel1Tag == kInsideTgu) {\r | |
474 | if (CompareString(tagName, "ctp_opc")) fDCSGTUObj->GetTgu()->GetCtpOpcArray()->Add(fCtpOpc);\r | |
475 | } else if (fLevel1Tag == kInsideSegment) {\r | |
476 | if (CompareString(tagName, "smu")) fLevel2Tag = kInsideNone;\r | |
477 | if (CompareString(tagName(0,3), "tmu")) {\r | |
478 | fSegment->GetTmuArray()->Add(fTmu);\r | |
479 | fLevel2Tag = kInsideNone;\r | |
6af58a56 | 480 | }\r |
481 | }\r | |
6b36d985 | 482 | }\r |
483 | \r | |
484 | \r | |
485 | // store pretrigger informations\r | |
486 | if (fSystem == kInsidePTR) {\r | |
487 | // no informations available yet\r | |
488 | }\r | |
3821ce70 | 489 | // // store GTU informations\r |
490 | // if (fSystem == kInsideGTU) {\r | |
491 | // if (CompareString(tagName, "SMMASK"))\r | |
492 | // fHandlerStatus = fDCSGTUObj->SetSMMask(fContent);\r | |
493 | // if (CompareString(tagName, "LINKMASK")) \r | |
494 | // fHandlerStatus = fDCSGTUObj->SetLinkMask(fCurrentSM, fCurrentStack, fContent);\r | |
495 | // if (CompareString(tagName, "STMASK"))\r | |
496 | // fDCSGTUObj->SetStackMaskBit(fCurrentSM, fCurrentStack, fContent.Atoi());\r | |
497 | // }\r | |
6b36d985 | 498 | }\r |
499 | \r | |
500 | //_____________________________________________________________________________\r | |
501 | void AliTRDSaxHandler::OnCharacters(const char *characters)\r | |
502 | {\r | |
503 | // copy the the text content of an XML element\r | |
504 | fContent = characters;\r | |
505 | }\r | |
506 | \r | |
507 | //_____________________________________________________________________________\r | |
508 | void AliTRDSaxHandler::OnComment(const char* /*text*/)\r | |
509 | {\r | |
510 | // comments within the XML file are ignored\r | |
511 | }\r | |
512 | \r | |
513 | //_____________________________________________________________________________\r | |
514 | void AliTRDSaxHandler::OnWarning(const char *text)\r | |
515 | {\r | |
516 | // process warnings here\r | |
517 | AliInfo(Form("Warning: %s",text));\r | |
518 | }\r | |
519 | \r | |
520 | //_____________________________________________________________________________\r | |
521 | void AliTRDSaxHandler::OnError(const char *text)\r | |
522 | {\r | |
523 | // process errors here\r | |
524 | AliError(Form("Error: %s",text));\r | |
525 | }\r | |
526 | \r | |
527 | //_____________________________________________________________________________\r | |
528 | void AliTRDSaxHandler::OnFatalError(const char *text)\r | |
529 | {\r | |
530 | // process fatal errors here\r | |
531 | AliError(Form("Fatal error: %s",text)); // use AliFatal?\r | |
532 | }\r | |
533 | \r | |
534 | //_____________________________________________________________________________\r | |
535 | void AliTRDSaxHandler::OnCdataBlock(const char* /*text*/, Int_t /*len*/)\r | |
536 | {\r | |
537 | // process character data blocks here\r | |
538 | // not implemented and should not be used here\r | |
539 | }\r | |
540 | \r |