//---- ANALYSIS system ----
#include "AliCaloTrackAODReader.h"
-#include "AliAODEvent.h"
#include "AliAODCaloCluster.h"
#include "AliAODTrack.h"
#include "AliESDtrack.h"
//____________________________________________________________________________
void AliCaloTrackAODReader::FillInputCTS() {
//Return array with Central Tracking System (CTS) tracks
-
+ if(fDebug > 2 ) printf("AliCaloTrackAODReader::FillInputCTS()\n");
Int_t nTracks = fInputEvent->GetNumberOfTracks() ;
Int_t naod = 0;
Double_t p[3];
//____________________________________________________________________________
void AliCaloTrackAODReader::FillInputEMCAL() {
//Return array with EMCAL clusters in aod format
-
+ if(fDebug > 2 ) printf("AliCaloTrackAODReader::FillInputEMCAL()\n");
+
//Get vertex for momentum calculation
Double_t v[3] ; //vertex ;
GetVertex(v);
AliAODCaloCluster * clus = 0;
if ( (clus = ((AliAODEvent*)fInputEvent)->GetCaloCluster(iclus)) ) {
if (clus->IsEMCALCluster()){
+
+ //Check if the cluster contains any bad channel and if close to calorimeter borders
+ if(GetCaloUtils()->ClusterContainsBadChannel("EMCAL",clus->GetCellsAbsId(), clus->GetNCells())) continue;
+ if(!GetCaloUtils()->CheckCellFiducialRegion(clus,((AliAODEvent*)fInputEvent)->GetEMCALCells())) continue;
+
TLorentzVector momentum ;
clus->GetMomentum(momentum, v);
if(fDebug > 2 && momentum.E() > 0.1) printf("AliCaloTrackAODReader::FillInputEMCAL() - Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n",
momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta());
+ //Recalibrate the cluster energy
+ if(GetCaloUtils()->IsRecalibrationOn()) {
+ Float_t energy = GetCaloUtils()->RecalibrateClusterEnergy(clus, (AliAODCaloCells*)GetEMCALCells());
+ clus->SetE(energy);
+ }
+
if(fWriteOutputStdAOD){
AliAODCaloCluster * newclus = new((*(fOutputEvent->GetCaloClusters()))[naod++])AliAODCaloCluster(*clus);
fAODEMCAL->Add(newclus);
//____________________________________________________________________________
void AliCaloTrackAODReader::FillInputPHOS() {
//Return array with PHOS clusters in aod format
-
+ if(fDebug > 2 ) printf("AliCaloTrackAODReader::FillInputPHOS()\n");
+
//Get vertex for momentum calculation
Double_t v[3] ; //vertex ;
GetVertex(v);
AliAODCaloCluster * clus = 0;
if ( (clus = ((AliAODEvent*)fInputEvent)->GetCaloCluster(iclus)) ) {
if (clus->IsPHOSCluster()){
+
+ //Check if the cluster contains any bad channel and if close to calorimeter borders
+ if( GetCaloUtils()->ClusterContainsBadChannel("PHOS",clus->GetCellsAbsId(), clus->GetNCells())) continue;
+ if(!GetCaloUtils()->CheckCellFiducialRegion(clus, ((AliAODEvent*)fInputEvent)->GetPHOSCells())) continue;
+
TLorentzVector momentum ;
clus->GetMomentum(momentum, v);
if(fDebug > 2 && momentum.E() > 0.1) printf("AliCaloTrackAODReader::FillInputPHOS() - Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n",
momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta());
-
+
+ //Recalibrate the cluster energy
+ if(GetCaloUtils()->IsRecalibrationOn()) {
+ Float_t energy = GetCaloUtils()->RecalibrateClusterEnergy(clus, (AliAODCaloCells*)GetPHOSCells());
+ clus->SetE(energy);
+ }
+
if(fWriteOutputStdAOD){
AliAODCaloCluster * newclus = new((*(fOutputEvent->GetCaloClusters()))[naod++])AliAODCaloCluster(*clus);
fAODPHOS->Add(newclus);