]>
Commit | Line | Data |
---|---|---|
d3a9c52a | 1 | void MakeTRDZeroMisAlignment(){ |
2 | // Create TClonesArray of zero misalignment objects for TRD | |
3 | // | |
4 | TClonesArray *array = new TClonesArray("AliAlignObjAngles",1000); | |
5 | TClonesArray &alobj = *array; | |
6 | ||
dfe9c69d | 7 | if(!AliGeomManager::GetGeometry()){ |
8 | if(!(AliCDBManager::Instance())->IsDefaultStorageSet()) | |
9 | AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT"); | |
10 | AliCDBManager::Instance()->SetRun(0); | |
11 | AliGeomManager::LoadGeometry(); | |
12 | } | |
d3a9c52a | 13 | // needed for the constructors with local coordinates not to fail |
14 | ||
15 | AliAlignObjAngles a; | |
16 | ||
17 | Double_t dx=0.,dy=0.,dz=0.,rx=0.,ry=0.,rz=0.; | |
18 | ||
19 | Int_t j=0; | |
20 | UShort_t volid; | |
21 | const char *symname; | |
22 | ||
23 | // create the chambers' alignment objects | |
ae079791 | 24 | for (Int_t iLayer = AliGeomManager::kTRD1; iLayer <= AliGeomManager::kTRD6; iLayer++) { |
25 | for (Int_t iModule = 0; iModule < AliGeomManager::LayerSize(iLayer); iModule++) { | |
26 | volid = AliGeomManager::LayerToVolUID(iLayer,iModule); | |
27 | symname = AliGeomManager::SymName(volid); | |
d3a9c52a | 28 | new(alobj[j++]) AliAlignObjAngles(symname,volid,dx,dy,dz,rx,ry,rz,kTRUE); |
29 | } | |
30 | } | |
31 | ||
dfe9c69d | 32 | const char* macroname = "MakeTRDZeroMisAlignment.C"; |
5bd470e1 | 33 | if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){ |
d3a9c52a | 34 | // save on file |
dfe9c69d | 35 | const char* filename = "TRDzeroMisalignment.root"; |
36 | TFile f(filename,"RECREATE"); | |
37 | if(!f){ | |
38 | Error(macroname,"cannot open file for output\n"); | |
39 | return; | |
40 | } | |
41 | Info(macroname,"Saving alignment objects to the file %s", filename); | |
d3a9c52a | 42 | f.cd(); |
43 | f.WriteObject(array,"TRDAlignObjs","kSingleKey"); | |
44 | f.Close(); | |
45 | }else{ | |
46 | // save in CDB storage | |
dfe9c69d | 47 | TString Storage = gSystem->Getenv("STORAGE"); |
48 | if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) { | |
49 | Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data()); | |
50 | return; | |
51 | } | |
52 | Info(macroname,"Saving alignment objects in CDB storage %s", | |
53 | Storage.Data()); | |
d3a9c52a | 54 | AliCDBManager* cdb = AliCDBManager::Instance(); |
dfe9c69d | 55 | AliCDBStorage* storage = cdb->GetStorage(Storage.Data()); |
56 | if(!storage){ | |
57 | Error(macroname,"Unable to open storage %s\n",Storage.Data()); | |
58 | return; | |
59 | } | |
d3a9c52a | 60 | AliCDBMetaData* md = new AliCDBMetaData(); |
61 | md->SetResponsible("Dariusz Miskowiec"); | |
62 | md->SetComment("Zero misalignment for TRD"); | |
5bd470e1 | 63 | md->SetAliRootVersion(gSystem->Getenv("ARVERSION")); |
dfe9c69d | 64 | AliCDBId id("TRD/Align/Data",0,AliCDBRunRange::Infinity()); |
d3a9c52a | 65 | storage->Put(array,id,md); |
66 | } | |
67 | ||
68 | array->Delete(); | |
69 | ||
70 | } | |
71 | ||
72 |