Record changes.
[u/mrichter/AliRoot.git] / TPC / AliTPCGenDBTemp.cxx
CommitLineData
9312398d 1
2// .L /afs/cern.ch/user/h/haavard/alice/tpc/temperature/AliTPCGenDBTemp.C+
3// TTimeStamp startTime(2006,10,18,0,0,0,0,kFALSE)
4// TTimeStamp endTime(2006,10,19,0,0,0,0,kFALSE)
5// Int_t run=2546
6// AliTPCGenDBTemp db
7// db->Init(run,"TPC/Config/Temperature","TPC/*/*")
8// db->MakeCalib("TempSensor.txt","DCSMap.root",startTime,endTime,run)
9
10
11#include "AliTPCGenDBTemp.h"
9f016d99 12#include "AliLog.h"
9312398d 13
14ClassImp(AliTPCGenDBTemp)
15
16const Int_t kValCut = 100; // discard temperatures > 100 degrees
17const Int_t kDiffCut = 5; // discard temperature differences > 5 degrees
18
19//______________________________________________________________________________________________
20
21AliTPCGenDBTemp::AliTPCGenDBTemp():
22 AliDCSGenDB()
23{
24}
25
26//______________________________________________________________________________________________
27
9f016d99 28AliTPCGenDBTemp::AliTPCGenDBTemp(const char *defaultStorage, const char *specificStorage) :
29 AliDCSGenDB(defaultStorage,specificStorage)
30{
31}
32
33//______________________________________________________________________________________________
34
35AliTPCGenDBTemp::AliTPCGenDBTemp(const AliTPCGenDBTemp& org) : AliDCSGenDB(org)
9312398d 36{
37
38//
39// Copy constructor
40//
9f016d99 41 AliError("copy constructor not implemented");
9312398d 42
9312398d 43}
44
45//______________________________________________________________________________________________
46AliTPCGenDBTemp::~AliTPCGenDBTemp(){
47//
48// destructor
49//
50
51}
52//______________________________________________________________________________________________
53AliTPCGenDBTemp& AliTPCGenDBTemp::operator= (const AliTPCGenDBTemp& org )
54{
55 //
56 // assignment operator
57 //
9f016d99 58 AliError("assignment operator not implemented");
9312398d 59 return *this;
60}
61
62
63//______________________________________________________________________________________________
64
65void AliTPCGenDBTemp::MakeCalib(const char *fList, const char *fMap,
66 const TTimeStamp& startTime,
67 const TTimeStamp& endTime,
68 Int_t run )
69{
70 // The Terminate() function is the last function to be called during
71 // a query. It always runs on the client, it can be used to present
72 // the results graphically or save the results to file.
73
74 AliTPCSensorTempArray *temperature = new AliTPCSensorTempArray(fList);
75 temperature->SetStartTime(startTime);
76 temperature->SetEndTime(endTime);
77 temperature->SetValCut(kValCut);
78 temperature->SetDiffCut(kDiffCut);
79 TMap* map = SetGraphFile(fMap);
80 if (map) {
81 temperature->MakeSplineFit(map);
82 }
83 delete map;
84 map=0;
85 fMap=0;
86
87 SetFirstRun(run);
88 SetLastRun(run);
89 SetSensorArray(temperature);
90 StoreObject("TPC/Calib/Temperature",temperature, fMetaData);
91}
92
93//______________________________________________________________________________________________
94
95TClonesArray * AliTPCGenDBTemp::ReadList(const char *fname) {
96 //
97 // read values from ascii file
98 //
99 TTree* tree = new TTree("tempConf","tempConf");
100 tree->ReadFile(fname,"");
101 TClonesArray *arr = AliTPCSensorTemp::ReadTree(tree);
102 delete tree;
103 return arr;
104}
105
106//______________________________________________________________________________________________
107
108TTree * AliTPCGenDBTemp::ReadListTree(const char *fname) {
109 //
110 // read values from ascii file
111 //
112 TTree* tree = new TTree("tempConf","tempConf");
113 tree->ReadFile(fname,"");
114 TClonesArray *arr = AliTPCSensorTemp::ReadTree(tree);
115 arr->Delete();
116 delete arr;
117 return tree;
118}