1 void MakeEMCALZeroMisAlignment(){
2 // Create TClonesArray of zero misalignment objects for EMCAL
4 const char* macroname = "MakeEMCALZeroMisAlignment.C";
5 const AliEMCALGeometry *geom = AliEMCALGeometry::GetInstance(AliEMCALGeometry::GetDefaultGeometryName(),"");
7 Error("MakeEMCALZeroMisAlignment","Cannot obtain AliEMCALGeometry singleton\n");
11 TClonesArray *array = new TClonesArray("AliAlignObjParams",geom->GetNumberOfSuperModules());
12 TClonesArray &alobj = *array;
15 Double_t dx=0., dy=0., dz=0., dpsi=0., dtheta=0., dphi=0.;
17 const TString fbasepath = "EMCAL/FullSupermodule";
18 const TString hbasepath = "EMCAL/HalfSupermodule";
21 Int_t iIndex=0; // let all modules have index=0 in a layer with no LUT
22 AliGeomManager::ELayerID iLayer = AliGeomManager::kInvalidLayer;
23 UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
31 new(alobj[j++]) AliAlignObjParams(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
37 new(alobj[j++]) AliAlignObjParams(pathstr, volid, dx, dy, dz, dpsi, dtheta, dphi, kTRUE);
41 AliEMCALSurvey emcalSurvey;
42 emcalSurvey.CreateNullObjects(alobj,geom);
44 if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){
46 const char* filename = "EMCALzeroMisalignment.root";
47 TFile f(filename,"RECREATE");
49 Error(macroname,"cannot open file for output\n");
52 Info(macroname,"Saving alignment objects to the file %s", filename);
54 f.WriteObject(array,"EMCALAlignObjs","kSingleKey");
57 // save in CDB storage
58 TString Storage = gSystem->Getenv("STORAGE");
59 if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) {
60 Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data());
63 Info(macroname,"Saving alignment objects in CDB storage %s",
65 AliCDBManager* cdb = AliCDBManager::Instance();
66 AliCDBStorage* storage = cdb->GetStorage(Storage.Data());
68 Error(macroname,"Unable to open storage %s\n",Storage.Data());
71 AliCDBMetaData* md = new AliCDBMetaData();
72 md->SetResponsible("Jennifer Klay");
73 md->SetComment("Zero misalignment for EMCAL");
74 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
75 AliCDBId id("EMCAL/Align/Data",0,AliCDBRunRange::Infinity());
76 storage->Put(array,id,md);