-// $Id: AliAnalysisTaskEmcalJet.cxx 56756 2012-05-30 05:03:02Z loizides $
+// $Id$
//
// Emcal jet analysis base task.
//
fPtBiasJetTrack(0),
fPtBiasJetClus(0),
fJetPtCut(1),
- fJetAreaCut(0.4),
+ fJetAreaCut(-1),
fPercAreaCut(-1),
fAreaEmcCut(0),
fJetMinEta(-0.9),
fJetMaxPhi(10),
fMaxClusterPt(100),
fMaxTrackPt(100),
+ fLeadingHadronType(0),
fJets(0),
fRho(0),
fRhoVal(0)
fPtBiasJetTrack(0),
fPtBiasJetClus(0),
fJetPtCut(1),
- fJetAreaCut(0.4),
+ fJetAreaCut(-1),
fPercAreaCut(-1),
fAreaEmcCut(0),
fJetMinEta(-0.9),
fJetMaxPhi(10),
fMaxClusterPt(100),
fMaxTrackPt(100),
+ fLeadingHadronType(0),
fJets(0),
fRho(0),
fRhoVal(0)
{
// Accept jet with a bias.
- if (jet->MaxTrackPt() < fPtBiasJetTrack && jet->MaxClusterPt() < fPtBiasJetClus)
- return kFALSE;
- else
- return kTRUE;
+ if (fLeadingHadronType == 0) {
+ if (jet->MaxTrackPt() < fPtBiasJetTrack) return kFALSE;
+ }
+ else if (fLeadingHadronType == 1) {
+ if (jet->MaxClusterPt() < fPtBiasJetClus) return kFALSE;
+ }
+ else {
+ if (jet->MaxTrackPt() < fPtBiasJetTrack && jet->MaxClusterPt() < fPtBiasJetClus) return kFALSE;
+ }
+
+ return kTRUE;
+}
+
+//________________________________________________________________________
+Float_t* AliAnalysisTaskEmcalJet::GenerateFixedBinArray(Int_t n, Float_t min, Float_t max) const
+{
+ Float_t *bins = new Float_t[n+1];
+
+ Float_t binWidth = (max-min)/n;
+ bins[0] = min;
+ for (Int_t i = 1; i <= n; i++) {
+ bins[i] = bins[i-1]+binWidth;
+ }
+
+ return bins;
+}
+
+//________________________________________________________________________
+Double_t AliAnalysisTaskEmcalJet::GetLeadingHadronPt(AliEmcalJet *jet) const
+{
+ if (fLeadingHadronType == 0) // charged leading hadron
+ return jet->MaxTrackPt();
+ else if (fLeadingHadronType == 1) // neutral leading hadron
+ return jet->MaxClusterPt();
+ else // charged or neutral
+ return jet->MaxPartPt();
}
//________________________________________________________________________
if (jet->MaxTrackPt() > fMaxTrackPt || jet->MaxClusterPt() > fMaxClusterPt)
return kFALSE;
- return (Bool_t)(jet->Eta() > fJetMinEta && jet->Eta() < fJetMaxEta && jet->Phi() > fJetMinPhi && jet->Phi() < fJetMaxPhi);
+ Double_t jetPhi = jet->Phi();
+ Double_t jetEta = jet->Eta();
+
+ if (fJetMinPhi < 0) // if limits are given in (-pi, pi) range
+ jetPhi -= TMath::Pi() * 2;
+
+ return (Bool_t)(jetEta > fJetMinEta && jetEta < fJetMaxEta && jetPhi > fJetMinPhi && jetPhi < fJetMaxPhi);
}
//________________________________________________________________________
AliInfo(Form("%s: jet area cut will be calculated as a percentage of the average area, given value will be overwritten", GetName()));
fJetAreaCut = fPercAreaCut * fJetRadius * fJetRadius * TMath::Pi();
}
+ if (fJetAreaCut < 0)
+ fJetAreaCut = 0;
if (fAnaType == kTPC) {
SetJetEtaLimits(-0.5, 0.5);
const Int_t n = array->GetEntriesFast();
- if (fJets->GetClass()->GetBaseClass("AliEmcalJet")) {
+ if (n < 1)
+ return 0;
+
+ if (array->GetClass()->GetBaseClass("AliEmcalJet")) {
for (Int_t i = 0; i < n; i++) {
}
}
- else if (fJets->GetClass()->GetBaseClass("AliVTrack")) {
+ else if (array->GetClass()->GetBaseClass("AliVTrack")) {
for (Int_t i = 0; i < n; i++) {
}
}
- else if (fJets->GetClass()->GetBaseClass("AliVCluster")) {
+ else if (array->GetClass()->GetBaseClass("AliVCluster")) {
for (Int_t i = 0; i < n; i++) {