From 3d8c1d8436ea455d974be67b4c9f5f7db78973db Mon Sep 17 00:00:00 2001 From: cblume Date: Tue, 3 Jun 2008 20:03:50 +0000 Subject: [PATCH] Take out the XML parser for the time being --- TRD/AliTRDPreprocessor.cxx | 65 +++++++++++++++++++------------------- TRD/AliTRDSaxHandler.cxx | 19 ++++++----- TRD/AliTRDSaxHandler.h | 34 +++++++++++++------- TRD/TRDbaseLinkDef.h | 1 - TRD/libTRDbase.pkg | 1 - 5 files changed, 64 insertions(+), 56 deletions(-) diff --git a/TRD/AliTRDPreprocessor.cxx b/TRD/AliTRDPreprocessor.cxx index 9df50840736..7c8a44af69a 100644 --- a/TRD/AliTRDPreprocessor.cxx +++ b/TRD/AliTRDPreprocessor.cxx @@ -38,7 +38,7 @@ #include #include #include -#include "TSAXParser.h" +//#include #include "AliCDBMetaData.h" #include "AliLog.h" @@ -48,7 +48,8 @@ #include "AliTRDCalibraFit.h" #include "AliTRDCalibraMode.h" #include "AliTRDCalibPadStatus.h" -#include "AliTRDSaxHandler.h" +//#include "AliTRDSaxHandler.h" + #include "Cal/AliTRDCalDet.h" #include "Cal/AliTRDCalPadStatus.h" #include "Cal/AliTRDCalDCS.h" @@ -709,36 +710,36 @@ UInt_t AliTRDPreprocessor::ProcessDCSConfigData() Log(Form("File %s not found!",nameFile)); } - // create parser and parse - TSAXParser saxParser; - AliTRDSaxHandler saxHandler; - saxParser.ConnectToHandler("AliTRDSaxHandler", &saxHandler); - saxParser.ParseFile(nameFile); - - // report errors if present - if (saxParser.GetParseCode() == 0) { - Log("XML file validation OK"); - } else { - Log(Form("ERROR in XML file validation. Parsecode: %s", saxParser.GetParseCode())); - return 6; - } - if (saxHandler.GetHandlerStatus() != 0) { - Log(Form("ERROR while creating calibration objects. Error code: %s", saxHandler.GetHandlerStatus())); - return 7; - } - - // get the calibration object storing the data from the handler - AliTRDCalDCS* fCalDCSObj = saxHandler.GetCalDCSObj(); - - // store the DCS calib data in the CDB - AliCDBMetaData metaData1; - metaData1.SetBeamPeriod(0); - metaData1.SetResponsible("Frederick Kramer"); - metaData1.SetComment("DCS configuration data in one AliTRDCalDCS object."); - if (!Store("Calib", "DCSCONFIG", fCalDCSObj, &metaData1, 0, kTRUE)) { - Log("problems while storing DCS config data object"); - return 8; - } +// // create parser and parse +// TSAXParser saxParser; +// AliTRDSaxHandler saxHandler; +// saxParser.ConnectToHandler("AliTRDSaxHandler", &saxHandler); +// saxParser.ParseFile(nameFile); + +// // report errors if present +// if (saxParser.GetParseCode() == 0) { +// Log("XML file validation OK"); +// } else { +// Log(Form("ERROR in XML file validation. Parsecode: %s", saxParser.GetParseCode())); +// return 6; +// } +// if (saxHandler.GetHandlerStatus() != 0) { +// Log(Form("ERROR while creating calibration objects. Error code: %s", saxHandler.GetHandlerStatus())); +// return 7; +// } + +// // get the calibration object storing the data from the handler +// AliTRDCalDCS* fCalDCSObj = saxHandler.GetCalDCSObj(); + +// // store the DCS calib data in the CDB +// AliCDBMetaData metaData1; +// metaData1.SetBeamPeriod(0); +// metaData1.SetResponsible("Frederick Kramer"); +// metaData1.SetComment("DCS configuration data in one AliTRDCalDCS object."); +// if (!Store("Calib", "DCSCONFIG", fCalDCSObj, &metaData1, 0, kTRUE)) { +// Log("problems while storing DCS config data object"); +// return 8; +// } return 0; } diff --git a/TRD/AliTRDSaxHandler.cxx b/TRD/AliTRDSaxHandler.cxx index 6993104a748..2782af21f23 100644 --- a/TRD/AliTRDSaxHandler.cxx +++ b/TRD/AliTRDSaxHandler.cxx @@ -19,7 +19,7 @@ // // // The SAX XML file handler used in the preprocessor // // // -// Authors: // +// Author: // // Frederick Kramer (kramer@ikf.uni-frankfurt.de) // // // //////////////////////////////////////////////////////////////////////////// @@ -27,22 +27,21 @@ #include #include #include -#include -#include -#include "AliTRDSaxHandler.h" #include +#include + +#include "AliLog.h" + +#include "AliTRDSaxHandler.h" +#include "AliTRDgeometry.h" + #include "Cal/AliTRDCalDCS.h" #include "Cal/AliTRDCalDCSFEE.h" #include "Cal/AliTRDCalDCSPTR.h" #include "Cal/AliTRDCalDCSGTU.h" -#include "AliTRDgeometry.h" -#include - ClassImp(AliTRDSaxHandler) - - //_____________________________________________________________________________ AliTRDSaxHandler::AliTRDSaxHandler() :TObject() @@ -281,7 +280,7 @@ void AliTRDSaxHandler::OnError(const char *text) } //_____________________________________________________________________________ -void AliTRDSaxHandler::OnFatalError(const char *text) +vois AliTRDSaxHandler::OnFatalError(const char *text) { // process fatal errors here AliError(Form("Fatal error: %s",text)); // use AliFatal? diff --git a/TRD/AliTRDSaxHandler.h b/TRD/AliTRDSaxHandler.h index a16f622c312..af27018b359 100644 --- a/TRD/AliTRDSaxHandler.h +++ b/TRD/AliTRDSaxHandler.h @@ -1,21 +1,30 @@ -#ifndef AliTRDSaxHandler_H -#define AliTRDSaxHandler_H - +#ifndef AliTRDSAXHANDLER_H +#define AliTRDSAXHANDLER_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * See cxx source for full Copyright notice */ -/* $Id$ */ +/* $Id: AliTRDSaxHandler.h 26327 2008-06-02 15:36:18Z cblume $ */ + +//////////////////////////////////////////////////////////////////////////// +// // +// The SAX XML file handler used in the preprocessor // +// // +// Author: // +// Frederick Kramer (kramer@ikf.uni-frankfurt.de) // +// // +//////////////////////////////////////////////////////////////////////////// #include "TObject.h" -#include "Cal/AliTRDCalDCS.h" -#include "Cal/AliTRDCalDCSFEE.h" -#include "Cal/AliTRDCalDCSPTR.h" -#include "Cal/AliTRDCalDCSGTU.h" -#include -#include +class TObjArray; + +class AliTRDCalDCS; +class AliTRDCalDCSFEE; +class AliTRDCalDCSPTR; +class AliTRDCalDCSGTU; class AliTRDSaxHandler : public TObject { + public: enum { kInsideFEE = 1, kInsidePTR = 2, kInsideGTU = 3 }; @@ -43,7 +52,7 @@ public: void OnFatalError(const char *name); void OnCdataBlock(const char *name, Int_t len); -private: + private: Int_t fHandlerStatus; // 0: everything OK, >0: error Int_t fNDCSPTR; // number of current PTR unit (to be abandonned soon) @@ -60,6 +69,7 @@ private: AliTRDCalDCSGTU* fDCSGTUObj; // the calib object for one GTU DCS board AliTRDCalDCS* fCalDCSObj; // the complete calib obj containing all inform. - ClassDef(AliTRDSaxHandler,1); + ClassDef(AliTRDSaxHandler,1); // The XML file handler for the preprocessor + }; #endif diff --git a/TRD/TRDbaseLinkDef.h b/TRD/TRDbaseLinkDef.h index c050816e5fe..2e78ddea38e 100644 --- a/TRD/TRDbaseLinkDef.h +++ b/TRD/TRDbaseLinkDef.h @@ -69,7 +69,6 @@ #pragma link C++ class AliTRDCalibPadStatus+; #pragma link C++ class AliTRDPreprocessor+; -#pragma link C++ class AliTRDSaxHandler+; #pragma link C++ class AliTRDDataDCS+; #pragma link C++ class AliTRDSensor+; diff --git a/TRD/libTRDbase.pkg b/TRD/libTRDbase.pkg index 6e7be5ccf07..b95d8c67854 100644 --- a/TRD/libTRDbase.pkg +++ b/TRD/libTRDbase.pkg @@ -47,7 +47,6 @@ SRCS= AliTRDarrayI.cxx \ AliTRDCalibPadStatus.cxx \ AliTRDQAChecker.cxx \ AliTRDPreprocessor.cxx \ - AliTRDSaxHandler.cxx \ AliTRDDataDCS.cxx \ AliTRDSensor.cxx \ AliTRDSensorArray.cxx \ -- 2.31.1