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)
7 // db->Init(run,"TPC/Config/Temperature","TPC/*/*")
8 // db->MakeCalib("TempSensor.txt","DCSMap.root",startTime,endTime,run)
11 #include "AliTPCGenDBTemp.h"
13 ClassImp(AliTPCGenDBTemp)
15 const Int_t kValCut = 100; // discard temperatures > 100 degrees
16 const Int_t kDiffCut = 5; // discard temperature differences > 5 degrees
18 //______________________________________________________________________________________________
20 AliTPCGenDBTemp::AliTPCGenDBTemp():
25 //______________________________________________________________________________________________
27 AliTPCGenDBTemp::AliTPCGenDBTemp(const AliTPCGenDBTemp& org):
35 ((AliTPCGenDBTemp &) org).Copy(*this);
38 //______________________________________________________________________________________________
39 AliTPCGenDBTemp::~AliTPCGenDBTemp(){
45 //______________________________________________________________________________________________
46 AliTPCGenDBTemp& AliTPCGenDBTemp::operator= (const AliTPCGenDBTemp& org )
49 // assignment operator
51 if (&org == this) return *this;
53 new (this) AliTPCGenDBTemp(org);
58 //______________________________________________________________________________________________
60 void AliTPCGenDBTemp::MakeCalib(const char *fList, const char *fMap,
61 const TTimeStamp& startTime,
62 const TTimeStamp& endTime,
65 // The Terminate() function is the last function to be called during
66 // a query. It always runs on the client, it can be used to present
67 // the results graphically or save the results to file.
69 AliTPCSensorTempArray *temperature = new AliTPCSensorTempArray(fList);
70 temperature->SetStartTime(startTime);
71 temperature->SetEndTime(endTime);
72 temperature->SetValCut(kValCut);
73 temperature->SetDiffCut(kDiffCut);
74 TMap* map = SetGraphFile(fMap);
76 temperature->MakeSplineFit(map);
84 SetSensorArray(temperature);
85 StoreObject("TPC/Calib/Temperature",temperature, fMetaData);
88 //______________________________________________________________________________________________
90 TClonesArray * AliTPCGenDBTemp::ReadList(const char *fname) {
92 // read values from ascii file
94 TTree* tree = new TTree("tempConf","tempConf");
95 tree->ReadFile(fname,"");
96 TClonesArray *arr = AliTPCSensorTemp::ReadTree(tree);
101 //______________________________________________________________________________________________
103 TTree * AliTPCGenDBTemp::ReadListTree(const char *fname) {
105 // read values from ascii file
107 TTree* tree = new TTree("tempConf","tempConf");
108 tree->ReadFile(fname,"");
109 TClonesArray *arr = AliTPCSensorTemp::ReadTree(tree);