From 567369a2ab09f504b22e1beccc9553c46b443942 Mon Sep 17 00:00:00 2001 From: arcelli Date: Thu, 26 Oct 2006 09:11:44 +0000 Subject: [PATCH] DCS data format in the OCDB (C.Zampolli) --- TOF/AliTOFFormatDCS.cxx | 79 +++++++++++++++++++++++++++++++++++++++++ TOF/AliTOFFormatDCS.h | 49 +++++++++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 TOF/AliTOFFormatDCS.cxx create mode 100644 TOF/AliTOFFormatDCS.h diff --git a/TOF/AliTOFFormatDCS.cxx b/TOF/AliTOFFormatDCS.cxx new file mode 100644 index 00000000000..0c4b34a1aff --- /dev/null +++ b/TOF/AliTOFFormatDCS.cxx @@ -0,0 +1,79 @@ +/************************************************************************** + * 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. * + **************************************************************************/ + +/* +$Log$ +*/ + +#include "AliTOFFormatDCS.h" + +// AliTOFFormatDCS class +// contining the format of a DCS calibration objects +// consisting in 10 floats +// (5 data points + 5 corresponding timestamps) +// and a short_integer + +ClassImp(AliTOFFormatDCS) + +//--------------------------------------------------------------- +AliTOFFormatDCS::AliTOFFormatDCS(): TObject(),fShort(0){ + // main constructor + for (Int_t i=0;i<3;i++){ + fFloats[i]=0; + fTimeStampsFloat[i]=0; + } + for (Int_t i=0;i<2;i++){ + fDeltas[i]=0; + fTimeStampsDelta[i]=0; + } +} +//--------------------------------------------------------------- + +AliTOFFormatDCS::AliTOFFormatDCS(const AliTOFFormatDCS & format): + TObject(), + fShort(format.fShort) +{ + // copy constructor + for (Int_t i=0;i<3;i++){ + this->fFloats[i]=format.GetFloat(i); + this->fTimeStampsFloat[i]=format.GetTimeStampFloat(i); + } + for (Int_t i=0;i<2;i++){ + this->fDeltas[i]=format.GetDelta(i); + this->fTimeStampsDelta[i]=format.GetTimeStampFloat(i); + } +} +//--------------------------------------------------------------- + +AliTOFFormatDCS& AliTOFFormatDCS:: operator=(const AliTOFFormatDCS & format) { + + // assignment operator + for (Int_t i=0;i<3;i++){ + this->fFloats[i]=format.GetFloat(i); + this->fTimeStampsFloat[i]=format.GetTimeStampFloat(i); + } + for (Int_t i=0;i<2;i++){ + this->fDeltas[i]=format.GetDelta(i); + this->fTimeStampsDelta[i]=format.GetTimeStampFloat(i); + } + this->fShort=format.GetShort(); + return *this; +} +//--------------------------------------------------------------- + +AliTOFFormatDCS::~AliTOFFormatDCS(){ + +} + diff --git a/TOF/AliTOFFormatDCS.h b/TOF/AliTOFFormatDCS.h new file mode 100644 index 00000000000..85365a9ff56 --- /dev/null +++ b/TOF/AliTOFFormatDCS.h @@ -0,0 +1,49 @@ +#ifndef AliTOFFormatDCS_H +#define AliTOFFormatDCS_H + +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ + +#include "TObject.h" + +// AliTOFFormatDCS class +// describing the format of the calibration data +// coming from DCS + +class AliTOFFormatDCS : public TObject +{ + public: + + AliTOFFormatDCS(); + AliTOFFormatDCS(const AliTOFFormatDCS & format); + AliTOFFormatDCS& operator=(const AliTOFFormatDCS & format); + virtual ~AliTOFFormatDCS(); + + Float_t GetFloat(Int_t i) const {return fFloats[i];} + Float_t GetTimeStampFloat(Int_t i) const {return fTimeStampsFloat[i];} + Float_t GetDelta(Int_t i) const {return fDeltas[i];} + Float_t GetTimeStampDelta(Int_t i) const {return fTimeStampsDelta[i];} + Short_t GetShort() const {return fShort;} + + void SetFloat(Int_t i, Float_t valfloat) {fFloats[i]=valfloat;} + void SetTimeStampFloat(Int_t i, Float_t timestampfloat) {fTimeStampsFloat[i]=timestampfloat;} + void SetDelta(Int_t i, Float_t valdelta) {fDeltas[i]=valdelta;} + void SetTimeStampDelta(Int_t i, Float_t timestampdelta) {fTimeStampsDelta[i]=timestampdelta;} + void SetShort(Short_t valshort) {fShort=valshort;} + + private: + + Float_t fFloats[3]; // Floats for values at determined + // time intervals + Float_t fTimeStampsFloat[3]; // Time stamps of the Floats + // for values at determined time intervals + Float_t fDeltas[2]; // Significant Increments + Float_t fTimeStampsDelta[2]; // Time stamps for the significant increments + Short_t fShort; // Short Integer + + ClassDef(AliTOFFormatDCS, 1); +}; + +#endif -- 2.43.0