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