1 void MakeT0ResMisAlignment(){
2 // Create TClonesArray of residual misalignment objects for T0
4 TClonesArray *array = new TClonesArray("AliAlignObjAngles",30);
5 TClonesArray &alobj = *array;
7 if(!gGeoManager) TGeoManager::Import("geometry.root");
8 // needed for the constructors with local coordinates not to fail
12 Double_t dx, dy, dz, dpsi, dtheta, dphi;
13 TRandom *rnd = new TRandom(4321);
14 Double_t sigmatr = 0.05; // max shift in cm
15 Double_t sigmarot = 0.3; // max rot in degrees
20 AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
21 UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
24 for (Int_t imod=0; imod<24; imod++){
33 dx = rnd->Gaus(0.,sigmatr);
34 dy = rnd->Gaus(0.,sigmatr);
35 dz = rnd->Gaus(0.,sigmatr);
36 dpsi = rnd->Gaus(0.,sigmarot);
37 dtheta = rnd->Gaus(0.,sigmarot);
38 dphi = rnd->Gaus(0.,sigmarot);
40 new(alobj[j++]) AliAlignObjAngles(symName.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
43 if(!gSystem->Getenv("$TOCDB")){
45 TFile f("T0residualMisalignment.root","RECREATE");
46 if(!f) cerr<<"cannot open file for output\n";
48 f.WriteObject(array,"T0ResidualObjs ","kSingleKey");
51 // save in CDB storage
52 const char* Storage = gSystem->Getenv("$STORAGE");
53 AliCDBManager* cdb = AliCDBManager::Instance();
54 AliCDBStorage* storage = cdb->GetStorage(Storage);
55 AliCDBMetaData* md = new AliCDBMetaData();
56 md->SetResponsible("Tomasz Malkiewicz");
57 md->SetComment("Residual misalignment for T0, produced with sigmatr=0.05 and sigmarot=0.3 in the local RS");
58 md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
59 AliCDBId id("T0/Align/Data",0,9999999);
60 storage->Put(array,id,md);