#include <TStyle.h>
#include <TPad.h>
#include <TFile.h>
+#include <TParticle.h>
// --- ANALYSIS system ---
#include "AliCalorimeterUtils.h"
#include "AliAODCaloCluster.h"
#include "AliOADBContainer.h"
#include "AliAnalysisManager.h"
+#include "AliAODMCParticle.h"
// --- Detector ---
#include "AliEMCALGeometry.h"
}
-
//_____________________________________________________________________________________
Bool_t AliCalorimeterUtils::CheckCellFiducialRegion(AliVCluster* cluster,
AliVCaloCells* cells,
}
}
+//_______________________________________________________________________________________________
+Bool_t AliCalorimeterUtils::IsMCParticleInCalorimeterAcceptance(TString calo, TParticle* particle)
+{
+ // Check that a MC ESD is in the calorimeter acceptance
+
+ if( (!IsPHOSGeoMatrixSet() && calo == "PHOS" ) ||
+ (!IsPHOSGeoMatrixSet() && calo == "EMCAL") )
+ {
+ AliFatal(Form("Careful Geo Matrix for %s is not set, use AliFidutialCut instead \n",calo.Data()));
+ return kFALSE ;
+ }
+
+ if(calo == "PHOS" )
+ {
+ Int_t mod = 0 ;
+ Double_t x = 0, z = 0 ;
+
+ return GetPHOSGeometry()->ImpactOnEmc( particle, mod, z, x);
+ }
+ else if(calo == "EMCAL")
+ {
+ Int_t absID = 0 ;
+
+ GetEMCALGeometry()->GetAbsCellIdFromEtaPhi( particle->Eta(), particle->Phi(), absID);
+
+ if( absID >= 0) return kTRUE ;
+ else return kFALSE ;
+ }
+
+ return kFALSE ;
+}
+
+//______________________________________________________________________________________________________
+Bool_t AliCalorimeterUtils::IsMCParticleInCalorimeterAcceptance(TString calo, AliAODMCParticle* particle)
+{
+ // Check that a MC AOD is in the calorimeter acceptance
+
+ if( (!IsPHOSGeoMatrixSet() && calo == "PHOS" ) ||
+ (!IsPHOSGeoMatrixSet() && calo == "EMCAL") )
+ {
+ AliFatal(Form("Careful Geo Matrix for %s is not set, use AliFidutialCut instead \n",calo.Data()));
+ return kFALSE ;
+ }
+
+ if(calo == "PHOS" )
+ {
+ Int_t mod = 0 ;
+ Double_t x = 0, z = 0 ;
+
+ Double_t vtx[]={ particle->Xv(), particle->Yv(), particle->Zv() } ;
+
+ return GetPHOSGeometry()->ImpactOnEmc(vtx, particle->Theta(), particle->Phi(), mod, z, x) ;
+ }
+ else if(calo == "EMCAL")
+ {
+ Int_t absID = 0 ;
+
+ GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(particle->Eta(),particle->Phi(),absID);
+
+ if( absID >= 0) return kTRUE ;
+ else return kFALSE ;
+ }
+
+ return kFALSE ;
+}
+
//_______________________________________________________________________
Bool_t AliCalorimeterUtils::MaskFrameCluster(Int_t iSM, Int_t ieta) const
{
class AliVCaloCells;
class AliPHOSGeoUtils;
class AliEMCALGeometry;
+class AliAODMCParticle;
+class TParticle;
+
#include "AliEMCALRecoUtils.h"
class AliCalorimeterUtils : public TObject {
fImportGeometryFromFile = import ;
fImportGeometryFilePath = path ; } // EMCAL
+ Bool_t IsMCParticleInCalorimeterAcceptance(TString calo, TParticle* particle);
+ Bool_t IsMCParticleInCalorimeterAcceptance(TString calo, AliAODMCParticle* particle);
+
void SwitchOnLoadOwnEMCALGeometryMatrices() { fLoadEMCALMatrices = kTRUE ; }
void SwitchOffLoadOwnEMCALGeometryMatrices() { fLoadEMCALMatrices = kFALSE ; }
void SetEMCALGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fEMCALMatrix[i] = m ; }
Int_t fNSuperModulesUsed; // Number of supermodules to be used in analysis, can be different than the real geo,
// to be used at initialization of histograms
- Bool_t fMCECellClusFracCorrOn; // Correct or not the weight of cells in cluster
+ Bool_t fMCECellClusFracCorrOn; // Correct or not the weight of cells in cluster
Float_t fMCECellClusFracCorrParam[4]; // Parameters for the function correcting the weight of the cells in the cluster
AliCalorimeterUtils( const AliCalorimeterUtils & cu) ; // cpy ctor