Temporary disable the raw version, it will be taken from FEE
[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
e953c953 15 const char *ZDCn="ZDC/NeutronZDC";
16 const char *ZDCp="ZDC/ProtonZDC";
1895a097 17
18 UShort_t iIndex=0;
ae079791 19 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
20 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
1895a097 21
e953c953 22 new(alobj[0]) AliAlignObjAngles(ZDCn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
23 new(alobj[1]) AliAlignObjAngles(ZDCp, volid, dx, dy, dz, dpsi, dtheta, dphi,kTRUE);
1895a097 24
5bd470e1 25 if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
1895a097 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
5bd470e1 34 const char* Storage = gSystem->Getenv("STORAGE");
1895a097 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");
5bd470e1 40 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
1895a097 41 AliCDBId id("ZDC/Align/Data",0,9999999);
42 storage->Put(array,id,md);
43 }
44
45 array->Delete();
46
47}
48