Macros for residual and full misalignment, collected by Raffaele
[u/mrichter/AliRoot.git] / ZDC / MakeZDCFullMisAlignment.C
CommitLineData
1895a097 1void MakeZDCFullMisAlignment(){
2 // Create TClonesArray of full 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=2., 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 Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
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("ZDCfullMisalignment.root","RECREATE");
28 if(!f) cerr<<"cannot open file for output\n";
29 f.cd();
30 f.WriteObject(array,"ZDCFullObjs ","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 full 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