#include "TSystem.h"
#include "AliLog.h"
+#include "AliRun.h"
#include "AliRunLoader.h"
#include "AliCaloAltroMapping.h"
#include "AliAltroBuffer.h"
fMapping[i] = (AliAltroMapping*)maps->At(i);
}
- fGeom = AliEMCALGeometry::GetInstance();
- if(!fGeom) {
- fGeom = AliEMCALGeometry::GetInstance("","");
- if(!fGeom) AliFatal(Form("Could not get geometry!!"));
+ //To make sure we match with the geometry in a simulation file,
+ //let's try to get it first. If not, take the default geometry
+ AliRunLoader *rl = AliRunLoader::GetRunLoader();
+ if (rl->GetAliRun() && rl->GetAliRun()->GetDetector("EMCAL")) {
+ fGeom = dynamic_cast<AliEMCAL*>(rl->GetAliRun()->GetDetector("EMCAL"))->GetGeometry();
+ } else {
+ AliInfo(Form("Using default geometry in raw reco"));
+ fGeom = AliEMCALGeometry::GetInstance(AliEMCALGeometry::GetDefaulGeometryName());
}
+ if(!fGeom) AliFatal(Form("Could not get geometry!"));
+
}
//____________________________________________________________________________