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");
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& org) : AliDCSGenDB(org)
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,
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 = new AliTPCSensorTempArray(fList);
86 temperature->SetStartTime(startTime);
87 temperature->SetEndTime(endTime);
88 temperature->SetValCut(kValCut);
89 temperature->SetDiffCut(kDiffCut);
90 TMap* map = SetGraphFile(fMap);
92 temperature->MakeSplineFit(map);
100 SetSensorArray(temperature);
101 StoreObject("TPC/Calib/Temperature",temperature, fMetaData);
104 //______________________________________________________________________________________________
106 TClonesArray * AliTPCGenDBTemp::ReadList(const char *fname, const char *title,
107 const TString& amandaString) {
109 // read values from ascii file
111 TTree* tree = new TTree(title,title);
112 tree->ReadFile(fname,"");
114 if ( amandaString.Length()== 0 ) {
115 arr = AliTPCSensorTemp::ReadTree(tree);
117 arr = AliTPCSensorTemp::ReadTree(tree,amandaString);
123 //______________________________________________________________________________________________
125 TTree * AliTPCGenDBTemp::ReadListTree(const char *fname, const char *title,
126 const TString& amandaString) {
128 // read values from ascii file
130 TTree* tree = new TTree(title,title);
131 tree->ReadFile(fname,"");
133 if ( amandaString.Length()== 0 ) {
134 arr = AliTPCSensorTemp::ReadTree(tree);
136 arr = AliTPCSensorTemp::ReadTree(tree,amandaString);
142 //______________________________________________________________________________________________
143 void AliTPCGenDBTemp::MakeConfig(const char *file, Int_t firstRun, Int_t lastRun,
144 const char *confDir, const TString& amandaString)
147 // Store Configuration file to OCDB
150 TTree *tree = ReadListTree(file,amandaString);
152 SetFirstRun(firstRun);
155 StoreObject(confDir, fConfTree, fMetaData);