Manso tracker is now ported into AliRoot-HLT framework properly.
[u/mrichter/AliRoot.git] / TOF / MakeTOFZeroMisAlignment.C
CommitLineData
b355f61e 1void MakeTOFZeroMisAlignment(){
b355f61e 2 // Create TClonesArray of zero misalignment objects for TOF
d3a9c52a 3 //
90dbf5fb 4 TClonesArray *array = new TClonesArray("AliAlignObjParams",2000);
b355f61e 5 TClonesArray &alobj = *array;
6fce62af 6 const char* macroname = "MakeTOFZeroMisAlignment.C";
b355f61e 7
6fce62af 8
ae079791 9 AliGeomManager::ELayerID idTOF = AliGeomManager::kTOF;
b355f61e 10 Int_t i;
11 Int_t j=0;
12 Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
13
ae079791 14 for(i=0; i<AliGeomManager::LayerSize(idTOF); i++) {
90dbf5fb 15 new(alobj[j++]) AliAlignObjParams(AliGeomManager::SymName(idTOF,i), AliGeomManager::LayerToVolUID(idTOF,i), dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
b355f61e 16 }
17
5bd470e1 18 if( gSystem->Getenv("TOCDB") != TString("kTRUE") ){
d3a9c52a 19 // save on file
dfe9c69d 20 const char* filename = "TOFzeroMisalignment.root";
21 TFile f(filename,"RECREATE");
22 if(!f){
23 Error(macroname,"cannot open file for output\n");
24 return;
25 }
26 Info(macroname,"Saving alignment objects to the file %s", filename);
d3a9c52a 27 f.cd();
28 f.WriteObject(array,"TOFAlignObjs","kSingleKey");
29 f.Close();
30 }else{
31 // save in CDB storage
dfe9c69d 32 TString Storage = gSystem->Getenv("STORAGE");
33 if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
34 Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
35 return;
36 }
37 Info(macroname,"Saving alignment objects in CDB storage %s",
38 Storage.Data());
d3a9c52a 39 AliCDBManager* cdb = AliCDBManager::Instance();
dfe9c69d 40 AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
41 if(!storage){
42 Error(macroname,"Unable to open storage %s\n",Storage.Data());
43 return;
44 }
d3a9c52a 45 AliCDBMetaData* md = new AliCDBMetaData();
46 md->SetResponsible("Silvia Arcelli");
47 md->SetComment("Zero misalignment for TOF");
48 md->SetAliRootVersion("HEAD");
dfe9c69d 49 AliCDBId id("TOF/Align/Data",0,AliCDBRunRange::Infinity());
d3a9c52a 50 storage->Put(array,id,md);
51 }
b355f61e 52
53 array->Delete();
54
55}
56
57