AliPhysics  9fe175b (9fe175b)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliCFTaskVertexingHF.h
Go to the documentation of this file.
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 
18 /* $Id$ */
19 
20 //-----------------------------------------------------------------------
25 //-----------------------------------------------------------------------
26 
27 
28 #include "AliAnalysisTaskSE.h"
29 #include "AliCFVertexingHF2Prong.h"
30 #include "AliCFVertexingHF3Prong.h"
32 #include "AliCFVertexingHF.h"
33 #include <TH1F.h>
34 #include <TProfile.h>
35 
36 class TH1I;
37 class TParticle ;
38 class TFile ;
39 class TClonesArray ;
40 class AliCFManager;
41 class AliAODRecoDecay;
43 class AliAODMCParticle;
44 class THnSparse;
45 class TF1;
46 class AliRDHFCuts;
49 
50 class AliCFTaskVertexingHF: public AliAnalysisTaskSE {
51  public:
52 
53  enum {
65  };
66 
67  enum {
68  kSnail = 0,
69  kCheetah = 1
70  };
71 
72  enum {
73  kAll = 0,
75  kL1520 = 2,
76  kKstar = 3,
77  kDelta = 4
78  };
79 
80  enum { kNtrk10=0, kNtrk10to16=1, kVZERO=2 };
81 
83  AliCFTaskVertexingHF(const Char_t* name, AliRDHFCuts* cuts, TF1* func = 0x0);
86  virtual ~AliCFTaskVertexingHF();
87 
90  void UserExec(Option_t *option);
91  void Init();
92  void LocalInit() {Init();}
93  void Terminate(Option_t *);
94 
96  void SetCorrelationMatrix(THnSparse* h) {fCorrelation=h;}
97  void SetAcceptanceUnf(Bool_t AcceptanceUnf) {fAcceptanceUnf = AcceptanceUnf;}
98  Bool_t GetAcceptanceUnf() const {return fAcceptanceUnf;}
99 
100 
102  void SetCFManager(AliCFManager* io) {fCFManager = io;}
103  AliCFManager * GetCFManager() {return fCFManager;}
104 
106  void SetFillFromGenerated(Bool_t flag) {fFillFromGenerated = flag;}
107  Bool_t GetFillFromGenerated() const {return fFillFromGenerated;}
108  void SetDecayChannel (Int_t decayChannel) {fDecayChannel = decayChannel;}
109  Int_t GetDecayChannel () {return fDecayChannel;}
110  void SetUseWeight(Bool_t useWeight){fUseWeight=useWeight;}
111  Bool_t GetUseWeight() const {return fUseWeight;}
112  Double_t GetWeight(Float_t pt);
113  Double_t dNdptFit(Float_t pt, Double_t* par);
114  Double_t GetPtWeightFromHistogram(Float_t pt);
115 
116  void SetUseFlatPtWeight(Bool_t useWeight){fUseFlatPtWeight=useWeight; fUseWeight=useWeight;}
117  Bool_t GetUseFlatPtWeight() const {return fUseFlatPtWeight;}
118  void SetUseZWeight(Bool_t useWeight){fUseZWeight=useWeight;}
119  Bool_t GetUseZWeight() const {return fUseZWeight;}
120  Double_t GetZWeight(Float_t z, Int_t runnumber);
121  Double_t DodzFit(Float_t z, Double_t* par);
122 
123  void SetUseNchWeight(Bool_t useWeight){fUseNchWeight=useWeight;}
124  Bool_t GetUseNchWeight() const {return fUseNchWeight;}
125  void SetMCNchHisto(TH1F* h){
126  if(fHistoMCNch) delete fHistoMCNch;
127  fHistoMCNch=new TH1F(*h);
128  }
129  void CreateMeasuredNchHisto();
130  void SetMeasuredNchHisto(TH1F* h){
131  if(fHistoMeasNch) delete fHistoMeasNch;
132  fHistoMeasNch=new TH1F(*h);
133  }
134  Double_t GetNchWeight(Int_t nch);
137  void SetIsPPData(Bool_t flag){ fIsPPData = flag; }
138  void SetIsPPbData(Bool_t flag){ fIsPPbData = flag; }
139 
140  void SetUseNchTrackletsWeight(Bool_t useWeight = kTRUE) { fUseNchWeight=useWeight; fUseTrackletsWeight=useWeight; fUseMultRatioAsWeight=useWeight; }
144 
147  void SetMultiplVsZProfileLHC10b(TProfile* hprof){
148  if(fMultEstimatorAvg[0]) delete fMultEstimatorAvg[0];
149  fMultEstimatorAvg[0]=new TProfile(*hprof);
150  }
151  void SetMultiplVsZProfileLHC10c(TProfile* hprof){
152  if(fMultEstimatorAvg[1]) delete fMultEstimatorAvg[1];
153  fMultEstimatorAvg[1]=new TProfile(*hprof);
154  }
155  void SetMultiplVsZProfileLHC10d(TProfile* hprof){
156  if(fMultEstimatorAvg[2]) delete fMultEstimatorAvg[2];
157  fMultEstimatorAvg[2]=new TProfile(*hprof);
158  }
159  void SetMultiplVsZProfileLHC10e(TProfile* hprof){
160  if(fMultEstimatorAvg[3]) delete fMultEstimatorAvg[3];
161  fMultEstimatorAvg[3]=new TProfile(*hprof);
162  }
163 
164  void SetMultiplVsZProfileLHC13b(TProfile* hprof){
165  if(fMultEstimatorAvg[0]) delete fMultEstimatorAvg[0];
166  fMultEstimatorAvg[0]=new TProfile(*hprof);
167  }
168  void SetMultiplVsZProfileLHC13c(TProfile* hprof){
169  if(fMultEstimatorAvg[1]) delete fMultEstimatorAvg[1];
170  fMultEstimatorAvg[1]=new TProfile(*hprof);
171  }
172 
173 
174  TProfile* GetEstimatorHistogram(const AliVEvent* event);
175  void SetReferenceMultiplcity(Double_t rmu){fRefMult=rmu;}
176 
177  void SetDselection(UShort_t originDselection) {fOriginDselection=originDselection;}
178  UShort_t GetDselection (){return fOriginDselection;}
179  void SetSign(Char_t isSign) {fSign = isSign;}
180  Char_t GetSign() {return fSign;}
181 
182  void SetCentralitySelection(Bool_t centSelec = kTRUE) {fCentralitySelection = centSelec;}
184 
185  void SetFakeSelection(Int_t fakeSel = 0) {fFakeSelection=fakeSel;}
187 
190 
191  void SetUseMCVertex(Bool_t opt){fUseMCVertex=opt;}
192  Bool_t GetUseMCVertex(){return fUseMCVertex;}
193 
194 
203 
204  Bool_t ProcessDs(Int_t returnCodeDs) const;
205 
206  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;}
207  Int_t GetConfiguration() const {return fConfiguration;}
208 
209  void SetWeightFunction(TF1* func) {fFuncWeight = func;}
210  TF1* GetWeightFunction() const {return fFuncWeight;}
211  void SetWeightHistogram(TH1F* histo) {
212  if(fHistoPtWeight) delete fHistoPtWeight;
213  fHistoPtWeight=new TH1F(*histo);
214  }
215  TH1F* GetWeightHistogram() const {return (TH1F*)fHistoPtWeight;}
216 
231 
232  void SetResonantDecay(UInt_t resonantDecay) {fResonantDecay = resonantDecay;}
233  UInt_t GetResonantDecay() const {return fResonantDecay;}
234 
239 
242 
243  void SetUseSelectionBit(Bool_t flag) { fUseSelectionBit=flag; }
244  Bool_t GetUseSelectionBit() const { return fUseSelectionBit; }
245 
246  Bool_t ProcessLctoV0Bachelor(Int_t returnCodeDs) const;
247 
248  void SetUseAdditionalCuts(Bool_t flag) { fDecayChannel == 22 ? fUseAdditionalCuts = flag : fUseAdditionalCuts = kFALSE;}
249  Bool_t GetUseAdditionalCuts() const { return fUseAdditionalCuts; }
250  void SetUseCutsForTMVA(Bool_t useCutsForTMVA) { fDecayChannel == 22 ? fUseCutsForTMVA = useCutsForTMVA : fUseAdditionalCuts = kFALSE;}
251  Bool_t GetUseCutsForTMVA() const {return fUseCutsForTMVA;}
252 
253  void SetUseCascadeTaskForLctoV0bachelor(Bool_t useCascadeTaskForLctoV0bachelor) {fUseCascadeTaskForLctoV0bachelor = useCascadeTaskForLctoV0bachelor;}
255 
258 
259  protected:
260  AliCFManager *fCFManager;
262  THnSparse* fCorrelation;
263  TList *fListProfiles; //list of profile histos for z-vtx correction
264  Int_t fCountMC;
267  Int_t fCountAcc;
268  Int_t fCountVertex;
269  Int_t fCountRefit;
270  Int_t fCountReco;
275  Int_t fEvents;
278  UShort_t fOriginDselection;
279  Bool_t fAcceptanceUnf;
281  Bool_t fUseWeight;
282  Double_t fWeight;
284  Bool_t fUseZWeight;
285  Bool_t fUseNchWeight;
288  Int_t fNvar;
289  TString fPartName;
290  TString fDauNames;
291  Char_t fSign;
295  Bool_t fUseMCVertex;
296  Int_t fDsOption;
297  Int_t fGenDsOption;
299  TF1* fFuncWeight;
302  TH1F* fHistoMCNch;
303  UInt_t fResonantDecay;
307  UInt_t fPDGcode;
308 
310  TProfile* fMultEstimatorAvg[4];
311  Double_t fRefMult;
313  Bool_t fIsPPData;
314  Bool_t fIsPPbData;
320 
322  ClassDef(AliCFTaskVertexingHF,25);
323 };
325 
326 #endif
void SetAcceptanceUnf(Bool_t AcceptanceUnf)
Double_t GetPtWeightFromHistogram(Float_t pt)
void SetCutOnMomConservation(Float_t cut)
Bool_t fUseAdditionalCuts
flag for pPb data (used for multiplicity corrections)
Bool_t fUseZWeight
flag to decide to use a flat pt shape
AliCFTaskVertexingHF & operator=(const AliCFTaskVertexingHF &c)
void SetWeightFunction(TF1 *func)
Bool_t fFillFromGenerated
decay channel to configure the task
void SetRejectCandidateIfNotFromQuark(Bool_t opt)
Double_t GetWeight(Float_t pt)
void SetMultiplVsZProfileLHC10e(TProfile *hprof)
Int_t fCountAcc
MC particle found in limited acceptance that doesn't satisfy acceptance cuts.
Bool_t GetUseZWeight() const
Int_t fCountRefit
Reco particle found that satisfy vertex constrained.
all decays (resonant + non-resonant)
void SetCFManager(AliCFManager *io)
CORRECTION FRAMEWORK RELATED FUNCTIONS.
Int_t fCountReco
Reco particle found that satisfy kTPCrefit and kITSrefit.
UInt_t fPDGcode
flag to use selection bit
Class for HF corrections as a function of many variables and step.
UInt_t GetResonantDecay() const
Int_t fCountGenLimAcc
MC particle found.
Bool_t fIsPPbData
flag for pp data (not checking centrality)
void SetDecayChannel(Int_t decayChannel)
TH1F * fHistoPtWeight
user-defined function to be used to calculate weights
TH1F * GetWeightHistogram() const
Bool_t fUseSelectionBit
Lc->V0+bachelor decay option (generation level)
Bool_t GetUseFlatPtWeight() const
AliCFTaskVertexingHF()
multiplicity estimators
Int_t fCountRecoITSClusters
Reco particle found that satisfy cuts in requested acceptance.
void SetFillFromGenerated(Bool_t flag)
get corr manager
Int_t fNvar
flag to use directly the ratio of the distributions (fHistoMCNch) instead of computing it ...
void SetUseNchTrackletsWeight(Bool_t useWeight=kTRUE)
void SetUseMCVertex(Bool_t opt)
Int_t fGenLctoV0bachelorOption
Lc->V0+bachelor decay option (selection level)
void SetUseAdditionalCuts(Bool_t flag)
Double_t GetZWeight(Float_t z, Int_t runnumber)
void SetPtWeightsFromFONLL276andBAMPSoverLHC12a17b()
Bool_t GetCutOnMomConservation() const
Int_t fCountGenLimAccNoAcc
MC particle found in limited acceptance.
Bool_t GetUseSelectionBit() const
Double_t dNdptFit(Float_t pt, Double_t *par)
Bool_t GetUseCutsForTMVA() const
TString fPartName
number of variables for the container
Bool_t GetUseNchTrackletsWeight() const
void SetUseSelectionBit(Bool_t flag)
void SetUseRatioMultiplicityDistributionsAsWeight(Bool_t flag=kTRUE)
Double_t fRefMult
TProfile with mult vas. Z per period.
Bool_t ProcessDs(Int_t returnCodeDs) const
Float_t fCutOnMomConservation
flag to define which task to use for Lc –> K0S+p
Bool_t fZvtxCorrectedNtrkEstimator
refrence multiplcity (period b)
TList * fListProfiles
response matrix for unfolding
Bool_t fAcceptanceUnf
flag to select D0 origins. 0 Only from charm 1 only from beauty 2 both from charm and beauty ...
Bool_t fUseTrackletsWeight
flag to decide whether to use Ncharged weights != 1 when filling the container or not ...
Int_t fCountVertex
MC particle found that satisfy acceptance cuts.
void SetMeasuredNchHisto(TH1F *h)
void SetResonantDecay(UInt_t resonantDecay)
void SetIsPPData(Bool_t flag)
Double_t DodzFit(Float_t z, Double_t *par)
Bool_t fUseCascadeTaskForLctoV0bachelor
these are the pre-selection cuts for the TMVA
void SetIsPPbData(Bool_t flag)
Double_t GetNchWeight(Int_t nch)
void SetCentralitySelection(Bool_t centSelec=kTRUE)
UShort_t fOriginDselection
flag to indicate whether data container should be filled with generated values also for reconstructed...
Bool_t fUseFlatPtWeight
weight used to fill the container
Char_t fSign
daughter in fin state
Int_t GetConfiguration() const
AliRDHFCuts * fCuts
flag for unfolding before or after cuts.
Int_t fFakeSelection
flag to switch off the centrality selection
TF1 * fFuncWeight
configuration (slow / fast) of the CF –> different variables will be allocated (all / reduced number)...
UInt_t fResonantDecay
histogram with Nch distribution from MC production
AliCFManager * GetCFManager()
global correction manager
Bool_t fCentralitySelection
flag to decide wheter to keep D0 only (0), D0bar only (1), or both D0 and D0bar (2) ...
void SetWeightHistogram(TH1F *histo)
void SetUseCutsForTMVA(Bool_t useCutsForTMVA)
Int_t fCountRecoAcc
Reco particle found that satisfy cuts.
Int_t fGenDsOption
Ds decay option (selection level)
void SetReferenceMultiplcity(Double_t rmu)
void SetUseWeight(Bool_t useWeight)
void SetUseZvtxCorrectedNtrkEstimator(Bool_t flag)
Bool_t fIsPPData
flag to use the z-vtx corrected (if not use uncorrected) multiplicity estimator
Int_t fConfiguration
Ds decay option (generation level)
Bool_t GetUseAdditionalCuts() const
void SetConfiguration(Int_t configuration)
void SetDselection(UShort_t originDselection)
Int_t fLctoV0bachelorOption
resonant deacy channel to be used if the CF should be run on resonant channels only ...
Bool_t fRejectIfNoQuark
selection flag for fakes tracks
slow configuration, all variables
TH1I * fHistEventsProcessed
pointer to the CF manager
TString fDauNames
D meson name.
Int_t fCountRecoPID
Reco particle found that satisfy cuts in PPR.
Bool_t GetUseRatioMultiplicityDistributionsAsWeight() const
Bool_t fUseMultRatioAsWeight
flag to decide whether to use Ncharged weights != 1 when filling the container or not ...
TF1 * GetWeightFunction() const
void SetUseNchWeight(Bool_t useWeight)
void SetUseFlatPtWeight(Bool_t useWeight)
Int_t fEvents
Reco PID step.
void SetCorrelationMatrix(THnSparse *h)
UNFOLDING.
Bool_t GetAcceptanceUnf() const
Bool_t fUseCutsForTMVA
flag to use additional cuts needed for Lc –> K0S + p, TMVA
void SetMultiplVsZProfileLHC10b(TProfile *hprof)
Int_t fDecayChannel
n. of events
void SetMultiplVsZProfileLHC10d(TProfile *hprof)
void UserExec(Option_t *option)
Int_t fCountRecoPPR
Reco particle found that satisfy cuts in n. of ITS clusters.
void SetSign(Char_t isSign)
Bool_t GetUseNchWeight() const
Bool_t fUseMCVertex
flag to remove events not geenrated with PYTHIA
Bool_t GetUseWeight() const
void SetMultiplicityEstimator(Int_t value)
Int_t fDsOption
flag to use MC vertex (useful when runnign in pp)
Bool_t fUseNchWeight
flag to decide whether to use z-vtx weights != 1 when filling the container or not ...
Bool_t GetUseCascadeTaskForLctoV0bachelor() const
void SetMultiplVsZProfileLHC13b(TProfile *hprof)
Class to compute variables for correction framework // for 3-body decays of D mesons (D+...
Bool_t GetFillFromGenerated() const
void SetMultiplVsZProfileLHC13c(TProfile *hprof)
TProfile * GetEstimatorHistogram(const AliVEvent *event)
void SetFakeSelection(Int_t fakeSel=0)
Int_t fMultiplicityEstimator
PDG code.
void UserCreateOutputObjects()
ANALYSIS FRAMEWORK STUFF to loop on data and fill output objects.
TH1F * fHistoMCNch
histogram with measured Nch distribution (pp 7 TeV)
TProfile * fMultEstimatorAvg[4]
Definition of the multiplicity estimator: kNtrk10=0, kNtrk10to16=1, kVZERO=2.
Double_t fWeight
flag to decide whether to use pt-weights != 1 when filling the container or not
TH1F * fHistoMeasNch
user-defined histogram to calculate the Pt weights
Bool_t ProcessLctoV0Bachelor(Int_t returnCodeDs) const
void SetUseCascadeTaskForLctoV0bachelor(Bool_t useCascadeTaskForLctoV0bachelor)
void SetUseZWeight(Bool_t useWeight)
void SetMultiplVsZProfileLHC10c(TProfile *hprof)