1 void MakeZDCFullMisAlignment(){
2 // Create TClonesArray of full misalignment objects for ZDC
4 const char* macroname = "MakeZDCFullMisAlignment.C";
6 TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
7 TClonesArray &alobj = *array;
9 Double_t dx=0., dy=2., dz=0.;
10 Double_t dpsi=0., dtheta=0., dphi=0.;
12 const char *ZDCCn="ZDC/NeutronZDC_C";
13 const char *ZDCCp="ZDC/ProtonZDC_C";
14 const char *ZDCAn="ZDC/NeutronZDC_A";
15 const char *ZDCAp="ZDC/ProtonZDC_A";
17 Int_t iIndex=0; //let all modules have index=0 in a layer with no LUT
18 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
19 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
21 new(alobj[0]) AliAlignObjParams(ZDCCn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
22 new(alobj[1]) AliAlignObjParams(ZDCCp, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
23 new(alobj[2]) AliAlignObjParams(ZDCAn, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
24 new(alobj[3]) AliAlignObjParams(ZDCAp, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
26 if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
28 const char* filename = "ZDCfullMisalignment.root";
29 TFile f(filename,"RECREATE");
31 Error(macroname,"cannot open file for output\n");
34 Info(macroname,"Saving alignment objects to the file %s", filename);
36 f.WriteObject(array,"ZDCAlignObjs","kSingleKey");
39 // save in CDB storage
40 TString Storage = gSystem->Getenv("STORAGE");
41 if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
42 Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
45 Info(macroname,"Saving alignment objects in CDB storage %s",
47 AliCDBManager* cdb = AliCDBManager::Instance();
48 AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
50 Error(macroname,"Unable to open storage %s\n",Storage.Data());
53 AliCDBMetaData* md = new AliCDBMetaData();
54 md->SetResponsible("Chiara Oppedisano");
55 md->SetComment("Alignment objects for ZDC full misalignment");
56 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
57 AliCDBId id("ZDC/Align/Data",0,AliCDBRunRange::Infinity());
58 storage->Put(array,id,md);