1 void MakeSTRUCTZeroMisAlignment(){
2 // Create TClonesArray of zero misalignment objects for all STRUCTures
3 // (presently this includes only FRAME)
5 const char* macroname = "MakeSTRUCTZeroMisAlignment.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);
24 if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
26 const char* filename = "STRUCTzeroMisalignment.root";
27 TFile f(filename,"RECREATE");
29 Error(macroname,"cannot open file for output\n");
32 Info(macroname,"Saving alignment objects in %s", filename);
34 f.WriteObject(array,"STRUCTAlignObjs","kSingleKey");
37 // save in CDB storage
38 TString Storage = gSystem->Getenv("STORAGE");
39 if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
40 Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
43 Info(macroname,"Saving alignment objects in CDB storage %s",Storage.Data());
44 AliCDBManager* cdb = AliCDBManager::Instance();
45 AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
47 Error(macroname,"Unable to open storage %s\n",Storage.Data());
50 AliCDBMetaData* md = new AliCDBMetaData();
51 md->SetResponsible("Grosso Raffaele");
52 md->SetComment("Zero misalignment for STRUCT: presently includes objects for FRAME");
53 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
54 AliCDBId id("GRP/Align/Data",0,AliCDBRunRange::Infinity());
55 storage->Put(array,id,md);