DP:Misalignment of CPV added
[u/mrichter/AliRoot.git] / PHOS / MakePHOSFullMisAlignment.C
CommitLineData
1895a097 1void MakePHOSFullMisAlignment(){
2 // Create TClonesArray of full misalignment objects for PHOS
3 //
4 TClonesArray *array = new TClonesArray("AliAlignObjAngles",11);
5 TClonesArray &alobj = *array;
6
7 AliAlignObjAngles a;
8
9 Double_t dpsi=0., dtheta=0., dphi=0.;
10 Double_t displacement = 10;
11
12 Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
13 AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer;
14 UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex);
15
16
17 // Alignment for 5 PHOS modules
7e154d52 18 new(alobj[0]) AliAlignObjAngles("PHOS/Module1",
1895a097 19 volid, -20., -10., 0., dpsi, dtheta, 5, kTRUE);
7e154d52 20 new(alobj[1]) AliAlignObjAngles("PHOS/Module2",
1895a097 21 volid, -10., 0., -10., dpsi, dtheta, 2, kTRUE);
7e154d52 22 new(alobj[2]) AliAlignObjAngles("PHOS/Module3",
1895a097 23 volid, 5., -10., 10., dpsi, dtheta, 0, kTRUE);
7e154d52 24 new(alobj[3]) AliAlignObjAngles("PHOS/Module4",
1895a097 25 volid, +10., -0., -10., dpsi, dtheta, 2, kTRUE);
7e154d52 26 new(alobj[4]) AliAlignObjAngles("PHOS/Module5",
1895a097 27 volid, +20., -10., 0., dpsi, dtheta, 5, kTRUE);
28
29 // Alignment for PHOS cradle
7e154d52 30 new(alobj[5]) AliAlignObjAngles("PHOS/Cradle0",
1895a097 31 volid, 0., 0., -displacement, dpsi, dtheta, dphi, kTRUE);
7e154d52 32 new(alobj[6]) AliAlignObjAngles("PHOS/Cradle1",
1895a097 33 volid, 0., 0., +displacement, dpsi, dtheta, dphi, kTRUE);
34
35 // Alignment for cradle wheels
7e154d52 36 new(alobj[7]) AliAlignObjAngles("PHOS/Wheel0",
1895a097 37 volid, 0., 0., -displacement, dpsi, dtheta, dphi, kTRUE);
7e154d52 38 new(alobj[8]) AliAlignObjAngles("PHOS/Wheel1",
1895a097 39 volid, 0., 0., -displacement, dpsi, dtheta, dphi, kTRUE);
7e154d52 40 new(alobj[9]) AliAlignObjAngles("PHOS/Wheel2",
1895a097 41 volid, 0., 0., +displacement, dpsi, dtheta, dphi, kTRUE);
7e154d52 42 new(alobj[10]) AliAlignObjAngles("PHOS/Wheel3",
1895a097 43 volid, 0., 0., +displacement, dpsi, dtheta, dphi, kTRUE);
44
45 // ************************* 2nd step ***************
46
5bd470e1 47 if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
1895a097 48 // save on file
49 TFile f("PHOSfullMisalignment.root","RECREATE");
50 if(!f) cerr<<"cannot open file for output\n";
51 f.cd();
52 f.WriteObject(array,"PHOSFullObjs ","kSingleKey");
53 f.Close();
54 }else{
55 // save in CDB storage
5bd470e1 56 const char* Storage = gSystem->Getenv("STORAGE");
1895a097 57 AliCDBManager *CDB = AliCDBManager::Instance();
58 AliCDBStorage* storage = CDB->GetStorage(Storage);
59 AliCDBMetaData *md= new AliCDBMetaData();
60 md->SetResponsible("Yuri Kharlov");
61 md->SetComment("Alignment objects for fully misaligned geometry");
5bd470e1 62 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
1895a097 63 AliCDBId id("PHOS/Align/Data",0,9999999);
64 storage->Put(array,id, md);
65 }
66
67 array->Delete();
68
69}