1 void MakeT0FullMisAlignment(){
2 // Create TClonesArray of full misalignment objects for T0
4 TClonesArray *array = new TClonesArray("AliAlignObjParams",4);
5 TClonesArray &alobj = *array;
7 Double_t dx, dy, dz, dpsi, dtheta, dphi;
8 TRandom3 *rnd = new TRandom3(4321);
9 Double_t sigmatr = 0.006; // sigma for shifts in cm
10 Double_t sigmarot = 0.001; // sigma for tilts in degrees
15 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
16 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
18 for (Int_t imod=0; imod<2; imod++)
20 symName="/ALIC_1/0STR_1";
21 if(imod==1) symName="/ALIC_1/0STL_1";
22 dx = rnd->Gaus(0.,sigmatr);
23 dy = rnd->Gaus(0.,sigmatr);
24 dz = rnd->Gaus(0.,sigmatr);
25 dpsi = rnd->Gaus(0.,sigmarot);
26 dtheta = rnd->Gaus(0.,sigmarot);
27 dphi = rnd->Gaus(0.,sigmarot);
28 new(alobj[imod]) AliAlignObjParams(symName.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
31 const char* macroname = "MakeT0FullMisAlignment.C";
32 if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
34 const char* filename = "T0fullMisalignment.root";
35 TFile f(filename,"RECREATE");
37 Error(macroname,"cannot open file for output\n");
40 Info(macroname,"Saving alignment objects to the file %s", filename);
42 f.WriteObject(array,"T0AlignObjs","kSingleKey");
45 // save in CDB storage
46 TString Storage = gSystem->Getenv("STORAGE");
47 if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
48 Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
51 Info(macroname,"Saving alignment objects in CDB storage %s",
53 AliCDBManager* cdb = AliCDBManager::Instance();
54 AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
56 Error(macroname,"Unable to open storage %s\n",Storage.Data());
59 AliCDBMetaData* md = new AliCDBMetaData();
60 md->SetResponsible("Tomasz Malkiewicz");
61 md->SetComment("Full misalignment for T0, produced with sigmatr=0.05 and sigmarot=0.3 in the local RS");
62 md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
63 AliCDBId id("T0/Align/Data",0,AliCDBRunRange::Infinity());
64 storage->Put(array,id,md);