]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/vertexingHF/AliCFTaskVertexingHF.h
Fixed memory leak (Renu)
[u/mrichter/AliRoot.git] / PWG3 / 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 //-----------------------------------------------------------------------
19 // Class for HF corrections as a function of many variables and step 
20 // Author : C. Zampolli, CERN
21 //                      D. Caffarri, Univ & INFN Padova caffarri@pd.infn.it
22 // Base class for HF Unfolding - agrelli@uu.nl
23 //-----------------------------------------------------------------------
24
25
26 #include "AliAnalysisTaskSE.h"
27 #include "AliCFVertexingHF2Prong.h"
28 //#include "AliCFVertexingHF3Prong.h"
29 #include "AliCFVertexingHF.h"
30
31 class TH1I;
32 class TParticle ;
33 class TFile ;
34 class TClonesArray ;
35 class AliCFManager;
36 class AliAODRecoDecay;
37 class AliAODRecoDecayHF2Prong;
38 class AliAODMCParticle;
39 class THnSparse;
40 class AliRDHFCuts;
41 class AliCFVertexingHF2Prong;
42 //class AliCFVertexingHF3Prong;
43
44 class AliCFTaskVertexingHF: public AliAnalysisTaskSE {
45 public:
46         
47         enum {
48                 kStepGeneratedLimAcc = 0,
49                 kStepGenerated       = 1,
50                 kStepAcceptance      = 2,
51                 kStepVertex          = 3,
52                 kStepRefit           = 4,
53                 kStepReconstructed   = 5,
54                 kStepRecoAcceptance  = 6,
55                 kStepRecoITSClusters = 7,
56                 kStepRecoPPR         = 8,
57                 kStepRecoPID         = 9
58         };
59         
60         AliCFTaskVertexingHF();
61         AliCFTaskVertexingHF(const Char_t* name, AliRDHFCuts* cuts);
62         AliCFTaskVertexingHF& operator= (const AliCFTaskVertexingHF& c);
63         AliCFTaskVertexingHF(const AliCFTaskVertexingHF& c);
64         virtual ~AliCFTaskVertexingHF();
65         
66         // ANALYSIS FRAMEWORK STUFF to loop on data and fill output objects
67         void     UserCreateOutputObjects();
68         void     UserExec(Option_t *option);
69         void     Init();
70         void     LocalInit() {Init();}
71         void     Terminate(Option_t *);
72         
73         // UNFOLDING
74         void     SetCorrelationMatrix(THnSparse* h) {fCorrelation=h;}
75         void     SetAcceptanceUnf(Bool_t AcceptanceUnf) {fAcceptanceUnf = AcceptanceUnf;}
76         Bool_t   GetAcceptanceUnf() const {return fAcceptanceUnf;}
77         
78         
79         // CORRECTION FRAMEWORK RELATED FUNCTIONS
80         void           SetCFManager(AliCFManager* io) {fCFManager = io;}   // global correction manager
81         AliCFManager * GetCFManager()                 {return fCFManager;} // get corr manager
82         
83         void     SetPDG(Int_t code) {fPDG = code; }     // defines the PDG code of searched HF
84
85         // Setters (and getters) for the config macro
86         void    SetFillFromGenerated(Bool_t flag) {fFillFromGenerated = flag;}
87         Bool_t  GetFillFromGenerated() const {return fFillFromGenerated;}
88         void    SetDecayChannel (Int_t decayChannel) {fDecayChannel = decayChannel;}
89         void     SetUseWeight(Bool_t useWeight){fUseWeight=useWeight;}
90         Bool_t   GetUseWeight() const {return fUseWeight;}
91         Double_t GetWeight(Float_t pt);
92         Double_t dNdptFit(Float_t pt, Double_t* par);
93         
94         //void   SetDselection(UShort_t originDselection);
95          
96 protected:
97         Int_t           fPDG;         //  PDG code of searched V0's
98         AliCFManager   *fCFManager;   //  pointer to the CF manager
99         TH1I *fHistEventsProcessed;   //! simple histo for monitoring the number of events processed
100         THnSparse* fCorrelation;      //  response matrix for unfolding
101         Int_t fCountMC;               //  MC particle found
102         Int_t fCountAcc;              //  MC particle found that satisfy acceptance cuts
103         Int_t fCountVertex;       //  Reco particle found that satisfy vertex constrained
104         Int_t fCountRefit;        //  Reco particle found that satisfy kTPCrefit and kITSrefit
105         Int_t fCountReco;             //  Reco particle found that satisfy cuts
106         Int_t fCountRecoAcc;          //  Reco particle found that satisfy cuts in requested acceptance
107         Int_t fCountRecoITSClusters;  //  Reco particle found that satisfy cuts in n. of ITS clusters
108         Int_t fCountRecoPPR;          //  Reco particle found that satisfy cuts in PPR
109         Int_t fCountRecoPID;          //Reco PID step 
110         Int_t fEvents;                //  n. of events
111         Int_t fDecayChannel;          // decay channel to configure the task
112         Bool_t fFillFromGenerated;    //  flag to indicate whether data container should be filled with generated values also for reconstructed particles
113         UShort_t fOriginDselection;      // flag to select D0 origins. 0 Only from charm 1 only from beauty 2 both from charm and beauty
114         Bool_t fAcceptanceUnf;        //  flag for unfolding before or after cuts.
115         AliRDHFCuts* fCuts;            // cuts
116         Bool_t fUseWeight;             //flag to decide whether to use weights != 1 when filling the container or not
117         Double_t fWeight;              //weight used to fill the container
118         Int_t fNvar;                   // number of variables for the container
119         
120         ClassDef(AliCFTaskVertexingHF,2); // class for HF corrections as a function of many variables
121 };
122
123 #endif