10 #include <THashList.h> 19 #include "AliAnalysisManager.h" 20 #include "AliAnalysisUtils.h" 21 #include "AliESDtrackCuts.h" 22 #include "AliESDtrack.h" 24 #include "AliInputEventHandler.h" 25 #include "AliMCEvent.h" 26 #include "AliMCParticle.h" 27 #include "AliVEvent.h" 49 DefineOutput(1, TList::Class());
61 fTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(
true, 1);
64 fTrackCuts->SetMaxDCAToVertexXYPtDep(
"0.0182+0.0350/pt^1.01");
71 for(
int i = 10; i < 100; i += 10){
72 fHistos->
CreateTH2(Form(
"hParticles_%d_%d", i, i + 10), Form(
"Efficiency Map between %d and %d GeV/c for true particles", i, i + 10), 100, -0.8, 0.8, 100, 0., 2 * TMath::Pi());
73 fHistos->
CreateTH2(Form(
"hTracks_%d_%d", i, i + 10), Form(
"Efficiency Map between %d and %d GeV/c for reconstructed tracks", i, i + 10), 100, -0.8, 0.8, 100, 0., 2 * TMath::Pi());
80 if(!fInputHandler->IsEventSelected() & AliVEvent::kINT7)
return;
83 if(!
fAnalysisUtil->IsVertexSelected2013pA(InputEvent()))
return;
85 AliESDtrack *track = NULL;
86 AliMCParticle *
part = 0;
88 for(
int ipart = 0; ipart < MCEvent()->GetNumberOfTracks(); ipart++){
89 part =
static_cast<AliMCParticle *
>(MCEvent()->GetTrack(ipart));
90 if(!part->Charge())
continue;
91 if(!MCEvent()->IsPhysicalPrimary(ipart))
continue;
92 if(TMath::Abs(part->Eta()) > 0.8)
continue;
93 if(!
FindPtBin(TMath::Abs(part->Pt()), ptmin, ptmax))
continue;
94 fHistos->
FillTH2(Form(
"hParticles_%d_%d", ptmin, ptmax), part->Eta(), part->Phi());
96 for(
int itrk = 0; itrk < InputEvent()->GetNumberOfTracks(); itrk++){
97 track =
static_cast<AliESDtrack *
>(InputEvent()->GetTrack(itrk));
98 part =
static_cast<AliMCParticle *
>(MCEvent()->GetTrack(TMath::Abs(track->GetLabel())));
99 if(!MCEvent()->IsPhysicalPrimary(TMath::Abs(part->GetLabel())))
continue;
100 if(TMath::Abs(part->Eta()) > 0.8)
continue;
102 if(!
FindPtBin(TMath::Abs(part->Pt()), ptmin, ptmax))
continue;
103 fHistos->
FillTH2(Form(
"hTracks_%d_%d", ptmin, ptmax), part->Eta(), part->Phi());
111 TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree();
113 AliError(Form(
"%s - UserNotify: No current tree!",GetName()));
121 TFile *curfile = tree->GetCurrentFile();
123 AliError(Form(
"%s - UserNotify: No current file!",GetName()));
128 if (chain) tree = chain->GetTree();
147 if (file.Contains(
".zip#")) {
148 Ssiz_t pos1 = file.Index(
"root_archive",12,0,TString::kExact);
149 Ssiz_t pos = file.Index(
"#",1,pos1,TString::kExact);
150 Ssiz_t pos2 = file.Index(
".root",5,TString::kExact);
151 file.Replace(pos+1,pos2-pos1,
"");
154 file.ReplaceAll(
gSystem->BaseName(file.Data()),
"");
156 AliDebug(1,Form(
"File name: %s",file.Data()));
161 strPthard.Remove(strPthard.Last(
'/'));
162 strPthard.Remove(strPthard.Last(
'/'));
163 if (strPthard.Contains(
"AOD")) strPthard.Remove(strPthard.Last(
'/'));
164 strPthard.Remove(0,strPthard.Last(
'/')+1);
165 if (strPthard.IsDec())
166 pthard = strPthard.Atoi();
168 AliWarning(Form(
"Could not extract file number from path %s", strPthard.Data()));
171 TFile *fxsec = TFile::Open(Form(
"%s%s",file.Data(),
"pyxsec.root"));
175 fxsec = TFile::Open(Form(
"%s%s",file.Data(),
"pyxsec_hists.root"));
181 TKey* key = (TKey*)fxsec->GetListOfKeys()->At(0);
186 TList *list =
dynamic_cast<TList*
>(key->ReadObj());
191 fXsec = ((TProfile*)list->FindObject(
"h1Xsec"))->GetBinContent(1);
192 fTrials = ((TH1F*)list->FindObject(
"h1Trials"))->GetBinContent(1);
196 TTree *xtree = (
TTree*)fxsec->Get(
"Xsection");
203 xtree->SetBranchAddress(
"xsection",&xsection);
204 xtree->SetBranchAddress(
"ntrials",&ntrials);
214 if(ptin < 10 || ptin > 100)
return false;
215 for(
double ptiter = 10; ptiter < 100; ptiter += 10){
216 if(ptin >= ptiter && ptin < ptiter + 10){
217 ptmin =
static_cast<Int_t>(ptiter);
218 ptmax =
static_cast<Int_t>(ptiter + 10);
virtual void UserCreateOutputObjects()
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
Bool_t PythiaInfoFromFile(const char *currFile, Float_t &fXsec, Float_t &fTrials, Int_t &pthard) const
AliAnalysisUtils * fAnalysisUtil
virtual void UserExec(Option_t *)
TString part
use mixed event to constrain combinatorial background
AliESDtrackCuts * fTrackCuts
Bool_t FindPtBin(Double_t ptin, Int_t &ptmin, Int_t &ptmax) const
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.
void CreateTProfile(const char *name, const char *title, int nbinsX, double xmin, double xmax, Option_t *opt="")
Create a new TProfile 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.
void FillProfile(const char *name, double x, double y, double weight=1.)
virtual Bool_t UserNotify()
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
Analysis of high- tracks in triggered events.
TFile * file
TList with histograms for a given trigger.
virtual ~AliAnalysisTaskEtaPhiEfficiency()
Container class for histograms.
AliAnalysisTaskEtaPhiEfficiency()