31 #include <TParticle.h> 32 #include "AliAnalysisManager.h" 34 #include "AliMCEvent.h" 51 DefineOutput(1, TList::Class());
64 fHistos->
CreateTH1(
"hTrueD0pi0piplpimi",
"True D0 pt spectrum (3 pion channel)", 200, 0., 200.);
65 fHistos->
CreateTH1(
"hTrueD0pi0piplpimiAcc",
"True D0 pt spectrum (3 pion channel, in acceptance)", 200, 0., 200.);
66 fHistos->
CreateTH2(
"hPi0FromD0pt",
"pt of the pi0 from D0 decay", 200, 0., 200., 200, 0., 200.);
67 fHistos->
CreateTH2(
"hPiPlFromD0pt",
"pt of the pi+ from D0 decay", 200, 0., 200., 200, 0., 200.);
68 fHistos->
CreateTH2(
"hPiMiFromD0pt",
"pt of the pi- from D0 decay", 200, 0., 200., 200, 0., 200.);
76 AliErrorStream() <<
"No MC event available" << std::endl;
79 for(
int ipart = 0; ipart < fMCEvent->GetNumberOfTracks(); ipart++){
80 auto part = fMCEvent->GetTrack(ipart);
81 if(TMath::Abs(part->PdgCode()) != 421)
continue;
82 if(TMath::Abs(part->Eta()) < 0.5)
continue;
86 if(!(
decay.fPi0daughter &&
decay.fPiMidaughter &&
decay.fPiPldaughter))
continue;
89 if(TMath::Abs(
decay.fPiPldaughter->Eta()) > 0.8)
continue;
90 if(TMath::Abs(
decay.fPiMidaughter->Eta()) > 0.8)
continue;
91 if(TMath::Abs(
decay.fPi0daughter->Eta()) > 0.7)
continue;
106 AliDebug(1,
"Found D0\n");
108 for(
auto idaughter = d0mother->GetFirstDaughter(); idaughter <= d0mother->GetLastDaughter(); idaughter++){
109 auto daughterpart = fMCEvent->GetTrack(idaughter);
110 AliDebug(2, Form(
"Daughter %d: %d\n", did, daughterpart->PdgCode()));
111 if(TMath::Abs(daughterpart->PdgCode()) == 111) decay.
fPi0daughter = daughterpart;
112 if(daughterpart->PdgCode() == 211) decay.
fPiPldaughter = daughterpart;
113 if(daughterpart->PdgCode() == -211) decay.
fPiMidaughter = daughterpart;
120 auto mgr = AliAnalysisManager::GetAnalysisManager();
122 std::cerr <<
"AliAnalysisTaskGammaConvDtrue: No AnalysisManager defined" << std::endl;
127 mgr->AddTask(d0task);
129 TString outputcont = mgr->GetCommonFileName();
130 outputcont +=
":D0MCtrue";
132 mgr->ConnectInput(d0task, 0, mgr->GetCommonInputContainer());
133 mgr->ConnectOutput(d0task, 1, mgr->CreateContainer(
"D0true", TList::Class(), AliAnalysisManager::kOutputContainer, outputcont));
D03PionDecay CheckFor3PionDecay(AliVParticle *d0mother) const
virtual ~AliAnalysisTaskGammaConvDtrue()
Base task in the EMCAL framework.
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
AliVParticle * fPiPldaughter
static AliAnalysisTaskGammaConvDtrue * AddTaskGammaConvDtrue()
AliAnalysisTaskGammaConvDtrue()
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
Create a new TH2 within the container.
THashList * GetListOfHistograms() const
Get the list of histograms.
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
virtual bool Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
AliVParticle * fPiMidaughter
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
THistManager * fHistos
! Output histograms
AliEmcalList * fOutput
!output list
AliVParticle * fPi0daughter
void SetMakeGeneralHistograms(Bool_t g)
Container class for histograms.
virtual void UserCreateOutputObjects()
void UserCreateOutputObjects()
Main initialization function on the worker.