]>
Commit | Line | Data |
---|---|---|
1 | void MakeT0ZeroMisAlignment(){ | |
2 | // Create TClonesArray of zero misalignment objects for T0 | |
3 | // | |
4 | TClonesArray *array = new TClonesArray("AliAlignObjParams",10); | |
5 | TClonesArray &alobj = *array; | |
6 | ||
7 | Double_t dx=0, dy=0, dz=0, dpsi=0, dtheta=0, dphi=0; | |
8 | ||
9 | TString symName, sn; | |
10 | ||
11 | Int_t iIndex=0; | |
12 | AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer; | |
13 | UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex); | |
14 | ||
15 | Int_t j=0; | |
16 | for (Int_t imod=0; imod<24; imod++) | |
17 | { | |
18 | if (imod < 12){ | |
19 | sn="T0/C/PMT"; | |
20 | }else{ | |
21 | sn="T0/A/PMT"; | |
22 | } | |
23 | symName = sn; | |
24 | symName += imod+1; | |
25 | ||
26 | new(alobj[j++]) AliAlignObjParams(symName.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE); | |
27 | } | |
28 | ||
29 | const char* macroname = "MakeT0ZeroMisAlignment.C"; | |
30 | if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){ | |
31 | // save on file | |
32 | const char* filename = "T0zeroMisalignment.root"; | |
33 | TFile f(filename,"RECREATE"); | |
34 | if(!f){ | |
35 | Error(macroname,"cannot open file for output\n"); | |
36 | return; | |
37 | } | |
38 | Info(macroname,"Saving alignment objects to the file %s", filename); | |
39 | f.cd(); | |
40 | f.WriteObject(array,"T0AlignObjs","kSingleKey"); | |
41 | f.Close(); | |
42 | }else{ | |
43 | // save in CDB storage | |
44 | TString Storage = gSystem->Getenv("STORAGE"); | |
45 | if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) { | |
46 | Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data()); | |
47 | return; | |
48 | } | |
49 | Info(macroname,"Saving alignment objects in CDB storage %s", | |
50 | Storage.Data()); | |
51 | AliCDBManager* cdb = AliCDBManager::Instance(); | |
52 | AliCDBStorage* storage = cdb->GetStorage(Storage.Data()); | |
53 | if(!storage){ | |
54 | Error(macroname,"Unable to open storage %s\n",Storage.Data()); | |
55 | return; | |
56 | } | |
57 | AliCDBMetaData* md = new AliCDBMetaData(); | |
58 | md->SetResponsible("Tomasz Malkiewicz"); | |
59 | md->SetComment("Zero misalignment for T0, produced with sigmatr=0.05 and sigmarot=0.3 in the local RS"); | |
60 | md->SetAliRootVersion(gSystem->Getenv("$ARVERSION")); | |
61 | AliCDBId id("T0/Align/Data",0,AliCDBRunRange::Infinity()); | |
62 | storage->Put(array,id,md); | |
63 | } | |
64 | ||
65 | array->Delete(); | |
66 | ||
67 | } | |
68 |