]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGHF/vertexingHF/AliCFTaskVertexingHF.h
Set bin labels to avoid warning when merging
[u/mrichter/AliRoot.git] / PWGHF / vertexingHF / AliCFTaskVertexingHF.h
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 //-----------------------------------------------------------------------
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"
30 #include "AliCFVertexingHF3Prong.h"
31 #include "AliCFVertexingHF.h"
32 #include <TH1F.h>
33
34 class TH1I;
35 class TParticle ;
36 class TFile ;
37 class TClonesArray ;
38 class AliCFManager;
39 class AliAODRecoDecay;
40 class AliAODRecoDecayHF2Prong;
41 class AliAODMCParticle;
42 class THnSparse;
43 class TF1;
44 class AliRDHFCuts;
45 class AliCFVertexingHF2Prong;
46 class AliCFVertexingHF3Prong;
47
48 class AliCFTaskVertexingHF: public AliAnalysisTaskSE {
49 public:
50         
51         enum {
52                 kStepGeneratedLimAcc = 0,
53                 kStepGenerated       = 1,
54                 kStepAcceptance      = 2,
55                 kStepVertex          = 3,
56                 kStepRefit           = 4,
57                 kStepReconstructed   = 5,
58                 kStepRecoAcceptance  = 6,
59                 kStepRecoITSClusters = 7,
60                 kStepRecoPPR         = 8,
61                 kStepRecoPID         = 9
62         };
63
64         enum {
65                 kSnail = 0,    // slow configuration, all variables
66                 kCheetah = 1   // fast configuration, only a subset of variables
67         };
68
69         enum {
70           kAll = 0,   // all decays (resonant + non-resonant)
71           kNonResonant = 1, // only non resonant
72           kL1520 = 2,  // Lc --> L(1520) + p
73           kKstar = 3,  // Lc --> K* + pi
74           kDelta = 4   // Lc --> Delta + K
75         };
76         
77         AliCFTaskVertexingHF();
78         AliCFTaskVertexingHF(const Char_t* name, AliRDHFCuts* cuts, TF1* func = 0x0);
79         AliCFTaskVertexingHF& operator= (const AliCFTaskVertexingHF& c);
80         AliCFTaskVertexingHF(const AliCFTaskVertexingHF& c);
81         virtual ~AliCFTaskVertexingHF();
82         
83         // ANALYSIS FRAMEWORK STUFF to loop on data and fill output objects
84         void     UserCreateOutputObjects();
85         void     UserExec(Option_t *option);
86         void     Init();
87         void     LocalInit() {Init();}
88         void     Terminate(Option_t *);
89         
90         // UNFOLDING
91         void     SetCorrelationMatrix(THnSparse* h) {fCorrelation=h;}
92         void     SetAcceptanceUnf(Bool_t AcceptanceUnf) {fAcceptanceUnf = AcceptanceUnf;}
93         Bool_t   GetAcceptanceUnf() const {return fAcceptanceUnf;}
94         
95         
96         // CORRECTION FRAMEWORK RELATED FUNCTIONS
97         void           SetCFManager(AliCFManager* io) {fCFManager = io;}   // global correction manager
98         AliCFManager * GetCFManager()                 {return fCFManager;} // get corr manager
99         
100         // Setters (and getters) for the config macro
101         void    SetFillFromGenerated(Bool_t flag) {fFillFromGenerated = flag;}
102         Bool_t  GetFillFromGenerated() const {return fFillFromGenerated;}
103         void    SetDecayChannel (Int_t decayChannel) {fDecayChannel = decayChannel;}
104         Int_t   GetDecayChannel () {return fDecayChannel;}
105         void     SetUseWeight(Bool_t useWeight){fUseWeight=useWeight;}
106         Bool_t   GetUseWeight() const {return fUseWeight;}
107         Double_t GetWeight(Float_t pt);
108         Double_t dNdptFit(Float_t pt, Double_t* par);
109
110         void SetUseFlatPtWeight(Bool_t useWeight){fUseFlatPtWeight=useWeight; fUseWeight=useWeight;}
111         Bool_t GetUseFlatPtWeight() const {return fUseFlatPtWeight;}
112         void SetUseZWeight(Bool_t useWeight){fUseZWeight=useWeight;}
113         Bool_t GetUseZWeight() const {return fUseZWeight;}
114         Double_t GetZWeight(Float_t z, Int_t runnumber);
115         Double_t DodzFit(Float_t z, Double_t* par);
116
117         void SetUseNchWeight(Bool_t useWeight){fUseNchWeight=useWeight;}
118         Bool_t GetUseNchWeight() const {return fUseNchWeight;}
119         void SetMCNchHisto(TH1F* h){
120           if(fHistoMCNch) delete fHistoMCNch;
121           fHistoMCNch=new TH1F(*h);
122         }
123         void CreateMeasuredNchHisto();
124         Double_t GetNchWeight(Int_t nch);
125
126         void   SetDselection(UShort_t originDselection) {fOriginDselection=originDselection;}
127         UShort_t GetDselection (){return fOriginDselection;}
128         void SetSign(Char_t isSign) {fSign = isSign;}
129         Char_t GetSign() {return fSign;}
130          
131         void SetCentralitySelection(Bool_t centSelec = kTRUE) {fCentralitySelection = centSelec;}   
132         Bool_t GetCentralitySelection() {return fCentralitySelection;} 
133
134         void SetFakeSelection(Int_t fakeSel = 0) {fFakeSelection=fakeSel;}
135         Int_t GetFakeSelection(){return fFakeSelection;}
136
137         void SetRejectCandidateIfNotFromQuark(Bool_t opt){fRejectIfNoQuark=opt;}
138         Bool_t GetRejectCandidateIfNotFromQuark(){return fRejectIfNoQuark;}
139
140         void SetUseMCVertex(Bool_t opt){fUseMCVertex=opt;}
141         Bool_t GetUseMCVertex(){return fUseMCVertex;}
142         
143
144         void SetKeepDsViaPhi(){fDsOption=1;}
145         void SetKeepDsViaK0star(){fDsOption=2;}
146         void SetKeepAllDs(){fDsOption=3;}
147         void SetCountAllDs(){fGenDsOption=AliCFVertexingHF3Prong::kCountAllDsKKpi;}
148         void SetCountDsViaPhi(){fGenDsOption=AliCFVertexingHF3Prong::kCountPhipi;}
149         void SetCountDsViaK0star(){fGenDsOption=AliCFVertexingHF3Prong::kCountK0stK;}
150         void SetCountResonantDs(){fGenDsOption=AliCFVertexingHF3Prong::kCountResonant;}
151         void SetCountNonResonantDs(){fGenDsOption=AliCFVertexingHF3Prong::kCountNonResonant;}
152
153         Bool_t ProcessDs(Int_t returnCodeDs) const;
154
155         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;} 
156         Int_t GetConfiguration() const {return fConfiguration;} 
157         
158         void SetWeightFunction(TF1* func) {fFuncWeight = func;}
159         TF1* GetWeightFunction() const {return fFuncWeight;}
160
161         void SetResonantDecay(UInt_t resonantDecay) {fResonantDecay = resonantDecay;}
162         UInt_t GetResonantDecay() const {return fResonantDecay;}
163         
164 protected:
165         AliCFManager   *fCFManager;   //  pointer to the CF manager
166         TH1I *fHistEventsProcessed;   //! simple histo for monitoring the number of events processed
167         THnSparse* fCorrelation;      //  response matrix for unfolding
168         Int_t fCountMC;               //  MC particle found
169         Int_t fCountAcc;              //  MC particle found that satisfy acceptance cuts
170         Int_t fCountVertex;       //  Reco particle found that satisfy vertex constrained
171         Int_t fCountRefit;        //  Reco particle found that satisfy kTPCrefit and kITSrefit
172         Int_t fCountReco;             //  Reco particle found that satisfy cuts
173         Int_t fCountRecoAcc;          //  Reco particle found that satisfy cuts in requested acceptance
174         Int_t fCountRecoITSClusters;  //  Reco particle found that satisfy cuts in n. of ITS clusters
175         Int_t fCountRecoPPR;          //  Reco particle found that satisfy cuts in PPR
176         Int_t fCountRecoPID;          //Reco PID step 
177         Int_t fEvents;                //  n. of events
178         Int_t fDecayChannel;          // decay channel to configure the task
179         Bool_t fFillFromGenerated;    //  flag to indicate whether data container should be filled with generated values also for reconstructed particles
180         UShort_t fOriginDselection;      // flag to select D0 origins. 0 Only from charm 1 only from beauty 2 both from charm and beauty
181         Bool_t fAcceptanceUnf;        //  flag for unfolding before or after cuts.
182         AliRDHFCuts* fCuts;            // cuts
183         Bool_t fUseWeight;             //flag to decide whether to use pt-weights != 1 when filling the container or not
184         Double_t fWeight;              //weight used to fill the container
185         Bool_t fUseFlatPtWeight;       // flag to decide to use a flat pt shape
186         Bool_t fUseZWeight;           // flag to decide whether to use z-vtx weights != 1 when filling the container or not
187         Bool_t fUseNchWeight;         // flag to decide whether to use Ncharged weights != 1 when filling the container or not
188         Int_t fNvar;                   // number of variables for the container
189         TString fPartName;    // D meson name
190         TString fDauNames;    // daughter in fin state
191         Char_t fSign;                 // flag to decide wheter to keep D0 only (0), D0bar only (1), or both D0 and D0bar (2)
192         Bool_t fCentralitySelection;  //flag to switch off the centrality selection
193         Int_t  fFakeSelection;  //selection flag for fakes tracks 
194         Bool_t fRejectIfNoQuark;  // flag to remove events not geenrated with PYTHIA
195         Bool_t fUseMCVertex;  // flag to use MC vertex (useful when runnign in pp)
196         Int_t  fDsOption;     // Ds decay option (selection level)
197         Int_t  fGenDsOption;     // Ds decay option (generation level)
198         Int_t fConfiguration; // configuration (slow / fast) of the CF --> different variables will be allocated (all / reduced number)
199         TF1* fFuncWeight;     // user-defined function to be used to calculate weights
200         TH1F* fHistoMeasNch;  // histogram with measured Nch distribution (pp 7 TeV)
201         TH1F* fHistoMCNch;  // histogram with Nch distribution from MC production
202         UInt_t fResonantDecay;  // resonant deacy channel to be used if the CF should be run on resonant channels only
203
204         ClassDef(AliCFTaskVertexingHF,12); // class for HF corrections as a function of many variables
205 };
206
207 #endif