Logics of high gain adding to digits has changed
[u/mrichter/AliRoot.git] / PHOS / MakePHOSResMisAlignment.C
CommitLineData
1895a097 1void MakePHOSResMisAlignment(){
2 // Create TClonesArray of residual 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 = 0.2;
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 // Alignment for 5 PHOS modules
7e154d52 17 new(alobj[0]) AliAlignObjAngles("PHOS/Module1",
1895a097 18 volid, -0.20, -0.1, +0.0, dpsi, dtheta, 0.2, kTRUE);
7e154d52 19 new(alobj[1]) AliAlignObjAngles("PHOS/Module2",
1895a097 20 volid, -0.10, +0.0, -0.2, dpsi, dtheta, 0.2, kTRUE);
7e154d52 21 new(alobj[2]) AliAlignObjAngles("PHOS/Module3",
1895a097 22 volid, 0.05, -0.1, 0.2, dpsi, dtheta, 0.0, kTRUE);
7e154d52 23 new(alobj[3]) AliAlignObjAngles("PHOS/Module4",
1895a097 24 volid, +0.10, -0.0, -0.1, dpsi, dtheta, 0.1, kTRUE);
7e154d52 25 new(alobj[4]) AliAlignObjAngles("PHOS/Module5",
1895a097 26 volid, +0.20, -0.1, 0.1, dpsi, dtheta, 0.2, kTRUE);
27
28 // Alignment for PHOS cradle
7e154d52 29 new(alobj[5]) AliAlignObjAngles("PHOS/Cradle0",
1895a097 30 volid, 0., 0., -displacement, dpsi, dtheta, dphi, kTRUE);
7e154d52 31 new(alobj[6]) AliAlignObjAngles("PHOS/Cradle1",
1895a097 32 volid, 0., 0., +displacement, dpsi, dtheta, dphi, kTRUE);
33
34 // Alignment for cradle wheels
7e154d52 35 new(alobj[7]) AliAlignObjAngles("PHOS/Wheel0",
1895a097 36 volid, 0., 0., -displacement, dpsi, dtheta, dphi, kTRUE);
7e154d52 37 new(alobj[8]) AliAlignObjAngles("PHOS/Wheel1",
1895a097 38 volid, 0., 0., -displacement, dpsi, dtheta, dphi, kTRUE);
7e154d52 39 new(alobj[9]) AliAlignObjAngles("PHOS/Wheel2",
1895a097 40 volid, 0., 0., +displacement, dpsi, dtheta, dphi, kTRUE);
7e154d52 41 new(alobj[10]) AliAlignObjAngles("PHOS/Wheel3",
1895a097 42 volid, 0., 0., +displacement, dpsi, dtheta, dphi, kTRUE);
43
44
45 if(!gSystem->Getenv("$TOCDB")){
46 // save on file
47 TFile f("PHOSresidualMisalignment.root","RECREATE");
48 if(!f) cerr<<"cannot open file for output\n";
49 f.cd();
50 f.WriteObject(array,"PHOSResidualObjs ","kSingleKey");
51 f.Close();
52 }else{
53 // save in CDB storage
54 const char* Storage = gSystem->Getenv("$STORAGE");
55 AliCDBManager *CDB = AliCDBManager::Instance();
56 AliCDBStorage* storage = CDB->GetStorage(Storage);
57 AliCDBMetaData *md= new AliCDBMetaData();
58 md->SetResponsible("Yuri Kharlov");
59 md->SetComment("Alignment objects for slightly misaligned geometry (residual misalignment");
60 md->SetAliRootVersion(gSystem->Getenv("$ARVERSION"));
61 AliCDBId id("PHOS/Align/Data",0,9999999);
62 storage->Put(array,id, md);
63 }
64
65 array->Delete();
66
67}