]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/vertexingHF/AliCFTaskVertexingHF.h
adapt to new emc filters plus small cleanup
[u/mrichter/AliRoot.git] / PWGHF / vertexingHF / AliCFTaskVertexingHF.h
CommitLineData
379592af 1#ifndef ALICFTASKVERTEXINGHF_H
2#define ALICFTASKVERTEXINGHF_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
27de2dfb 18/* $Id$ */
19
379592af 20//-----------------------------------------------------------------------
21// Class for HF corrections as a function of many variables and step
22// Author : C. Zampolli, CERN
23// D. Caffarri, Univ & INFN Padova caffarri@pd.infn.it
24// Base class for HF Unfolding - agrelli@uu.nl
25//-----------------------------------------------------------------------
26
27
28#include "AliAnalysisTaskSE.h"
29#include "AliCFVertexingHF2Prong.h"
f96b7f1a 30#include "AliCFVertexingHF3Prong.h"
5cd139bc 31#include "AliCFVertexingHFLctoV0bachelor.h"
379592af 32#include "AliCFVertexingHF.h"
afb24c40 33#include <TH1F.h>
379592af 34
35class TH1I;
36class TParticle ;
37class TFile ;
38class TClonesArray ;
39class AliCFManager;
40class AliAODRecoDecay;
41class AliAODRecoDecayHF2Prong;
42class AliAODMCParticle;
43class THnSparse;
5b37c6e5 44class TF1;
f2703bd2 45class AliRDHFCuts;
379592af 46class AliCFVertexingHF2Prong;
6e2e4f50 47class AliCFVertexingHF3Prong;
379592af 48
49class AliCFTaskVertexingHF: public AliAnalysisTaskSE {
50public:
51
52 enum {
53 kStepGeneratedLimAcc = 0,
54 kStepGenerated = 1,
55 kStepAcceptance = 2,
56 kStepVertex = 3,
57 kStepRefit = 4,
58 kStepReconstructed = 5,
59 kStepRecoAcceptance = 6,
60 kStepRecoITSClusters = 7,
61 kStepRecoPPR = 8,
62 kStepRecoPID = 9
63 };
fbec9fa9 64
ec5288c3 65 enum {
66 kSnail = 0, // slow configuration, all variables
67 kCheetah = 1 // fast configuration, only a subset of variables
68 };
fdd5a897 69
70 enum {
71 kAll = 0, // all decays (resonant + non-resonant)
72 kNonResonant = 1, // only non resonant
73 kL1520 = 2, // Lc --> L(1520) + p
74 kKstar = 3, // Lc --> K* + pi
75 kDelta = 4 // Lc --> Delta + K
76 };
d74f7bc1 77
78 enum { kNtrk10=0, kNtrk10to16=1, kVZERO=2 }; // multiplicity estimators
379592af 79
80 AliCFTaskVertexingHF();
5b37c6e5 81 AliCFTaskVertexingHF(const Char_t* name, AliRDHFCuts* cuts, TF1* func = 0x0);
379592af 82 AliCFTaskVertexingHF& operator= (const AliCFTaskVertexingHF& c);
83 AliCFTaskVertexingHF(const AliCFTaskVertexingHF& c);
84 virtual ~AliCFTaskVertexingHF();
85
86 // ANALYSIS FRAMEWORK STUFF to loop on data and fill output objects
87 void UserCreateOutputObjects();
88 void UserExec(Option_t *option);
f2703bd2 89 void Init();
90 void LocalInit() {Init();}
379592af 91 void Terminate(Option_t *);
92
93 // UNFOLDING
94 void SetCorrelationMatrix(THnSparse* h) {fCorrelation=h;}
95 void SetAcceptanceUnf(Bool_t AcceptanceUnf) {fAcceptanceUnf = AcceptanceUnf;}
96 Bool_t GetAcceptanceUnf() const {return fAcceptanceUnf;}
97
98
99 // CORRECTION FRAMEWORK RELATED FUNCTIONS
100 void SetCFManager(AliCFManager* io) {fCFManager = io;} // global correction manager
101 AliCFManager * GetCFManager() {return fCFManager;} // get corr manager
102
f2703bd2 103 // Setters (and getters) for the config macro
104 void SetFillFromGenerated(Bool_t flag) {fFillFromGenerated = flag;}
105 Bool_t GetFillFromGenerated() const {return fFillFromGenerated;}
106 void SetDecayChannel (Int_t decayChannel) {fDecayChannel = decayChannel;}
3ee5eb83 107 Int_t GetDecayChannel () {return fDecayChannel;}
f2703bd2 108 void SetUseWeight(Bool_t useWeight){fUseWeight=useWeight;}
109 Bool_t GetUseWeight() const {return fUseWeight;}
110 Double_t GetWeight(Float_t pt);
111 Double_t dNdptFit(Float_t pt, Double_t* par);
17bf1a34 112
113 void SetUseFlatPtWeight(Bool_t useWeight){fUseFlatPtWeight=useWeight; fUseWeight=useWeight;}
114 Bool_t GetUseFlatPtWeight() const {return fUseFlatPtWeight;}
115 void SetUseZWeight(Bool_t useWeight){fUseZWeight=useWeight;}
116 Bool_t GetUseZWeight() const {return fUseZWeight;}
117 Double_t GetZWeight(Float_t z, Int_t runnumber);
118 Double_t DodzFit(Float_t z, Double_t* par);
afb24c40 119
120 void SetUseNchWeight(Bool_t useWeight){fUseNchWeight=useWeight;}
121 Bool_t GetUseNchWeight() const {return fUseNchWeight;}
122 void SetMCNchHisto(TH1F* h){
123 if(fHistoMCNch) delete fHistoMCNch;
124 fHistoMCNch=new TH1F(*h);
125 }
126 void CreateMeasuredNchHisto();
127 Double_t GetNchWeight(Int_t nch);
d74f7bc1 128 void SetMultiplicityEstimator(Int_t value){ fMultiplicityEstimator=value; }
129 Int_t GetMultiplicityEstimator(){ return fMultiplicityEstimator; }
130 void SetIsPPData(Bool_t flag){ fIsPPData = flag; }
131
4fa6d5f8 132 void SetUseNchTrackletsWeight(Bool_t useWeight = kTRUE) { fUseNchWeight=useWeight; fUseTrackletsWeight=useWeight; }
133 Bool_t GetUseNchTrackletsWeight() const {return fUseTrackletsWeight;}
afb24c40 134
6e2e4f50 135 void SetDselection(UShort_t originDselection) {fOriginDselection=originDselection;}
3ee5eb83 136 UShort_t GetDselection (){return fOriginDselection;}
137 void SetSign(Char_t isSign) {fSign = isSign;}
138 Char_t GetSign() {return fSign;}
379592af 139
fbec9fa9 140 void SetCentralitySelection(Bool_t centSelec = kTRUE) {fCentralitySelection = centSelec;}
141 Bool_t GetCentralitySelection() {return fCentralitySelection;}
b7af2639 142
1f780958 143 void SetFakeSelection(Int_t fakeSel = 0) {fFakeSelection=fakeSel;}
144 Int_t GetFakeSelection(){return fFakeSelection;}
0ada222f 145
146 void SetRejectCandidateIfNotFromQuark(Bool_t opt){fRejectIfNoQuark=opt;}
147 Bool_t GetRejectCandidateIfNotFromQuark(){return fRejectIfNoQuark;}
148
149 void SetUseMCVertex(Bool_t opt){fUseMCVertex=opt;}
150 Bool_t GetUseMCVertex(){return fUseMCVertex;}
fbec9fa9 151
6c62cb59 152
153 void SetKeepDsViaPhi(){fDsOption=1;}
154 void SetKeepDsViaK0star(){fDsOption=2;}
155 void SetKeepAllDs(){fDsOption=3;}
f96b7f1a 156 void SetCountAllDs(){fGenDsOption=AliCFVertexingHF3Prong::kCountAllDsKKpi;}
157 void SetCountDsViaPhi(){fGenDsOption=AliCFVertexingHF3Prong::kCountPhipi;}
158 void SetCountDsViaK0star(){fGenDsOption=AliCFVertexingHF3Prong::kCountK0stK;}
159 void SetCountResonantDs(){fGenDsOption=AliCFVertexingHF3Prong::kCountResonant;}
160 void SetCountNonResonantDs(){fGenDsOption=AliCFVertexingHF3Prong::kCountNonResonant;}
6c62cb59 161
162 Bool_t ProcessDs(Int_t returnCodeDs) const;
ec5288c3 163
164 void SetConfiguration(Int_t configuration) {(configuration == kSnail) ? Printf("Slow configuration chosen, all variables will be used!") : Printf("Fast configuration chosen, all variablesOnly pt, y, phi, ct, fake, z_vtx, centrality and multiplicity will be used!"); fConfiguration = configuration;}
165 Int_t GetConfiguration() const {return fConfiguration;}
6c62cb59 166
5b37c6e5 167 void SetWeightFunction(TF1* func) {fFuncWeight = func;}
168 TF1* GetWeightFunction() const {return fFuncWeight;}
942a78ce 169 void SetPtWeightsFromFONLL276overLHC12a17a();
170 void SetPtWeightsFromDataPbPb276overLHC12a17a();
1d9442de 171 void SetPtWeightsFromFONLL276overLHC12a17b();
172 void SetPtWeightsFromFONLL276andBAMPSoverLHC12a17b();
3825480a 173 void SetPtWeightsFromFONLL5overLHC13d3();
fdd5a897 174
175 void SetResonantDecay(UInt_t resonantDecay) {fResonantDecay = resonantDecay;}
176 UInt_t GetResonantDecay() const {return fResonantDecay;}
5cd139bc 177
178 void SetKeepLctoK0Sp() {fLctoV0bachelorOption=1;}
179 void SetKeepLctoLambdaBarpi() {fLctoV0bachelorOption=2;}
180 void SetKeepLctoLambdapi() {fLctoV0bachelorOption=4;}
181 void SetKeepLctoV0bachelor() {fLctoV0bachelorOption=7;}
182
5cd139bc 183 void SetCountLctoK0Sp(){fGenLctoV0bachelorOption=AliCFVertexingHFLctoV0bachelor::kCountK0Sp;}
ff12b981 184 void SetCountLctoLambdapi(){fGenLctoV0bachelorOption=AliCFVertexingHFLctoV0bachelor::kCountLambdapi;}
ca7d039b 185
186 void SetUseSelectionBit(Bool_t flag) { fUseSelectionBit=flag; }
187 Bool_t GetUseSelectionBit() const { return fUseSelectionBit; }
5cd139bc 188
189 Bool_t ProcessLctoV0Bachelor(Int_t returnCodeDs) const;
190
379592af 191protected:
379592af 192 AliCFManager *fCFManager; // pointer to the CF manager
193 TH1I *fHistEventsProcessed; //! simple histo for monitoring the number of events processed
194 THnSparse* fCorrelation; // response matrix for unfolding
195 Int_t fCountMC; // MC particle found
196 Int_t fCountAcc; // MC particle found that satisfy acceptance cuts
197 Int_t fCountVertex; // Reco particle found that satisfy vertex constrained
198 Int_t fCountRefit; // Reco particle found that satisfy kTPCrefit and kITSrefit
199 Int_t fCountReco; // Reco particle found that satisfy cuts
200 Int_t fCountRecoAcc; // Reco particle found that satisfy cuts in requested acceptance
201 Int_t fCountRecoITSClusters; // Reco particle found that satisfy cuts in n. of ITS clusters
202 Int_t fCountRecoPPR; // Reco particle found that satisfy cuts in PPR
203 Int_t fCountRecoPID; //Reco PID step
204 Int_t fEvents; // n. of events
f2703bd2 205 Int_t fDecayChannel; // decay channel to configure the task
379592af 206 Bool_t fFillFromGenerated; // flag to indicate whether data container should be filled with generated values also for reconstructed particles
207 UShort_t fOriginDselection; // flag to select D0 origins. 0 Only from charm 1 only from beauty 2 both from charm and beauty
208 Bool_t fAcceptanceUnf; // flag for unfolding before or after cuts.
f2703bd2 209 AliRDHFCuts* fCuts; // cuts
17bf1a34 210 Bool_t fUseWeight; //flag to decide whether to use pt-weights != 1 when filling the container or not
f2703bd2 211 Double_t fWeight; //weight used to fill the container
17bf1a34 212 Bool_t fUseFlatPtWeight; // flag to decide to use a flat pt shape
213 Bool_t fUseZWeight; // flag to decide whether to use z-vtx weights != 1 when filling the container or not
afb24c40 214 Bool_t fUseNchWeight; // flag to decide whether to use Ncharged weights != 1 when filling the container or not
4fa6d5f8 215 Bool_t fUseTrackletsWeight; // flag to decide whether to use Ncharged weights != 1 when filling the container or not
216 Int_t fNvar; // number of variables for the container
31da6b05 217 TString fPartName; // D meson name
218 TString fDauNames; // daughter in fin state
3ee5eb83 219 Char_t fSign; // flag to decide wheter to keep D0 only (0), D0bar only (1), or both D0 and D0bar (2)
b7af2639 220 Bool_t fCentralitySelection; //flag to switch off the centrality selection
fbec9fa9 221 Int_t fFakeSelection; //selection flag for fakes tracks
0ada222f 222 Bool_t fRejectIfNoQuark; // flag to remove events not geenrated with PYTHIA
223 Bool_t fUseMCVertex; // flag to use MC vertex (useful when runnign in pp)
c83eda41 224 Int_t fDsOption; // Ds decay option (selection level)
225 Int_t fGenDsOption; // Ds decay option (generation level)
ec5288c3 226 Int_t fConfiguration; // configuration (slow / fast) of the CF --> different variables will be allocated (all / reduced number)
5b37c6e5 227 TF1* fFuncWeight; // user-defined function to be used to calculate weights
afb24c40 228 TH1F* fHistoMeasNch; // histogram with measured Nch distribution (pp 7 TeV)
229 TH1F* fHistoMCNch; // histogram with Nch distribution from MC production
fdd5a897 230 UInt_t fResonantDecay; // resonant deacy channel to be used if the CF should be run on resonant channels only
5cd139bc 231 Int_t fLctoV0bachelorOption; // Lc->V0+bachelor decay option (selection level)
232 Int_t fGenLctoV0bachelorOption; // Lc->V0+bachelor decay option (generation level)
ca7d039b 233 Bool_t fUseSelectionBit; // flag to use selection bit
04b11915 234 UInt_t fPDGcode; // PDG code
b7af2639 235
d74f7bc1 236 Int_t fMultiplicityEstimator; // Definition of the multiplicity estimator: kNtrk10=0, kNtrk10to16=1, kVZERO=2
237 Bool_t fIsPPData; // flag for pp data (not checking centrality)
238
4fa6d5f8 239 ClassDef(AliCFTaskVertexingHF,17); // class for HF corrections as a function of many variables
379592af 240};
241
242#endif