]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/scripts/TestSurveyToAlignObjs.C
Finalised the survey to alignment conversion. Closing corresponding task
[u/mrichter/AliRoot.git] / FMD / scripts / TestSurveyToAlignObjs.C
index e4735605b5c03488c55379c99c5e38d5bd315a8d..839df67a81d3792c9f1a48a9ee46cede8bbe9c3a 100644 (file)
@@ -1,10 +1,33 @@
 void
-TestSurveyToAlignObjs()
+TestSurveyToAlignObjs(Int_t det=1, Bool_t cdbStore=false)
 {
+  if (det < 1 || det > 2) { 
+    Error("TestSurveyToAlignObjs", "Invalid detector %d (must be 1,2, or 3)", 
+         det);
+    return;
+  }
+
+  const char* files[] = { 
+    "$ALICE_ROOT/FMD/Survey_943928_FMD.txt", 
+    "$ALICE_ROOT/FMD/Survey_976326_FMD.txt", 
+    0 
+  };
+  
+  
   AliGeomManager::LoadGeometry("geometry.root");
 
   AliFMDSurveyToAlignObjs convert;
-  convert.LoadSurveyFromLocalFile("$ALICE_ROOT/FMD/Survey_XXX_FMD.txt");
+  if (!convert.LoadSurveyFromLocalFile(files[det-1])) { 
+    Error("TestSurveyToAlignObjs", "Failed to load %s", files[det-1]);
+    return;
+  }
   convert.Run();
+  convert.CreateAlignObjs();
+  convert.GetAlignObjArray()->Print();
+
+  if (!cdbStore) 
+    convert.StoreAlignObjToFile("FMD_Survey.root", "FMD");
+  else 
+    convert.StoreAlignObjToCDB("FMD/Align/Data", "FMD");
 }