]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCGenDBTemp.cxx
Using proper file IDs in DAs
[u/mrichter/AliRoot.git] / TPC / AliTPCGenDBTemp.cxx
index c58f498fcd28f19053fdd6e1c8d5375197e2dedd..27a27a79333e218feb8a2506dec0c2b6173d95ee 100644 (file)
@@ -1,5 +1,4 @@
 
-// .L /afs/cern.ch/user/h/haavard/alice/tpc/temperature/AliTPCGenDBTemp.C+
 // TTimeStamp startTime(2006,10,18,0,0,0,0,kFALSE)
 // TTimeStamp endTime(2006,10,19,0,0,0,0,kFALSE)
 // Int_t run=2546
@@ -7,8 +6,21 @@
 // db->Init(run,"TPC/Config/Temperature","TPC/*/*")
 // db->MakeCalib("TempSensor.txt","DCSMap.root",startTime,endTime,run)
 
+//  Data base entry generation:
+  
+//  AliTPCGenDBTemp db
+//  db->SetDefaultStorage("local://$ALICE_ROOT");
+//  db->SetSpecificStorage("local:///afs/cern.ch/alice/tpctest/Calib/");
+//  db->Init(0,"TPC/Config/Temperature","TPC/*/*")
+//  db->MakeConfig("TempSensor.txt",0,999999999,"TPC/Config/Temperature")
+
+  
+
+
+
 
 #include "AliTPCGenDBTemp.h"
+#include "AliLog.h"
 
 ClassImp(AliTPCGenDBTemp)
 
@@ -24,15 +36,21 @@ AliTPCGenDBTemp::AliTPCGenDBTemp():
 
 //______________________________________________________________________________________________
 
-AliTPCGenDBTemp::AliTPCGenDBTemp(const AliTPCGenDBTemp& org):
-  AliDCSGenDB(org)
+AliTPCGenDBTemp::AliTPCGenDBTemp(const char *defaultStorage, const char *specificStorage) :
+   AliDCSGenDB(defaultStorage,specificStorage)
+{
+}
+
+//______________________________________________________________________________________________
+
+AliTPCGenDBTemp::AliTPCGenDBTemp(const AliTPCGenDBTemp& org) : AliDCSGenDB(org)
 {
 
 //
 //  Copy constructor
 //
+ AliError("copy constructor not implemented");
 
- ((AliTPCGenDBTemp &) org).Copy(*this);
 }
 
 //______________________________________________________________________________________________
@@ -43,14 +61,12 @@ AliTPCGenDBTemp::~AliTPCGenDBTemp(){
 
 }
 //______________________________________________________________________________________________
-AliTPCGenDBTemp& AliTPCGenDBTemp::operator= (const AliTPCGenDBTemp& org )
+AliTPCGenDBTemp& AliTPCGenDBTemp::operator= (const AliTPCGenDBTemp&  )
 {
  //
  // assignment operator
  //
- if (&org == this) return *this;
-
- new (this) AliTPCGenDBTemp(org);
+ AliError("assignment operator not implemented");
  return *this;
 }
 
@@ -87,27 +103,56 @@ void AliTPCGenDBTemp::MakeCalib(const char *fList, const char *fMap,
 
 //______________________________________________________________________________________________
 
-TClonesArray * AliTPCGenDBTemp::ReadList(const char *fname) {
+TClonesArray * AliTPCGenDBTemp::ReadList(const char *fname, const char *title,
+                       const TString& amandaString) {
   //
   // read values from ascii file
   //
-  TTree* tree = new TTree("tempConf","tempConf");
+  TTree* tree = new TTree(title,title);
   tree->ReadFile(fname,"");
-  TClonesArray *arr = AliTPCSensorTemp::ReadTree(tree);
+  TClonesArray *arr;
+  if ( amandaString.Length()== 0 ) {
+    arr = AliTPCSensorTemp::ReadTree(tree);
+  } else {
+    arr = AliTPCSensorTemp::ReadTree(tree,amandaString);
+  }
   delete tree;
   return arr;
 }
 
 //______________________________________________________________________________________________
 
-TTree * AliTPCGenDBTemp::ReadListTree(const char *fname) {
+TTree * AliTPCGenDBTemp::ReadListTree(const char *fname, const char *title,
+                         const TString& amandaString) {
   //
   // read values from ascii file
   //
-  TTree* tree = new TTree("tempConf","tempConf");
+  TTree* tree = new TTree(title,title);
   tree->ReadFile(fname,"");
-  TClonesArray *arr = AliTPCSensorTemp::ReadTree(tree);
+  TClonesArray *arr;
+  if ( amandaString.Length()== 0 ) {
+    arr = AliTPCSensorTemp::ReadTree(tree);
+  } else {
+    arr = AliTPCSensorTemp::ReadTree(tree,amandaString);
+  }
   arr->Delete();
   delete arr;
   return tree;
 }
+//______________________________________________________________________________________________
+void AliTPCGenDBTemp::MakeConfig(const char *file, Int_t firstRun, Int_t lastRun, 
+                             const char *confDir, const TString& amandaString)
+{
+   //
+   // Store Configuration file to OCDB
+   //
+
+   TTree *tree = ReadListTree(file,amandaString);
+   SetConfTree(tree);
+   SetFirstRun(firstRun);
+   SetLastRun(lastRun);
+
+   StoreObject(confDir, fConfTree, fMetaData);
+}
+
+