AliPhysics  v5-06-40-01 (42bb456)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnalysisTaskSELc2eleLambdafromAODtracks.h
Go to the documentation of this file.
1 #ifndef ALIANALYSISTASKSELC2ELELAMBDAFROMAODTRACKS_H
2 #define ALIANALYSISTASKSELC2ELELAMBDAFROMAODTRACKS_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 "TSystem.h"
23 
24 #include "AliAnalysisTaskSE.h"
25 #include "AliAODEvent.h"
26 #include "AliPID.h"
28 
30 
31 class THnSparse;
32 class TH1F;
33 class TClonesArray;
35 class AliESDVertex;
36 class AliAODMCParticle;
37 class AliEventPoolManager;
39 
40 class AliAnalysisTaskSELc2eleLambdafromAODtracks : public AliAnalysisTaskSE
41 {
42  public:
44  AliAnalysisTaskSELc2eleLambdafromAODtracks(const Char_t* name, AliRDHFCutsLctoeleLambdafromAODtracks* cuts, Bool_t writeVariableTree=kTRUE);
46 
48  virtual void UserCreateOutputObjects();
49  virtual void Init();
50  virtual void LocalInit() {Init();}
51  virtual void UserExec(Option_t *option);
52  virtual void Terminate(Option_t *option);
53 
54  void FillROOTObjects(AliAODRecoCascadeHF *elobj, AliAODv0 *v0, AliAODTrack *trk, TClonesArray *mcArray, Bool_t mixing);
55  void FillElectronROOTObjects(AliAODTrack *trk, TClonesArray *mcArray);
56  void FillV0ROOTObjects(AliAODv0 *v0, TClonesArray *mcArray);
57  void FillMCROOTObjects(AliAODMCParticle *part, AliAODMCParticle *mcepart, AliAODMCParticle *mcv0part, Int_t decaytype);
58  void FillMCEleROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray);
59  void FillMCV0ROOTObjects(AliAODMCParticle *mcv0part, TClonesArray *mcArray);
60  void MakeMCAnalysis(TClonesArray *mcArray);
61  void MakeAnalysis(AliAODEvent *aod, TClonesArray *mcArray);
62 
63  void SelectV0( const AliVEvent *event,Int_t nV0,Int_t &nSeleV0, Bool_t *seleV0Flags, TClonesArray *mcArray);
64  void SelectTrack( const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks,Bool_t *seleFlags, TClonesArray *mcArray);
65 
67  void SetMC(Bool_t theMCon) {fUseMCInfo = theMCon;}
68  Bool_t GetMC() const {return fUseMCInfo;}
69  void SetUseCentralityV0M(Bool_t centon) {fUseCentralityV0M = centon;}
70  Bool_t GetUseCentralityV0M() const {return fUseCentralityV0M;}
75 
77 
78  AliAODRecoCascadeHF* MakeCascadeHF(AliAODv0 *casc, AliAODTrack *trk, AliAODEvent *aod, AliAODVertex *vert, Bool_t mixing);
79  AliAODVertex* ReconstructSecondaryVertex(AliAODv0 *casc, AliAODTrack *trk, AliAODEvent *aod);
80  Int_t MatchToMC(AliAODRecoCascadeHF *elobj, TClonesArray *mcArray, Int_t *pdgele_array, Int_t *pdgv0_array, Int_t *labelele_array, Int_t *labelv0_array, Int_t &ngen_ele, Int_t &ngen_v0);
81 
82 
87  void SetPoolPVzBinLimits(Int_t Nzvtxbins,const Double_t *ZvtxBins){
88  fNzVtxBins = Nzvtxbins;
89  for(int ix = 0;ix<fNzVtxBins+1;ix++){fZvtxBins[ix] = ZvtxBins[ix];}
90  }
91  void SetPoolCentBinLimits(Int_t Ncentbins,const Double_t *CentBins){
92  fNCentBins = Ncentbins;
93  for(int ix = 0;ix<fNCentBins+1;ix++){fCentBins[ix] = CentBins[ix];}
94  }
95  void DoEventMixingWithPools(Int_t index,AliAODEvent *aodEvent, Bool_t *seleFlags);
96  void ResetPool(Int_t poolIndex);
97  Int_t GetPoolIndex(Double_t zvert, Double_t mult);
98 
99 
100  private:
101 
104 
105  void DefineTreeVariables();
106  void DefineEleTreeVariables();
107  void DefineV0TreeVariables();
108  void DefineMCTreeVariables();
113 
114  AliAODVertex *CallPrimaryVertex(AliAODv0 *v0, AliAODTrack *trk, AliAODEvent *evt);
115  AliAODVertex* PrimaryVertex(const TObjArray *trkArray,AliVEvent *event);
116 
117  Bool_t fUseMCInfo;
118  TList *fOutput;
119  TList *fOutputAll;
120  TList *fListCuts;
121  TH1F *fCEvents;
122  TH1F *fHTrigger;
123  TH1F *fHCentrality;
124  AliRDHFCutsLctoeleLambdafromAODtracks *fAnalCuts;// Cuts - sent to output slot 2
129  TTree *fVariablesTree;
136  Bool_t fIsMB;
137  Bool_t fIsSemi;
138  Bool_t fIsCent;
139  Bool_t fIsINT7;
140  Bool_t fIsEMC7;
147  AliAODVertex *fVtx1;
148  AliESDVertex *fV1;
149  Float_t fVtxZ;
150  Double_t fBzkG;
151  Float_t fCentrality;
152  Int_t fRunNumber;
153  Float_t fTriggerCheck;
156 
157  //--------------------- My histograms ------------------
158  THnSparse* fHistoEleLambdaMass;
171 
172  //Efficiency calculation
179 
180  THnSparse* fHistoElePtvsEtaRS;
181  THnSparse* fHistoElePtvsEtaWS;
184  THnSparse* fHistoElePtvsEtaMCS;
186 
196 
197  THnSparse* fHistoElePtvsd0RS;
198  THnSparse* fHistoElePtvsd0WS;
199  THnSparse* fHistoElePtvsd0RSMix;
200  THnSparse* fHistoElePtvsd0WSMix;
201  THnSparse* fHistoElePtvsd0MCS;
204 
205  //Feeddown from Xic0
216 
217  //Feeddown from XicPlus
228 
229  //Checking histograms
230  TH1F* fHistoBachPt;
233  TH1F* fHistod0Bach;
246  THnSparse* fHistoElePtvsCutVarsRS[17];
247  THnSparse* fHistoElePtvsCutVarsWS[17];
248  THnSparse* fHistoElePtvsCutVarsMCS[17];
251  THnSparse* fHistoLcMCGen;
257  THnSparse* fHistoElectronMCGen;
258  THnSparse* fHistoLambdaMCGen;
259 
264 
265  //Mixing
268  Int_t fNzVtxBins;
269  Double_t fZvtxBins[100]; // [fNzVtxBinsDim]
270  Int_t fNCentBins;
271  Double_t fCentBins[100]; // [fNCentBinsDim]
272  Int_t fNOfPools;
273  TTree** fEventBuffer;
274  TObjString *fEventInfo; //unique event id for mixed event check
275  TObjArray* fElectronTracks; // array of electron-compatible tracks
276 
279 };
281 #endif
282 
THnSparse * fHistoEleLambdaMassMCGen
! EFficiency calculation denominator
THnSparse * fHistoEleLambdaMassvsElePtRSMix
! e-Lambda mass vs elept spectra right sign (mixed event)
TH2F * fHistoElectronTOFSelPID
! TOF electron PID after selection
TH2F * fHistoElePtRSMix
! e spectra right sign (mixed event)
Bool_t fIsMB
Reconstruct primary vertex excluding candidate tracks.
virtual void UserCreateOutputObjects()
Implementation of interface methods.
THnSparse * fHistoElePtvsLambdaPtRSMix
! e-Xi spectra (right-sign, mix)
THnSparse * fHistoElePtvsLambdaPtMCGen
! e-Xi spectra efficiency denominator
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS
! EFficiency calculation numerator
TTree * fVariablesTree
flag to decide whether to write the candidate variables on a tree variables
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen
! EFficiency calculation numerator
TH2F * fHistoElectronTPCPIDSelTOFSmallEta
! TPC electron PID after TOF 3 sigma cut (|eta|<0.6)
THnSparse * fHistoEleLambdaMassRSMix
! e-Lambda mass spectra right sign (mixed event)
Int_t fNzVtxBins
maximum number of events to be used in event mixing
TTree * fMCVariablesTree
! tree of the candidate variables after track selection on output slot 4
Float_t * fCandidateMCEleVariables
! variables to be written to the tree
void FillMCROOTObjects(AliAODMCParticle *part, AliAODMCParticle *mcepart, AliAODMCParticle *mcv0part, Int_t decaytype)
void FillMCV0ROOTObjects(AliAODMCParticle *mcv0part, TClonesArray *mcArray)
void DoEventMixingWithPools(Int_t index, AliAODEvent *aodEvent, Bool_t *seleFlags)
THnSparse * fHistoElePtvsd0RSMix
! e pt-d0 spectra (right-sign, mix)
TList * fOutputAll
! User Output slot 3 //analysis histograms
THnSparse * fHistoEleLambdaMassvsElePtRS
! e-Lambda mass vs elept spectra right sign
TH2F * fHistoElePtFeeddownXicPlusMCS
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaMassFeeddownXic0MCGen
! EFficiency calculation numerator
AliAODVertex * PrimaryVertex(const TObjArray *trkArray, AliVEvent *event)
THnSparse * fHistoElePtvsLambdaPtFeeddownXic0MCS
! e-Xi spectra efficiency numerator
THnSparse * fHistoEleLambdaMassMCS
! EFficiency calculation numerator
TH2F * fHistoElePtMCGen
! EFficiency calculation denominator
TH2F * fHistoElePtWSMix
! e spectra wrong sign (mixed event)
void FillMCEleROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray)
THnSparse * fHistoElePtvsd0PromptMCS
! e pt-d0 spectra (right-sign)
THnSparse * fHistoEleLambdaMassFeeddownXicPlusMCS
! EFficiency calculation numerator
AliAnalysisTaskSELc2eleLambdafromAODtracks & operator=(const AliAnalysisTaskSELc2eleLambdafromAODtracks &source)
Float_t * fCandidateMCVariables
! variables to be written to the tree
THnSparse * fHistoElePtvsLambdaPtFeeddownXic0MCGen
! e-Xi spectra efficiency numerator
THnSparse * fHistoElePtvsCutVarsWS[17]
! e pt- cut variables (Wrong-sign)
THnSparse * fHistoElePtvsLambdaPtMCS
! e-Xi spectra efficiency numerator
THnSparse * fHistoEleLambdaMassFeeddownXic0MCS
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaMassWS
! e-Lambda mass spectra wrong sign
Bool_t fWriteMCVariableTree
flag to decide whether to write the candidate variables on a tree variables
THnSparse * fHistoElePtvsEtaMCGen
! e spectra efficiency denominator
THnSparse * fHistoElectronMCGen
! electron in mcArray (only from charmed baryon)
THnSparse * fHistoElePtvsd0BFeeddownMCS
! e pt-d0 spectra (right-sign)
void SelectTrack(const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks, Bool_t *seleFlags, TClonesArray *mcArray)
Bool_t fWriteEachVariableTree
flag to decide whether to write the candidate variables on a tree variables
Float_t * fCandidateMCV0Variables
! variables to be written to the tree
void FillElectronROOTObjects(AliAODTrack *trk, TClonesArray *mcArray)
TH2F * fHistoElectronTPCPIDSelTOFLargeEta
! TPC electron PID after TOF 3 sigma cut (0.8>|eta|>0.6)
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXic0MCGen
! EFficiency calculation numerator
TH2F * fHistoElePtFeeddownXicPlusMCGen
! EFficiency calculation numerator
AliAODRecoCascadeHF * MakeCascadeHF(AliAODv0 *casc, AliAODTrack *trk, AliAODEvent *aod, AliAODVertex *vert, Bool_t mixing)
TH2F * fHistoElePtFeeddownXic0MCGen
! EFficiency calculation numerator
THnSparse * fHistoElePtvsCutVarsRS[17]
! e pt- cut variables (Right-sign)
THnSparse * fHistoElePtvsLambdaPtWSMix
! e-Xi spectra (wrong-sign, mix)
THnSparse * fHistoEleLambdaMassvsElePtMCS
! EFficiency calculation numerator
TH2F * fHistoElePtFeeddownXic0MCS
! EFficiency calculation numerator
THnSparse * fHistoElePtvsd0WSMix
! e pt-d0 spectra (wrong-sign, mix)
TTree * fMCV0VariablesTree
! tree of the candidate variables after track selection on output slot 4
TH2F * fHistoElectronTPCPIDSelTOF
! TPC electron PID after TOF 3 sigma cut
THnSparse * fHistoEleLambdaMassFeeddownXicPlusMCGen
! EFficiency calculation numerator
THnSparse * fHistoLambdaMCGen
! Lambda in mcArray (only from charmed baryon)
Int_t MatchToMC(AliAODRecoCascadeHF *elobj, TClonesArray *mcArray, Int_t *pdgele_array, Int_t *pdgv0_array, Int_t *labelele_array, Int_t *labelv0_array, Int_t &ngen_ele, Int_t &ngen_v0)
THnSparse * fHistoEleLambdaMassvsElePtWSMix
! e-Lambda mass vs elept spectra wrong sign (mixed event)
THnSparse * fHistoElePtvsEtaFeeddownXicPlusMCGen
! e spectra efficiency numerator
THnSparse * fHistoElePtvsEtaFeeddownXic0MCGen
! e spectra efficiency numerator
TTree * fMCEleVariablesTree
! tree of the candidate variables after track selection on output slot 4
TTree * fV0VariablesTree
! tree of the candidate variables after track selection on output slot 4
THnSparse * fHistoElePtvsLambdaPtvsLcPtMCGen
! e-Xi spectra efficiency denominator
void SelectV0(const AliVEvent *event, Int_t nV0, Int_t &nSeleV0, Bool_t *seleV0Flags, TClonesArray *mcArray)
void SetPoolCentBinLimits(Int_t Ncentbins, const Double_t *CentBins)
THnSparse * fHistoEleLambdaMassWSMix
! e-Lambda mass spectra wrong sign (mixed event)
THnSparse * fHistoElePtvsEtaFeeddownXic0MCS
! e spectra efficiency numerator
Float_t * fCandidateEleVariables
! variables to be written to the tree
AliNormalizationCounter * fCounter
! Counter for normalization
void SetPoolPVzBinLimits(Int_t Nzvtxbins, const Double_t *ZvtxBins)
THnSparse * fHistoElePtvsLambdaPtMCLcGen
! e-Xi spectra efficiency denominator
THnSparse * fHistoElePtvsEtaFeeddownXicPlusMCS
! e spectra efficiency numerator
THnSparse * fHistoElePtvsLambdaPtFeeddownXicPlusMCS
! e-Xi spectra efficiency numerator
THnSparse * fHistoElePtvsLambdaPtFeeddownXicPlusMCGen
! e-Xi spectra efficiency numerator
AliAODVertex * CallPrimaryVertex(AliAODv0 *v0, AliAODTrack *trk, AliAODEvent *evt)
THnSparse * fHistoElePtvsEtaMCS
! e spectra efficiency numerator
TH1F * fHistoBachPtMCGen
! Bachelor pT histogram (efficiency denominator)
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXic0MCS
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaMassRS
! e-Lambda mass spectra right sign
THnSparse * fHistoEleLambdaMassvsElePtMCGen
! EFficiency calculation denominator
THnSparse * fHistoElePtvsCutVarsMCS[17]
! e pt- cut variables (MCS)
void FillROOTObjects(AliAODRecoCascadeHF *elobj, AliAODv0 *v0, AliAODTrack *trk, TClonesArray *mcArray, Bool_t mixing)
TH1F * fHistoBachPtMCS
! Bachelor pT histogram (efficiency numerator)
AliAODVertex * ReconstructSecondaryVertex(AliAODv0 *casc, AliAODTrack *trk, AliAODEvent *aod)
TH2F * fHistoElectronTPCSelPID
! TPC electron PID after selection
THnSparse * fHistoEleLambdaMassvsElePtWS
! e-Lambda mass vs elept spectra wrong sign
Float_t * fCandidateV0Variables
! variables to be written to the tree
TTree * fEleVariablesTree
! tree of the candidate variables after track selection on output slot 4
TH2F * fHistoElectronTPCPIDSelTOFEtaDep[8]
! TPC electron PID after TOF 3 sigma cut (0.8>|eta|>0.6)
THnSparse * fHistoElePtvsLambdaPtvsLcPtMCS
! e-Xi spectra efficiency numerator