1 void MakeT0ZeroMisAlignment(){
2 // Create TClonesArray of zero misalignment objects for T0
4 TClonesArray *array = new TClonesArray("AliAlignObjParams",4);
5 TClonesArray &alobj = *array;
7 Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
12 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
13 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
15 for (Int_t imod=0; imod<2; imod++)
17 symName="/ALIC_1/0STR_1";
20 symName="/ALIC_1/0STL_1";
22 new(alobj[imod]) AliAlignObjParams(symName.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
25 const char* macroname = "MakeT0ZeroMisAlignment.C";
26 if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
28 const char* filename = "T0zeroMisalignment.root";
29 TFile f(filename,"RECREATE");
31 Error(macroname,"cannot open file for output\n");
34 Info(macroname,"Saving alignment objects to the file %s", filename);
36 f.WriteObject(array,"T0AlignObjs","kSingleKey");
39 // save in CDB storage
40 TString Storage = gSystem->Getenv("STORAGE");
41 if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
42 Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
45 Info(macroname,"Saving alignment objects in CDB storage %s",
47 AliCDBManager* cdb = AliCDBManager::Instance();
48 AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
50 Error(macroname,"Unable to open storage %s\n",Storage.Data());
53 AliCDBMetaData* md = new AliCDBMetaData();
54 md->SetResponsible("Tomasz Malkiewicz");
55 md->SetComment("Zero misalignment for T0, produced with sigmatr=0.05 and sigmarot=0.3 in the local RS");
56 md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
57 AliCDBId id("T0/Align/Data",0,AliCDBRunRange::Infinity());
58 storage->Put(array,id,md);