// and stores both reference data and spline fits results //
// in the CDB //
// //
-// Author: //
+// Authors: //
// R. Bailhache (R.Bailhache@gsi.de) //
// W. Monange (w.monange@gsi.de) //
+// F. Kramer (kramer@ikf.uni-frankfurt.de) //
// //
////////////////////////////////////////////////////////////////////////////
#include <TString.h>
#include <TList.h>
#include <TCollection.h>
+#include <TSAXParser.h>
#include "AliCDBMetaData.h"
#include "AliLog.h"
#include "AliTRDCalibraFit.h"
#include "AliTRDCalibraMode.h"
#include "AliTRDCalibPadStatus.h"
+#include "AliTRDSaxHandler.h"
#include "Cal/AliTRDCalDet.h"
#include "Cal/AliTRDCalPadStatus.h"
+#include "Cal/AliTRDCalDCS.h"
ClassImp(AliTRDPreprocessor)
TString runType = GetRunType();
Log(Form("runtype %s\n",runType.Data()));
+ // always process the configuration data
+/* Int_t resultDCSC = */ProcessDCSConfigData(); // for testing!
+ // if there was an error, return with its code
+// if (resultDCSC != 0) return resultDCSC; // for testing!
+
if (runType=="PEDESTAL"){
if(ExtractPedestals()) return 1;
return 0;
//TString runPar = GetRunParameter("HLTStatus");
//if(runPar=="1") {
if(GetHLTStatus()) {
- if(ExtractHLT()) return 1;
+ /*if(*/ExtractHLT()/*) return 1*/; // for testing!
}
// DAQ if HLT failed
if(!fVdriftHLT) {
- if(ExtractDriftVelocityDAQ()) return 1;
+ /*if(*/ExtractDriftVelocityDAQ()/*) return 1*/; // for testing!
}
// DCS
if(ProcessDCS(dcsAliasMap)) return 1;
return error;
}
+
+//_____________________________________________________________________________
+UInt_t AliTRDPreprocessor::ProcessDCSConfigData()
+{
+ //
+ // process the configuration of FEE, PTR and GTU
+ // reteive XML file from the DCS FXS
+ // parse it and store TObjArrays in the CDB
+ // return 0 for success, otherwise:
+ // 5: could not get the file from the FXS
+ // 6: ERROR in XML validation: something wrong with the file
+ // 7: ERROR while creating calibration objects in the handler
+ // 8: error while storing data in the CDB
+ // > 100: SaxHandler error code
+ //
+
+ Log("Processing the DCS config summary file.");
+
+ // get the XML file
+ const char * xmlFile = GetFile(kDCS,"CONFIGSUMMARY","");
+ if (xmlFile == NULL) {
+ return 5;
+ Log(Form("File %s not found!",xmlFile));
+ }
+
+ // create parser and parse
+ TSAXParser saxParser;
+ AliTRDSaxHandler saxHandler;
+ saxParser.ConnectToHandler("AliTRDSaxHandler", &saxHandler);
+ saxParser.ParseFile(xmlFile);
+
+ // 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;
+}
+