]>
Commit | Line | Data |
---|---|---|
a24be56b | 1 | void MakeSTRUCTZeroMisAlignment(){ |
2 | // Create TClonesArray of zero misalignment objects for all STRUCTures | |
3 | // (presently this includes only FRAME) | |
4 | // | |
5 | const char* macroname = "MakeSTRUCTZeroMisAlignment.C"; | |
6 | ||
7 | TClonesArray *array = new TClonesArray("AliAlignObjParams",20); | |
8 | ||
9 | Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT | |
10 | AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer; | |
11 | UShort_t dvoluid = AliGeomManager::LayerToVolUID(iLayer,iIndex); //dummy vol id | |
12 | ||
13 | const char* basepath ="ALIC_1/B077_1/BSEGMO"; | |
14 | TString segmpath; | |
15 | ||
16 | for(Int_t sm=0; sm<18; sm++){ | |
17 | segmpath=basepath; | |
18 | segmpath+=sm; | |
19 | segmpath+="_1"; | |
20 | cout<<segmpath.Data()<<endl; | |
21 | new((*array)[sm]) AliAlignObjParams(segmpath.Data(),dvoluid,0.,0.,0.,0.,0.,0.,kTRUE); | |
22 | } | |
23 | ||
24 | if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){ | |
25 | // save on file | |
26 | const char* filename = "STRUCTzeroMisalignment.root"; | |
27 | TFile f(filename,"RECREATE"); | |
28 | if(!f){ | |
29 | Error(macroname,"cannot open file for output\n"); | |
30 | return; | |
31 | } | |
32 | Info(macroname,"Saving alignment objects in %s", filename); | |
33 | f.cd(); | |
34 | f.WriteObject(array,"STRUCTAlignObjs","kSingleKey"); | |
35 | f.Close(); | |
36 | }else{ | |
37 | // save in CDB storage | |
38 | TString Storage = gSystem->Getenv("STORAGE"); | |
39 | if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) { | |
40 | Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data()); | |
41 | return; | |
42 | } | |
43 | Info(macroname,"Saving alignment objects in CDB storage %s",Storage.Data()); | |
44 | AliCDBManager* cdb = AliCDBManager::Instance(); | |
45 | AliCDBStorage* storage = cdb->GetStorage(Storage.Data()); | |
46 | if(!storage){ | |
47 | Error(macroname,"Unable to open storage %s\n",Storage.Data()); | |
48 | return; | |
49 | } | |
50 | AliCDBMetaData* md = new AliCDBMetaData(); | |
51 | md->SetResponsible("Grosso Raffaele"); | |
52 | md->SetComment("Zero misalignment for STRUCT: presently includes objects for FRAME"); | |
53 | md->SetAliRootVersion(gSystem->Getenv("ARVERSION")); | |
54 | AliCDBId id("GRP/Align/Data",0,AliCDBRunRange::Infinity()); | |
55 | storage->Put(array,id,md); | |
56 | } | |
57 | ||
58 | array->Delete(); | |
59 | ||
60 | } | |
61 |