1 void MakeT0FullMisAlignment(){
2 // Create TClonesArray of full misalignment objects for T0
4 TClonesArray *array = new TClonesArray("AliAlignObjParams",30);
5 TClonesArray &alobj = *array;
7 Double_t dx, dy, dz, dpsi, dtheta, dphi;
8 TRandom *rnd = new TRandom(4321);
9 Double_t sigmatr = 0.05; // sigma for shifts in cm
10 Double_t sigmarot = 0.3; // sigma for tilts in degrees
15 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
16 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
19 for (Int_t imod=0; imod<24; imod++){
28 dx = rnd->Gaus(0.,sigmatr);
29 dy = rnd->Gaus(0.,sigmatr);
30 dz = rnd->Gaus(0.,sigmatr);
31 dpsi = rnd->Gaus(0.,sigmarot);
32 dtheta = rnd->Gaus(0.,sigmarot);
33 dphi = rnd->Gaus(0.,sigmarot);
35 new(alobj[j++]) AliAlignObjParams(symName.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
38 const char* macroname = "MakeT0FullMisAlignment.C";
39 if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
41 const char* filename = "T0fullMisalignment.root";
42 TFile f(filename,"RECREATE");
44 Error(macroname,"cannot open file for output\n");
47 Info(macroname,"Saving alignment objects to the file %s", filename);
49 f.WriteObject(array,"T0AlignObjs","kSingleKey");
52 // save in CDB storage
53 TString Storage = gSystem->Getenv("STORAGE");
54 if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
55 Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
58 Info(macroname,"Saving alignment objects in CDB storage %s",
60 AliCDBManager* cdb = AliCDBManager::Instance();
61 AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
63 Error(macroname,"Unable to open storage %s\n",Storage.Data());
66 AliCDBMetaData* md = new AliCDBMetaData();
67 md->SetResponsible("Tomasz Malkiewicz");
68 md->SetComment("Full misalignment for T0, produced with sigmatr=0.05 and sigmarot=0.3 in the local RS");
69 md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
70 AliCDBId id("T0/Align/Data",0,AliCDBRunRange::Infinity());
71 storage->Put(array,id,md);