#include <TClonesArray.h>
#include <TList.h>
+#include "AliESDEvent.h"
#include "AliAnalysisManager.h"
#include "AliCentrality.h"
#include "AliVCluster.h"
// User create outputs.
}
+//_____________________________________________________
+Int_t AliAnalysisTaskEmcal::GetBeamType()
+{
+ // Get beam type : pp-AA-pA
+ // ESDs have it directly, AODs get it from hardcoded run number ranges
+
+ AliESDEvent *esd = dynamic_cast<AliESDEvent*>(InputEvent());
+ if (esd) {
+ const AliESDRun *run = esd->GetESDRun();
+ TString beamType = run->GetBeamType();
+ if (beamType == "p-p")
+ return kpp;
+ else if (beamType == "A-A")
+ return kAA;
+ else if (beamType == "p-A")
+ return kpA;
+ else
+ return kNA;
+ }
+ else
+ {
+ Int_t runNumber = InputEvent()->GetRunNumber();
+ if ((runNumber >= 136851 && runNumber <= 139517) || // LHC10h
+ (runNumber >= 166529 && runNumber <= 170593)) // LHC11h
+ {
+ return kAA;
+ }
+ else
+ {
+ return kpp;
+ }
+ }
+}
+
//________________________________________________________________________
void AliAnalysisTaskEmcal::RetrieveEventObjects()
{
// Retrieve objects from event.
+ if (!InputEvent()) {
+ AliError("Could not retrieve event! Returning...");
+ return;
+ }
+
fVertex[0] = 0;
fVertex[1] = 0;
fVertex[2] = 0;
InputEvent()->GetPrimaryVertex()->GetXYZ(fVertex);
- AliCentrality *aliCent = InputEvent()->GetCentrality();
- if (aliCent) {
- fCent = aliCent->GetCentralityPercentile("V0M");
- if (fCent >= 0 && fCent < 10) fCentBin = 0;
- else if (fCent >= 10 && fCent < 30) fCentBin = 1;
- else if (fCent >= 30 && fCent < 50) fCentBin = 2;
- else if (fCent >= 50 && fCent <= 100) fCentBin = 3;
+ if (GetBeamType() == kAA) {
+ AliCentrality *aliCent = InputEvent()->GetCentrality();
+ if (aliCent) {
+ fCent = aliCent->GetCentralityPercentile("V0M");
+ if (fCent >= 0 && fCent < 10) fCentBin = 0;
+ else if (fCent >= 10 && fCent < 30) fCentBin = 1;
+ else if (fCent >= 30 && fCent < 50) fCentBin = 2;
+ else if (fCent >= 50 && fCent <= 100) fCentBin = 3;
+ else {
+ AliWarning(Form("Negative centrality: %f. Assuming 99", fCent));
+ fCentBin = 3;
+ }
+ }
else {
- AliWarning(Form("Negative centrality: %f. Assuming 99", fCent));
+ AliWarning(Form("Could not retrieve centrality information! Assuming 99"));
fCentBin = 3;
}
}
else {
- AliWarning(Form("Could not retrieve centrality information! Assuming 99"));
- fCentBin = 3;
+ fCent = 99;
+ fCentBin = 0;
}
if ((!fCaloName.IsNull()) && (fAnaType == kEMCAL)) {
return kFALSE;
if (jet->Area() <= fJetAreaCut)
return kFALSE;
- if (fAnaType == kEMCAL && !jet->IsInsideEmcal())
- return kFALSE;
- return (Bool_t)(jet->Eta() > fMinEta && jet->Eta() < fMaxEta && jet->Phi() > fMinPhi && jet->Phi() < fMaxPhi);
+ return (Bool_t)(jet->Eta() > fMinEta + fJetRadius && jet->Eta() < fMaxEta - fJetRadius && jet->Phi() > fMinPhi + fJetRadius && jet->Phi() < fMaxPhi - fJetRadius);
}
//________________________________________________________________________
kEMCAL = 1, // EMCal + TPC analysis
};
+ enum BeamType {
+ kNA = -1,
+ kpp = 0,
+ kAA = 1,
+ kpA = 2
+ };
+
AliAnalysisTaskEmcal();
AliAnalysisTaskEmcal(const char *name);
virtual ~AliAnalysisTaskEmcal();
Bool_t AcceptJet(AliEmcalJet* jet) const;
Bool_t IsJetTrack(AliEmcalJet* jet, Int_t itrack, Bool_t sorted = kTRUE) const;
Bool_t IsJetCluster(AliEmcalJet* jet, Int_t iclus, Bool_t sorted = kTRUE) const;
+ Int_t GetBeamType() ;
virtual void RetrieveEventObjects() ;
virtual void FillHistograms() {;}