]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - VZERO/VZEROSurveyToAlignment.C
New treatment of the cluster coordinate (Christoph)
[u/mrichter/AliRoot.git] / VZERO / VZEROSurveyToAlignment.C
index e5fa992f524c56d6387613d859e197ec5e0a4459..da41f65c5f41ccc6d87e8882fd52776c14cd648b 100644 (file)
@@ -1,4 +1,3 @@
-
 void VZEROSurveyToAlignment(){
 
   // Macro to convert survey data into alignment data. 
@@ -129,9 +128,9 @@ void VZEROSurveyToAlignment(){
 
      for(Int_t i=0; i<3; i++) 
      { ngA[i]  = coordinates[0][i] / 10.0 ; 
-       ngB[i]  = coordinates[1][i] / 10.0 ;
-       ngC[i]  = coordinates[2][i] / 10.0 ; 
-       ngD[i]  = coordinates[3][i] / 10.0 ; }
+       ngD[i]  = coordinates[1][i] / 10.0 ;
+       ngB[i]  = coordinates[2][i] / 10.0 ; 
+       ngC[i]  = coordinates[3][i] / 10.0 ; }
           
    cout<<endl<<"Fiducial marks coordinates in the global RS given by surveyers:\n"<<
     "A "<<ngA[0]<<" "<<ngA[1]<<" "<<ngA[2]<<" "<<endl<<
@@ -185,7 +184,7 @@ void VZEROSurveyToAlignment(){
     plane[i] = n[i] * s;
   }
   plane[3] = -( plane[0] * ngA[0] + plane[1] * ngA[1] + plane[2] * ngA[2] );
-  //  cout<<plane[0]<<"  "<<plane[1]<<"  "<<plane[2]<<"  "<<plane[3]<<"  "<<endl;
+//  cout<<plane[0]<<"  "<<plane[1]<<"  "<<plane[2]<<"  "<<plane[3]<<"  "<<endl;
 
   // The center of the square with fiducial marks as corners
   // as the middle point of one diagonal - md
@@ -200,8 +199,7 @@ void VZEROSurveyToAlignment(){
   for(i=0;i<3;i++){
     orig[i] = md[i] - plane[i]*zdepth;
   }
-  orig[1] = md[1] - plane[1]*zdepth;
-  orig[2] = md[2] - plane[2]*zdepth;
+
   cout<<endl<<"Center of the box: "<<orig[0]<<"  "<<orig[1]<<"  "<<orig[2]<<endl;
 
   // get x,y local directions needed to write the global rotation matrix
@@ -248,22 +246,21 @@ void VZEROSurveyToAlignment(){
   
   if(!gSystem->Getenv("$TOCDB")){
     // save on file
-    TFile f("V0Survey.root","RECREATE");
-    if(!f) cerr<<"cannot open file for output\n";
-    f.cd();
-    f.WriteObject(array,"V0SurveyObjs ","kSingleKey");
-    f.Close();
+     TFile f("V0Survey.root","RECREATE");
+     if(!f) cerr<<"cannot open file for output\n";
+     f.cd();
+     f.WriteObject(array,"V0SurveyObjs ","kSingleKey");
+     f.Close();
   }else{
     // save in CDB storage
-    const char* Storage = gSystem->Getenv("$STORAGE");
-    AliCDBManager* cdb = AliCDBManager::Instance();
-    AliCDBStorage* storage = cdb->GetStorage(Storage);
-    AliCDBMetaData* md = new AliCDBMetaData();
-    md->SetResponsible("Brigitte Cheynis");
-    md->SetComment("Alignment objects for V0 survey");
-    md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
-    AliCDBId id("VZERO/Align/Data",0,9999999);
-    storage->Put(array,id,md);
+     AliCDBManager* cdb = AliCDBManager::Instance();
+     AliCDBStorage* storage = cdb->GetStorage("local://$ALICE_ROOT");
+     AliCDBMetaData* mda = new AliCDBMetaData();
+     mda->SetResponsible("Brigitte Cheynis");
+     mda->SetComment("Alignment objects for V0 survey");
+     mda->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
+     AliCDBId id("VZERO/Align/Data",0,9999999);
+     storage->Put(array,id,mda);
   }
 
   array->Delete();