]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - macros/MakeAllDETsZeroMisAlignment.C
For AliAnalysisTaskSingleMu: remove check for IsPileupSPD; possibility to add the...
[u/mrichter/AliRoot.git] / macros / MakeAllDETsZeroMisAlignment.C
index 37daf1dd174b138129c4d64813ad99a35ed48326..a515f5a51986c96fb42f60ff1bcbdfe700bb7456 100644 (file)
@@ -1,6 +1,6 @@
-const char* GetARversion();
+#include "ARVersion.h"
 
-void MakeAllDETsZeroMisAlignment(Char_t* CDBstorage = "local://$ALICE_ROOT"){
+void MakeAllDETsZeroMisAlignment(Char_t* CDBstorage = "local://$HOME/ZeroMisAlignment", Bool_t partialGeom=kFALSE){
   // Make zero 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
@@ -14,13 +14,18 @@ void MakeAllDETsZeroMisAlignment(Char_t* CDBstorage = "local://$ALICE_ROOT"){
   }else{  
     gSystem->Setenv("TOCDB","kTRUE");
     gSystem->Setenv("STORAGE",strStorage.Data());
-    gSystem->Setenv("ARVERSION",GetARversion());
+    gSystem->Setenv("ARVERSION",ALIROOT_SVN_BRANCH);
+  }
+  if(partialGeom){
+    gSystem->Setenv("REALSETUP","kTRUE");
+  }else{
+    gSystem->Setenv("REALSETUP","kFALSE");
   }
 
   // Load geometry from CDB updating it if we are producing the
   // alignment objects for the CDB
   AliCDBManager* cdb = AliCDBManager::Instance();
-  if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT");
+  if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
   cdb->SetRun(0);
   
   if(strStorage.IsNull()){ //if we produce the objects into a file
@@ -29,7 +34,11 @@ void MakeAllDETsZeroMisAlignment(Char_t* CDBstorage = "local://$ALICE_ROOT"){
     // update geometry in it
     Info(macroname,"Updating geometry in CDB storage %s",strStorage.Data());
     gROOT->ProcessLine(".L $ALICE_ROOT/GRP/UpdateCDBIdealGeom.C");
+    if(partialGeom){
+      UpdateCDBIdealGeom(strStorage.Data(),"$ALICE_ROOT/macros/Config_PDC06.C");
+    }else{
     UpdateCDBIdealGeom(strStorage.Data(),"$ALICE_ROOT/macros/Config.C");    
+    }
     // load the same geometry from given CDB storage
     AliCDBPath path("GRP","Geometry","Data");
     AliCDBStorage* storage = cdb->GetStorage(strStorage.Data());
@@ -46,7 +55,7 @@ void MakeAllDETsZeroMisAlignment(Char_t* CDBstorage = "local://$ALICE_ROOT"){
   gSystem->Exec("aliroot -b -q $ALICE_ROOT/GRP/MakeSTRUCTZeroMisAlignment.C");
 
   // run macros for sensitive modules
-  TString sModules="EMCAL,FMD,HMPID,ITS,MUON,PMD,PHOS,T0,TRD,TPC,TOF,VZERO,ZDC";
+  TString sModules="ACORDE,EMCAL,FMD,HMPID,ITS,MUON,PMD,PHOS,T0,TRD,TPC,TOF,VZERO,ZDC";
   TObjArray *detArray = sModules.Tokenize(',');
   TIter iter(detArray);
   TObjString *ostr;
@@ -66,23 +75,3 @@ void MakeAllDETsZeroMisAlignment(Char_t* CDBstorage = "local://$ALICE_ROOT"){
   return;
 }
 
-const char* GetARversion(){
-  // Get AliRoot version from $ALICE_ROOT/CVS/Repository file
-  // It's the best we can do without a GetVersion() method
-  TFile *fv= TFile::Open("$ALICE_ROOT/CVS/Repository?filetype=raw","READ");
-  Int_t size = fv->GetSize();
-  char *buf = new Char_t[size];
-  memset(buf, '\0', size);
-  fv->Seek(0);
-  const char* alirootv;
-  if ( fv->ReadBuffer(buf, size) ) {
-    Printf("Error reading AliRoot version from file to buffer!");
-    alirootv = "";
-  }
-  if(buf=="AliRoot"){
-    alirootv="HEAD";
-  }else{
-    alirootv = buf;
-  }
-  return alirootv;
-}