// these initialisations are needed for a singleton
AliEMCALGeometry *AliEMCALGeometry::fgGeom = 0;
Bool_t AliEMCALGeometry::fgInit = kFALSE;
-Char_t* AliEMCALGeometry::fgDefaultGeometryName = "SHISH_77_TRD1_2X2_FINAL_110DEG";
+Char_t* AliEMCALGeometry::fgDefaultGeometryName = "SHISH_77_TRD1_2X2_FINAL_110DEG scTh=0.176 pbTh=0.144";
//
// Usage:
// You can create the AliEMCALGeometry object independently from anything.
} // end if fgInit
}else{
if ( strcmp(fgGeom->GetName(), name) != 0) {
- printf("\ncurrent geometry is %s : ", fgGeom->GetName());
- printf(" you cannot call %s ", name);
+ AliWarning(Form("\ncurrent geometry is %s : ", fgGeom->GetName())));
+ AliFatal(Form(" you cannot call %s ", name));
}else{
rv = (AliEMCALGeometry *) fgGeom;
} // end
#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!"));
+
}
//____________________________________________________________________________
#include "AliEMCALRecParam.h"
#include "AliEMCALGeometry.h"
+#include "AliRunLoader.h"
+#include "AliRun.h"
ClassImp(AliEMCALReconstructor)
InitRecParam();
fgRawUtils = new AliEMCALRawUtils;
- 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 reconstruction"));
+ fGeom = AliEMCALGeometry::GetInstance(AliEMCALGeometry::GetDefaulGeometryName());
}
+ if(!fGeom) AliFatal(Form("Could not get geometry!"));
+
}
//____________________________________________________________________________