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
a45bb6dc 16 Int_t i=0 ;
1895a097 17
18 // Alignment for 5 PHOS modules
a45bb6dc 19 new(alobj[i++]) AliAlignObjAngles("PHOS/Module1",
1895a097 20 volid, -20., -10., 0., dpsi, dtheta, 5, kTRUE);
a45bb6dc 21 new(alobj[i++]) AliAlignObjAngles("PHOS/Module2",
1895a097 22 volid, -10., 0., -10., dpsi, dtheta, 2, kTRUE);
a45bb6dc 23 new(alobj[i++]) AliAlignObjAngles("PHOS/Module3",
1895a097 24 volid, 5., -10., 10., dpsi, dtheta, 0, kTRUE);
a45bb6dc 25 new(alobj[i++]) AliAlignObjAngles("PHOS/Module4",
1895a097 26 volid, +10., -0., -10., dpsi, dtheta, 2, kTRUE);
a45bb6dc 27 new(alobj[i++]) AliAlignObjAngles("PHOS/Module5",
1895a097 28 volid, +20., -10., 0., dpsi, dtheta, 5, kTRUE);
29
a45bb6dc 30 Double_t dx=0., dy=0., dz=0. ;
31 // Alignment of CPV modules
32 new(alobj[i++]) AliAlignObjAngles("PHOS/Module1/CPV",
33 volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
34 new(alobj[i++]) AliAlignObjAngles("PHOS/Module2/CPV",
35 volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
36 new(alobj[i++]) AliAlignObjAngles("PHOS/Module3/CPV",
37 volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
38 new(alobj[i++]) AliAlignObjAngles("PHOS/Module4/CPV",
39 volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
40 new(alobj[i++]) AliAlignObjAngles("PHOS/Module5/CPV",
41 volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
42
1895a097 43 // Alignment for PHOS cradle
a45bb6dc 44 new(alobj[i++]) AliAlignObjAngles("PHOS/Cradle0",
1895a097 45 volid, 0., 0., -displacement, dpsi, dtheta, dphi, kTRUE);
a45bb6dc 46 new(alobj[i++]) AliAlignObjAngles("PHOS/Cradle1",
1895a097 47 volid, 0., 0., +displacement, dpsi, dtheta, dphi, kTRUE);
48
49 // Alignment for cradle wheels
a45bb6dc 50 new(alobj[i++]) AliAlignObjAngles("PHOS/Wheel0",
1895a097 51 volid, 0., 0., -displacement, dpsi, dtheta, dphi, kTRUE);
a45bb6dc 52 new(alobj[i++]) AliAlignObjAngles("PHOS/Wheel1",
1895a097 53 volid, 0., 0., -displacement, dpsi, dtheta, dphi, kTRUE);
a45bb6dc 54 new(alobj[i++]) AliAlignObjAngles("PHOS/Wheel2",
1895a097 55 volid, 0., 0., +displacement, dpsi, dtheta, dphi, kTRUE);
a45bb6dc 56 new(alobj[i++]) AliAlignObjAngles("PHOS/Wheel3",
1895a097 57 volid, 0., 0., +displacement, dpsi, dtheta, dphi, kTRUE);
58
59 // ************************* 2nd step ***************
60
a45bb6dc 61 if(!gSystem->Getenv("$TOCDB")){
1895a097 62 // save on file
63 TFile f("PHOSfullMisalignment.root","RECREATE");
64 if(!f) cerr<<"cannot open file for output\n";
65 f.cd();
66 f.WriteObject(array,"PHOSFullObjs ","kSingleKey");
67 f.Close();
68 }else{
69 // save in CDB storage
a45bb6dc 70 const char* Storage = gSystem->Getenv("$STORAGE");
1895a097 71 AliCDBManager *CDB = AliCDBManager::Instance();
72 AliCDBStorage* storage = CDB->GetStorage(Storage);
73 AliCDBMetaData *md= new AliCDBMetaData();
74 md->SetResponsible("Yuri Kharlov");
75 md->SetComment("Alignment objects for fully misaligned geometry");
a45bb6dc 76 md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
1895a097 77 AliCDBId id("PHOS/Align/Data",0,9999999);
78 storage->Put(array,id, md);
79 }
80
81 array->Delete();
82
83}