1 void MakeEMCALZeroMisAlignment(){
2 // Create TClonesArray of zero misalignment objects for EMCAL
4 TClonesArray *array = new TClonesArray("AliAlignObjParams",10);
5 TClonesArray &alobj = *array;
6 const char* macroname = "MakeEMCALZeroMisAlignment.C";
8 Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
10 const TString fbasepath = "EMCAL/FullSupermodule";
11 const TString hbasepath = "EMCAL/HalfSupermodule";
14 Int_t iIndex=0; // let all modules have index=0 in a layer with no LUT
15 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
16 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
24 new(alobj[j++]) AliAlignObjParams(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
30 new(alobj[j++]) AliAlignObjParams(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
33 if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
35 const char* filename = "EMCALzeroMisalignment.root";
36 TFile f(filename,"RECREATE");
38 Error(macroname,"cannot open file for output\n");
41 Info(macroname,"Saving alignment objects to the file %s", filename);
43 f.WriteObject(array,"EMCALAlignObjs","kSingleKey");
46 // save in CDB storage
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());
52 Info(macroname,"Saving alignment objects in CDB storage %s",
54 AliCDBManager* cdb = AliCDBManager::Instance();
55 AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
57 Error(macroname,"Unable to open storage %s\n",Storage.Data());
60 AliCDBMetaData* md = new AliCDBMetaData();
61 md->SetResponsible("Jennifer Clay");
62 md->SetComment("Zero misalignment for EMCAL");
63 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
64 AliCDBId id("EMCAL/Align/Data",0,AliCDBRunRange::Infinity());
65 storage->Put(array,id,md);