3 void MakeAllDETsFullMisAlignment(Char_t* CDBstorage = "local://$HOME/FullMisAlignment", Bool_t partialGeom=kFALSE){
4 // Make full misalignment objects for all detectors
5 // Pass different "CDBstorage" argument if needed (e.g. to fill
6 // conditions' data base on alien) or set it to null string to have
7 // the objects saved locally on file
8 // This macro defines the default name and place for the detector-macros
9 // in charge of producing the full misalignment objects as
10 // $ALICE_ROOT/DET/MakeDETFullMisAlignment.C
12 const char* macroname="MakeAllDETsFullMisAlignment.C";
14 TString strStorage(CDBstorage);
15 if(strStorage.IsNull()){
16 gSystem->Setenv("TOCDB","kFALSE");
18 gSystem->Setenv("TOCDB","kTRUE");
19 gSystem->Setenv("STORAGE",strStorage.Data());
20 gSystem->Setenv("ARVERSION",ALIROOT_SVN_BRANCH);
23 gSystem->Setenv("REALSETUP","kTRUE");
25 gSystem->Setenv("REALSETUP","kFALSE");
28 // Load geometry from CDB updating it if we are producing the
29 // alignment objects for the CDB
30 AliCDBManager* cdb = AliCDBManager::Instance();
31 if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
34 if(strStorage.IsNull()){ //if we produce the objects into a file
35 AliGeomManager::LoadGeometry(); //load geom from default CDB storage
36 }else{ // if we produce the objects in a CDB storage
37 // update geometry in it
38 Info(macroname,"Updating geometry in CDB storage %s",strStorage.Data());
39 gROOT->ProcessLine(".L $ALICE_ROOT/GRP/UpdateCDBIdealGeom.C");
41 UpdateCDBIdealGeom(strStorage.Data(),"$ALICE_ROOT/macros/Config_PDC06.C");
43 UpdateCDBIdealGeom(strStorage.Data(),"$ALICE_ROOT/macros/Config.C");
45 // load the same geometry from given CDB storage
46 AliCDBPath path("GRP","Geometry","Data");
47 AliCDBStorage* storage = cdb->GetStorage(strStorage.Data());
48 AliCDBEntry *entry = storage->Get(path.GetPath(),cdb->GetRun());
49 if(!entry) Fatal(macroname,"Couldn't load geometry data from CDB!");
51 TGeoManager* geom = (TGeoManager*) entry->GetObject();
52 if (!geom) Fatal(macroname,"Couldn't find TGeoManager in the specified CDB entry!");
53 AliGeomManager::SetGeometry(geom);
56 // run macro for non-sensitive modules
57 // (presently generates only FRAME alignment objects)
58 gSystem->Exec("aliroot -b -q $ALICE_ROOT/GRP/MakeSTRUCTFullMisAlignment.C");
60 // run macros for sensitive modules
61 TString sModules="ACORDE,EMCAL,FMD,HMPID,ITS,MUON,PMD,PHOS,T0,TRD,TPC,TOF,VZERO,ZDC";
62 TObjArray *detArray = sModules.Tokenize(',');
65 TString exec_det_macro;
67 while((ostr = (TObjString*) iter.Next())){
68 TString str(ostr->String());
69 exec_det_macro="aliroot -b -q $ALICE_ROOT/";
71 exec_det_macro+="/Make";
73 exec_det_macro+="FullMisAlignment.C";
75 gSystem->Exec(exec_det_macro.Data());