+++ /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. *
- **************************************************************************/
-
-
-///////////////////////////////////////////////////////////////////////////////
-// //
-// Class to generate TPC atmospheric pressure data base entries //
-// Author: Haavard Helstrup //
-// //
-///////////////////////////////////////////////////////////////////////////////
-
-
-
-/**
-TTimeStamp startTime(2006,10,18,0,0,0,0,kFALSE)
-TTimeStamp endTime(2006,10,19,0,0,0,0,kFALSE)
-Int_t run=2546
-AliTPCDBPressure db
-db->Init(run)
-db->MakeCalib("PressureSensor.txt","DCSMap.root",startTime,endTime,firstRun,lastRun)
-
-
-**/
-#include "AliTPCDBPressure.h"
-
-ClassImp(AliTPCDBPressure)
-
-//______________________________________________________________________________________________
-
-AliTPCDBPressure::AliTPCDBPressure():
- fFirstRun(0),
- fLastRun(0),
- fPressure(0),
- fStorLoc(0),
- fCalib(0),
- fMetaData(0),
- fConfTree(0)
-//
-// standard constructor
-//
-{}
-
-//______________________________________________________________________________________________
-
-AliTPCDBPressure::AliTPCDBPressure(const AliTPCDBPressure& org):
- TObject(org),
- fFirstRun(org.fFirstRun),
- fLastRun(org.fLastRun),
- fPressure(0),
- fStorLoc(0),
- fCalib(0),
- fMetaData(0),
- fConfTree(0)
-{
-//
-// Copy constructor
-//
-
- ((AliTPCDBPressure &) org).Copy(*this);
-}
-
-//______________________________________________________________________________________________
-AliTPCDBPressure::~AliTPCDBPressure(){
-//
-// destructor
-//
- fCalib->Terminate();
- delete fPressure;
- delete fMetaData;
- delete fConfTree;
-}
-
-//______________________________________________________________________________________________
-AliTPCDBPressure& AliTPCDBPressure::operator= (const AliTPCDBPressure& org )
-{
- //
- // assignment operator
- //
- if (&org == this) return *this;
-
- new (this) AliTPCDBPressure(org);
- return *this;
-}
-
-//______________________________________________________________________________________________
-void AliTPCDBPressure::Copy(TObject &c) const
-{
- //
- // Copy function
- //
-
- TObject::Copy(c);
-}
-
-//______________________________________________________________________________________________
-void AliTPCDBPressure::MakeCalib(const char *list, const char *mapDCS,
- const TTimeStamp& startTime,
- const TTimeStamp& endTime,
- Int_t firstRun, Int_t lastRun )
-{
- // 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.
-
- TClonesArray *arr = ReadList(list);
- AliDCSSensorArray *fPressure = new AliDCSSensorArray(arr);
- fPressure->SetStartTime(startTime);
- fPressure->SetEndTime(endTime);
- TMap* map = SetGraphFile(mapDCS);
- if (map) {
- fPressure->MakeSplineFit(map);
- }
- delete map;
- map=0;
- mapDCS=0;
-
- SetFirstRun(firstRun);
- SetLastRun(lastRun);
-
- StoreObject("TPC/Calib/Pressure",fPressure, fMetaData);
-}
-
-//______________________________________________________________________________________________
-void AliTPCDBPressure::MakeConfig(const char *file, Int_t firstRun, Int_t lastRun )
-{
- //
- // Store Configuration file to OCDB
- //
-
- TTree *tree = ReadListTree(file);
- SetConfTree(tree);
- SetFirstRun(firstRun);
- SetLastRun(lastRun);
-
- StoreObject("TPC/Config/Pressure",fConfTree, fMetaData);
-}
-
-
-
-//______________________________________________________________________________________________
-AliCDBMetaData* AliTPCDBPressure::CreateMetaObject(const char* objectClassName)
-{
- AliCDBMetaData *md1= new AliCDBMetaData();
- md1->SetObjectClassName(objectClassName);
- md1->SetResponsible("Haavard Helstrup");
- md1->SetBeamPeriod(2);
- md1->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- md1->SetComment("Pressure");
-
- return md1;
-}
-
-//______________________________________________________________________________________________
-void AliTPCDBPressure::StoreObject(const char* cdbPath, TObject* object, AliCDBMetaData* metaData)
-{
-
- AliCDBId id1(cdbPath, fFirstRun, fLastRun);
- if (fStorLoc) fStorLoc->Put(object, id1, metaData);
-}
-
-//______________________________________________________________________________________________
-void AliTPCDBPressure::Init(Int_t run){
-
- Long64_t longRun;
-
- SetFirstRun(run);
- SetLastRun(run);
-
- InitDB(run);
- fCalib = AliTPCcalibDB::Instance();
- longRun=run;
- fCalib->SetRun(longRun);
- fPressure = fCalib->GetPressure();
-
-}
-
-//______________________________________________________________________________________________
-void AliTPCDBPressure::InitDB(Int_t run)
-{
- // Data base generation
-
- char *CDBpath="local:///afs/cern.ch/alice/tpctest/Calib/";
-
- fMetaData = CreateMetaObject("AliDCSSensorArray");
- AliCDBManager *man = AliCDBManager::Instance();
- man->SetDefaultStorage("local:///afs/cern.ch/alice/tpctest/AliRoot/HEAD");
- man->SetRun(run);
- man->SetSpecificStorage("TPC/*/*","local:///afs/cern.ch/alice/tpctest/Calib");
- AliCDBEntry *config = man->Get("TPC/Config/Pressure");
- if (config) fConfTree = (TTree*)config->GetObject();
- fStorLoc = man->GetStorage(CDBpath);
- if (!fStorLoc) return;
-}
-
-
-//_____________________________________________________________________________
-TMap* AliTPCDBPressure::SetGraphFile(const char *fname)
-{
- //
- // Read DCS maps from file given by fname
- //
- TFile file(fname);
- TMap * map = (TMap*)file.Get("DCSMap");
- return map;
-}
-
-//______________________________________________________________________________________________
-
-TClonesArray * AliTPCDBPressure::ReadList(const char *fname) {
- //
- // read values from ascii file
- //
- TTree* tree = new TTree("pressureConf","pressureConf");
- tree->ReadFile(fname,"");
- TClonesArray *arr = AliDCSSensor::ReadTree(tree);
- return arr;
-}
-
-//______________________________________________________________________________________________
-
-TTree * AliTPCDBPressure::ReadListTree(const char *fname) {
- //
- // read values from ascii file
- //
- TTree* tree = new TTree("pressureConf","pressureConf");
- tree->ReadFile(fname,"");
- TClonesArray *arr = AliDCSSensor::ReadTree(tree);
- arr->Delete();
- delete arr;
- return tree;
-}
-
-
+++ /dev/null
-/////////////////////////////////////////////////////////////////
-// Class to generate temperature sensor data base entries.
-//
-// Existing data base structure read at start of processsing.
-// 20/12-2006 HH.
-// Modification log:
-/////////////////////////////////////////////////////////////////
-
-#ifndef AliTPCDBPressure_h
-#define AliTPCDBPressure_h
-
-#include <TROOT.h>
-#include <TProfile.h>
-#include <TProfile2D.h>
-#include <TH1F.h>
-#include <TFile.h>
-#include <TObjArray.h>
-
-#include "AliTPCcalibDB.h"
-#include "AliCDBMetaData.h"
-#include "AliCDBManager.h"
-#include "AliCDBId.h"
-#include "AliCDBStorage.h"
-#include "AliDCSSensorArray.h"
-#include "AliLog.h"
-#include "TSystem.h"
-
-class AliTPCDBPressure : public TObject {
-
-public:
-
- AliTPCDBPressure();
- AliTPCDBPressure(const AliTPCDBPressure& org);
- ~AliTPCDBPressure();
- AliTPCDBPressure& operator= (const AliTPCDBPressure& org);
- void Copy(TObject &c) const;
- void MakeCalib(const char *file, const char *fMap,
- const TTimeStamp& startTime,
- const TTimeStamp& endTime,
- Int_t firstRun, Int_t lastRun);
- void MakeConfig(const char *file, Int_t firstRun, Int_t lastRun);
- AliCDBMetaData* CreateMetaObject(const char *objectClassName);
- void StoreObject(const char* cdbPath, TObject* object, AliCDBMetaData* metaData);
- void Init(Int_t run);
- void InitDB(Int_t run);
- void SetFirstRun(Int_t frun){fFirstRun=frun;}
- void SetLastRun(Int_t lrun) {fLastRun=lrun;}
- TMap* SetGraphFile(const char* fname);
- void SetConfTree(TTree *tree) {fConfTree=tree;}
- TTree* GetConfTree() const {return fConfTree;}
- static TClonesArray * ReadList(const char* fname);
- static TTree * ReadListTree(const char* fname);
-
-private:
-
- Int_t fFirstRun; // first run in validity period
- Int_t fLastRun; // last run in validity period
- AliDCSSensorArray *fPressure; // array of pressure sensors
- AliCDBStorage *fStorLoc; // pointer to CDB storage
- AliTPCcalibDB *fCalib; // calibration object
- AliCDBMetaData *fMetaData; // data base metadata
- TTree *fConfTree; // configuration tree
-
- ClassDef(AliTPCDBPressure,1)
- };
-#endif
-
+++ /dev/null
-/**
-.L /afs/cern.ch/user/h/haavard/alice/tpc/temperature/AliTPCDBTemp.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
-AliTPCDBTemp db
-db->Init(run)
-db->MakeCalib("TempSensor.txt","DCSMap.root",startTime,endTime,run)
-
-
-**/
-#include "AliTPCDBTemp.h"
-
-ClassImp(AliTPCDBTemp)
-
-const Int_t kValCut = 100; // discard temperatures > 100 degrees
-const Int_t kDiffCut = 5; // discard temperature differences > 5 degrees
-
-//______________________________________________________________________________________________
-
-AliTPCDBTemp::AliTPCDBTemp():
- fFirstRun(0),
- fLastRun(0),
- fTemperature(0),
- fStorLoc(0),
- fCalib(0),
- fMetaData(0),
- fConfTree(0)
-{}
-//______________________________________________________________________________________________
-
-AliTPCDBTemp::AliTPCDBTemp(const AliTPCDBTemp& org):
- TObject(org),
- fFirstRun(org.fFirstRun),
- fLastRun(org.fLastRun),
- fTemperature(0),
- fStorLoc(0),
- fCalib(0),
- fMetaData(0),
- fConfTree(0)
-{
-//
-// Copy constructor
-//
-
- ((AliTPCDBTemp &) org).Copy(*this);
-}
-
-//______________________________________________________________________________________________
-AliTPCDBTemp::~AliTPCDBTemp(){
-//
-// destructor
-//
- fCalib->Terminate();
- delete fTemperature;
- delete fMetaData;
- delete fConfTree;
-}
-
-//______________________________________________________________________________________________
-AliTPCDBTemp& AliTPCDBTemp::operator= (const AliTPCDBTemp& org )
-{
- //
- // assignment operator
- //
- if (&org == this) return *this;
-
- new (this) AliTPCDBTemp(org);
- return *this;
-}
-
-//______________________________________________________________________________________________
-void AliTPCDBTemp::Copy(TObject &c) const
-{
- //
- // Copy function
- //
-
- TObject::Copy(c);
-}
-
-
-//______________________________________________________________________________________________
-
-void AliTPCDBTemp::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 *fTemperature = new AliTPCSensorTempArray(fList);
- fTemperature->SetStartTime(startTime);
- fTemperature->SetEndTime(endTime);
- fTemperature->SetValCut(kValCut);
- fTemperature->SetDiffCut(kDiffCut);
- TMap* map = SetGraphFile(fMap);
- if (map) {
- fTemperature->MakeSplineFit(map);
- }
- delete map;
- map=0;
- fMap=0;
-
- SetFirstRun(run);
- SetLastRun(run);
- StoreObject("TPC/Calib/Temperature",fTemperature, fMetaData);
-}
-
-//______________________________________________________________________________________________
-void AliTPCDBTemp::MakeConfig(const char *file, Int_t firstRun, Int_t lastRun )
-{
- //
- // Store Configuration file to OCDB
- //
-
- TTree *tree = ReadListTree(file);
- SetConfTree(tree);
- SetFirstRun(firstRun);
- SetLastRun(lastRun);
-
- AliCDBMetaData* metaConf=CreateMetaObject("TTree");
- StoreObject("TPC/Config/Temperature",fConfTree, metaConf);
-}
-
-
-//______________________________________________________________________________________________
-
-AliCDBMetaData* AliTPCDBTemp::CreateMetaObject(const char* objectClassName)
-{
- AliCDBMetaData *md1= new AliCDBMetaData();
- md1->SetObjectClassName(objectClassName);
- md1->SetResponsible("Haavard Helstrup");
- md1->SetBeamPeriod(2);
- md1->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
- md1->SetComment("Temperature");
-
- return md1;
-}
-//______________________________________________________________________________________________
-
-void AliTPCDBTemp::StoreObject(const char* cdbPath, TObject* object, AliCDBMetaData* metaData)
-{
-
- AliCDBId id1(cdbPath, fFirstRun, fLastRun);
- if (fStorLoc) fStorLoc->Put(object, id1, metaData);
-}
-//______________________________________________________________________________________________
-
-void AliTPCDBTemp::Init(Int_t run){
-
-// Int_t kLastRun=4000;
- Long64_t longRun;
-
- SetFirstRun(run);
- SetLastRun(run);
-
- InitDB(run);
- fCalib = AliTPCcalibDB::Instance();
- longRun=run;
- fCalib->SetRun(longRun);
- fTemperature = fCalib->GetTemperature();
-
-}
-//______________________________________________________________________________________________
-
-void AliTPCDBTemp::InitDB(Int_t run)
-{
- // Data base generation
-
- char *CDBpath="local:///afs/cern.ch/alice/tpctest/Calib/";
-
- fMetaData = CreateMetaObject("AliTPCSensorTempArray");
- AliCDBManager *man = AliCDBManager::Instance();
- man->SetDefaultStorage("local:///afs/cern.ch/alice/tpctest/AliRoot/HEAD");
- man->SetRun(run);
- man->SetSpecificStorage("TPC/*/*","local:///afs/cern.ch/alice/tpctest/Calib");
- AliCDBEntry *config = man->Get("TPC/Config/Temperature");
- if (config) fConfTree = (TTree*)config->GetObject();
- fStorLoc = man->GetStorage(CDBpath);
- if (!fStorLoc) return;
-}
-//_____________________________________________________________________________
-TMap* AliTPCDBTemp::SetGraphFile(const char *fname)
-{
- //
- // Read DCS maps from file given by fname
- //
- TFile file(fname);
- TMap * map = (TMap*)file.Get("DCSMap");
- return map;
-}
-//______________________________________________________________________________________________
-
-TClonesArray * AliTPCDBTemp::ReadList(const char *fname) {
- //
- // read values from ascii file
- //
- TTree* tree = new TTree("tempConf","tempConf");
- tree->ReadFile(fname,"");
- TClonesArray *arr = AliTPCSensorTemp::ReadTree(tree);
- return arr;
-}
-
-//______________________________________________________________________________________________
-
-TTree * AliTPCDBTemp::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;
-}
+++ /dev/null
-/////////////////////////////////////////////////////////////////
-// Class to generate temperature sensor data base entries.
-//
-// Existing data base structure read at start of processsing.
-// 20/12-2006 HH.
-// Modification log:
-/////////////////////////////////////////////////////////////////
-
-#ifndef AliTPCDBTemp_h
-#define AliTPCDBTemp_h
-
-#include <TROOT.h>
-#include <TProfile.h>
-#include <TProfile2D.h>
-#include <TH1F.h>
-#include <TFile.h>
-#include <TObjArray.h>
-
-#include "AliTPCcalibDB.h"
-#include "AliCDBMetaData.h"
-#include "AliCDBManager.h"
-#include "AliCDBId.h"
-#include "AliCDBStorage.h"
-#include "AliTPCSensorTempArray.h"
-#include "AliLog.h"
-
-class AliTPCDBTemp : public TObject {
-
-public:
-
- AliTPCDBTemp();
- AliTPCDBTemp(const AliTPCDBTemp& org);
- ~AliTPCDBTemp();
- AliTPCDBTemp& operator= (const AliTPCDBTemp& org);
- void Copy(TObject &c) const;
- void MakeCalib(const char *file, const char *fMap,
- const TTimeStamp& startTime,
- const TTimeStamp& endTime, Int_t run);
- void MakeConfig(const char *file, Int_t firstRun, Int_t lastRun);
- AliCDBMetaData* CreateMetaObject(const char *objectClassName);
- void StoreObject(const char* cdbPath, TObject* object, AliCDBMetaData* metaData);
- void Init(Int_t run);
- void InitDB(Int_t run);
- void SetFirstRun(Int_t frun){fFirstRun=frun;}
- void SetLastRun(Int_t lrun) {fLastRun=lrun;}
- TMap* SetGraphFile(const char* fname);
- void SetConfTree(TTree* tree) {fConfTree=tree;}
- TTree* GetConfTree() const {return fConfTree;}
- static TClonesArray * ReadList(const char* fname);
- static TTree * ReadListTree(const char* fname);
-
-private:
-
- Int_t fFirstRun; // first run in validity period
- Int_t fLastRun; // last run in validity period
- AliTPCSensorTempArray *fTemperature; // array of temperature sensors
- AliCDBStorage *fStorLoc; // pointer to CDB storage
- AliTPCcalibDB *fCalib; // calibration object
- AliCDBMetaData *fMetaData; // data base metadata
- TTree *fConfTree; // configuration tree
-
- ClassDef(AliTPCDBTemp,1)
-};
-#endif
#pragma link C++ class AliTPCLaserTracks+;
#pragma link C++ class AliTPCSensorTemp+;
#pragma link C++ class AliTPCSensorTempArray+;
-#pragma link C++ class AliTPCDBTemp+;
-#pragma link C++ class AliTPCDBPressure+;
+#pragma link C++ class AliTPCGenDBTemp+;
+#pragma link C++ class AliTPCGenDBConf+;
#pragma link C++ class AliTPCAltroMapping+;
AliTPCCalibPedestal.cxx AliTPCCalibSignal.cxx AliTPCCalibCE.cxx \
AliTPCPreprocessor.cxx \
AliTPCCalibViewer.cxx AliTPCCalibViewerGUI.cxx \
- AliTPCDBTemp.cxx AliTPCDBPressure.cxx \
- AliCorrector.cxx AliTPCExB.cxx AliTPCExBExact.cxx AliTPCExBFirst.cxx
+ AliTPCGenDBTemp.cxx AliTPCGenDBConf.cxx \
+ AliCorrector.cxx AliTPCExB.cxx AliTPCExBExact.cxx AliTPCExBFirst.cxx