--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+ author: Roberto Preghenella (preghenella@bo.infn.it)
+*/
+///////////////////////////////////////////////////////////////
+// //
+// This classes provide the object to store the full dump //
+// of TOF FEE configuration database. //
+// //
+///////////////////////////////////////////////////////////////
+
+#include "AliTOFFEEDump.h"
+#include <string.h>
+#include <iostream>
+#include <fstream>
+#include "TSystem.h"
+#include "AliLog.h"
+
+ClassImp(AliTOFFEEDump)
+
+//_______________________________________________________________
+
+AliTOFFEEDump::AliTOFFEEDump() :
+ TObject(),
+ fSize(0),
+ fData(NULL)
+{
+ /* default constructor */
+}
+
+#if 0
+//_______________________________________________________________
+
+AliTOFFEEDump::AliTOFFEEDump(const AliTOFFEEDump &source) :
+ TObject(source),
+ fSize(source.fSize),
+ fData(NULL)
+{
+ /* copy constructor */
+
+ /* check size */
+ if (fSize == 0) return;
+
+ /* allocate and copy data */
+ fData = new UChar_t[fSize];
+ memcpy(fData, source.fData, fSize);
+}
+
+//_______________________________________________________________
+
+AliTOFFEEDump &
+AliTOFFEEDump::operator=(const AliTOFFEEDump &source)
+{
+ /* operator= */
+
+ /* check source and destination size */
+ if (source.fSize == 0 || fSize != source.fSize) return *this;
+
+ /* copy data */
+ memcpy(fData, source.fData, fSize);
+ return *this;
+}
+#endif
+
+//_______________________________________________________________
+
+AliTOFFEEDump::~AliTOFFEEDump()
+{
+ /* default destructor */
+
+ if (fData) delete [] fData;
+}
+
+//_______________________________________________________________
+
+Bool_t
+AliTOFFEEDump::operator!=(const AliTOFFEEDump &source)
+{
+ /* operator!= */
+
+ /* check size */
+ if (fSize != source.fSize) return kTRUE;
+
+ /* check data */
+ if (memcmp(fData, source.fData, fSize) != 0) return kTRUE;
+
+ return kFALSE;
+}
+
+//_______________________________________________________________
+
+Bool_t
+AliTOFFEEDump::ReadFromFile(const Char_t *filename)
+{
+ /* read from file */
+
+ /* open file */
+ Char_t *expandedFileName = gSystem->ExpandPathName(filename);
+ std::ifstream is;
+ is.open(expandedFileName, std::ios::binary);
+ if (!is.is_open()) {
+ AliError(Form("error while opening TOF FEE dump file: %s", filename));
+ return kFALSE;
+ }
+ AliInfo(Form("TOF FEE dump file opened: %s", filename));
+
+ /* get file size */
+ Int_t begin = is.tellg();
+ is.seekg(0, std::ios::end); /* end */
+ Int_t end = is.tellg();
+ Int_t size = end - begin;
+ is.seekg(0, std::ios::beg); /* rewind file */
+ if (size <= 0) {
+ AliError(Form("error while getting TOF FEE dump file size: %d", size));
+ return kFALSE;
+ }
+ AliInfo(Form("got TOF FEE dump file size: %d", size));
+
+ /* check previous allocation */
+ if (fData) {
+ AliWarning("data already allocated, old data will be overwritten");
+ delete [] fData;
+ }
+
+ /* allocate and read data */
+ fSize = size;
+ fData = new UChar_t[fSize];
+ is.read((Char_t *)fData, fSize);
+ AliInfo(Form("TOF FEE dump file stored"));
+
+ /* close file */
+ is.close();
+
+ return kTRUE;
+}
+
+//_______________________________________________________________
+
+void
+AliTOFFEEDump::DumpData() {
+ /* dump data */
+
+ printf("*** TOF FEE dump data ***\n");
+ printf("data size = %d bytes\n", fSize);
+ printf("*************************\n");
+ UInt_t nwords = fSize / 4;
+ UInt_t *data = (UInt_t *)fData;
+ for (Int_t iword = 0; iword < nwords; iword++) {
+ if (iword != 0 && iword % 4 == 0) printf("\n");
+ printf("%08x ", data[iword]);
+ }
+ printf("\n*************************\n");
+
+}
--- /dev/null
+#ifndef ALITOFFEEDUMP_H
+#define ALITOFFEEDUMP_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id: AliTOFDecoder.h,v 1.2 2007/05/08 11:55:24 arcelli Exp $ */
+
+///////////////////////////////////////////////////////////////
+// //
+// This classes provide the object to store the full dump //
+// of TOF FEE configuration database. //
+// //
+///////////////////////////////////////////////////////////////
+
+#include "TObject.h"
+
+class AliTOFFEEDump :
+public TObject
+{
+
+ public:
+
+ AliTOFFEEDump(); /* default constructor */
+ virtual ~AliTOFFEEDump(); /* default destructor */
+ Bool_t operator!=(const AliTOFFEEDump &source); /* operator!= */
+ Bool_t operator==(const AliTOFFEEDump &source) {return !(*this != source);}; /* operator== */
+
+ UInt_t GetSize() const {return fSize;}; /* get size */
+ UChar_t *GetData() {return fData;}; /* get data */
+ Bool_t ReadFromFile(const Char_t *filename); /* read from file */
+ void DumpData(); /* dump data */
+
+ private:
+
+ AliTOFFEEDump(const AliTOFFEEDump &source); /* copy constructor */
+ AliTOFFEEDump &operator=(const AliTOFFEEDump &source); /* operator= */
+
+ UInt_t fSize; // size
+ UChar_t *fData; //[fSize] data
+
+ ClassDef(AliTOFFEEDump, 1);
+
+};
+
+#endif /* ALITOFFEEDUMP_H */
#include "AliTOFRawStream.h"
#include "AliTOFCableLengthMap.h"
#include "AliTOFcalibHisto.h"
+#include "AliTOFFEEDump.h"
// TOF preprocessor class.
TH1C hCurrentFEE("hCurrentFEE","histo with current FEE channel status", fNChannels, 0, fNChannels);
- /* load current TOF FEE config from DCS FXS, parse,
+ /* load current TOF FEE(dump) from DCS FXS,
+ * setup TOFFEEdump object */
+
+ const char * toffeeFileName = GetFile(kDCS,"TofFeeMap","");
+ AliInfo(Form("toffee file name = %s", toffeeFileName));
+ if (toffeeFileName == NULL) {
+ return 15;
+ }
+ AliTOFFEEDump feedump;
+ feedump.ReadFromFile(toffeeFileName);
+
+ /* load current TOF FEE(light) config from DCS FXS, parse,
* fill current FEE histogram and set FEE status */
const char * nameFile = GetFile(kDCS,"TofFeeLightMap","");
- AliInfo(Form("nameFile = %s",nameFile));
+ AliInfo(Form("toffeeLight file name = %s",nameFile));
if (nameFile == NULL) {
return 15;
}
/* check whether we don't have to store reference data.
* in this case we return without errors. */
if (fStoreRefData) {
- /* store reference data */
- AliCDBMetaData metaDataHisto;
- metaDataHisto.SetBeamPeriod(0);
- metaDataHisto.SetResponsible("Roberto Preghenella");
- metaDataHisto.SetComment("This preprocessor stores the FEE Ref data of the current run.");
- AliInfo("Storing FEE reference data");
- /* store FEE reference data */
- if (!StoreReferenceData("Calib", "FEEData", &hCurrentFEE, &metaDataHisto)) {
- /* failed */
- Log("problems while storing FEE reference data");
- if (fStatus){
- delete fStatus;
- fStatus = 0;
- }
- return 18; /* error return code for problems while storing FEE reference data */
- }
+ /* store reference data */
+ AliCDBMetaData metaDataHisto;
+ metaDataHisto.SetBeamPeriod(0);
+ metaDataHisto.SetResponsible("Roberto Preghenella");
+ metaDataHisto.SetComment("This preprocessor stores the FEE Ref data of the current run.");
+ AliInfo("Storing FEE reference data");
+ /* store FEE reference data */
+ if (!StoreReferenceData("Calib", "FEEData", &hCurrentFEE, &metaDataHisto)) {
+ /* failed */
+ Log("problems while storing FEE reference data");
+ if (fStatus){
+ delete fStatus;
+ fStatus = 0;
+ }
+ return 18; /* error return code for problems while storing FEE reference data */
+ }
+
+ /* store TOF FEE dump reference data */
+ AliCDBMetaData metaDatadump;
+ metaDatadump.SetBeamPeriod(0);
+ metaDatadump.SetResponsible("Roberto Preghenella");
+ metaDatadump.SetComment("This preprocessor stores the TOF FEE dump Ref data of the current run.");
+ AliInfo("Storing TOF FEE dump reference data");
+ /* store FEE reference data */
+ if (!StoreReferenceData("Calib", "FEEDump", &feedump, &metaDatadump)) {
+ /* failed */
+ Log("problems while storing TOF FEE dump reference data");
+ return 18; /* error return code for problems while storing FEE reference data */
+ }
}
/* check whether we don't need to update OCDB.
AliTestShuttle::SetMainRefStorage("local://$ALICE_ROOT/OCDB/SHUTTLE/TestShuttle/TestReference");
// create AliTestShuttle instance
- Int_t nrun = 6;
+ Int_t nrun = 7;
AliTestShuttle* shuttle = new AliTestShuttle(nrun, 30, 980);
//setting run type to physiscs
shuttle->SetInputRunType(RunType);
shuttle->AddInputFile(AliTestShuttle::kDAQ, "TOF", "DELAYS", "MON", "$ALICE_ROOT/TOF/ShuttleInput/Total.root");
shuttle->AddInputFile(AliTestShuttle::kDAQ, "TOF", "RUNLevel", "MON", "$ALICE_ROOT/TOF/ShuttleInput/Partial.root");
shuttle->AddInputFile(AliTestShuttle::kDCS, "TOF", "TofFeeLightMap", "", "$ALICE_ROOT/TOF/ShuttleInput/TOFFEElight.20090616.102605.8000");
+ shuttle->AddInputFile(AliTestShuttle::kDCS, "TOF", "TofFeeMap", "", "$ALICE_ROOT/TOF/ShuttleInput/TOFFEE.20091217.194708.105517");
TString filename;
TString LDCname;
#pragma link C++ class AliTOFDataDCS+;
#pragma link C++ class AliTOFFormatDCS+;
#pragma link C++ class AliTOFFEEReader+;
+#pragma link C++ class AliTOFFEEDump+;
#pragma link C++ class AliTOFCableLengthMap+;
#pragma link C++ class AliTOFNoiseConfigHandler+;
#pragma link C++ class AliTOFcalibHisto+;
#pragma link C++ class AliTOFArray+;
-#pragma link C++ class AliTOFDaConfigHandler+;
#endif
AliTOFFormatDCS.cxx \
AliTOFPreprocessorFDR.cxx \
AliTOFFEEReader.cxx \
+ AliTOFFEEDump.cxx \
AliTOFCableLengthMap.cxx \
AliTOFNoiseConfigHandler.cxx \
AliTOFcalibHisto.cxx \
- AliTOFArray.cxx \
- AliTOFDaConfigHandler.cxx
+ AliTOFArray.cxx
HDRS:= $(SRCS:.cxx=.h)
PACKSOFLAGS:= $(SOFLAGS) -L$(ALICE_ROOT)/lib/tgt_$(ALICE_TARGET) \
-lSTEER -lCDB -lSTEERBase \
-lRAWDatarec -lRAWDatabase \
- -L$(ROOTLIBDIR) -lGeom
+ -L$(shell root-config --libdir) -lGeom
endif