]>
Commit | Line | Data |
---|---|---|
1 | void MakeVZEROZeroMisAlignment(){ | |
2 | // Create TClonesArray of zero misalignment objects for VZERO | |
3 | // | |
4 | const char* macroname = "MakeVZEROZeroMisAlignment.C"; | |
5 | ||
6 | TClonesArray *array = new TClonesArray("AliAlignObjParams",10); | |
7 | TClonesArray &alobj = *array; | |
8 | ||
9 | Double_t dx, dy, dz, dpsi, dtheta, dphi; | |
10 | ||
11 | Int_t iIndex=0; | |
12 | AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer; | |
13 | UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex); | |
14 | ||
15 | TString V0right("VZERO/V0C"); | |
16 | new(alobj[0]) AliAlignObjParams(V0right.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE); | |
17 | TString V0left("VZERO/V0A"); | |
18 | new(alobj[1]) AliAlignObjParams(V0left.Data(), volid, dx, dy, dz, dpsi, dtheta, dphi,kTRUE); | |
19 | ||
20 | if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){ | |
21 | // save on file | |
22 | const char* filename = "VZEROzeroMisalignment.root"; | |
23 | TFile f(filename,"RECREATE"); | |
24 | if(!f){ | |
25 | Error(macroname,"cannot open file for output\n"); | |
26 | return; | |
27 | } | |
28 | Info(macroname,"Saving alignment objects to the file %s", filename); | |
29 | f.cd(); | |
30 | f.WriteObject(array,"VZEROAlignObjs","kSingleKey"); | |
31 | f.Close(); | |
32 | }else{ | |
33 | // save in CDB storage | |
34 | TString Storage = gSystem->Getenv("STORAGE"); | |
35 | if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) { | |
36 | Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data()); | |
37 | return; | |
38 | } | |
39 | Info(macroname,"Saving alignment objects in CDB storage %s", | |
40 | Storage.Data()); | |
41 | AliCDBManager* cdb = AliCDBManager::Instance(); | |
42 | AliCDBStorage* storage = cdb->GetStorage(Storage.Data()); | |
43 | if(!storage){ | |
44 | Error(macroname,"Unable to open storage %s\n",Storage.Data()); | |
45 | return; | |
46 | } | |
47 | AliCDBMetaData* md = new AliCDBMetaData(); | |
48 | md->SetResponsible("Brigitte Cheynis"); | |
49 | md->SetComment("Alignment objects for V0 zero-misalignment"); | |
50 | md->SetAliRootVersion(gSystem->Getenv("ARVERSION")); | |
51 | AliCDBId id("VZERO/Align/Data",0,AliCDBRunRange::Infinity()); | |
52 | storage->Put(array,id,md); | |
53 | } | |
54 | ||
55 | array->Delete(); | |
56 | ||
57 | } | |
58 |