]> git.uio.no Git - u/mrichter/AliRoot.git/blob - macros/MakeAllDETsZeroMisAlignment.C
Using AliGeomManager in the macros (Raffaele)
[u/mrichter/AliRoot.git] / macros / MakeAllDETsZeroMisAlignment.C
1 void MakeAllDETsZeroMisAlignment(Char_t* CDBstorage = "local://$HOME/Zero"){
2   // Make zero misalignment objects for all detectors
3   // Pass different "CDBstorage" argument if needed (e.g. to fill
4   // conditions' data base on alien) or set it to null string to have
5   // the objects saved locally on file 
6   //
7   TString strStorage(CDBstorage);
8   if(strStorage.IsNull()){
9     gSystem->Setenv("TOCDB","kFALSE");
10   }else{  
11     gSystem->Setenv("TOCDB","kTRUE");
12     gSystem->Setenv("STORAGE",strStorage.Data());
13     gSystem->Setenv("ARVERSION","v4-05-08");
14   }
15
16   if(!AliGeomManager::GetGeometry()){
17     if(!(AliCDBManager::Instance())->IsDefaultStorageSet())
18       AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
19       AliCDBManager::Instance()->SetRun(0);
20     AliGeomManager::LoadGeometry();
21   }
22
23
24   TString dets="EMCAL,FMD,HMPID,ITS,MUON,PMD,PHOS,T0,TRD,TPC,TOF,VZERO,ZDC";
25   TObjArray *detArray = dets.Tokenize(',');
26   TIter iter(detArray);
27   TObjString *ostr;
28   TString exec_det_macro;
29
30   while((ostr = (TObjString*) iter.Next())){
31     TString str(ostr->String());
32     exec_det_macro="aliroot -b -q $ALICE_ROOT/";
33     exec_det_macro+=str;
34     exec_det_macro+="/Make";
35     exec_det_macro+=str;
36     exec_det_macro+="ZeroMisAlignment.C";
37     
38     gSystem->Exec(exec_det_macro.Data());
39   }
40
41   return;
42 }