]>
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 | ||
14 | const TString basepath = "ALIC_1/XEN1_1/SMOD_"; | |
15 | TString pathstr; | |
16 | ||
17 | Int_t iIndex=0; // let all modules have index=0 in a layer with no LUT | |
18 | AliAlignObj::ELayerID iLayer = AliAlignObj::kInvalidLayer; | |
19 | UShort_t volid = AliAlignObj::LayerToVolUID(iLayer,iIndex); | |
20 | ||
21 | Int_t i; | |
22 | ||
23 | // RS = local | |
24 | // sigma translation = 1mm | |
25 | // sigma rotation = 0.1 degree | |
26 | TRandom *rnd = new TRandom(4321); | |
27 | Double_t sigmatr = 0.1; // max shift in cm w.r.t. local RS | |
28 | Double_t sigmarot = 0.1; // max rot in degrees w.r.t. local RS | |
29 | for(i=0; i<10; i++){ | |
30 | dx = rnd->Gaus(0.,sigmatr); | |
31 | dy = rnd->Gaus(0.,sigmatr); | |
32 | dz = rnd->Gaus(0.,sigmatr); | |
33 | dpsi = rnd->Gaus(0.,sigmarot); | |
34 | dtheta = rnd->Gaus(0.,sigmarot); | |
35 | dphi = rnd->Gaus(0.,sigmarot); | |
36 | pathstr=basepath; | |
37 | pathstr+=(i+1); | |
38 | new(alobj[i]) AliAlignObjAngles(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kFALSE); | |
39 | } | |
40 | ||
41 | if(!gSystem->Getenv("$TOCDB")){ | |
42 | // save on file | |
43 | TFile f("EMCALresidualMisalignment.root","RECREATE"); | |
44 | if(!f) cerr<<"cannot open file for output\n"; | |
45 | f.cd(); | |
46 | f.WriteObject(array,"T0ResidualObjs ","kSingleKey"); | |
47 | f.Close(); | |
48 | }else{ | |
49 | // save in CDB storage | |
50 | const char* Storage = gSystem->Getenv("$STORAGE"); | |
51 | AliCDBManager* cdb = AliCDBManager::Instance(); | |
52 | AliCDBStorage* storage = cdb->GetStorage(Storage); | |
53 | AliCDBMetaData* md = new AliCDBMetaData(); | |
54 | md->SetResponsible("Jennifer Clay"); | |
55 | md->SetComment("Residual misalignment for EMCAL, produced with sigmatr=0.05 and sigmarot=0.3 in the local RS"); | |
56 | md->SetAliRootVersion(gSystem->Getenv("$ARVERSION")); | |
57 | AliCDBId id("EMCAL/Align/Data",0,9999999); | |
58 | storage->Put(array,id,md); | |
59 | } | |
60 | ||
61 | array->Delete(); | |
62 | ||
63 | } | |
64 |