vertex resolution improved
[u/mrichter/AliRoot.git] / ZDC / MakeZDCResMisAlignment.C
CommitLineData
1895a097 1void MakeZDCResMisAlignment(){
2 // Create TClonesArray of residual misalignment objects for ZDC
3 //
4 if(!gGeoManager) TGeoManager::Import("geometry.root");
5 // needed for the constructors with local coordinates not to fail
6
7 TClonesArray *array = new TClonesArray("AliAlignObjAngles",10);
8 TClonesArray &alobj = *array;
9
10 AliAlignObjAngles a;
11
12 Double_t dx=0., dy=0.05, dz=0.;
13 Double_t dpsi=0., dtheta=0., dphi=0.;
14
15 const char *ZDC_N="ALIC_1/ZDC_1/ZNEU_1";
16 const char *ZDC_P="ALIC_1/ZDC_1/ZPRO_1";
17
18 UShort_t iIndex=0;
19 AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
20 UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
21
22 new(alobj[0]) AliAlignObjAngles(ZDC_N, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
23 new(alobj[1]) AliAlignObjAngles(ZDC_P, volid, dx, dy, dz, dpsi, dtheta, dphi,kTRUE);
24
25 if(!gSystem->Getenv("$TOCDB")){
26 // save in file
27 TFile f("ZDCresidualMisalignment.root","RECREATE");
28 if(!f) cerr<<"cannot open file for output\n";
29 f.cd();
30 f.WriteObject(array,"ZDCResidualObjs ","kSingleKey");
31 f.Close();
32 }else{
33 // save in CDB storage
34 const char* Storage = gSystem->Getenv("$STORAGE");
35 AliCDBManager* cdb = AliCDBManager::Instance();
36 AliCDBStorage* storage = cdb->GetStorage(Storage);
37 AliCDBMetaData* md = new AliCDBMetaData();
38 md->SetResponsible("Chiara Oppedisano");
39 md->SetComment("Alignment objects for ZDC residual misalignment");
40 md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
41 AliCDBId id("ZDC/Align/Data",0,9999999);
42 storage->Put(array,id,md);
43 }
44
45 array->Delete();
46
47}
48