fOutputAODBranch(0x0), fNewAOD(kFALSE),
fOutputAODName(""), fOutputAODClassName(""),
fAODObjArrayName(""), fAddToHistogramsName(""),
- fCentralityClass("V0M"),fCentralityOpt(10),
fCaloPID(0x0), fFidCut(0x0), fIC(0x0),fMCUtils(0x0), fNMS(0x0),
fCaloUtils(0x0),
fHistoPtBins(0), fHistoPtMax(0.), fHistoPtMin(0.),
return fReader->GetEventNumber() ;
}
-//__________________________________________________
-Int_t AliAnaPartCorrBaseClass::GetEventCentrality() const {
- //Return current event centrality
-
- if(GetCentrality()){
- if(fCentralityOpt==100) return (Int_t) GetCentrality()->GetCentralityPercentile(fCentralityClass);
- else if(fCentralityOpt==10) return GetCentrality()->GetCentralityClass10(fCentralityClass);
- else if(fCentralityOpt==5) return GetCentrality()->GetCentralityClass5(fCentralityClass);
- else {
- printf("AliAnaPartCorrBaseClass::Unknown centrality option %d, use 5, 10 or 100\n",fCentralityOpt);
- return 0;
- }
- }
- else return 0;
-
-}
-
//__________________________________________________
AliStack * AliAnaPartCorrBaseClass::GetMCStack() const {
return fCaloUtils->GetModuleNumber(cluster);}
//Centrality
- AliCentrality* GetCentrality() const { return fReader->GetCentrality() ;}
- void SetCentralityClass(TString name) { fCentralityClass = name ;}
- void SetCentralityOpt(Int_t opt) { fCentralityOpt = opt ;}
- TString GetCentralityClass() const { return fCentralityClass ;}
- Int_t GetCentralityPercent() const { return fCentralityOpt ;}
- Int_t GetEventCentrality() const ;
+ AliCentrality* GetCentrality() const { return fReader->GetCentrality() ;}
+ Int_t GetEventCentrality() const { return fReader->GetEventCentrality() ;}
virtual void Terminate(TList * /*outputList*/) {;}
TString fAODObjArrayName ; // Name of ref array kept in a TList in AliAODParticleCorrelation with clusters or track references.
TString fAddToHistogramsName;// Add this string to histograms name
- TString fCentralityClass; // Name of selected centrality class
- Int_t fCentralityOpt; // Option for the returned value of the centrality, possible options 5, 10, 100
-
//Analysis helper classes access pointers
AliCaloPID * fCaloPID; //! PID calculation
AliFiducialCut * fFidCut; //! Acceptance cuts
Int_t fHistoTrMMax ; // Maximum value of track multiplicity histogram range
Int_t fHistoTrMMin ; // Minimum value of track multiplicity histogram range
- ClassDef(AliAnaPartCorrBaseClass,14)
+ ClassDef(AliAnaPartCorrBaseClass,15)
} ;
fAnaLED(kFALSE),fTaskName(""),fCaloUtils(0x0),
fMixedEvent(NULL), fNMixedEvent(1), fVertex(NULL),
fWriteOutputDeltaAOD(kFALSE),fOldAOD(kFALSE),fCaloFilterPatch(kFALSE),
- fEMCALClustersListName(""),fZvtxCut(0.)
+ fEMCALClustersListName(""),fZvtxCut(0.),
+ fCentralityClass("V0M"),fCentralityOpt(10)
+
{
//Ctor
fZvtxCut = 10.;
+ //Centrality
+ fCentralityBin[0]=fCentralityBin[1]=-1;
+
}
//________________________________________________________________
printf("Read Kine from, stack? %d, AOD ? %d \n", fReadStack, fReadAODMCParticles) ;
printf("Delta AOD File Name = %s\n", fDeltaAODFileName.Data()) ;
+ if(GetCentrality())
+ printf("Centrality: Class %s, Option %d, Bin [%d,%d] \n", fCentralityClass.Data(),fCentralityOpt,fCentralityBin[0], fCentralityBin[1]) ;
+
printf(" \n") ;
+
}
//___________________________________________________
//
// }
+ //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 && fCentralityOpt==100){
+ Int_t cen = GetEventCentrality();
+ if(cen > fCentralityBin[1] || cen < fCentralityBin[0]) return kFALSE; //reject events out of bin.
+ }
+
//Fill Vertex array
FillVertexArray();
}
}
+//__________________________________________________
+Int_t AliCaloTrackReader::GetEventCentrality() const {
+ //Return current event centrality
+
+ if(GetCentrality()){
+ if(fCentralityOpt==100) return (Int_t) GetCentrality()->GetCentralityPercentile(fCentralityClass);
+ else if(fCentralityOpt==10) return GetCentrality()->GetCentralityClass10(fCentralityClass);
+ else if(fCentralityOpt==5) return GetCentrality()->GetCentralityClass5(fCentralityClass);
+ else {
+ printf("AliAnaPartCorrBaseClass::Unknown centrality option %d, use 5, 10 or 100\n",fCentralityOpt);
+ return 0;
+ }
+ }
+ else return 0;
+
+}
+
//____________________________________________________________________________
void AliCaloTrackReader::GetVertex(Double_t vertex[3]) const {
//Return vertex position to be used for single event analysis
void SwitchOffCaloFilterPatch() {fCaloFilterPatch = kFALSE ; }
Bool_t IsCaloFilterPatchOn() {if(fDataType == kAOD) { return fCaloFilterPatch ; }
else { return kFALSE ; } }
-
- virtual AliCentrality* GetCentrality() const {return 0x0;}
-
+ //Centrality
+ virtual AliCentrality* GetCentrality() const {return 0x0;} //Actual method to recover the pointer is in the ESD/AODReader
+ void SetCentralityClass(TString name) { fCentralityClass = name ;}
+ void SetCentralityOpt(Int_t opt) { fCentralityOpt = opt ;}
+ TString GetCentralityClass() const { return fCentralityClass ;}
+ Int_t GetCentralityOpt() const { return fCentralityOpt ;}
+ Int_t GetEventCentrality() const ;
+ 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; if(min>=0 && max > 0) fCentralityOpt = 100; }
+ Float_t GetCentralityBin(Int_t i) const { if(i < 0 || i > 1) return 0 ; else return fCentralityBin[i] ; }
//MC reader methods:
Bool_t fCaloFilterPatch; // CaloFilter patch
TString fEMCALClustersListName; //Alternative list of clusters produced elsewhere and not from InputEvent
Float_t fZvtxCut ; // Cut on vertex position
-
- ClassDef(AliCaloTrackReader,22)
+
+ //Centrality
+ TString fCentralityClass; // Name of selected centrality class
+ Int_t fCentralityOpt; // Option for the returned value of the centrality, possible options 5, 10, 100
+ Int_t fCentralityBin[2]; // Minimum and maximum value of the centrality for the analysis
+
+ ClassDef(AliCaloTrackReader,23)
} ;