]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - T0/AliT0Align.cxx
fix macros
[u/mrichter/AliRoot.git] / T0 / AliT0Align.cxx
index cd774d6c6bba6bd307e29004caa65ea3057de29c..593d1f5c361b2daf902ded433f11222abc8cfe24 100644 (file)
@@ -28,6 +28,7 @@ Preliminary test version (T.Malkiewicz)
 #include "TFile.h"
 #include "TMath.h"
 #include "TSystem.h"
+#include "TString.h"
 #include "AliSurveyObj.h"
 #include "AliAlignObjParams.h"
 #include "AliCDBStorage.h"
@@ -87,15 +88,18 @@ AliT0Align::AliT0Align(Int_t reportloc, Int_t side, Int_t reportglob) :
   fRepLoc = reportloc;
   fRepGlob = reportglob;
   fSide = side;
-  Char_t path[50];
-  fFileGlob = new Char_t[80];
-  fUser = new Char_t[10];
-  sprintf(path,gSystem->Getenv("ALICE_ROOT")); 
+  // Char_t path[50];
+  TString path = Form("%s",gSystem->Getenv("ALICE_ROOT")) ;
+  // fFileGlob = new Char_t[80];
+  //  fUser = new Char_t[10];
+  fFileGlob = Form("%s/T0/Survey_%d_V0.txt",path.Data(),reportglob);
+  fUser = Form("%s/T0/Survey_%d_V0.txt",path.Data(),reportglob);
+  // sprintf(path,gSystem->Getenv("ALICE_ROOT")); 
   //
   // sprintf(fFileLoc,"%s/T0/Survey_%d_T0.txt",path,reportloc);
-  sprintf(fFileGlob,"%s/T0/Survey_%d_V0.txt",path,reportglob);
+  // sprintf(fFileGlob,"%s/T0/Survey_%d_V0.txt",path,reportglob);
   //
-  sprintf(fUser,gSystem->Getenv("alien_API_USER"));
+  // sprintf(fUser,gSystem->Getenv("alien_API_USER"));
 }
 //_________________________________________________________________________
 AliT0Align::AliT0Align(const AliT0Align &align) :
@@ -136,7 +140,7 @@ AliT0Align::~AliT0Align()
   //
   if(fT0AAlignObj) delete fT0AAlignObj;
   if(fT0CAlignObj) delete fT0CAlignObj;
-  if(fFileGlob) delete[] fT0CAlignObj;
+  if(fFileGlob) delete[] fFileGlob;
   if(fUser) delete[] fUser;
 }
 //__________________________________________________________________________
@@ -147,7 +151,7 @@ Bool_t AliT0Align::LoadSurveyData()
  
  AliSurveyObj * s1 = new AliSurveyObj();
  const int numberPoints = 2;
- TString pointNames[numberPoints]={"FLANGE_CENTER","C67_6_Beamcircle"}; 
+ TString pointNames[numberPoints]={"Flange_0","C67_6_Beamcircle"}; 
  
  if(fRepLoc == 0) 
  { 
@@ -252,7 +256,7 @@ void AliT0Align::Run()
   //
   // runs the full chain
   //
-  SetDebug(0);
+  // SetDebug(0);
   Bool_t flag = LoadSurveyData();
     if(flag) 
   {
@@ -271,7 +275,7 @@ void AliT0Align::StoreAlignObj()
  // Storing T0 alignment objects 
  //
  AliCDBManager* cdb = AliCDBManager::Instance();
- if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+ if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
  //
  TClonesArray *array = new TClonesArray("AliAlignObjParams",2);
 //
@@ -292,9 +296,10 @@ void AliT0Align::StoreAlignObj()
   if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
     // save on file
     const char* filename = "T0SurveyMisalignment.root";
-    Char_t fullname[80];
-    sprintf(fullname,"%s/T0/Align/Data/%s",gSystem->Getenv("ALICE_ROOT"),filename);
-    TFile *f = new TFile(fullname,"RECREATE");
+    //  Char_t fullname[80];
+    //  sprintf(fullname,"%s/T0/Align/Data/%s",gSystem->Getenv("ALICE_ROOT"),filename);
+    TString fullname = Form("%s/T0/Align/Data/%s",gSystem->Getenv("ALICE_ROOT"), filename);
+    TFile *f = new TFile(fullname.Data(),"RECREATE");
     if(!f){
       AliError("cannot open file for output\n");
       return;