Remove compiler warnings
[u/mrichter/AliRoot.git] / TPC / AliTPCGenDBTemp.cxx
CommitLineData
9312398d 1
9312398d 2// TTimeStamp startTime(2006,10,18,0,0,0,0,kFALSE)
3// TTimeStamp endTime(2006,10,19,0,0,0,0,kFALSE)
4// Int_t run=2546
5// AliTPCGenDBTemp db
6// db->Init(run,"TPC/Config/Temperature","TPC/*/*")
7// db->MakeCalib("TempSensor.txt","DCSMap.root",startTime,endTime,run)
8
e03a46ac 9// Data base entry generation:
10
11// AliTPCGenDBTemp db
12// db->SetDefaultStorage("local://$ALICE_ROOT");
13// db->SetSpecificStorage("local:///afs/cern.ch/alice/tpctest/Calib/");
14// db->Init(0,"TPC/Config/Temperature","TPC/*/*")
15// db->MakeConfig("TempSensor.txt",0,999999999,"TPC/Config/Temperature")
16
17
18
19
20
9312398d 21
22#include "AliTPCGenDBTemp.h"
9f016d99 23#include "AliLog.h"
9312398d 24
25ClassImp(AliTPCGenDBTemp)
26
27const Int_t kValCut = 100; // discard temperatures > 100 degrees
28const Int_t kDiffCut = 5; // discard temperature differences > 5 degrees
29
30//______________________________________________________________________________________________
31
32AliTPCGenDBTemp::AliTPCGenDBTemp():
33 AliDCSGenDB()
34{
35}
36
37//______________________________________________________________________________________________
38
9f016d99 39AliTPCGenDBTemp::AliTPCGenDBTemp(const char *defaultStorage, const char *specificStorage) :
40 AliDCSGenDB(defaultStorage,specificStorage)
41{
42}
43
44//______________________________________________________________________________________________
45
f4a89669 46AliTPCGenDBTemp::AliTPCGenDBTemp(const AliTPCGenDBTemp& ) : AliDCSGenDB()
9312398d 47{
48
49//
50// Copy constructor
51//
9f016d99 52 AliError("copy constructor not implemented");
9312398d 53
9312398d 54}
55
56//______________________________________________________________________________________________
57AliTPCGenDBTemp::~AliTPCGenDBTemp(){
58//
59// destructor
60//
61
62}
63//______________________________________________________________________________________________
e03a46ac 64AliTPCGenDBTemp& AliTPCGenDBTemp::operator= (const AliTPCGenDBTemp& )
9312398d 65{
66 //
67 // assignment operator
68 //
9f016d99 69 AliError("assignment operator not implemented");
9312398d 70 return *this;
71}
72
73
74//______________________________________________________________________________________________
75
76void AliTPCGenDBTemp::MakeCalib(const char *fList, const char *fMap,
77 const TTimeStamp& startTime,
78 const TTimeStamp& endTime,
5a163c08 79 Int_t run, const TString& amandaString )
9312398d 80{
81 // The Terminate() function is the last function to be called during
82 // a query. It always runs on the client, it can be used to present
83 // the results graphically or save the results to file.
84
5a163c08 85 AliTPCSensorTempArray *temperature=0;
86 if ( amandaString.Length()== 0 ) {
87 temperature = new AliTPCSensorTempArray(fList);
88 } else {
89 temperature = new AliTPCSensorTempArray(fList,amandaString);
90 }
9312398d 91 temperature->SetStartTime(startTime);
92 temperature->SetEndTime(endTime);
93 temperature->SetValCut(kValCut);
94 temperature->SetDiffCut(kDiffCut);
95 TMap* map = SetGraphFile(fMap);
96 if (map) {
97 temperature->MakeSplineFit(map);
98 }
99 delete map;
100 map=0;
101 fMap=0;
102
103 SetFirstRun(run);
104 SetLastRun(run);
105 SetSensorArray(temperature);
106 StoreObject("TPC/Calib/Temperature",temperature, fMetaData);
107}
108
109//______________________________________________________________________________________________
110
e03a46ac 111TClonesArray * AliTPCGenDBTemp::ReadList(const char *fname, const char *title,
112 const TString& amandaString) {
9312398d 113 //
114 // read values from ascii file
115 //
e03a46ac 116 TTree* tree = new TTree(title,title);
9312398d 117 tree->ReadFile(fname,"");
e03a46ac 118 TClonesArray *arr;
119 if ( amandaString.Length()== 0 ) {
120 arr = AliTPCSensorTemp::ReadTree(tree);
121 } else {
122 arr = AliTPCSensorTemp::ReadTree(tree,amandaString);
123 }
9312398d 124 delete tree;
125 return arr;
126}
127
128//______________________________________________________________________________________________
129
e03a46ac 130TTree * AliTPCGenDBTemp::ReadListTree(const char *fname, const char *title,
131 const TString& amandaString) {
9312398d 132 //
133 // read values from ascii file
134 //
e03a46ac 135 TTree* tree = new TTree(title,title);
9312398d 136 tree->ReadFile(fname,"");
e03a46ac 137 TClonesArray *arr;
138 if ( amandaString.Length()== 0 ) {
139 arr = AliTPCSensorTemp::ReadTree(tree);
140 } else {
141 arr = AliTPCSensorTemp::ReadTree(tree,amandaString);
142 }
9312398d 143 arr->Delete();
144 delete arr;
145 return tree;
146}
e03a46ac 147//______________________________________________________________________________________________
148void AliTPCGenDBTemp::MakeConfig(const char *file, Int_t firstRun, Int_t lastRun,
149 const char *confDir, const TString& amandaString)
150{
151 //
152 // Store Configuration file to OCDB
153 //
154
87d77b35 155 TTree *tree = ReadListTree(file,"tempConf",amandaString);
e03a46ac 156 SetConfTree(tree);
157 SetFirstRun(firstRun);
158 SetLastRun(lastRun);
159
160 StoreObject(confDir, fConfTree, fMetaData);
161}
162
163