\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/AliTRDCalDCSGTUTgu.h"\r
#include "Cal/AliTRDCalDCSFEE.h"\r
-#include "Cal/AliTRDCalDCSPTR.h"\r
#include "Cal/AliTRDCalDCSGTU.h"\r
\r
ClassImp(AliTRDSaxHandler)\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
}\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
\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
}\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
// //
////////////////////////////////////////////////////////////////////////////
+
#include "TObject.h"
#include "Cal/AliTRDCalDCSGTUCtpOpc.h"
#include "Cal/AliTRDCalDCSGTUBoardInfo.h"
#include "Cal/AliTRDCalDCSGTUSegment.h"
-#include "Cal/AliTRDCalDCSGTUTmu.h"
+#include "Cal/AliTRDCalDCSGTUTmu.h"
class TObjArray;
-
class AliTRDCalDCS;
class AliTRDCalDCSFEE;
class AliTRDCalDCSPTR;
class AliTRDCalDCSGTU;
+
class AliTRDSaxHandler : public TObject {
public:
Int_t GetHandlerStatus() const { return fHandlerStatus; }
// functions for all possible events
- void OnStartDocument();
- void OnEndDocument();
+ void OnStartDocument() const;
+ void OnEndDocument() const;
void OnStartElement(const char *name, const TList *attributes);
void OnEndElement(const char *name);
void OnCharacters(const char *name);
- void OnComment(const char *name);
+ void OnComment(const char *name) const;
void OnWarning(const char *name);
void OnError(const char *name);
void OnFatalError(const char *name);
- void OnCdataBlock(const char *name, Int_t len);
+ void OnCdataBlock(const char *name, Int_t len) const;
private:
bool CompareString(TString str, const char *str2);
- Int_t fHandlerStatus; // 0: everything OK, >0: error
- Int_t fNDCSPTR; // number of current PTR unit (to be abandonned soon)
- Int_t fNDCSGTU; // number of current GTU unit (to be abandonned soon)
- TObjArray* fFEEArr; // array of AliTRDCalDCSFEE objects
- TObjArray* fPTRArr; // array of AliTRDCalDCSPTR objects
+ Int_t fHandlerStatus; // 0: everything OK, >0: error
+ Int_t fNDCSPTR; // number of current PTR unit (to be abandonned soon)
+ Int_t fNDCSGTU; // number of current GTU unit (to be abandonned soon)
+ TObjArray* fFEEArr; // array of AliTRDCalDCSFEE objects
+ TObjArray* fPTRArr; // array of AliTRDCalDCSPTR objects
// TObjArray* fGTUArr; // array of AliTRDCalDCSGTU objects
- Int_t fSystem; // current system (FEE/PTR/GTU)
- Int_t fInsideRstate; // if we are inside rstate
- Int_t fCurrentSM; // current supermodule
- Int_t fCurrentStack; // current stack
- Int_t fCurrentROB; // current ROB during processing
- Int_t fCurrentMCM; // current MCM
- Int_t fCurrentADC; // current ADC
- TString fContent; // content of the xml element (text)
- AliTRDCalDCSFEE* fDCSFEEObj; // the calib object for one FEE DCS board
- AliTRDCalDCSPTR* fDCSPTRObj; // the calib object for one PTR DCS board
- AliTRDCalDCSGTU* fDCSGTUObj; // the calib object for one GTU DCS board
- AliTRDCalDCS* fCalDCSObj; // the complete calib obj containing all inform.
- Int_t fLevel1Tag; //
- Int_t fLevel2Tag; //
- Bool_t fInsideBoardInfo;
-
- AliTRDCalDCSGTUTmu* fTmu;
- AliTRDCalDCSGTUCtpOpc* fCtpOpc;
- AliTRDCalDCSGTUSegment* fSegment;
- AliTRDCalDCSGTUBoardInfo* fBoardInfo;
+ Int_t fSystem; // current system (FEE/PTR/GTU) (while parsing)
+ Int_t fInsideRstate; // if we are inside rstate (while parsing)
+ Int_t fCurrentSM; // current supermodule (while parsing)
+ Int_t fCurrentStack; // current stack (while parsing)
+ Int_t fCurrentROB; // current ROB (while parsing)
+ Int_t fCurrentMCM; // current MCM (while parsing)
+ Int_t fCurrentADC; // current ADC (while parsing)
+ TString fContent; // content of the xml element (text)
+ AliTRDCalDCSFEE* fDCSFEEObj; // the calib object for one FEE DCS board
+ AliTRDCalDCSPTR* fDCSPTRObj; // the calib object for one PTR DCS board
+ AliTRDCalDCSGTU* fDCSGTUObj; // the calib object for one GTU DCS board
+ AliTRDCalDCS* fCalDCSObj; // the complete calib obj containing all info
+ Int_t fLevel1Tag; // 1st level in XML (while parsing)
+ Int_t fLevel2Tag; // 2nd level in XML (while parsing)
+ Bool_t fInsideBoardInfo; // if we are inside BoardInfo (while parsing)
+
+ AliTRDCalDCSGTUTmu* fTmu; // GTU calibration data: pattern generator
+ AliTRDCalDCSGTUCtpOpc* fCtpOpc; // GTU calibration data: OPC
+ AliTRDCalDCSGTUSegment* fSegment; // GTU calibration data: SMU tracklets/tracks/triggers
+ AliTRDCalDCSGTUBoardInfo* fBoardInfo; // GTU calibration data: hard-/software and type
- ClassDef(AliTRDSaxHandler,2); // The XML file handler for the preprocessor
+ ClassDef(AliTRDSaxHandler,2); // The XML file handler for the preprocessor
};
#endif