, fCellMatchdEta(), fCellMatchdPhi()
, fMaxEvent(0), fDoTrackMatching(kFALSE)
, fSelectCell(kFALSE), fSelectCellMinE(0), fSelectCellMinFrac(0)
-, fRemoveLEDEvents(kTRUE), fRemoveExoticEvents(kFALSE)
+, fRemoveLEDEvents(kTRUE),fRemoveExoticEvents(kFALSE)
, fImportGeometryFromFile(kFALSE), fImportGeometryFilePath("")
-, fOADBSet(kFALSE), fAccessOADB(kTRUE), fOADBFilePath("")
+, fOADBSet(kFALSE), fAccessOADB(kTRUE), fOADBFilePath("")
+, fCentralityClass("")
{
// Constructor
fCellMatchdPhi[j] = -999;
}
+ fCentralityBin[0] = fCentralityBin[1]=-1;
}
, fCellMatchdEta(), fCellMatchdPhi()
, fMaxEvent(0), fDoTrackMatching(kFALSE)
, fSelectCell(kFALSE), fSelectCellMinE(0), fSelectCellMinFrac(0)
-, fRemoveLEDEvents(kTRUE), fRemoveExoticEvents(kFALSE)
+, fRemoveLEDEvents(kTRUE), fRemoveExoticEvents(kFALSE)
, fImportGeometryFromFile(kFALSE), fImportGeometryFilePath("")
-, fOADBSet(kFALSE), fAccessOADB(kTRUE), fOADBFilePath("")
-
+, fOADBSet(kFALSE), fAccessOADB(kTRUE), fOADBFilePath("")
+, fCentralityClass("")
{
// Constructor
if(fSelectCellMinE <= 0) fSelectCellMinE = 0.005;
if(fSelectCellMinFrac <= 0) fSelectCellMinFrac = 0.001;
+ //Centrality
+ if(fCentralityClass == "") fCentralityClass = "V0M";
+ fCentralityBin[0] = fCentralityBin[1]=-1;
+
if (fOCDBpath == "") fOCDBpath = "raw://" ;
if (fOutputAODBranchName == "") fOutputAODBranchName = "newEMCALClusters" ;
fDoTrackMatching = clus->fDoTrackMatching;
fOutputAODBranchName = clus->fOutputAODBranchName;
for(Int_t i = 0; i < 12; i++) fGeomMatrix[i] = clus->fGeomMatrix[i] ;
+ fCentralityClass = clus->fCentralityClass;
+ fCentralityBin[0] = clus->fCentralityBin[0];
+ fCentralityBin[1] = clus->fCentralityBin[1];
}
// Init geometry, I do not like much to do it like this ...
//Remove the contents of AOD branch output list set in the previous event
fOutputAODBranch->Clear("C");
+ LoadBranches();
+
+ //Check if there is a centrality value, PbPb analysis, and if a centrality bin selection is requested
+ //If we need a centrality bin, we select only those events in the corresponding bin.
+ if( GetCentrality() && fCentralityBin[0] >= 0 && fCentralityBin[1] >= 0 )
+ {
+ Int_t cen = GetEventCentrality();
+ if(cen > fCentralityBin[1] || cen < fCentralityBin[0]) return ; //reject events out of bin.
+ }
+
// intermediate array with new clusters : init the array only once or clear from previous event
if(!fCaloClusterArr) fCaloClusterArr = new TObjArray(10000);
else fCaloClusterArr->Delete();//Clear("C"); it leaks?
- LoadBranches();
-
//Get the event, do some checks and settings
CheckAndGetEvent() ;
class TTree;
class TClonesArray;
+#include "AliCentrality.h";
+
//EMCAL
class AliEMCALGeometry;
class AliEMCALCalibData;
void SetImportGeometryFromFile(Bool_t im,
TString pa = "") { fImportGeometryFromFile = im ;
fImportGeometryFilePath = pa ; }
-
//AOD methods
void SetAODBranchName(TString &name) { fOutputAODBranchName = name ; }
void FillAODFile(Bool_t yesno) { fFillAODFile = yesno ; }
void SetOADBFilePath(TString path) { fOADBFilePath = path ; }
+ // Centrality selection
+
+ AliCentrality* GetCentrality() { return InputEvent()->GetCentrality() ; } //Look in AOD reader, different there
+ void SetCentralityClass(TString name) { fCentralityClass = name ; }
+ TString GetCentralityClass() const { return fCentralityClass ; }
+ Int_t GetEventCentrality() { if(GetCentrality()) return GetCentrality()->GetCentralityPercentile(fCentralityClass) ;
+ else return -1 ; }
+ void SetCentralityBin(Int_t min, Int_t max) //Set the centrality bin to select the event. If used, then need to get percentile
+ { fCentralityBin[0]=min ; fCentralityBin[1]=max ; }
+ Float_t GetCentralityBin(Int_t i) const { if(i < 0 || i > 1) return -1 ;
+ else return fCentralityBin[i] ; }
+
private:
virtual void FillCaloClusterInEvent();
Bool_t fAccessOADB ; // Get calibration from OADB for EMCAL
TString fOADBFilePath ; // Default path $ALICE_ROOT/OADB/EMCAL, if needed change
+ //Centrality
+ TString fCentralityClass; // Name of selected centrality class
+ Int_t fCentralityBin[2]; // Minimum and maximum value of the centrality for the analysis
+
+
AliAnalysisTaskEMCALClusterize( const AliAnalysisTaskEMCALClusterize&); // not implemented
AliAnalysisTaskEMCALClusterize& operator=(const AliAnalysisTaskEMCALClusterize&); // not implemented
- ClassDef(AliAnalysisTaskEMCALClusterize, 21);
+ ClassDef(AliAnalysisTaskEMCALClusterize, 22);
};
// $Id$
AliAnalysisTaskEMCALClusterize* AddTaskEMCALClusterize(
- TString & arrayName,
- const Bool_t bFillAOD = kFALSE,
- const Int_t bMC = kFALSE,
- const Bool_t exotic = kTRUE,
- const TString name = "V1Unfold",
- const TString trigger = "",
- const Bool_t tm = kTRUE,
- const Int_t minEcell = 50,
- const Int_t minEseed = 100,
- const Int_t maxDeltaT = 250,
- const Int_t timeWindow = 1000,
- const Int_t minEUnf = 15,
- const Int_t minFrac = 1,
- const Bool_t bRecalE = kTRUE,
- const Bool_t bBad = kTRUE,
- const Bool_t bRecalT = kTRUE,
- const Bool_t bNonLine = kFALSE,
- const Int_t nRowDiff = 1,
- const Int_t nColDiff = 1
-)
+ TString & arrayName,
+ const Bool_t bFillAOD = kFALSE,
+ const Int_t bMC = kFALSE,
+ const Bool_t exotic = kTRUE,
+ const TString name = "V1Unfold",
+ const TString trigger = "",
+ const Bool_t tm = kTRUE,
+ const Int_t minEcell = 50,
+ const Int_t minEseed = 100,
+ const Int_t maxDeltaT = 250,
+ const Int_t timeWindow = 1000,
+ const Int_t minEUnf = 15,
+ const Int_t minFrac = 1,
+ const Bool_t bRecalE = kTRUE,
+ const Bool_t bBad = kTRUE,
+ const Bool_t bRecalT = kTRUE,
+ const Bool_t bNonLine = kFALSE,
+ const Int_t minCen = -1,
+ const Int_t maxCen = -1,
+ const Int_t nRowDiff = 1,
+ const Int_t nColDiff = 1
+ )
{
// Get the pointer to the existing analysis manager via the static access method.
//==============================================================================
printf("Passed Settings : mc %d, exo %d, name %s, trigger %s, tm %d\n",bMC,exotic,name.Data(),trigger.Data(),tm);
printf(" Ecell %d, Eseed %d, dT %d, wT %d, minUnf %d, minFrac %d \n",minEcell, minEseed,maxDeltaT,timeWindow,minEUnf,minFrac);
- printf(" recalE %d, bad %d, recalT %d, nonlin %d, rowDiff %d, colDiff %d \n",bRecalE,bBad,bRecalT,bNonLine,nRowDiff,nColDiff);
+ printf(" recalE %d, bad %d, recalT %d, nonlin %d, minCen %d, maxCen %d, rowDiff %d, colDiff %d \n",bRecalE,bBad,bRecalT,bNonLine,minCen,maxCen,nRowDiff,nColDiff);
+ // Create name of task and AOD branch depending on different settings
+
+ if(name.Contains("NxN")) arrayName = Form("%dx%d_Ecell%d_Eseed%d_DT%d_WT%d",2*nRowDiff+1,2*nColDiff+1,minEcell,minEseed,maxDeltaT,timeWindow);
+ else arrayName = Form( "%s_Ecell%d_Eseed%d_DT%d_WT%d", name.Data(),minEcell,minEseed,maxDeltaT,timeWindow);
+
+ if(minCen != -1 && maxCen != -1)
+ arrayName+=Form("_Cen%d_%d",minCen,maxCen);
+
+ printf("Created Branch Name: \n",arrayName.Data());
+
+
//-------------------------------------------------------
// Init the task and do settings
//-------------------------------------------------------
- AliAnalysisTaskEMCALClusterize* clusterize = new AliAnalysisTaskEMCALClusterize(Form("EMCALClusterize%s_Ecell%d_Eseed%d_DT%d_WT%d",
- name.Data(),minEcell,minEseed,maxDeltaT,timeWindow));
+ AliAnalysisTaskEMCALClusterize* clusterize = new AliAnalysisTaskEMCALClusterize(Form("EMCALClusterize%s",arrayName.Data()));
+ clusterize->SetAODBranchName(arrayName);
+
//clusterize->SetOCDBPath("local://$ALICE_ROOT/OCDB");
// Some general settings to create AOD file in case we want to keep it
}
// Set clusters branch name, make sure the analysis after this one reads this name
-
- if(name.Contains("NxN")) arrayName = Form("%dx%d_Ecell%d_Eseed%d_DT%d_WT%d",2*nRowDiff+1,2*nColDiff+1,minEcell,minEseed,maxDeltaT,timeWindow);
- else arrayName = Form( "%s_Ecell%d_Eseed%d_DT%d_WT%d", name.Data(),minEcell,minEseed,maxDeltaT,timeWindow);
-
- clusterize->SetAODBranchName(arrayName);
-
- printf("Created Branch Name: \n",arrayName.Data());
-
+
//-------------------------------------------------------
// Final settings, pass to manager and set the containers
//-------------------------------------------------------