AliPhysics  master (3d17d9d)
AliAnalysisTaskGammaConvV1.h
Go to the documentation of this file.
1 #ifndef ALIANLYSISTASKGAMMACONVV1_cxx
2 #define ALIANLYSISTASKGAMMACONVV1_cxx
3 
4 #include "AliAnalysisTaskSE.h"
5 #include "AliESDtrack.h"
6 #include "AliV0ReaderV1.h"
7 #include "AliCaloPhotonCuts.h"
8 #include "AliConvEventCuts.h"
9 #include "AliKFConversionPhoton.h"
11 #include "AliConversionAODBGHandlerRP.h"
12 #include "AliConversionMesonCuts.h"
13 #include "AliAnalysisManager.h"
14 #include "AliAnalysisTaskConvJet.h"
15 #include "TProfile2D.h"
16 #include "TH3.h"
17 #include "TH3F.h"
18 #include "TMVA/Tools.h"
19 #include "TMVA/Reader.h"
20 #include <vector>
21 #include <map>
22 
24 
25  public:
27  AliAnalysisTaskGammaConvV1(const char *name);
29 
30  virtual void UserCreateOutputObjects();
31  virtual Bool_t Notify();
32  virtual void UserExec(Option_t *);
33  virtual void Terminate(const Option_t*);
34  void InitBack();
35 
36  void SetV0ReaderName(TString name){fV0ReaderName=name; return;}
37  void SetLightOutput(Bool_t flag ){fDoLightOutput = flag;}
38 
39  void SetIsHeavyIon(Int_t flag) { fIsHeavyIon = flag ;}
40  void SetIsMC(Int_t isMC) { fIsMC = isMC ;}
42  void SetDoMesonQA(Int_t flag) { fDoMesonQA = flag ;}
43  void SetDoPhotonQA(Int_t flag) { fDoPhotonQA = flag ;}
47  void SetDoTHnSparse(Bool_t flag) { fDoTHnSparse = flag ;}
50  void SetFileNameBDT(TString filename) { fFileNameBDT = filename.Data() ;}
51  void InitializeBDT();
52  void ProcessPhotonBDT();
53  void ProcessClusters();
54  void ProcessJets();
57  void CalculateBackground();
58  void CalculateBackgroundRP();
59  void ProcessMCParticles();
60  void ProcessAODMCParticles();
62  void ProcessTruePhotonCandidates( AliAODConversionPhoton* TruePhotonCandidate);
63  void ProcessTruePhotonCandidatesAOD( AliAODConversionPhoton* TruePhotonCandidate);
64  void ProcessTrueMesonCandidates( AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1);
65  void ProcessTrueMesonCandidatesAOD(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1);
66  void RotateParticle(AliAODConversionPhoton *gamma);
67  void RotateParticleAccordingToEP(AliAODConversionPhoton *gamma, Double_t previousEventEP, Double_t thisEventEP);
68  void SetEventCutList(Int_t nCuts, TList *CutArray) { fnCuts = nCuts ;
69  fEventCutArray = CutArray ;}
70  void SetConversionCutList(Int_t nCuts, TList *CutArray) { fnCuts = nCuts ;
71  fCutArray = CutArray ;}
72 
73  void SetMesonCutList(Int_t nCuts, TList *CutArray) { fnCuts = nCuts ;
74  fMesonCutArray = CutArray ;}
75  void SetClusterCutList(Int_t nCuts, TList *CutArray) { fnCuts = nCuts ;
76  fClusterCutArray = CutArray ;}
77 
79 
80  // BG HandlerSettings
82  void FillPhotonCombinatorialBackgroundHist(AliAODConversionPhoton *TruePhotonCandidate, Int_t pdgCode[], Double_t PhiParticle[]);
83  void FillPhotonCombinatorialMothersHistESD(TParticle *daughter,TParticle *mother);
84  void FillPhotonCombinatorialMothersHistAOD(AliAODMCParticle *daughter, AliAODMCParticle* motherCombPart);
85  void MoveParticleAccordingToVertex(AliAODConversionPhoton* particle,const AliGammaConversionAODBGHandler::GammaConversionVertex *vertex);
87  void SetLogBinningXTH2(TH2* histoRebin);
88  Int_t GetSourceClassification(Int_t daughter, Int_t pdgCode);
89 
90  // Additional functions
91  Bool_t CheckVectorForDoubleCount(vector<Int_t> &vec, Int_t tobechecked);
92  void FillMultipleCountMap(map<Int_t,Int_t> &ma, Int_t tobechecked);
93  void FillMultipleCountHistoAndClear(map<Int_t,Int_t> &ma, TH1F* hist);
94  Double_t GetOriginalInvMass(const AliConversionPhotonBase * photon, AliVEvent * event) const;
95 
96  protected:
97  AliV0ReaderV1* fV0Reader; //
99  Bool_t fDoLightOutput; // switch for running light output, kFALSE -> normal mode, kTRUE -> light mode
101  AliConversionAODBGHandlerRP** fBGHandlerRP; //
102  AliVEvent* fInputEvent; //
103  AliMCEvent* fMCEvent; //
112  TClonesArray* fReaderGammas; //
143  UChar_t iCatPhoton;
144  UChar_t iPhotonMCInfo;
145  // 0: garbage,
146  // 1: background
147  // 2: secondary photon not from eta or k0s,
148  // 3: secondary photon from eta,
149  // 4: secondary photon from k0s,
150  // 5: dalitz
151  // 6: primary gamma
160  THnSparseF** sESDMotherInvMassPtZM;
170  THnSparseF** sPtRDeltaROpenAngle;
185  TH1F** fHistoMCPi0Pt;
189  TH1F** fHistoMCEtaPt;
262  vector<Int_t> vecDoubleCountTruePi0s;
263  vector<Int_t> vecDoubleCountTrueEtas;
268  map<Int_t,Int_t> mapMultipleCountTruePi0s;
269  map<Int_t,Int_t> mapMultipleCountTrueEtas;
271  TH1F** fHistoNEvents;
276  TH1F** fHistoVertexZ;
278  Int_t fDoCentralityFlat; //flag for centrality flattening
284 
285  TH1F** fHistoPtJet; // Histogram of Jet Pt
286  TH1F** fHistoJetEta; // Histogram of Jet Eta
287  TH1F** fHistoJetPhi; // Histogram of Jet Phi
288  TH1F** fHistoJetArea; // Histogram of Jet Area
289  TH1F** fHistoNJets; // Histogram of number of jets
290  TH1F** fHistoEventwJets; // Histogram of number of events with jets > 0
291  TH1F** fHistoJetPi0PtRatio; // Histogram of PtPi0/PtJet
292  TH1F** fHistoDoubleCounting; // Histogram if NM candidates are defined within multiple jets
293  TH2F** fHistoJetMotherInvMassPt; // Histogram of NM candidates with a jet in the event
294  TH2F** fHistoPi0InJetMotherInvMassPt; // Histogram of NM candidates that are inside a jet
295  TH2F** fHistoMotherBackJetInvMassPt; // Histogram of Backgrouns candidates that are involved with jets
296  TH2F** fHistoRJetPi0Cand; // Histogram of RJetPi0Cand vs Pt
297  TH2F** fHistoEtaPhiJetPi0Cand; // Histogram of delta eta and delta phi distr between jet and NM candidates
298  TH2F** fHistoEtaPhiJetWithPi0Cand; // Histogram of delta eta and delta phi distr when pi0 is inside a jet
299  TH2F** fHistoJetFragmFunc; // Histogram to determine fragmentation function
300  TH2F** fHistoJetFragmFuncZInvMass; // Histogram of Inv Mass distribution with z
301  TH2F** fHistoTruevsRecJetPt; // Histogram of true jet pt vs reconstructed jet pt
302  TH2F** fHistoTrueJetMotherInvMassPt; // Histogram of true pi0s in an event with a jet
303  TH2F** fHistoTrueInJetMotherInvMassPt; // Histogram of true pi0s in a jet
304  TH2F** fHistoTruePrimaryJetInvMassPt; // Histogram of true primary pi0s in an event with a jet
305  TH2F** fHistoTruePrimaryinJetInvMassPt; // Histogram of true primary pi0s in a jet
306  TH2F** fHistoTruePrimaryInJetInvMassTruePt; // Histogram of true primary pi0s in a jet with their true pt
307  TH1F** fHistoTrueDoubleCountingJet; // Histogram of when a true pi0 is defined to be in multiple jets
308  TH2F** fHistoTrueJetFragmFunc; // Histogram to determine true fragmentation function
309  TH2F** fHistoTrueJetFragmFuncZInvMass; // Histogram to determine true Inv Mass distribution with z
310  TH1F** fHistoMCPi0JetInAccPt; // Histogram with weighted pi0 in a jet event in acceptance, pT
311  TH1F** fHistoMCPi0inJetInAccPt; // Histogram with weighted pi0 in a jet in acceptance, pT
312  TH1F** fHistoMCEtaJetInAccPt; // Histogram with weighted eta in a jet event in acceptance, pT
313  TH1F** fHistoMCEtainJetInAccPt; // Histogram with weighted eta in a jet in acceptance, pT
314  TH1F** fHistoMCPi0JetEventGenerated; // Histogram with mesons in a jet event generated, pT
315  TH1F** fHistoMCPi0inJetGenerated; // Histogram with mesons in a jet generated, pT
316  TH1F** fHistoMCEtaJetEventGenerated; // Histogram with mesons in a jet event generated, pT
317  TH1F** fHistoMCEtainJetGenerated; // Histogram with mesons in a jet generated, pT
318  TH2F** fHistoTrueSecondaryFromK0sJetInvMassPt; // Histogram with validated secondary mothers from K0s in an event with a jet, invMass, pt
319  TH2F** fHistoTrueSecondaryFromK0sinJetInvMassPt; // Histogram with validated secondary mothers from K0s in a jet, invMass, pt
320  TH2F** fHistoTrueSecondaryFromLambdaJetInvMassPt; // Histogram with validated secondary mothers from lambda in an event with a jet, invMass, pt
321  TH2F** fHistoTrueSecondaryFromLambdainJetInvMassPt; // Histogram with validated secondary mothers from lambda in a jet, invMass, pt
322  TH2F** fHistoTrueSecondaryFromK0lJetInvMassPt; // Histogram with validated secondary mothers from K0l in an event with a jet, invMass, pt
323  TH2F** fHistoTrueSecondaryFromK0linJetInvMassPt; // Histogram with validated secondary mothers from K0l in a jet, invMass, pt
324  TH2F** fHistoTrueSecondaryInvJetMassPt; // Histogram with validated secondary mothers in an event with a jet, invMass, pt
325  TH2F** fHistoTrueSecondaryInvinJetMassPt; // Histogram with validated secondary mothers in a jet, invMass, pt
326  TH2F** fHistoUnfoldingAsData; // Histogram to use for jet pi0 unfolding
327  TH2F** fHistoUnfoldingMissed; // Histogram to use for jet pi0 unfolding
328  TH2F** fHistoUnfoldingReject; // Histogram to use for jet pi0 unfolding
329  TH2F** fHistoUnfoldingAsDataInvMassZ; // Histogram to use for jet pi0 unfolding for z inmass
330  TH2F** fHistoUnfoldingMissedInvMassZ; // Histogram to use for jet pi0 unfolding for z inmass
331  TH2F** fHistoUnfoldingRejectInvMassZ; // Histogram to use for jet pi0 unfolding for z inmass
332 
333  vector<Double_t> fVectorJetPt; // Vector of JetPt
334  vector<Double_t> fVectorJetPx; // Vector of JetPx
335  vector<Double_t> fVectorJetPy; // Vector of JetPy
336  vector<Double_t> fVectorJetPz; // Vector of JetPz
337  vector<Double_t> fVectorJetEta; // Vector of JetEta
338  vector<Double_t> fVectorJetPhi; // Vector of JetPhi
339  vector<Double_t> fVectorJetArea; // Vector of JetArea
340  vector<Double_t> fTrueVectorJetPt; // Vector of True JetPt
341  vector<Double_t> fTrueVectorJetPx; // Vector of True JetPx
342  vector<Double_t> fTrueVectorJetPy; // Vector of True JetPy
343  vector<Double_t> fTrueVectorJetPz; // Vector of True JetPz
344  vector<Double_t> fTrueVectorJetEta; // Vector of True JetEta
345  vector<Double_t> fTrueVectorJetPhi; // Vector of True JetPhi
346 
353  TProfile** fProfileEtaShift;
357  TProfile** fHistoEtaShift;
361  TMVA::Reader* fBDTreader;
367  UChar_t iFlag;
368  UChar_t iMesonMCInfo;
369  // 0: garbage,
370  // 1: background
371  // 2: secondary meson not from eta or k0s,
372  // 3: secondary meson from eta,
373  // 4: secondary meson from k0s,
374  // 5: dalitz
375  // 6: primary meson gamma-gamma-channel
376  Double_t fEventPlaneAngle; // EventPlaneAngle
377  TRandom3 fRandom; //
379  Double_t* fUnsmearedPx; //[fnGammaCandidates]
380  Double_t* fUnsmearedPy; //[fnGammaCandidates]
381  Double_t* fUnsmearedPz; //[fnGammaCandidates]
382  Double_t* fUnsmearedE; //[fnGammaCandidates]
383  Int_t* fMCEventPos; //[fnGammaCandidates]
384  Int_t* fMCEventNeg; //[fnGammaCandidates]
385  Int_t* fESDArrayPos; //[fnGammaCandidates]
386  Int_t* fESDArrayNeg; //[fnGammaCandidates]
398  Bool_t fDoTHnSparse; // flag for using THnSparses for background estimation
399  Double_t fWeightJetJetMC; // weight for Jet-Jet MC
400  Double_t* fWeightCentrality; //[fnCuts], weight for centrality flattening
401  Bool_t fEnableClusterCutsForTrigger; //enables ClusterCuts for Trigger
403  TTree* tBrokenFiles; // tree for keeping track of broken files
404  TObjString* fFileNameBroken; // string object for broken file name
405 
406  private:
407 
408  AliAnalysisTaskGammaConvV1(const AliAnalysisTaskGammaConvV1&); // Prevent copy-construction
409  AliAnalysisTaskGammaConvV1 &operator=(const AliAnalysisTaskGammaConvV1&); // Prevent assignment
410  ClassDef(AliAnalysisTaskGammaConvV1, 48);
411 };
412 
413 #endif
void RotateParticleAccordingToEP(AliAODConversionPhoton *gamma, Double_t previousEventEP, Double_t thisEventEP)
TH1F ** fHistoMCPi0WOEvtWeightPt
array of histos with unweighted pi0, pT
const char * filename
Definition: TestFCM.C:1
Int_t GetSourceClassification(Int_t daughter, Int_t pdgCode)
double Double_t
Definition: External.C:58
Definition: External.C:260
Definition: External.C:236
TH2F ** fHistoDoubleCountTrueEtaInvMassPt
array of histos with double counted pi0s, invMass, pT
AliAnalysisTaskConvJet * fConvJetReader
void RotateParticle(AliAODConversionPhoton *gamma)
vector< Int_t > vecDoubleCountTrueConvGammas
vector containing labels of validated eta
void ProcessTruePhotonCandidatesAOD(AliAODConversionPhoton *TruePhotonCandidate)
void FillPhotonCombinatorialMothersHistAOD(AliAODMCParticle *daughter, AliAODMCParticle *motherCombPart)
map< Int_t, Int_t > mapMultipleCountTrueEtas
map containing pi0 labels that are counted at least twice
AliAnalysisTaskGammaConvV1 & operator=(const AliAnalysisTaskGammaConvV1 &)
void ProcessTruePhotonCandidates(AliAODConversionPhoton *TruePhotonCandidate)
map< Int_t, Int_t > mapMultipleCountTrueConvGammas
map containing eta labels that are counted at least twice
void SetEventCutList(Int_t nCuts, TList *CutArray)
TH2F ** fHistoDoubleCountTrueConvGammaRPt
array of histos with double counted etas, invMass, pT
void SetClusterCutList(Int_t nCuts, TList *CutArray)
TProfile ** fProfileJetJetXSection
array of profiles with eta shift
TH1F ** fHistoMultipleCountTrueEta
array of histos how often TruePi0s are counted
TH1F ** fHistoNGoodESDTracks
array of histos with event information without event weights
vector< Int_t > vecDoubleCountTruePi0s
array of histos with double counted photons, R, pT
void FillMultipleCountHistoAndClear(map< Int_t, Int_t > &ma, TH1F *hist)
AliConversionAODBGHandlerRP ** fBGHandlerRP
TH1F ** fHistoMCEtaWOEvtWeightPt
array of histos without event weights pi0, pT
void SetMoveParticleAccordingToVertex(Bool_t flag)
AliGammaConversionAODBGHandler ** fBGHandler
void ProcessTrueMesonCandidatesAOD(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1)
void FillMultipleCountMap(map< Int_t, Int_t > &ma, Int_t tobechecked)
TH1F ** fHistoMultipleCountTrueConvGamma
array of histos how often TrueEtas are counted
void SetConversionCutList(Int_t nCuts, TList *CutArray)
int Int_t
Definition: External.C:63
Double_t GetOriginalInvMass(const AliConversionPhotonBase *photon, AliVEvent *event) const
void SetDoMaterialBudgetWeightingOfGammasForTrueMesons(Bool_t flag)
Definition: External.C:204
float Float_t
Definition: External.C:68
vector< Int_t > vecDoubleCountTrueEtas
vector containing labels of validated pi0
virtual void Terminate(const Option_t *)
void ProcessTrueMesonCandidates(AliAODConversionMother *Pi0Candidate, AliAODConversionPhoton *TrueGammaCandidate0, AliAODConversionPhoton *TrueGammaCandidate1)
TH1F ** fHistoEventSphericity
array of histos with ntrials for jetjet
void SetFileNameBDT(TString filename)
TProfile ** fHistoEtaShift
array of histos with event Sphericity
TH2F ** fHistoMCEtaPtJetPt
array of histos with weighted pi0, pT, hardest jet pt
void FillPhotonCombinatorialBackgroundHist(AliAODConversionPhoton *TruePhotonCandidate, Int_t pdgCode[], Double_t PhiParticle[])
Int_t mode
Definition: anaM.C:41
TH1F ** fHistoNV0Tracks
correlation V=Mult vs number TPC out Tracks
TH1F ** fHistoMCEtaPt
array of histos without event weights eta, pT
void SetDoClusterSelectionForTriggerNorm(Bool_t flag)
TH1F ** fhJetJetNTrials
array of profiles with xsection for jetjet
Bool_t isMC
TH1F ** fHistoMCPhysicalPrimariesPt
array of histos with weighted eta, pT, hardest jet pt
Definition: External.C:220
void FillPhotonCombinatorialMothersHistESD(TParticle *daughter, TParticle *mother)
void MoveParticleAccordingToVertex(AliAODConversionPhoton *particle, const AliGammaConversionAODBGHandler::GammaConversionVertex *vertex)
const char Option_t
Definition: External.C:48
TH1F ** fHistoNEvents
map containing photon labels that are counted at least twice
bool Bool_t
Definition: External.C:53
void SetMesonCutList(Int_t nCuts, TList *CutArray)
map< Int_t, Int_t > mapMultipleCountTruePi0s
array of histos how often TrueConvGammass are counted
Implementation of a sample jet analysis task.
TH2F ** fHistoV0MultVsNumberTPCoutTracks
array of histos with SPD tracklets vs SPD clusters for background rejection
Bool_t CheckVectorForDoubleCount(vector< Int_t > &vec, Int_t tobechecked)
TH1F ** fHistoMultipleCountTruePi0
vector containing labels of validated photons