]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/vertexingHF/AliAnalysisTaskSELc2V0bachelorTMVA.h
Additional odifications to compile without ZeroMQ
[u/mrichter/AliRoot.git] / PWGHF / vertexingHF / AliAnalysisTaskSELc2V0bachelorTMVA.h
CommitLineData
0abe5247 1#ifndef ALIANALYSISTASKSELC2V0BACHELORTMVA_H
2#define ALIANALYSISTASKSELC2V0BACHELORTMVA_H
3/**************************************************************************
4 * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
5 * *
6 * Author: The ALICE Off-line Project. *
7 * Contributors are mentioned in the code where appropriate. *
8 * *
9 * Permission to use, copy, modify and distribute this software and its *
10 * documentation strictly for non-commercial purposes is hereby granted *
11 * without fee, provided that the above copyright notice appears in all *
12 * copies and that both the copyright notice and this permission notice *
13 * appear in the supporting documentation. The authors make no claims *
14 * about the suitability of this software for any purpose. It is *
15 * provided "as is" without express or implied warranty. *
16 **************************************************************************/
17
18/* $Id: AliAnalysisTaskSELc2V0bachelorTMVA.h 61835 2013-04-05 23:07:23Z fprino $ */
19
20#include "TROOT.h"
21#include "TSystem.h"
22
23#include "AliAnalysisTaskSE.h"
24#include "AliAODEvent.h"
25#include "AliAODMCHeader.h"
26#include "AliPID.h"
27#include "AliAODTrack.h"
28#include "AliAODVertex.h"
29#include "AliAODRecoDecay.h"
30#include "AliPIDResponse.h"
31#include "AliPIDCombined.h"
32#include "AliTPCPIDResponse.h"
33#include "AliRDHFCutsLctoV0.h"
34#include "AliNormalizationCounter.h"
35#include "AliVertexingHFUtils.h"
36#include "AliAODRecoCascadeHF.h"
37
38class TH1F;
39class TH1D;
40
41class AliAnalysisTaskSELc2V0bachelorTMVA : public AliAnalysisTaskSE
42{
43
44 public:
45
46 enum EBachelor {
47 kBachInvalid = -1,
48 kBachFake = 0,
49 kBachNoProton = 1,
50 kBachPrimary = 2,
51 kBachNoLambdaMother = 3,
52 kBachDifferentLambdaMother = 4,
53 kBachCorrectLambdaMother = 5 };
54
55 enum EK0S {
56 kK0SInvalid = -1,
57 kK0SFake = 0,
58 kK0SNoK0S = 1,
59 kK0SWithoutMother = 2,
60 kK0SNotFromK0 = 3,
61 kK0Primary = 4,
62 kK0NoLambdaMother = 5,
63 kK0DifferentLambdaMother = 6,
64 kK0CorrectLambdaMother = 7 };
65
66 AliAnalysisTaskSELc2V0bachelorTMVA();
67 AliAnalysisTaskSELc2V0bachelorTMVA(const Char_t* name, AliRDHFCutsLctoV0* cutsA,
68 Bool_t useOnTheFly=kFALSE);
69 virtual ~AliAnalysisTaskSELc2V0bachelorTMVA();
70
71 // Implementation of interface methods
72 virtual void UserCreateOutputObjects();
73 virtual void Init();
74 virtual void LocalInit() {Init();}
75 virtual void UserExec(Option_t *option);
76 virtual void Terminate(Option_t *option);
77
78 // histos
79 void FillLc2pK0Sspectrum(AliAODRecoCascadeHF *part, Int_t isLc,
80 Int_t &nSelectedAnal, AliRDHFCutsLctoV0 *cutsAnal,
81 TClonesArray *mcArray);
82
83 void MakeAnalysisForLc2prK0S(TClonesArray *arrayLctopK0s,
84 TClonesArray *mcArray,
85 Int_t &nSelectedAnal, AliRDHFCutsLctoV0 *cutsAnal,
86 TClonesArray *array3Prong, AliAODMCHeader *aodheader);
87
88 // set MC usage
89 void SetMC(Bool_t theMCon) {fUseMCInfo = theMCon;}
90 Bool_t GetMC() const {return fUseMCInfo;}
91
92 void SetK0sAnalysis(Bool_t a) {fIsK0sAnalysis=a;}
93 Bool_t GetK0sAnalysis() const {return fIsK0sAnalysis;}
94
95 void SetUseOnTheFlyV0(Bool_t a) { fUseOnTheFlyV0=a; }
96 Bool_t GetUseOnTheFlyV0() { return fUseOnTheFlyV0; }
97
98 void SetIspA(Bool_t a) { fIspA=a; }
99 Bool_t GetIspA() { return fIspA; }
100
101 void SetFillOnlySgn(Bool_t a) { fFillOnlySgn=a; }
102 Bool_t GetFillOnlySgn() { return fFillOnlySgn; }
103
104 void SetTopoConstraint(Bool_t a) { ftopoConstraint=a; }
105 Bool_t GetTopoConstraint() { return ftopoConstraint; }
106
107 void SetCallKFVertexing(Bool_t a) { fCallKFVertexing=a; }
108 Bool_t GetCallKFVertexing() { return fCallKFVertexing; }
109
110 void SetKeepingKeepingOnlyHIJINGBkg(Bool_t a) { fKeepingOnlyHIJINGBkg = a;}
111 Bool_t GetKeepingOnlyHIJINGBkg() {return fKeepingOnlyHIJINGBkg;}
112
ef87f0d6 113 void SetKFCutChi2NDF(Float_t a) {fCutKFChi2NDF = a;}
114 Float_t GetKFCutChi2NDF() {return fCutKFChi2NDF;}
115
116 void SetKFCutDeviationFromVtx(Float_t a) {fCutKFDeviationFromVtx = a;}
117 Float_t GetKFCutDeviationFromVtx() {return fCutKFDeviationFromVtx;}
118
119 void SetKFCutDeviationFromVtxV0(Float_t a) {fCutKFDeviationFromVtxV0 = a;}
120 Float_t GetKFCutDeviationFromVtxV0() {return fCutKFDeviationFromVtxV0;}
121
ae48be26 122 void SetKeepingKeepingOnlyPYTHIABkg(Bool_t a) { fKeepingOnlyPYTHIABkg = a;}
123 Bool_t GetKeepingOnlyPYTHIABkg() {return fKeepingOnlyPYTHIABkg;}
124
0abe5247 125 private:
126
127 EBachelor CheckBachelor(AliAODRecoCascadeHF *part, AliAODTrack* bachelor, TClonesArray *mcArray);
128 EK0S CheckK0S(AliAODRecoCascadeHF *part, AliAODv0* v0part, TClonesArray *mcArray);
129 //EK0S CheckK0S(AliAODRecoCascadeHF *part, AliAODTrack* v0part, TClonesArray *mcArray );
130 Int_t FindV0Label(AliAODRecoDecay* v0part, TClonesArray *mcArray) const;
131 Int_t FindLcLabel(AliAODRecoCascadeHF* cascade, TClonesArray *mcArray) const;
132 Int_t CallKFVertexing(AliAODRecoCascadeHF *cascade, AliAODv0* v0part, AliAODTrack* bach, TClonesArray *mcArray,
133 Double_t* V0KF, Double_t* errV0KF, Double_t* LcKF, Double_t* errLcKF,
134 Double_t* distances, Double_t* armPolKF);
0abe5247 135
136 AliAnalysisTaskSELc2V0bachelorTMVA(const AliAnalysisTaskSELc2V0bachelorTMVA &source);
137 AliAnalysisTaskSELc2V0bachelorTMVA& operator=(const AliAnalysisTaskSELc2V0bachelorTMVA& source);
138
139 Bool_t fUseMCInfo; // Use MC info
140 TList *fOutput; // User output1: list of trees
141
142 // define the histograms
143 TH1F *fCEvents; // Histogram to check selected events
144 AliPIDResponse *fPIDResponse; //! PID response object
145 AliPIDCombined *fPIDCombined; //! combined PID response object
146 Bool_t fIsK0sAnalysis; // switch between Lpi and K0sp
147 AliNormalizationCounter *fCounter; // AliNormalizationCounter on output slot 4
148 AliRDHFCutsLctoV0 *fAnalCuts; // Cuts - sent to output slot 5
149 TList *fListCuts; // list of cuts
150 Bool_t fUseOnTheFlyV0; // flag to analyze also on-the-fly V0 candidates
151 Bool_t fIsEventSelected; // flag for event selected
152
153 TTree *fVariablesTreeSgn; //! tree of the candidate variables after track selection (Signal)
154 TTree *fVariablesTreeBkg; //! tree of the candidate variables after track selection (Background)
155 Float_t *fCandidateVariables; //! variables to be written to the tree
156
157 Bool_t fIspA; // flag for running on pA
158
159 TH1F* fHistoEvents; // histogram with number of events analyzed
160 TH1F* fHistoLc; // histogram with number of Lc
161 TH1F* fHistoLcOnTheFly; // histogram with number of Lc with on-the-fly V0
162 Bool_t fFillOnlySgn; // flag to fill only signal (speeding up processing)
163 TH1F* fHistoLcBeforeCuts; // histogram with number of Lc before any cut
164 TH1F* fHistoFiducialAcceptance; // histogram to check FiducialAcceptance cut
165 TH2F* fHistoCodesSgn; // histogram with codes for bachelor and V0 for signal
166 TH2F* fHistoCodesBkg; // histogram with codes for bachelor and V0 for background
167 TH1F* fHistoLcpKpiBeforeCuts; // histogram number of true Lc-->pKpi (3 prong) before any cut
168 AliAODVertex *fVtx1; // primary vertex
169
170 TH1D* fHistoDistanceLcToPrimVtx; // KF: distance Lc vertex from primary vertex
171 TH1D* fHistoDistanceV0ToPrimVtx; // KF: distance V0 vertex from primary vertex
172 TH1D* fHistoDistanceV0ToLc; // KF: distance V0 vertex from Lc vertex
173
174 TH1D* fHistoDistanceLcToPrimVtxSgn; // KF: distance of signal Lc vertex from primary vertex
175 TH1D* fHistoDistanceV0ToPrimVtxSgn; // KF: distance for signal Lc of V0 vertex from primary vertex
176 TH1D* fHistoDistanceV0ToLcSgn; // KF: distance for signal Lc of V0 vertex from Lc vertex
177
178 TH1D* fHistoVtxLcResidualToPrimVtx; // KF: residual wrt MC of distance Lc vertex from primary vertex (MC - KF)
179 TH1D* fHistoVtxV0ResidualToPrimVtx; // KF: residual wrt MC of distance V0 vertex from primary vertex (MC - KF)
180 TH1D* fHistoVtxV0ResidualToLc; // KF: residual wrt MC of distance V0 vertex from Lc vertex (MC - KF)
181
182 TH1D* fHistoMassV0All; // KF: mass for all V0 reconstructed with KF
183 TH1D* fHistoDecayLengthV0All; // KF: decay length for all V0 reconstructed with KF
184 TH1D* fHistoLifeTimeV0All; // KF: life time for all V0 reconstructed with KF
185
186 TH1D* fHistoMassV0True; // KF: mass for true V0 reconstructed with KF
187 TH1D* fHistoDecayLengthV0True; // KF: decay length for true V0 reconstructed with KF
188 TH1D* fHistoLifeTimeV0True; // KF: life time for true V0 reconstructed with KF
189
190 TH1D* fHistoMassV0TrueFromAOD; // KF: AOD mass for true V0 reconstructed with KF
191
192 TH1D* fHistoMassV0TrueK0S; // KF: mass for true V0 which are really K0S reconstructed with KF
193 TH1D* fHistoDecayLengthV0TrueK0S; // KF: decay length for true V0 which are really K0S reconstructed with KF
194 TH1D* fHistoLifeTimeV0TrueK0S; // KF: life time for true V0 which are really K0S reconstructed with KF
195
196 TH1D* fHistoMassV0TrueK0SFromAOD; // KF: AOD mass for true V0 which are really K0S reconstructed with KF
197
198 TH1D* fHistoMassLcAll; // KF: mass for all Lc reconstructed with KF
199 TH1D* fHistoDecayLengthLcAll; // KF: decay length for all Lc reconstructed with KF
200 TH1D* fHistoLifeTimeLcAll; // KF: life time for all Lc reconstructed with KF
201
202 TH1D* fHistoMassLcTrue; // KF: mass for true cascades reconstructed with KF
203 TH1D* fHistoDecayLengthLcTrue; // KF: decay length for true cascades reconstructed with KF
204 TH1D* fHistoLifeTimeLcTrue; // KF: life time for true cascades reconstructed with KF
205
206 TH1D* fHistoMassLcTrueFromAOD; // KF: AOD mass for true cascades reconstructed with KF
207
208 TH1D* fHistoMassV0fromLcAll; // KF: mass of V0 for all cascades reconstructed with KF
209 TH1D* fHistoDecayLengthV0fromLcAll; // KF: decay length of V0 for all cascades reconstructed with KF
210 TH1D* fHistoLifeTimeV0fromLcAll; // KF: life time of V0 for all cascades reconstructed with KF
211
212 TH1D* fHistoMassV0fromLcTrue; // KF: mass of V0 for true cascades reconstructed with KF
213 TH1D* fHistoDecayLengthV0fromLcTrue;// KF: decay length of V0 for true cascades reconstructed with KF
214 TH1D* fHistoLifeTimeV0fromLcTrue; // KF: life time of V0 for true cascades reconstructed with KF
215
216 TH1D* fHistoMassLcSgn; // KF: mass of signal Lc reconstructed with KF
217 TH1D* fHistoMassLcSgnFromAOD; // KF: AOD mass of signal Lc reconstructed with KF
218 TH1D* fHistoDecayLengthLcSgn; // KF: decay length of signal Lc reconstructed with KF
219 TH1D* fHistoLifeTimeLcSgn; // KF: life time of signal Lc reconstructed with KF
220
221 TH1D* fHistoMassV0fromLcSgn; // KF: mass of V0 for signal Lc reconstructed with KF
222 TH1D* fHistoDecayLengthV0fromLcSgn; // KF: decay length of V0 for signal Lc reconstructed with KF
223 TH1D* fHistoLifeTimeV0fromLcSgn; // KF: life time of V0 for signal Lc reconstructed with KF
224
225 TH2D* fHistoKF; // KF: V0 code vs Lc code from KF (mass, decaylength, lifetime considered)
226 TH1D* fHistoKFV0; // KF: V0 code from KF (mass, decaylength, lifetime considered)
227 TH1D* fHistoKFLc; // KF: Lc code from KF (mass, decaylength, lifetime considered)
228
229 TH2D* fHistoMassKFV0; // KF: mass vs mass error for V0 from KF
230 TH2D* fHistoDecayLengthKFV0; // KF: decay length vs decay length error for V0 from KF
231 TH2D* fHistoLifeTimeKFV0; // KF: life time vs life time error for V0 from KF
232
233 TH2D* fHistoMassKFLc; // KF: mass vs mass error for Lc from KF
234 TH2D* fHistoDecayLengthKFLc; // KF: decay length vs decay length error for Lc from KF
235 TH2D* fHistoLifeTimeKFLc; // KF: life time vs life time error for Lc from KF
236
237 TH2D* fHistoArmenterosPodolanskiV0KF; // KF: Armeteros-Podolanski plot for all V0 from KF
238 TH2D* fHistoArmenterosPodolanskiV0KFSgn; // KF: Armeteros-Podolanski plot for V0 from signal Lc from KF
239 TH2D* fHistoArmenterosPodolanskiV0AOD; // KF: AOD Armeteros-Podolanski plot for all V0 from KF
240 TH2D* fHistoArmenterosPodolanskiV0AODSgn; // KF: AOD Armeteros-Podolanski plot for V0 from signal Lc from KF
241
242 TList *fOutputKF; // User output1: list of histograms from KF
243
244 Int_t fmcLabelLc; // label of candidate
245 Bool_t ftopoConstraint; // flag to use topological constraints in KF
246 Bool_t fCallKFVertexing; // flag to decide whether to call or not KF
247 Bool_t fKeepingOnlyHIJINGBkg; // flag to fill bkg with only candidates that have daughters generated by HIJING (to be used for enriched MC)
248 AliVertexingHFUtils* fUtils; // AliVertexingHFUtils used to check the generator of a specific candidate
249 TH1F* fHistoBackground; // histo to check the number of candidates with at least one daughter for the injected signal
ef87f0d6 250 Float_t fCutKFChi2NDF; // cut for KF on chi2/NDF
251 Float_t fCutKFDeviationFromVtx; // cut for KF on distance to primary vtx
252 Float_t fCutKFDeviationFromVtxV0; // cut for KF on distance to primary vtx for V0
253 Int_t fCurrentEvent; // current event number - for debug purposes
254 Double_t fBField; // magnetic field of current event
ae48be26 255 Bool_t fKeepingOnlyPYTHIABkg; // flag to allow to use only PYTHIA tracks for background
0abe5247 256
ae48be26 257 ClassDef(AliAnalysisTaskSELc2V0bachelorTMVA, 4); // class for Lc->p K0
0abe5247 258};
259
260#endif
261