]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - macros/MakeAllDETsResMisAlignment.C
Macros for residual and full misalignment, collected by Raffaele
[u/mrichter/AliRoot.git] / macros / MakeAllDETsResMisAlignment.C
diff --git a/macros/MakeAllDETsResMisAlignment.C b/macros/MakeAllDETsResMisAlignment.C
new file mode 100644 (file)
index 0000000..e57ccda
--- /dev/null
@@ -0,0 +1,46 @@
+void MakeAllDETsResMisAlignment(Char_t* CDBstorage = "local://$HOME/Residual"){
+  // Make residual misalignment objects for all detectors
+  // Pass different "CDBstorage" argument if needed (e.g. to fill
+  // conditions' data base on alien) or set it to null string to have
+  // the objects saved locally on file 
+  // This macro defines the default name and place for the detector-macros
+  // in charge of producing the full misalignment objects as 
+  // $ALICE_ROOT/DET/MakeDETResidualMisAlignment.C
+  //
+  TString strStorage(CDBstorage);
+  if(strStorage.IsNull()){
+    gSystem->Setenv("$TOCDB","kFALSE");
+  }else{  
+    gSystem->Setenv("$TOCDB","kTRUE");
+    gSystem->Setenv("$STORAGE",strStorage.Data());
+    gSystem->Setenv("$ARVERSION","v4-04-Release");
+  }
+
+  // if not already present, create geometry file needed by those detectors
+  // producing their objects in the local RS
+  if(gSystem->AccessPathName("./geometry.root")){
+    gAlice->Init();
+    gGeoManager->Export("geometry.root");
+  }else{
+    TGeoManager::Import("geometry.root");
+  }
+
+  TString dets="EMCAL,FMD,ITS,MUON,PHOS,PMD,RICH,START,TOF,TPC,TRD,VZERO,ZDC";
+  TObjArray *detArray = dets.Tokenize(',');
+  TIter iter(detArray);
+  TObjString *ostr;
+  TString exec_det_macro;
+
+  while((ostr = (TObjString*) iter.Next())){
+    TString str(ostr->String());
+    exec_det_macro="aliroot -b -q $ALICE_ROOT/";
+    exec_det_macro+=str;
+    exec_det_macro+="/Make";
+    exec_det_macro+=str;
+    exec_det_macro+="ResMisAlignment.C";
+    
+    gSystem->Exec(exec_det_macro.Data());
+  }
+
+  return;
+}