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