1 void MakePHOSResMisAlignment(){
2 // Create TClonesArray of residual misalignment objects for PHOS
4 const AliPHOSGeometry *phosGeom = AliPHOSGeometry::GetInstance("IHEP", "IHEP");
6 Error("MakePHOSFullMisAlignment", "Cannot obtain AliPHOSGeometry singleton\n");
10 AliPHOSEMCAGeometry *emca = phosGeom->GetEMCAGeometry();
11 TClonesArray *array = new TClonesArray("AliAlignObjParams", 16 + phosGeom->GetNModules() *
12 emca->GetNStripX() * emca->GetNStripZ());
13 TClonesArray &alobj = *array;
15 Double_t dpsi=0., dtheta=0., dphi=0.;
16 Double_t displacement = 0.2;
17 Int_t iIndex=0; // let all modules have index=0 in a layer with no LUT
18 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
19 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
22 // Alignment for 5 PHOS modules
23 new(alobj[i++]) AliAlignObjParams("PHOS/Module1",
24 volid, -0.20, -0.1, +0.0, dpsi, dtheta, 0.2, kTRUE);
25 new(alobj[i++]) AliAlignObjParams("PHOS/Module2",
26 volid, -0.10, +0.0, -0.2, dpsi, dtheta, 0.2, kTRUE);
27 new(alobj[i++]) AliAlignObjParams("PHOS/Module3",
28 volid, 0.05, -0.1, 0.2, dpsi, dtheta, 0.0, kTRUE);
29 new(alobj[i++]) AliAlignObjParams("PHOS/Module4",
30 volid, +0.10, -0.0, -0.1, dpsi, dtheta, 0.1, kTRUE);
31 new(alobj[i++]) AliAlignObjParams("PHOS/Module5",
32 volid, +0.20, -0.1, 0.1, dpsi, dtheta, 0.2, kTRUE);
34 Double_t dx=0., dy=0., dz=0. ;
35 // Alignment of CPV modules
36 new(alobj[i++]) AliAlignObjParams("PHOS/Module1/CPV",
37 volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
38 new(alobj[i++]) AliAlignObjParams("PHOS/Module2/CPV",
39 volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
40 new(alobj[i++]) AliAlignObjParams("PHOS/Module3/CPV",
41 volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
42 new(alobj[i++]) AliAlignObjParams("PHOS/Module4/CPV",
43 volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
44 new(alobj[i++]) AliAlignObjParams("PHOS/Module5/CPV",
45 volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
48 // Alignment for PHOS cradle
49 new(alobj[i++]) AliAlignObjParams("PHOS/Cradle0",
50 volid, 0., 0., -displacement, dpsi, dtheta, dphi, kTRUE);
51 new(alobj[i++]) AliAlignObjParams("PHOS/Cradle1",
52 volid, 0., 0., +displacement, dpsi, dtheta, dphi, kTRUE);
54 // Alignment for cradle wheels
55 new(alobj[i++]) AliAlignObjParams("PHOS/Wheel0",
56 volid, 0., 0., -displacement, dpsi, dtheta, dphi, kTRUE);
57 new(alobj[i++]) AliAlignObjParams("PHOS/Wheel1",
58 volid, 0., 0., -displacement, dpsi, dtheta, dphi, kTRUE);
59 new(alobj[i++]) AliAlignObjParams("PHOS/Wheel2",
60 volid, 0., 0., +displacement, dpsi, dtheta, dphi, kTRUE);
61 new(alobj[i++]) AliAlignObjParams("PHOS/Wheel3",
62 volid, 0., 0., +displacement, dpsi, dtheta, dphi, kTRUE);
64 AliPHOSSurvey geodesicData("phos_mod3_survey.txt");
65 geodesicData.CreateAliAlignObjParams(alobj);
67 const char* macroname = "MakePHOSResMisAlignment.C";
68 if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
70 const char* filename = "PHOSresidualMisalignment.root";
71 TFile f(filename,"RECREATE");
73 Error(macroname,"cannot open file for output\n");
76 Info(macroname,"Saving alignment objects to the file %s", filename);
78 f.WriteObject(array,"PHOSAlignObjs","kSingleKey");
81 // save in CDB storage
82 TString Storage = gSystem->Getenv("STORAGE");
83 if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
84 Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
87 Info(macroname,"Saving alignment objects in CDB storage %s",
89 AliCDBManager* cdb = AliCDBManager::Instance();
90 AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
92 Error(macroname,"Unable to open storage %s\n",Storage.Data());
95 AliCDBMetaData *md= new AliCDBMetaData();
96 md->SetResponsible("Yuri Kharlov");
97 md->SetComment("Alignment objects for slightly misaligned geometry (residual misalignment");
98 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
99 AliCDBId id("PHOS/Align/Data",0,AliCDBRunRange::Infinity());
100 storage->Put(array,id, md);