]>
Commit | Line | Data |
---|---|---|
a24be56b | 1 | void MakeAllDETsZeroMisAlignment(Char_t* CDBstorage = "local://$HOME/ZeroMisAlignment", Bool_t partialGeom=kFALSE){ |
d3a9c52a | 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 | // | |
6fce62af | 7 | const char* macroname="MakeAllDETsZeroMisAlignment.C"; |
8 | ||
d3a9c52a | 9 | TString strStorage(CDBstorage); |
10 | if(strStorage.IsNull()){ | |
5bd470e1 | 11 | gSystem->Setenv("TOCDB","kFALSE"); |
d3a9c52a | 12 | }else{ |
5bd470e1 | 13 | gSystem->Setenv("TOCDB","kTRUE"); |
14 | gSystem->Setenv("STORAGE",strStorage.Data()); | |
a24be56b | 15 | gROOT->ProcessLine(".L $ALICE_ROOT/macros/GetARversion.C"); |
6fce62af | 16 | gSystem->Setenv("ARVERSION",GetARversion()); |
d3a9c52a | 17 | } |
a24be56b | 18 | if(partialGeom){ |
19 | gSystem->Setenv("PARTGEOM","kTRUE"); | |
20 | }else{ | |
21 | gSystem->Setenv("PARTGEOM","kFALSE"); | |
22 | } | |
d3a9c52a | 23 | |
6fce62af | 24 | // Load geometry from CDB updating it if we are producing the |
25 | // alignment objects for the CDB | |
26 | AliCDBManager* cdb = AliCDBManager::Instance(); | |
27 | if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT"); | |
28 | cdb->SetRun(0); | |
29 | ||
30 | if(strStorage.IsNull()){ //if we produce the objects into a file | |
31 | AliGeomManager::LoadGeometry(); //load geom from default CDB storage | |
32 | }else{ // if we produce the objects in a CDB storage | |
33 | // update geometry in it | |
34 | Info(macroname,"Updating geometry in CDB storage %s",strStorage.Data()); | |
35 | gROOT->ProcessLine(".L $ALICE_ROOT/GRP/UpdateCDBIdealGeom.C"); | |
a24be56b | 36 | if(partialGeom){ |
37 | UpdateCDBIdealGeom(strStorage.Data(),"$ALICE_ROOT/macros/Config_PDC06.C"); | |
38 | }else{ | |
6fce62af | 39 | UpdateCDBIdealGeom(strStorage.Data(),"$ALICE_ROOT/macros/Config.C"); |
a24be56b | 40 | } |
6fce62af | 41 | // load the same geometry from given CDB storage |
42 | AliCDBPath path("GRP","Geometry","Data"); | |
43 | AliCDBStorage* storage = cdb->GetStorage(strStorage.Data()); | |
44 | AliCDBEntry *entry = storage->Get(path.GetPath(),cdb->GetRun()); | |
45 | if(!entry) Fatal(macroname,"Couldn't load geometry data from CDB!"); | |
46 | entry->SetOwner(0); | |
47 | TGeoManager* geom = (TGeoManager*) entry->GetObject(); | |
48 | if (!geom) Fatal(macroname,"Couldn't find TGeoManager in the specified CDB entry!"); | |
49 | AliGeomManager::SetGeometry(geom); | |
d3a9c52a | 50 | } |
6fce62af | 51 | |
52 | // run macro for non-sensitive modules | |
53 | // (presently generates only FRAME alignment objects) | |
54 | gSystem->Exec("aliroot -b -q $ALICE_ROOT/GRP/MakeSTRUCTZeroMisAlignment.C"); | |
d3a9c52a | 55 | |
6fce62af | 56 | // run macros for sensitive modules |
57 | TString sModules="EMCAL,FMD,HMPID,ITS,MUON,PMD,PHOS,T0,TRD,TPC,TOF,VZERO,ZDC"; | |
58 | TObjArray *detArray = sModules.Tokenize(','); | |
d3a9c52a | 59 | TIter iter(detArray); |
60 | TObjString *ostr; | |
61 | TString exec_det_macro; | |
62 | ||
63 | while((ostr = (TObjString*) iter.Next())){ | |
64 | TString str(ostr->String()); | |
65 | exec_det_macro="aliroot -b -q $ALICE_ROOT/"; | |
66 | exec_det_macro+=str; | |
67 | exec_det_macro+="/Make"; | |
68 | exec_det_macro+=str; | |
69 | exec_det_macro+="ZeroMisAlignment.C"; | |
70 | ||
71 | gSystem->Exec(exec_det_macro.Data()); | |
72 | } | |
73 | ||
74 | return; | |
75 | } | |
6fce62af | 76 |