3 void MakeAllDETsZeroMisAlignment(Char_t* CDBstorage = "local://$HOME/ZeroMisAlignment", Bool_t partialGeom=kFALSE){
4 // Make zero 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
9 const char* macroname="MakeAllDETsZeroMisAlignment.C";
11 TString strStorage(CDBstorage);
12 if(strStorage.IsNull()){
13 gSystem->Setenv("TOCDB","kFALSE");
15 gSystem->Setenv("TOCDB","kTRUE");
16 gSystem->Setenv("STORAGE",strStorage.Data());
17 gSystem->Setenv("ARVERSION",ALIROOT_SVN_BRANCH);
20 gSystem->Setenv("REALSETUP","kTRUE");
22 gSystem->Setenv("REALSETUP","kFALSE");
25 // Load geometry from CDB updating it if we are producing the
26 // alignment objects for the CDB
27 AliCDBManager* cdb = AliCDBManager::Instance();
28 if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
31 if(strStorage.IsNull()){ //if we produce the objects into a file
32 AliGeomManager::LoadGeometry(); //load geom from default CDB storage
33 }else{ // if we produce the objects in a CDB storage
34 // update geometry in it
35 Info(macroname,"Updating geometry in CDB storage %s",strStorage.Data());
36 gROOT->ProcessLine(".L $ALICE_ROOT/GRP/UpdateCDBIdealGeom.C");
38 UpdateCDBIdealGeom(strStorage.Data(),"$ALICE_ROOT/macros/Config_PDC06.C");
40 UpdateCDBIdealGeom(strStorage.Data(),"$ALICE_ROOT/macros/Config.C");
42 // load the same geometry from given CDB storage
43 AliCDBPath path("GRP","Geometry","Data");
44 AliCDBStorage* storage = cdb->GetStorage(strStorage.Data());
45 AliCDBEntry *entry = storage->Get(path.GetPath(),cdb->GetRun());
46 if(!entry) Fatal(macroname,"Couldn't load geometry data from CDB!");
48 TGeoManager* geom = (TGeoManager*) entry->GetObject();
49 if (!geom) Fatal(macroname,"Couldn't find TGeoManager in the specified CDB entry!");
50 AliGeomManager::SetGeometry(geom);
53 // run macro for non-sensitive modules
54 // (presently generates only FRAME alignment objects)
55 gSystem->Exec("aliroot -b -q $ALICE_ROOT/GRP/MakeSTRUCTZeroMisAlignment.C");
57 // run macros for sensitive modules
58 TString sModules="ACORDE,EMCAL,FMD,HMPID,ITS,MUON,PMD,PHOS,T0,TRD,TPC,TOF,VZERO,ZDC";
59 TObjArray *detArray = sModules.Tokenize(',');
62 TString exec_det_macro;
64 while((ostr = (TObjString*) iter.Next())){
65 TString str(ostr->String());
66 exec_det_macro="aliroot -b -q $ALICE_ROOT/";
68 exec_det_macro+="/Make";
70 exec_det_macro+="ZeroMisAlignment.C";
72 gSystem->Exec(exec_det_macro.Data());