\r
////////////////////////////////////////////////////////////////////////////\r
// //\r
-// The SAX XML file handler used in the preprocessor //\r
+// The SAX XML file handler used in the TRD preprocessor //\r
// //\r
-// Author: //\r
+// Authors: //\r
// Frederick Kramer (kramer@ikf.uni-frankfurt.de) //\r
+// Thomas Bird (thomas@thomasbird.com) //\r
// //\r
////////////////////////////////////////////////////////////////////////////\r
\r
+\r
#include <TList.h>\r
-#include <TXMLAttr.h>\r
-#include <TObjArray.h>\r
#include <TMath.h>\r
-\r
#include "AliLog.h"\r
+#include "Cal/AliTRDCalDCSGTUTgu.h"\r
+#include "Cal/AliTRDCalDCSPTR.h"\r
\r
+#include <TXMLAttr.h>\r
+#include <TObjArray.h>\r
#include "AliTRDSaxHandler.h"\r
#include "AliTRDgeometry.h"\r
-\r
-#include "Cal/AliTRDCalDCS.h"\r
-#include "Cal/AliTRDCalDCSFEE.h"\r
-#include "Cal/AliTRDCalDCSPTR.h"\r
+#include "Cal/AliTRDCalDCSv2.h"\r
+#include "Cal/AliTRDCalDCSFEEv2.h"\r
#include "Cal/AliTRDCalDCSGTU.h"\r
\r
ClassImp(AliTRDSaxHandler)\r
,fDCSFEEObj(0)\r
,fDCSPTRObj(0)\r
,fDCSGTUObj(0)\r
- ,fCalDCSObj(new AliTRDCalDCS())\r
+ ,fCalDCSObj(new AliTRDCalDCSv2())\r
,fLevel1Tag(-2)\r
,fLevel2Tag(-2)\r
,fInsideBoardInfo(false)\r
,fSegment(0)\r
,fBoardInfo(0)\r
{\r
- //\r
// AliTRDSaxHandler default constructor\r
- //\r
fFEEArr->SetOwner();\r
fPTRArr->SetOwner();\r
}\r
,fSegment(0)\r
,fBoardInfo(0)\r
{\r
- //\r
// AliTRDSaxHandler copy constructor\r
- //\r
}\r
\r
//_____________________________________________________________________________\r
AliTRDSaxHandler &AliTRDSaxHandler::operator=(const AliTRDSaxHandler &sh)\r
{\r
- //\r
// Assignment operator\r
- //\r
if (&sh == this) return *this;\r
-\r
new (this) AliTRDSaxHandler(sh);\r
return *this;\r
}\r
//_____________________________________________________________________________\r
AliTRDSaxHandler::~AliTRDSaxHandler()\r
{\r
- //\r
// AliTRDSaxHandler destructor\r
- //\r
-\r
if (fFEEArr) {\r
delete fFEEArr;\r
fFEEArr = 0x0;\r
delete fCalDCSObj;\r
fCalDCSObj = 0x0;\r
}\r
-\r
}\r
\r
//_____________________________________________________________________________\r
-AliTRDCalDCS* AliTRDSaxHandler::GetCalDCSObj()\r
+AliTRDCalDCSv2* AliTRDSaxHandler::GetCalDCSObj()\r
{\r
// put the arrays in the global calibration object and return this\r
fCalDCSObj->SetFEEArr(fFEEArr);\r
}\r
\r
//_____________________________________________________________________________\r
-void AliTRDSaxHandler::OnStartDocument()\r
+void AliTRDSaxHandler::OnStartDocument() const\r
{\r
// if something should happen right at the beginning of the\r
// XML document, this must happen here\r
}\r
\r
//_____________________________________________________________________________\r
-void AliTRDSaxHandler::OnEndDocument()\r
+void AliTRDSaxHandler::OnEndDocument() const\r
{\r
// if something should happen at the end of the XML document\r
// this must be done here\r
bool AliTRDSaxHandler::CompareString(TString str, const char *str2)\r
{\r
// compre strings, ignoring case\r
- return !(bool)str.CompareTo(str2,str.kIgnoreCase);\r
// returns true if they are the same, else false\r
+ return !(bool)str.CompareTo(str2,str.kIgnoreCase);\r
}\r
\r
\r
}\r
\r
if (fSystem == kInsideGTU) {\r
-// cout << "Start: " << tagName << " " << fLevel1Tag << " " << fLevel2Tag << " " << fInsideBoardInfo << "\n";\r
if (CompareString(tagName, "tgu")) fLevel1Tag = kInsideTgu;\r
if (CompareString(tagName, "board_info")) {\r
fInsideBoardInfo = true;\r
} else if (fSystem == kInsideFEE) {\r
if (CompareString(tagName, "gaintbl")) fLevel1Tag = kInsideGainTable;\r
}\r
- \r
\r
// set if we are inside rstate \r
// (in principle not necessary - just to be more safe against stupid tags)\r
}\r
if (CompareString(attribName, "roc") && CompareString(tagName, "ack")) {\r
if (attribValue.Atoi() != fDCSFEEObj->GetDCSid())\r
- fDCSFEEObj->SetStatusBit(3); // consistency check\r
+ fDCSFEEObj->SetStatusBit(4); // consistency check\r
}\r
if (CompareString(attribName, "rob") && CompareString(tagName, "ro-board") && (fInsideRstate == 1)) {\r
fCurrentROB = attribValue.Atoi();\r
}\r
\r
if (fInsideBoardInfo) {\r
-// cout << tagName << ": " << attribName << "=" << attribValue << "\n";\r
if (CompareString(tagName, "board_info") && CompareString(attribName, "board_id")) fBoardInfo->SetId(attribValue);\r
if (CompareString(tagName, "board_info") && CompareString(attribName, "design_type")) fBoardInfo->SetType(attribValue.Atoi());\r
if (CompareString(tagName, "board_info") && CompareString(attribName, "pci_ga")) fBoardInfo->SetPciGa(attribValue.Atoi());\r
// if there is a new DCS element put it in the correct array\r
if (CompareString(tagName, "DCS")) {\r
if (fSystem == kInsideFEE) {\r
- fDCSFEEObj = new AliTRDCalDCSFEE(name,dcsTitle);\r
+ fDCSFEEObj = new AliTRDCalDCSFEEv2();\r
fDCSFEEObj->SetDCSid(dcsId);\r
}\r
if (fSystem == kInsidePTR) {\r
if (fLevel1Tag == kInsideGainTable) {\r
if (CompareString(tagName, "name")) fDCSFEEObj->SetGainTableName(fContent);\r
if (CompareString(tagName, "desc")) fDCSFEEObj->SetGainTableDesc(fContent);\r
- if (CompareString(tagName, "adcdac")) fDCSFEEObj->SetGainTableAdcdac(fCurrentROB, fCurrentMCM, fContent.Atoi());\r
- if (CompareString(tagName, "fgfn")) fDCSFEEObj->SetGainTableFgfn(fCurrentROB, fCurrentMCM, fCurrentADC, fContent.Atoi());\r
- if (CompareString(tagName, "fgan")) fDCSFEEObj->SetGainTableFgan(fCurrentROB, fCurrentMCM, fCurrentADC, fContent.Atoi());\r
+ if (fCurrentROB>=0 && fCurrentMCM>=0) {\r
+ if (CompareString(tagName, "adcdac")) fDCSFEEObj->SetGainTableAdcdac(fCurrentROB, fCurrentMCM, fContent.Atoi());\r
+ if (fCurrentADC>=0) {\r
+ if (CompareString(tagName, "fgfn")) fDCSFEEObj->SetGainTableFgfn(fCurrentROB, fCurrentMCM, fCurrentADC, fContent.Atoi());\r
+ if (CompareString(tagName, "fgan")) fDCSFEEObj->SetGainTableFgan(fCurrentROB, fCurrentMCM, fCurrentADC, fContent.Atoi());\r
+ }\r
+ }\r
}\r
if (fInsideRstate == 1) {\r
if (fCurrentROB>=0 && fCurrentMCM>=0) {\r
}\r
\r
if (fSystem == kInsideGTU) {\r
-// cout << "Close: " << tagName << " " << fLevel1Tag << " " << fLevel2Tag << " " << fInsideBoardInfo << "\n";\r
-\r
// if (CompareString(tagName, "run")) { \r
// fDCSGTUObj->SetSORFlag(TString(fContent(fContent.Length()-1,1)).Atoi());\r
// fDCSGTUObj->SetRunNumber(TString(fContent(0,fContent.Length()-2)).Atoi());\r
}\r
\r
//_____________________________________________________________________________\r
-void AliTRDSaxHandler::OnComment(const char* /*text*/)\r
+void AliTRDSaxHandler::OnComment(const char* /*text*/) const\r
{\r
// comments within the XML file are ignored\r
}\r
}\r
\r
//_____________________________________________________________________________\r
-void AliTRDSaxHandler::OnCdataBlock(const char* /*text*/, Int_t /*len*/)\r
+void AliTRDSaxHandler::OnCdataBlock(const char* /*text*/, Int_t /*len*/) const\r
{\r
// process character data blocks here\r
// not implemented and should not be used here\r