Manso tracker is now ported into AliRoot-HLT framework properly.
[u/mrichter/AliRoot.git] / TRD / MakeTRDZeroMisAlignment.C
CommitLineData
d3a9c52a 1void MakeTRDZeroMisAlignment(){
2 // Create TClonesArray of zero misalignment objects for TRD
3 //
6fce62af 4 const char* macroname = "MakeTRDZeroMisAlignment.C";
90dbf5fb 5 TClonesArray *array = new TClonesArray("AliAlignObjParams",1000);
d3a9c52a 6 TClonesArray &alobj = *array;
7
d3a9c52a 8
9 Double_t dx=0.,dy=0.,dz=0.,rx=0.,ry=0.,rz=0.;
10
11 Int_t j=0;
12 UShort_t volid;
13 const char *symname;
14
6fce62af 15 // create the supermodules' alignment objects
16 for (int i; i<18; i++) {
17 TString sm_symname(Form("TRD/sm%02d",i));
18 new(alobj[j++]) AliAlignObjParams(sm_symname.Data(),0,dx,dy,dz,rx,ry,rz,kTRUE);
19 }
20
21 // create the chambers' alignment objects
ae079791 22 for (Int_t iLayer = AliGeomManager::kTRD1; iLayer <= AliGeomManager::kTRD6; iLayer++) {
23 for (Int_t iModule = 0; iModule < AliGeomManager::LayerSize(iLayer); iModule++) {
24 volid = AliGeomManager::LayerToVolUID(iLayer,iModule);
25 symname = AliGeomManager::SymName(volid);
90dbf5fb 26 new(alobj[j++]) AliAlignObjParams(symname,volid,dx,dy,dz,rx,ry,rz,kTRUE);
d3a9c52a 27 }
28 }
29
5bd470e1 30 if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
d3a9c52a 31 // save on file
dfe9c69d 32 const char* filename = "TRDzeroMisalignment.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);
d3a9c52a 39 f.cd();
40 f.WriteObject(array,"TRDAlignObjs","kSingleKey");
41 f.Close();
42 }else{
43 // save in CDB storage
dfe9c69d 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());
d3a9c52a 51 AliCDBManager* cdb = AliCDBManager::Instance();
dfe9c69d 52 AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
53 if(!storage){
54 Error(macroname,"Unable to open storage %s\n",Storage.Data());
55 return;
56 }
d3a9c52a 57 AliCDBMetaData* md = new AliCDBMetaData();
58 md->SetResponsible("Dariusz Miskowiec");
59 md->SetComment("Zero misalignment for TRD");
5bd470e1 60 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
dfe9c69d 61 AliCDBId id("TRD/Align/Data",0,AliCDBRunRange::Infinity());
d3a9c52a 62 storage->Put(array,id,md);
63 }
64
65 array->Delete();
66
67}
68
69