1 void MakeSTRUCTResMisAlignment(){
2 // Create TClonesArray of residual misalignment objects for all STRUCTures
3 // (presently this includes only FRAME)
5 const char* macroname = "MakeSTRUCTResMisAlignment.C";
7 TClonesArray *array = new TClonesArray("AliAlignObjParams",20);
9 Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
10 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
11 UShort_t dvoluid = AliGeomManager::LayerToVolUID(iLayer,iIndex); //dummy vol id
13 const char* basepath ="ALIC_1/B077_1/BSEGMO";
16 for(Int_t sm=0; sm<18; sm++){
20 cout<<segmpath.Data()<<endl;
21 new((*array)[sm]) AliAlignObjParams(segmpath.Data(),dvoluid,0.,0.,0.,0.,0.,0.,kTRUE);
25 if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
27 const char* filename = "STRUCTresMisalignment.root";
28 TFile f(filename,"RECREATE");
30 Error(macroname,"cannot open file for output\n");
33 Info(macroname,"Saving alignment objects in %s", filename);
35 f.WriteObject(array,"STRUCTAlignObjs","kSingleKey");
38 // save in CDB storage
39 TString Storage = gSystem->Getenv("STORAGE");
40 if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
41 Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
44 Info(macroname,"Saving alignment objects in CDB storage %s",Storage.Data());
45 AliCDBManager* cdb = AliCDBManager::Instance();
46 AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
48 Error(macroname,"Unable to open storage %s\n",Storage.Data());
51 AliCDBMetaData* md = new AliCDBMetaData();
52 md->SetResponsible("Grosso Raffaele");
53 md->SetComment("Residual misalignment for STRUCT. Presently includes objects for FRAME.");
54 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
55 AliCDBId id("GRP/Align/Data",0,AliCDBRunRange::Infinity());
56 storage->Put(array,id,md);