Macros for residual and full misalignment, collected by Raffaele
[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
18 new(alobj[0]) AliAlignObjAngles("/ALIC_1/PHOS_1",
19 volid, -20., -10., 0., dpsi, dtheta, 5, kTRUE);
20 new(alobj[1]) AliAlignObjAngles("/ALIC_1/PHOS_2",
21 volid, -10., 0., -10., dpsi, dtheta, 2, kTRUE);
22 new(alobj[2]) AliAlignObjAngles("/ALIC_1/PHOS_3",
23 volid, 5., -10., 10., dpsi, dtheta, 0, kTRUE);
24 new(alobj[3]) AliAlignObjAngles("/ALIC_1/PHOS_4",
25 volid, +10., -0., -10., dpsi, dtheta, 2, kTRUE);
26 new(alobj[4]) AliAlignObjAngles("/ALIC_1/PHOS_5",
27 volid, +20., -10., 0., dpsi, dtheta, 5, kTRUE);
28
29 // Alignment for PHOS cradle
30 new(alobj[5]) AliAlignObjAngles("/ALIC_1/PCRA_0",
31 volid, 0., 0., -displacement, dpsi, dtheta, dphi, kTRUE);
32 new(alobj[6]) AliAlignObjAngles("/ALIC_1/PCRA_1",
33 volid, 0., 0., +displacement, dpsi, dtheta, dphi, kTRUE);
34
35 // Alignment for cradle wheels
36 new(alobj[7]) AliAlignObjAngles("/ALIC_1/PWHE_0",
37 volid, 0., 0., -displacement, dpsi, dtheta, dphi, kTRUE);
38 new(alobj[8]) AliAlignObjAngles("/ALIC_1/PWHE_1",
39 volid, 0., 0., -displacement, dpsi, dtheta, dphi, kTRUE);
40 new(alobj[9]) AliAlignObjAngles("/ALIC_1/PWHE_2",
41 volid, 0., 0., +displacement, dpsi, dtheta, dphi, kTRUE);
42 new(alobj[10]) AliAlignObjAngles("/ALIC_1/PWHE_3",
43 volid, 0., 0., +displacement, dpsi, dtheta, dphi, kTRUE);
44
45 // ************************* 2nd step ***************
46
47 if(!gSystem->Getenv("$TOCDB")){
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
56 const char* Storage = gSystem->Getenv("$STORAGE");
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");
62 md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
63 AliCDBId id("PHOS/Align/Data",0,9999999);
64 storage->Put(array,id, md);
65 }
66
67 array->Delete();
68
69}