25 #include "AliAnalysisUtils.h"
26 #include "AliAODInputHandler.h"
27 #include "AliAODTrack.h"
29 #include "AliEMCALGeometry.h"
30 #include "AliEMCALRecoUtils.h"
31 #include "AliEMCALTriggerPatchInfo.h"
33 #include "AliESDtrackCuts.h"
34 #include "AliESDEvent.h"
35 #include "AliInputEventHandler.h"
36 #include "AliPIDResponse.h"
37 #include "AliTOFPIDResponse.h"
38 #include "AliVVertex.h"
47 namespace EMCalTriggerPtAnalysis {
49 AliAnalysisTaskChargedParticlesRef::AliAnalysisTaskChargedParticlesRef() :
54 fEtaLabCut(-0.5, 0.5),
56 fPhiCut(0., TMath::TwoPi()),
66 fEtaLabCut(-0.5, 0.5),
68 fPhiCut(0., TMath::TwoPi()),
88 const int kdimPID = 3;
89 const int knbinsPID[kdimPID] = {1000, 200, 300};
90 const double kminPID[kdimPID] = {-100., 0., 0.}, kmaxPID[kdimPID] = {100., 200., 1.5};
92 fHistos->
CreateTH1(Form(
"hEventCount%s", trg.Data()), Form(
"Event Counter for trigger class %s", trg.Data()), 1, 0.5, 1.5);
93 fHistos->
CreateTH1(Form(
"hVertexBefore%s", trg.Data()), Form(
"Vertex distribution before z-cut for trigger class %s", trg.Data()), 500, -50, 50);
94 fHistos->
CreateTH1(Form(
"hVertexAfter%s", trg.Data()), Form(
"Vertex distribution after z-cut for trigger class %s", trg.Data()), 100, -10, 10);
96 fHistos->
CreateTH3(Form(
"hPtEtaPhiAll%s", trg.Data()), Form(
"p_{t}-#eta-#phi distribution of all accepted tracks for trigger %s; p_{t} (GeV/c); #eta; #phi", trg.Data()), newbinning,
TLinearBinning(64, -0.8, 0.8),
TLinearBinning(100, 0., 2*TMath::Pi()));
97 fHistos->
CreateTH3(Form(
"hPtEtaPhiEMCALAll%s", trg.Data()), Form(
"p_{t}-#eta-#phi distribution of all accepted tracks pointing to the EMCAL for trigger %s; p_{t} (GeV/c); #eta; #phi", trg.Data()), newbinning,
TLinearBinning(64, -0.8, 0.8),
TLinearBinning(100, 0., 2*TMath::Pi()));
98 fHistos->
CreateTH3(Form(
"hPtEtaPhiCent%s", trg.Data()), Form(
"p_{t}-#eta-#phi distribution of all accepted tracks for trigger %s; p_{t} (GeV/c); #eta; #phi", trg.Data()), newbinning,
TLinearBinning(64, -0.8, 0.8),
TLinearBinning(100, 0., 2*TMath::Pi()));
99 fHistos->
CreateTH3(Form(
"hPtEtaPhiEMCALCent%s", trg.Data()), Form(
"p_{t}-#eta-#phi distribution of all accepted tracks pointing to the EMCAL for trigger %s; p_{t} (GeV/c); #eta; #phi", trg.Data()), newbinning,
TLinearBinning(64, -0.8, 0.8),
TLinearBinning(100, 0., 2*TMath::Pi()));
102 fHistos->
CreateTH2(Form(
"hTPCdEdxEMCAL%s", trg.Data()), Form(
"TPC dE/dx of charged particles in the EMCAL region for trigger %s", trg.Data()), 400, -20., 20., 200, 0., 200.);
103 fHistos->
CreateTH2(Form(
"hTOFBetaEMCAL%s", trg.Data()), Form(
"TOF beta of charged particles in the EMCAL region for trigger %s", trg.Data()), 400, -20., 20., 150, 0., 1.5);
104 fHistos->
CreateTHnSparse(Form(
"hPIDcorrEMCAL%s", trg.Data()), Form(
"Correlation of PID observables for Trigger %s", trg.Data()), kdimPID, knbinsPID, kminPID, kmaxPID);
110 Bool_t hasPIDresponse = fInputHandler->GetPIDResponse() !=
nullptr;
111 if(
fStudyPID && !hasPIDresponse) AliErrorStream() <<
"PID requested but PID response not available" << std::endl;
123 AliVTrack *checktrack(
nullptr);
124 int ptmin[5] = {1,2,5,10,20};
126 Double_t etaEMCAL(0.), phiEMCAL(0.);
127 for(
int itrk = 0; itrk < fInputEvent->GetNumberOfTracks(); ++itrk){
128 checktrack =
dynamic_cast<AliVTrack *
>(fInputEvent->GetTrack(itrk));
129 if(!checktrack)
continue;
132 if(TMath::Abs(checktrack->Pt()) < 0.1)
continue;
133 if(checktrack->IsA() == AliESDtrack::Class()){
134 AliESDtrack copytrack(*(static_cast<AliESDtrack *>(checktrack)));
135 AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(©track);
136 etaEMCAL = copytrack.GetTrackEtaOnEMCal();
137 phiEMCAL = copytrack.GetTrackPhiOnEMCal();
139 AliAODTrack copytrack(*(static_cast<AliAODTrack *>(checktrack)));
140 AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(©track);
141 etaEMCAL = copytrack.GetTrackEtaOnEMCal();
142 phiEMCAL = copytrack.GetTrackPhiOnEMCal();
144 Int_t supermoduleID = -1;
145 isEMCAL =
fGeom->SuperModuleNumberFromEtaPhi(etaEMCAL, phiEMCAL, supermoduleID);
147 isEMCAL = isEMCAL && supermoduleID < 10;
194 AliDebugStream(1) << GetName() <<
": Using weight " << weight <<
" for trigger " << eventclass <<
" in particle histograms." << std::endl;
195 double kinepointall[3] = {TMath::Abs(pt), etalab, phi}, kinepointcent[3] = {TMath::Abs(pt), etacent, phi};
196 fHistos->
FillTH3(Form(
"hPtEtaPhiAll%s", eventclass.Data()), kinepointall, weight);
197 fHistos->
FillTH3(Form(
"hPtEtaPhiCent%s", eventclass.Data()), kinepointcent, weight);
199 fHistos->
FillTH3(Form(
"hPtEtaPhiEMCALAll%s", eventclass.Data()), kinepointall, weight);
200 fHistos->
FillTH3(Form(
"hPtEtaPhiEMCALCent%s", eventclass.Data()), kinepointall, weight);
209 AliDebugStream(1) << GetName() <<
": Using weight " << weight <<
" for trigger " << eventclass <<
" in PID histograms." << std::endl;
210 AliPIDResponse *pid = fInputHandler->GetPIDResponse();
211 if(TMath::Abs(trk.Eta()) > 0.5)
return;
212 if(!((trk.GetStatus() & AliVTrack::kTOFout) && (trk.GetStatus() & AliVTrack::kTIME)))
return;
214 double poverz = TMath::Abs(trk.P())/static_cast<double>(trk.Charge());
215 fHistos->
FillTH2(Form(
"hTPCdEdxEMCAL%s", eventclass.Data()), poverz, trk.GetTPCsignal(), weight);
217 Double_t trtime = (trk.GetTOFsignal() - pid->GetTOFResponse().GetTimeZero()) * 1e-12;
218 Double_t v = trk.GetIntegratedLength()/(100. * trtime);
220 fHistos->
FillTH2(Form(
"hTOFBetaEMCAL%s", eventclass.Data()), poverz, beta, weight);
221 double datapoint[3] = {poverz, trk.GetTPCsignal(), beta};
std::vector< TString > fSelectedTriggers
! Triggers selected for given event
std::vector< TString > GetSupportedTriggers()
Double_t fEtaSign
Sign of the eta distribution (swaps when beam directions swap): p-Pb: +1, Pb-p: -1.
AliEmcalTrackSelection * fTrackCuts
Standard track selection.
Class creating a linear binning, used in the histogram manager.
THistManager * fHistos
Task Histogram container.
static AliEmcalTrackSelection * TrackCutsFactory(TString name, Bool_t isAOD)
virtual ~AliAnalysisTaskChargedParticlesRef()
Test class for charged particle distributions.
Double_t GetTriggerWeight(const TString &triggerclass) const
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
void FillTH3(const char *hname, double x, double y, double z, double weight=1., Option_t *opt="")
Bool_t fStudyPID
Use kinematics correlation histograms.
void AddStep(Double_t max, Double_t binwidth)
virtual void UserFillHistosBeforeEventSelection()
void SetCaloTriggerPatchInfoName(const char *n)
AliCutValueRange< double > fEtaCmsCut
Cut applied in frame.
Base class for analyses using EMCAL triggers.
Double_t fYshift
Rapidity shift.
void FillTHnSparse(const char *name, const double *x, double weight=1., Option_t *opt="")
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
AliEMCALGeometry * fGeom
!emcal geometry
virtual void CreateUserHistos()
AliAnalysisTaskChargedParticlesRef()
Definition of the -binning used in the histograms.
void SetEMCALTrackSelection(AliEmcalTrackSelection *sel)
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Helper class creating user defined custom binning.
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
virtual void CreateUserObjects()
AliCutValueRange< double > fPhiCut
Cut applied in .
AliCutValueRange< double > fEtaLabCut
Cut applied in frame.
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
Double_t fVertex[3]
!event vertex
void FillPIDHistos(const TString &eventclass, const AliVTrack &track)
void SetNeedEmcalGeom(Bool_t n)
void InitializeTrackCuts(TString cutname, bool isAOD)
virtual void UserFillHistosAfterEventSelection()
THnSparse * CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
void FillTrackHistos(const TString &eventclass, Double_t pt, Double_t eta, Double_t etacent, Double_t phi, Bool_t inEmcal)
TH3 * CreateTH3(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, int nbinsz, double zmin, double zmax, Option_t *opt="")
virtual bool IsTrackAccepted(AliVTrack *const trk)=0
bool IsInRange(t value) const
void SetMinimum(Double_t min)