AliPhysics  v5-06-40-01 (42bb456)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnalysisTaskSEXic2eleXifromAODtracks.h
Go to the documentation of this file.
1 #ifndef ALIANALYSISTASKSEXIC2ELEXIFROMAODTRACKS_H
2 #define ALIANALYSISTASKSEXIC2ELEXIFROMAODTRACKS_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 AliAnalysisTaskSEXic2eleXifromAODtracks : public AliAnalysisTaskSE
41 {
42  public:
44  AliAnalysisTaskSEXic2eleXifromAODtracks(const Char_t* name, AliRDHFCutsXictoeleXifromAODtracks* 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, AliAODcascade *casc, AliAODTrack *trk, TClonesArray *mcArray, Bool_t mixing);
55  void FillElectronROOTObjects(AliAODTrack *trk, TClonesArray *mcArray);
56  void FillCascROOTObjects(AliAODcascade *casc, TClonesArray *mcArray);
57  void FillMCROOTObjects(AliAODMCParticle *part, AliAODMCParticle *mcepart, AliAODMCParticle *mcv0part, Int_t decaytype);
58  void FillMCEleROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray);
59  void FillMCCascROOTObjects(AliAODMCParticle *mccpart, TClonesArray *mcArray);
60  void MakeMCAnalysis(TClonesArray *mcArray);
61  void MakeAnalysis(AliAODEvent *aod, TClonesArray *mcArray);
62 
63  void SelectCascade( const AliVEvent *event,Int_t nCasc,Int_t &nSeleCasc, Bool_t *seleCascFlags, 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(AliAODcascade *casc, AliAODTrack *trk, AliAODEvent *aod, AliAODVertex *vert, Bool_t mixing);
79  AliAODVertex* ReconstructSecondaryVertex(AliAODcascade *casc, AliAODTrack *trk, AliAODEvent *aod);
80  Int_t MatchToMC(AliAODRecoCascadeHF *elobj, TClonesArray *mcArray, Int_t *pdgarray_ele, Int_t *pdgarray_casc, Int_t *labelarray_ele, Int_t *labelarray_casc, Int_t &ngen_ele, Int_t &ngen_casc);
81  Int_t MatchToMCCascade(AliAODcascade *theCascade, Int_t pdgabscasc, Int_t *pdgDgcasc, Int_t *pdgDgv0, TClonesArray *mcArray) const;
82 
83 
88  void SetPoolPVzBinLimits(Int_t Nzvtxbins,const Double_t *ZvtxBins){
89  fNzVtxBins = Nzvtxbins;
90  for(int ix = 0;ix<fNzVtxBins+1;ix++){fZvtxBins[ix] = ZvtxBins[ix];}
91  }
92  void SetPoolCentBinLimits(Int_t Ncentbins,const Double_t *CentBins){
93  fNCentBins = Ncentbins;
94  for(int ix = 0;ix<fNCentBins+1;ix++){fCentBins[ix] = CentBins[ix];}
95  }
96  void DoEventMixingWithPools(Int_t index,AliAODEvent *aodEvent, Bool_t *seleFlags);
97  void ResetPool(Int_t poolIndex);
98  Int_t GetPoolIndex(Double_t zvert, Double_t mult);
99 
100 
101  private:
102 
105 
106  void DefineTreeVariables();
107  void DefineEleTreeVariables();
109  void DefineMCTreeVariables();
114 
115  AliAODVertex *CallPrimaryVertex(AliAODcascade *casc, AliAODTrack *trk, AliAODEvent *evt);
116  AliAODVertex* PrimaryVertex(const TObjArray *trkArray,AliVEvent *event);
117 
118  Bool_t fUseMCInfo;
119  TList *fOutput;
120  TList *fOutputAll;
121  TList *fListCuts;
122  TH1F *fCEvents;
123  TH1F *fHTrigger;
124  TH1F *fHCentrality;
125  AliRDHFCutsXictoeleXifromAODtracks *fAnalCuts;// Cuts - sent to output slot 2
128  TTree *fVariablesTree;
137  Bool_t fIsMB;
138  Bool_t fIsSemi;
139  Bool_t fIsCent;
140  Bool_t fIsINT7;
141  Bool_t fIsEMC7;
148  AliAODVertex *fVtx1;
149  AliESDVertex *fV1;
150  Float_t fVtxZ;
151  Double_t fBzkG;
152  Float_t fCentrality;
153  Int_t fRunNumber;
154  Float_t fTriggerCheck;
157 
158  //--------------------- My histograms ------------------
159  THnSparse* fHistoEleXiMass;
160  THnSparse* fHistoEleXiMassRS;
161  THnSparse* fHistoEleXiMassWS;
162  THnSparse* fHistoEleXiMassRSMix;
163  THnSparse* fHistoEleXiMassWSMix;
172  THnSparse* fHistoEleXiMassMCS;
173  THnSparse* fHistoEleXiMassMCGen;
178 
179  THnSparse* fHistoElePtvsEtaRS;
180  THnSparse* fHistoElePtvsEtaWS;
183  THnSparse* fHistoElePtvsEtaMCS;
185 
186  THnSparse* fHistoElePtvsXiPtRS;
187  THnSparse* fHistoElePtvsXiPtWS;
190  THnSparse* fHistoElePtvsXiPtMCS;
195 
196  THnSparse* fHistoElePtvsd0RS;
197  THnSparse* fHistoElePtvsd0WS;
198  THnSparse* fHistoElePtvsd0RSMix;
199  THnSparse* fHistoElePtvsd0WSMix;
200  THnSparse* fHistoElePtvsd0MCS;
203 
204  TH1F* fHistoBachPt;
207  TH1F* fHistod0Bach;
220  THnSparse* fHistoElePtvsCutVarsRS[23];
221  THnSparse* fHistoElePtvsCutVarsWS[23];
222  THnSparse* fHistoElePtvsCutVarsMCS[23];
225  THnSparse* fHistoXicMCGen;
227  THnSparse* fHistoElectronMCGen;
228  THnSparse* fHistoXiMCGen;
229 
234 
235  //Mixing
238  Int_t fNzVtxBins;
239  Double_t fZvtxBins[100]; // [fNzVtxBinsDim]
240  Int_t fNCentBins;
241  Double_t fCentBins[100]; // [fNCentBinsDim]
242  Int_t fNOfPools;
243  TTree** fEventBuffer;
244  TObjString *fEventInfo;
245  TObjArray* fElectronTracks;
246 
249 };
251 #endif
252 
THnSparse * fHistoElePtvsXiPtMCGen
! e-Xi spectra efficiency denominator
TH1F * fHistoBachPtMCGen
! Bachelor pT histogram (efficiency denominator)
THnSparse * fHistoElePtvsd0RS
! e pt-d0 spectra (right-sign)
TH2F * fHistoElectronTPCPIDSelTOFEtaDep[8]
! TPC electron PID after TOF 3 sigma cut Eta dep
Bool_t fWriteMCVariableTree
flag to decide whether to write the candidate variables on a tree variables
Int_t MatchToMCCascade(AliAODcascade *theCascade, Int_t pdgabscasc, Int_t *pdgDgcasc, Int_t *pdgDgv0, TClonesArray *mcArray) const
Float_t * fCandidateCascVariables
! variables to be written to the tree
AliAnalysisTaskSEXic2eleXifromAODtracks & operator=(const AliAnalysisTaskSEXic2eleXifromAODtracks &source)
THnSparse * fHistoElePtvsXiPtRSMix
! e-Xi spectra (right-sign, mix)
Float_t * fCandidateMCVariables
! variables to be written to the tree
void SelectTrack(const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks, Bool_t *seleFlags, TClonesArray *mcArray)
THnSparse * fHistoElePtvsCutVarsRS[23]
! e pt- cut variables (Right-sign)
void FillMCEleROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray)
TList * fOutputAll
! User Output slot 3 //analysis histograms
THnSparse * fHistoElePtvsd0MCS
! e pt-d0 spectra (right-sign)
THnSparse * fHistoElePtvsd0PromptMCS
! e pt-d0 spectra (right-sign)
THnSparse * fHistoElePtvsXiPtvsXicPtMCS
! e-Xi spectra efficiency numerator
TTree * fMCCascVariablesTree
! tree of the candidate variables after track selection on output slot 4
THnSparse * fHistoEleXiMassvsElePtMCGen
! e-Xi mass-ept spectra (Efficiency denominator)
THnSparse * fHistoElectronMCGen
! electron in mcArray (only from charmed baryon)
THnSparse * fHistoEleXiMassvsElePtRS
! e-Xi mass spectra (right-sign)
void FillElectronROOTObjects(AliAODTrack *trk, TClonesArray *mcArray)
THnSparse * fHistoEleXiMassRS
! e-Xi mass spectra (right-sign)
THnSparse * fHistoElePtvsEtaWSMix
! e spectra (wrong-sign, mix)
Int_t MatchToMC(AliAODRecoCascadeHF *elobj, TClonesArray *mcArray, Int_t *pdgarray_ele, Int_t *pdgarray_casc, Int_t *labelarray_ele, Int_t *labelarray_casc, Int_t &ngen_ele, Int_t &ngen_casc)
THnSparse * fHistoElePtvsXiPtWSMix
! e-Xi spectra (wrong-sign, mix)
TTree * fCascVariablesTree
! tree of the candidate variables after track selection on output slot 4
virtual void UserCreateOutputObjects()
Implementation of interface methods.
THnSparse * fHistoElePtvsd0WS
! e pt-d0 spectra (wrong-sign)
Float_t * fCandidateEleVariables
! variables to be written to the tree
TTree * fMCEleVariablesTree
! tree of the candidate variables after track selection on output slot 4
void FillMCROOTObjects(AliAODMCParticle *part, AliAODMCParticle *mcepart, AliAODMCParticle *mcv0part, Int_t decaytype)
THnSparse * fHistoElePtvsEtaMCGen
! e spectra efficiency denominator
THnSparse * fHistoEleXiMassMCGen
! e-Xi mass spectra (Efficiency denominator)
THnSparse * fHistoElePtvsEtaMCS
! e spectra efficiency numerator
TTree * fMCVariablesTree
! tree of the candidate variables after track selection on output slot 4
THnSparse * fHistoElePtvsXiPtMCS
! e-Xi spectra efficiency numerator
THnSparse * fHistoEleXiMassWS
! e-Xi mass spectra (wrong-sign)
THnSparse * fHistoElePtvsCutVarsWS[23]
! e pt- cut variables (Wrong-sign)
TH1F * fHistoBachPtMCS
! Bachelor pT histogram (efficiency numerator)
void MakeAnalysis(AliAODEvent *aod, TClonesArray *mcArray)
void SetPoolCentBinLimits(Int_t Ncentbins, const Double_t *CentBins)
AliAODVertex * PrimaryVertex(const TObjArray *trkArray, AliVEvent *event)
THnSparse * fHistoEleXiMassvsElePtMCS
! e-Xi mass-ept spectra (Efficiency numerator)
void FillMCCascROOTObjects(AliAODMCParticle *mccpart, TClonesArray *mcArray)
THnSparse * fHistoElePtvsCutVarsMCS[23]
! e pt- cut variables (MCS)
THnSparse * fHistoXiMCGen
! Xi in mcArray (only from charmed baryon)
THnSparse * fHistoElePtvsXiPtRS
! e-Xi spectra (right-sign)
TH2F * fHistoElePtMCS
! e spectra (Efficiency numerator)
TH2F * fHistoElectronTOFSelPID
! TOF electron PID after selection
Float_t * fCandidateMCCascVariables
! variables to be written to the tree
Float_t * fCandidateMCEleVariables
! variables to be written to the tree
THnSparse * fHistoEleXiMassMCS
! e-Xi mass spectra (Efficiency numerator)
TTree * fEleVariablesTree
flag to decide whether to write the candidate variables on a tree variables
TObjArray * fElectronTracks
unique event id for mixed event check
TH1F * fCEvents
! Histogram to check selected events
TH2F * fHistoElectronTPCPIDSelTOFSmallEta
! TPC electron PID after TOF 3 sigma cut (|eta|<0.6)
THnSparse * fHistoElePtvsd0WSMix
! e pt-d0 spectra (wrong-sign, mix)
TH2F * fHistoElectronTPCPIDSelTOF
! TPC electron PID after TOF 3 sigma cut
void SetPoolPVzBinLimits(Int_t Nzvtxbins, const Double_t *ZvtxBins)
AliAODRecoCascadeHF * MakeCascadeHF(AliAODcascade *casc, AliAODTrack *trk, AliAODEvent *aod, AliAODVertex *vert, Bool_t mixing)
AliNormalizationCounter * fCounter
! Counter for normalization
Int_t fNzVtxBins
maximum number of events to be used in event mixing
TH2F * fHistoElePtMCGen
! e spectra (Efficiency denominator)
THnSparse * fHistoElePtvsd0RSMix
! e pt-d0 spectra (right-sign, mix)
void FillCascROOTObjects(AliAODcascade *casc, TClonesArray *mcArray)
THnSparse * fHistoElePtvsXiPtWS
! e-Xi spectra (wrong-sign)
AliAODVertex * ReconstructSecondaryVertex(AliAODcascade *casc, AliAODTrack *trk, AliAODEvent *aod)
AliAODVertex * CallPrimaryVertex(AliAODcascade *casc, AliAODTrack *trk, AliAODEvent *evt)
TH2F * fHistoElectronTPCPIDSelTOFLargeEta
! TPC electron PID after TOF 3 sigma cut (0.8>|eta|>0.6)
THnSparse * fHistoEleXiMassvsElePtWSMix
! e-Xi mass-ept spectra (wrong-sign)
Bool_t fIsMB
Reconstruct primary vertex excluding candidate tracks.
THnSparse * fHistoElePtvsEtaRSMix
! e spectra (right-sign, mix)
THnSparse * fHistoEleXiMassvsElePtRSMix
! e-Xi mass-ept spectra (right-sign)
THnSparse * fHistoElePtvsd0BFeeddownMCS
! e pt-d0 spectra (right-sign)
void SelectCascade(const AliVEvent *event, Int_t nCasc, Int_t &nSeleCasc, Bool_t *seleCascFlags, TClonesArray *mcArray)
void DoEventMixingWithPools(Int_t index, AliAODEvent *aodEvent, Bool_t *seleFlags)
TH2F * fHistoElectronTPCSelPID
! TPC electron PID after selection
THnSparse * fHistoEleXiMassRSMix
! e-Xi mass spectra (right-sign)
THnSparse * fHistoEleXiMassvsElePtWS
! e-Xi mass spectra (wrong-sign)
THnSparse * fHistoEleXiMassWSMix
! e-Xi mass spectra (wrong-sign)
THnSparse * fHistoElePtvsXiPtMCXicGen
! e-Xi spectra efficiency denominator
void FillROOTObjects(AliAODRecoCascadeHF *elobj, AliAODcascade *casc, AliAODTrack *trk, TClonesArray *mcArray, Bool_t mixing)
THnSparse * fHistoElePtvsXiPtvsXicPtMCGen
! e-Xi spectra efficiency numerator
TTree * fVariablesTree
flag to decide whether to write the candidate variables on a tree variables