]>
Commit | Line | Data |
---|---|---|
1895a097 | 1 | void MakeEMCALResMisAlignment(){ |
2 | // Create TClonesArray of residual misalignment objects for EMCAL | |
3 | // | |
4 | TClonesArray *array = new TClonesArray("AliAlignObjAngles",10); | |
5 | TClonesArray &alobj = *array; | |
6 | ||
7 | if(!gGeoManager) TGeoManager::Import("geometry.root"); | |
8 | // needed for the constructors with local coordinates not to fail | |
9 | ||
10 | AliAlignObjAngles a; | |
11 | ||
12 | Double_t dx, dy, dz, dpsi, dtheta, dphi; | |
13 | ||
7e154d52 | 14 | const TString basepath = "EMCAL/FullSupermodule"; |
d3a9c52a | 15 | const TString hbasepath = "EMCAL/HalfSupermodule"; |
1895a097 | 16 | TString pathstr; |
17 | ||
18 | Int_t iIndex=0; // let all modules have index=0 in a layer with no LUT | |
ae079791 | 19 | AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer; |
20 | UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex); | |
1895a097 | 21 | |
22 | Int_t i; | |
d3a9c52a | 23 | Int_t j=0; |
1895a097 | 24 | |
25 | // RS = local | |
26 | // sigma translation = 1mm | |
27 | // sigma rotation = 0.1 degree | |
28 | TRandom *rnd = new TRandom(4321); | |
29 | Double_t sigmatr = 0.1; // max shift in cm w.r.t. local RS | |
30 | Double_t sigmarot = 0.1; // max rot in degrees w.r.t. local RS | |
d3a9c52a | 31 | |
1895a097 | 32 | for(i=0; i<10; i++){ |
33 | dx = rnd->Gaus(0.,sigmatr); | |
34 | dy = rnd->Gaus(0.,sigmatr); | |
35 | dz = rnd->Gaus(0.,sigmatr); | |
36 | dpsi = rnd->Gaus(0.,sigmarot); | |
37 | dtheta = rnd->Gaus(0.,sigmarot); | |
38 | dphi = rnd->Gaus(0.,sigmarot); | |
39 | pathstr=basepath; | |
40 | pathstr+=(i+1); | |
d3a9c52a | 41 | new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE); |
42 | } | |
43 | ||
44 | for(i=0; i<2; i++){ | |
45 | dx = rnd->Gaus(0.,sigmatr); | |
46 | dy = rnd->Gaus(0.,sigmatr); | |
47 | dz = rnd->Gaus(0.,sigmatr); | |
48 | dpsi = rnd->Gaus(0.,sigmarot); | |
49 | dtheta = rnd->Gaus(0.,sigmarot); | |
50 | dphi = rnd->Gaus(0.,sigmarot); | |
51 | pathstr=hbasepath; | |
52 | pathstr+=(i+1); | |
53 | new(alobj[j++]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE); | |
1895a097 | 54 | } |
55 | ||
5bd470e1 | 56 | if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){ |
1895a097 | 57 | // save on file |
58 | TFile f("EMCALresidualMisalignment.root","RECREATE"); | |
59 | if(!f) cerr<<"cannot open file for output\n"; | |
60 | f.cd(); | |
61 | f.WriteObject(array,"T0ResidualObjs ","kSingleKey"); | |
62 | f.Close(); | |
63 | }else{ | |
64 | // save in CDB storage | |
5bd470e1 | 65 | const char* Storage = gSystem->Getenv("STORAGE"); |
1895a097 | 66 | AliCDBManager* cdb = AliCDBManager::Instance(); |
67 | AliCDBStorage* storage = cdb->GetStorage(Storage); | |
68 | AliCDBMetaData* md = new AliCDBMetaData(); | |
69 | md->SetResponsible("Jennifer Clay"); | |
70 | md->SetComment("Residual misalignment for EMCAL, produced with sigmatr=0.05 and sigmarot=0.3 in the local RS"); | |
5bd470e1 | 71 | md->SetAliRootVersion(gSystem->Getenv("ARVERSION")); |
1895a097 | 72 | AliCDBId id("EMCAL/Align/Data",0,9999999); |
73 | storage->Put(array,id,md); | |
74 | } | |
75 | ||
76 | array->Delete(); | |
77 | ||
78 | } | |
79 |