2 // TTimeStamp startTime(2006,10,18,0,0,0,0,kFALSE)
3 // TTimeStamp endTime(2006,10,19,0,0,0,0,kFALSE)
6 // db->Init(run,"TPC/Config/Temperature","TPC/*/*")
7 // db->MakeCalib("TempSensor.txt","DCSMap.root",startTime,endTime,run)
9 // Data base entry generation:
12 // db->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
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")
22 #include "AliTPCGenDBTemp.h"
25 ClassImp(AliTPCGenDBTemp)
27 const Int_t kValCut = 100; // discard temperatures > 100 degrees
28 const Int_t kDiffCut = 5; // discard temperature differences > 5 degrees
30 //______________________________________________________________________________________________
32 AliTPCGenDBTemp::AliTPCGenDBTemp():
37 //______________________________________________________________________________________________
39 AliTPCGenDBTemp::AliTPCGenDBTemp(const char *defaultStorage, const char *specificStorage) :
40 AliDCSGenDB(defaultStorage,specificStorage)
44 //______________________________________________________________________________________________
46 AliTPCGenDBTemp::AliTPCGenDBTemp(const AliTPCGenDBTemp& ) : AliDCSGenDB()
52 AliError("copy constructor not implemented");
56 //______________________________________________________________________________________________
57 AliTPCGenDBTemp::~AliTPCGenDBTemp(){
63 //______________________________________________________________________________________________
64 AliTPCGenDBTemp& AliTPCGenDBTemp::operator= (const AliTPCGenDBTemp& )
67 // assignment operator
69 AliError("assignment operator not implemented");
74 //______________________________________________________________________________________________
76 void AliTPCGenDBTemp::MakeCalib(const char *fList, const char *fMap,
77 const TTimeStamp& startTime,
78 const TTimeStamp& endTime,
79 Int_t run, const TString& amandaString )
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.
85 AliTPCSensorTempArray *temperature=0;
86 if ( amandaString.Length()== 0 ) {
87 temperature = new AliTPCSensorTempArray(fList);
89 temperature = new AliTPCSensorTempArray(fList,amandaString);
91 temperature->SetStartTime(startTime);
92 temperature->SetEndTime(endTime);
93 temperature->SetValCut(kValCut);
94 temperature->SetDiffCut(kDiffCut);
95 TMap* map = SetGraphFile(fMap);
97 temperature->MakeSplineFit(map);
105 SetSensorArray(temperature);
106 StoreObject("TPC/Calib/Temperature",temperature, fMetaData);
109 //______________________________________________________________________________________________
111 TClonesArray * AliTPCGenDBTemp::ReadList(const char *fname, const char *title,
112 const TString& amandaString) {
114 // read values from ascii file
116 TTree* tree = new TTree(title,title);
117 tree->ReadFile(fname,"");
119 if ( amandaString.Length()== 0 ) {
120 arr = AliTPCSensorTemp::ReadTree(tree);
122 arr = AliTPCSensorTemp::ReadTree(tree,amandaString);
128 //______________________________________________________________________________________________
130 TTree * AliTPCGenDBTemp::ReadListTree(const char *fname, const char *title) {
132 // read values from ascii file
134 TTree* tree = new TTree(title,title);
135 tree->ReadFile(fname,"");
139 //______________________________________________________________________________________________
140 void AliTPCGenDBTemp::MakeConfig(const char *file, Int_t firstRun, Int_t lastRun,
144 // Store Configuration file to OCDB
147 TTree *tree = ReadListTree(file,"tempConf");
149 SetFirstRun(firstRun);
152 StoreObject(confDir, fConfTree, fMetaData);