AliPhysics  a0db429 (a0db429)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
AliAnalysisTaskSELc2pK0sfromAODtracks.h
Go to the documentation of this file.
1 #ifndef ALIANALYSISTASKSELC2PK0SFROMAODTRACKS_H
2 #define ALIANALYSISTASKSELC2PK0SFROMAODTRACKS_H
3 
4 /**************************************************************************
5  * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
6  * *
7  * Author: The ALICE Off-line Project. *
8  * Contributors are mentioned in the code where appropriate. *
9  * *
10  * Permission to use, copy, modify and distribute this software and its *
11  * documentation strictly for non-commercial purposes is hereby granted *
12  * without fee, provided that the above copyright notice appears in all *
13  * copies and that both the copyright notice and this permission notice *
14  * appear in the supporting documentation. The authors make no claims *
15  * about the suitability of this software for any purpose. It is *
16  * provided "as is" without express or implied warranty. *
17  **************************************************************************/
18 
19 /* $Id$ */
20 
21 #include "TROOT.h"
22 #include "TVector.h"
23 #include "TSystem.h"
24 
25 #include "AliAnalysisTaskSE.h"
26 #include "AliAODEvent.h"
27 #include "AliPID.h"
29 
31 
32 class THnSparse;
33 class TH1F;
34 class TH2F;
35 class TH3F;
36 class TClonesArray;
38 class AliESDVertex;
39 class AliAODMCParticle;
40 class AliEventPoolManager;
42 
43 class AliAnalysisTaskSELc2pK0sfromAODtracks : public AliAnalysisTaskSE
44 {
45  public:
47  AliAnalysisTaskSELc2pK0sfromAODtracks(const Char_t* name, AliRDHFCutsLctopK0sfromAODtracks* cuts, Bool_t writeVariableTree=kTRUE);
49 
51  virtual void UserCreateOutputObjects();
52  virtual void Init();
53  virtual void LocalInit() {Init();}
54  virtual void UserExec(Option_t *option);
55  virtual void Terminate(Option_t *option);
56 
57  void FillROOTObjects(AliAODRecoCascadeHF *lcobj, AliAODv0 *v0, AliAODTrack *trk, AliAODEvent *aod, TClonesArray *mcarray);
58  void FillMixROOTObjects(TLorentzVector *pt, TLorentzVector *ev, TVector *tinfo, TVector *vinfo);
59  Bool_t MakeMCAnalysis(TClonesArray *mcArray);
60  void MakeAnalysis(AliAODEvent *aod, TClonesArray *mcArray);
61  void FillProtonROOTObjects(AliAODTrack *trk, TClonesArray *mcArray);
62  void FillMCROOTObjects(AliAODMCParticle *part, AliAODMCParticle *mcepart, AliAODMCParticle *mcv0part, Int_t decaytype);
63  void FillV0ROOTObjects(AliAODv0 *v0, TClonesArray *mcArray);
64  void FillMCProtonROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray);
65  void FillMCV0ROOTObjects(AliAODMCParticle *mcv0part, TClonesArray *mcArray);
66  void SelectV0( const AliVEvent *event,Int_t nV0,Int_t &nSeleV0, Bool_t *seleV0Flags, TClonesArray *mcArray);
67  void SelectTrack( const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks,Int_t *seleFlags, TClonesArray *mcArray);
68  Int_t MatchToMC(AliAODRecoCascadeHF *elobj, TClonesArray *mcArray, Int_t *pdgarray_pr, Int_t *pdgarray_v0, Int_t *labelarray_pr, Int_t *labelarray_v0, Int_t &ngen_pr, Int_t &ngen_v0);
69 
70 
72  void SetMC(Bool_t theMCon) {fUseMCInfo = theMCon;}
73  Bool_t GetMC() const {return fUseMCInfo;}
74  void SetUseCentralityV0M(Bool_t centon) {fUseCentralityV0M = centon;}
75  Bool_t GetUseCentralityV0M() const {return fUseCentralityV0M;}
76 
78 
79  AliAODRecoCascadeHF* MakeCascadeHF(AliAODv0 *casc, AliAODTrack *trk, AliAODEvent *aod, AliAODVertex *vert);
80  AliAODVertex* ReconstructSecondaryVertex(AliAODv0 *casc, AliAODTrack *trk, AliAODEvent *aod);
81 
86  void SetPoolPVzBinLimits(Int_t Nzvtxbins,const Double_t *ZvtxBins){
87  fNzVtxBins = Nzvtxbins;
88  for(int ix = 0;ix<fNzVtxBins+1;ix++){fZvtxBins[ix] = ZvtxBins[ix];}
89  }
90  void SetPoolCentBinLimits(Int_t Ncentbins,const Double_t *CentBins){
91  fNCentBins = Ncentbins;
92  for(int ix = 0;ix<fNCentBins+1;ix++){fCentBins[ix] = CentBins[ix];}
93  }
94  void SetPoolRPBinLimits(Int_t Nrpbins,const Double_t *rpbins){
95  fNRPBins = Nrpbins;
96  for(int ix = 0;ix<fNRPBins+1;ix++){fRPBins[ix] = rpbins[ix];}
97  }
98  void DoEventMixingWithPools(Int_t index);
99  void ResetPool(Int_t poolIndex);
100  Int_t GetPoolIndex(Double_t zvert, Double_t mult, Double_t rp);
101 
102  private:
103 
106 
107  void DefineTreeVariables();
109  void DefineV0TreeVariables();
110  void DefineMCTreeVariables();
115 
116  AliAODVertex *CallPrimaryVertex(AliAODv0 *v0, AliAODTrack *trk, AliAODEvent *evt);
117  AliAODVertex* PrimaryVertex(const TObjArray *trkArray,AliVEvent *event);
118 
119  Bool_t fUseMCInfo;
120  TList *fOutput;
121  TList *fOutputAll;
122  TList *fListCuts;
123  TH1F *fCEvents;
124  TH1F *fHTrigger;
125  TH1F *fHCentrality;
132  TTree *fVariablesTree;
139  Bool_t fIsMB;
140  Bool_t fIsSemi;
141  Bool_t fIsCent;
142  Bool_t fIsINT7;
143  Bool_t fIsEMC7;
150  AliAODVertex *fVtx1;
151  AliESDVertex *fV1;
152  Float_t fVtxZ;
153  Double_t fBzkG;
154  Float_t fCentrality;
155  Float_t fReactionPlane;
156  Int_t fRunNumber;
157  Float_t fTriggerCheck;
161 
162  //--------------------- My histograms ------------------
166 
167  THnSparse* fHistoLcMCGen;
168  THnSparse* fHistoLcK0SpMass;
169  THnSparse* fHistoLcK0SpMassMix;
175  THnSparse* fHistoLcK0SpMassMCS;
177  THnSparse* fHistoLcKPluspMass;
178  THnSparse* fHistoLcKMinuspMass;
181 
182  TH2F* fHistoBachPt;
185  TH2F* fHistoKaonPt;
191  TH1F* fHistod0Bach;
192  TH1F* fHistod0V0;
193  TH1F* fHistod0d0;
200 
201  //Mixing
204  Int_t fNzVtxBins;
205  Double_t fZvtxBins[100]; // [fNzVtxBinsDim]
206  Int_t fNCentBins;
207  Double_t fCentBins[100]; // [fNCentBinsDim]
208  Int_t fNRPBins;
209  Double_t fRPBins[100]; // [fNRPBinsDim]
210  Int_t fNOfPools;
211  TTree** fEventBuffer;
212  TObjString *fEventInfo;
213  TObjArray* fProtonTracks;
214  TObjArray* fV0Tracks;
215  TObjArray* fProtonCutVarsArray;
216  TObjArray* fV0CutVarsArray;
217 
218 
221 };
223 #endif
224 
TTree * fMCVariablesTree
! tree of the candidate variables after track selection on output slot 7
void FillProtonROOTObjects(AliAODTrack *trk, TClonesArray *mcArray)
Int_t MatchToMC(AliAODRecoCascadeHF *elobj, TClonesArray *mcArray, Int_t *pdgarray_pr, Int_t *pdgarray_v0, Int_t *labelarray_pr, Int_t *labelarray_v0, Int_t &ngen_pr, Int_t &ngen_v0)
TH2F * fHistoBachPtMCGen
! Bachelor pT histogram (efficiency denominator)
TObjArray * fProtonTracks
unique event id for mixed event check
void SelectTrack(const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks, Int_t *seleFlags, TClonesArray *mcArray)
AliAODVertex * PrimaryVertex(const TObjArray *trkArray, AliVEvent *event)
TH1F * fHistoProbProton
! Probability to be proton histogram
TH1F * fHReactionPlane
! Histogram to check Reaction plane
Float_t * fCandidateProtonVariables
! variables to be written to the tree
void SetPoolPVzBinLimits(Int_t Nzvtxbins, const Double_t *ZvtxBins)
TTree * fVariablesTree
flag to decide whether to write the candidate variables on a tree variables
void SetPoolRPBinLimits(Int_t Nrpbins, const Double_t *rpbins)
void FillROOTObjects(AliAODRecoCascadeHF *lcobj, AliAODv0 *v0, AliAODTrack *trk, AliAODEvent *aod, TClonesArray *mcarray)
TH2F * fHistoKaonPtMCGen
! Kaon pT histogram (efficiency denominator)
TH2F * fHistoKaonPtMCS
! Kaon pT histogram (efficiency numerator)
Float_t * fCandidateV0Variables
! variables to be written to the tree
AliAnalysisTaskSELc2pK0sfromAODtracks & operator=(const AliAnalysisTaskSELc2pK0sfromAODtracks &source)
TH1F * fHCentrality
! Histogram to check Centrality
TTree * fMCProtonVariablesTree
! tree of the candidate variables after track selection on output slot 9
TTree * fMCV0VariablesTree
! tree of the candidate variables after track selection on output slot 10
TTree * fProtonVariablesTree
! tree of the candidate variables after track selection on output slot 5
virtual void UserCreateOutputObjects()
Implementation of interface methods.
void MakeAnalysis(AliAODEvent *aod, TClonesArray *mcArray)
TH2F * fHistoBachPtMCS
! Bachelor pT histogram (efficiency numerator)
TObjArray * fV0CutVarsArray
array of RDHF cut information
void FillMCV0ROOTObjects(AliAODMCParticle *mcv0part, TClonesArray *mcArray)
Bool_t fWriteMCVariableTree
flag to decide whether to write the candidate variables on a tree variables
Bool_t fWriteEachVariableTree
flag to decide whether to write the candidate variables on a tree variables
Int_t GetPoolIndex(Double_t zvert, Double_t mult, Double_t rp)
void SelectV0(const AliVEvent *event, Int_t nV0, Int_t &nSeleV0, Bool_t *seleV0Flags, TClonesArray *mcArray)
TTree * fV0VariablesTree
! tree of the candidate variables after track selection on output slot 6
Int_t fNzVtxBins
maximum number of events to be used in event mixing
void FillV0ROOTObjects(AliAODv0 *v0, TClonesArray *mcArray)
Float_t * fCandidateMCVariables
! variables to be written to the tree
void FillMixROOTObjects(TLorentzVector *pt, TLorentzVector *ev, TVector *tinfo, TVector *vinfo)
void FillMCROOTObjects(AliAODMCParticle *part, AliAODMCParticle *mcepart, AliAODMCParticle *mcv0part, Int_t decaytype)
Bool_t fIsMB
Reconstruct primary vertex excluding candidate tracks.
TList * fOutputAll
! User Output slot 3 //analysis histograms
Float_t * fCandidateMCV0Variables
! variables to be written to the tree
TH1F * fCEvents
! Histogram to check selected events
Float_t * fCandidateMCProtonVariables
! variables to be written to the tree
AliAODRecoCascadeHF * MakeCascadeHF(AliAODv0 *casc, AliAODTrack *trk, AliAODEvent *aod, AliAODVertex *vert)
void FillMCProtonROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray)
Double_t fCentBins[100]
number of centrality bins
AliNormalizationCounter * fCounter
EvNumber counter.
AliAODVertex * CallPrimaryVertex(AliAODv0 *v0, AliAODTrack *trk, AliAODEvent *evt)
TObjArray * fV0Tracks
array of electron-compatible tracks
void SetPoolCentBinLimits(Int_t Ncentbins, const Double_t *CentBins)
AliAODVertex * ReconstructSecondaryVertex(AliAODv0 *casc, AliAODTrack *trk, AliAODEvent *aod)
TH1F * fHistoV0CosPA
! V0 cosine pointing angle to primary vertex
TObjArray * fProtonCutVarsArray
array of lambda-compatible tracks