From 9312398dc375fbd71ea77ce42dc357e84a4bb770 Mon Sep 17 00:00:00 2001 From: hristov Date: Wed, 18 Jul 2007 10:20:27 +0000 Subject: [PATCH] Data base generation class for temperature sensors (Haavard) --- TPC/AliTPCGenDBTemp.cxx | 113 ++++++++++++++++++++++++++++++++++++++++ TPC/AliTPCGenDBTemp.h | 46 ++++++++++++++++ 2 files changed, 159 insertions(+) create mode 100644 TPC/AliTPCGenDBTemp.cxx create mode 100644 TPC/AliTPCGenDBTemp.h diff --git a/TPC/AliTPCGenDBTemp.cxx b/TPC/AliTPCGenDBTemp.cxx new file mode 100644 index 00000000000..c58f498fcd2 --- /dev/null +++ b/TPC/AliTPCGenDBTemp.cxx @@ -0,0 +1,113 @@ + +// .L /afs/cern.ch/user/h/haavard/alice/tpc/temperature/AliTPCGenDBTemp.C+ +// TTimeStamp startTime(2006,10,18,0,0,0,0,kFALSE) +// TTimeStamp endTime(2006,10,19,0,0,0,0,kFALSE) +// Int_t run=2546 +// AliTPCGenDBTemp db +// db->Init(run,"TPC/Config/Temperature","TPC/*/*") +// db->MakeCalib("TempSensor.txt","DCSMap.root",startTime,endTime,run) + + +#include "AliTPCGenDBTemp.h" + +ClassImp(AliTPCGenDBTemp) + +const Int_t kValCut = 100; // discard temperatures > 100 degrees +const Int_t kDiffCut = 5; // discard temperature differences > 5 degrees + +//______________________________________________________________________________________________ + +AliTPCGenDBTemp::AliTPCGenDBTemp(): + AliDCSGenDB() +{ +} + +//______________________________________________________________________________________________ + +AliTPCGenDBTemp::AliTPCGenDBTemp(const AliTPCGenDBTemp& org): + AliDCSGenDB(org) +{ + +// +// Copy constructor +// + + ((AliTPCGenDBTemp &) org).Copy(*this); +} + +//______________________________________________________________________________________________ +AliTPCGenDBTemp::~AliTPCGenDBTemp(){ +// +// destructor +// + +} +//______________________________________________________________________________________________ +AliTPCGenDBTemp& AliTPCGenDBTemp::operator= (const AliTPCGenDBTemp& org ) +{ + // + // assignment operator + // + if (&org == this) return *this; + + new (this) AliTPCGenDBTemp(org); + return *this; +} + + +//______________________________________________________________________________________________ + +void AliTPCGenDBTemp::MakeCalib(const char *fList, const char *fMap, + const TTimeStamp& startTime, + const TTimeStamp& endTime, + Int_t run ) +{ + // The Terminate() function is the last function to be called during + // a query. It always runs on the client, it can be used to present + // the results graphically or save the results to file. + + AliTPCSensorTempArray *temperature = new AliTPCSensorTempArray(fList); + temperature->SetStartTime(startTime); + temperature->SetEndTime(endTime); + temperature->SetValCut(kValCut); + temperature->SetDiffCut(kDiffCut); + TMap* map = SetGraphFile(fMap); + if (map) { + temperature->MakeSplineFit(map); + } + delete map; + map=0; + fMap=0; + + SetFirstRun(run); + SetLastRun(run); + SetSensorArray(temperature); + StoreObject("TPC/Calib/Temperature",temperature, fMetaData); +} + +//______________________________________________________________________________________________ + +TClonesArray * AliTPCGenDBTemp::ReadList(const char *fname) { + // + // read values from ascii file + // + TTree* tree = new TTree("tempConf","tempConf"); + tree->ReadFile(fname,""); + TClonesArray *arr = AliTPCSensorTemp::ReadTree(tree); + delete tree; + return arr; +} + +//______________________________________________________________________________________________ + +TTree * AliTPCGenDBTemp::ReadListTree(const char *fname) { + // + // read values from ascii file + // + TTree* tree = new TTree("tempConf","tempConf"); + tree->ReadFile(fname,""); + TClonesArray *arr = AliTPCSensorTemp::ReadTree(tree); + arr->Delete(); + delete arr; + return tree; +} diff --git a/TPC/AliTPCGenDBTemp.h b/TPC/AliTPCGenDBTemp.h new file mode 100644 index 00000000000..b41c4be6e81 --- /dev/null +++ b/TPC/AliTPCGenDBTemp.h @@ -0,0 +1,46 @@ +///////////////////////////////////////////////////////////////// +// Class to generate temperature sensor data base entries. +// +// Existing data base structure read at start of processsing. +// 20/12-2006 HH. +// Modification log: +///////////////////////////////////////////////////////////////// + +#ifndef AliTPCGenDBTemp_h +#define AliTPCGenDBTemp_h + +#include +#include +#include + +#include "AliTPCSensorTempArray.h" +#include "AliLog.h" +#include "AliDCSGenDB.h" + +class AliTPCGenDBTemp : public AliDCSGenDB { + +public: + +// constructors + + AliTPCGenDBTemp(); + AliTPCGenDBTemp(const AliTPCGenDBTemp& org); + ~AliTPCGenDBTemp(); + AliTPCGenDBTemp& operator= (const AliTPCGenDBTemp& org); + void MakeCalib(const char *file, const char *fMap, + const TTimeStamp& startTime, + const TTimeStamp& endTime, Int_t run); + +// functionality + + static TClonesArray * ReadList(const char* fname); + static TTree * ReadListTree(const char* fname); + +// getters/setters + + +private: + + ClassDef(AliTPCGenDBTemp,1) +}; +#endif -- 2.43.0