reduced size of the tree
[u/mrichter/AliRoot.git] / PWGLF / STRANGENESS / Hypernuclei / AliAnalysisTaskLambdaNAOD.h
1 #ifndef ALIANALYSISTASKLAMBDANAOD_H
2 #define ALIANALYSISTASKLAMBDANAOD_H
3
4
5 /**************************************************************************
6  * Author : Nicole Alice Martin (nicole.alice.martin@cern.ch)                  *
7  *                                                                        *
8  * Contributors are mentioned in the code where appropriate.              *
9  *                                                                        *
10  * Permission to use, copy, modify and distribute this software and its   *
11  * documentation strictly for non-commercial purposes is hereby granted   *
12  * without fee, provided that the above copyright notice appears in all   *
13  * copies and that both the copyright notice and this permission notice   *
14  * appear in the supporting documentation. The authors make no claims     *
15  * about the suitability of this software for any purpose. It is          *
16  * provided "as is" without express or implied warranty.                  *
17  **************************************************************************/
18
19 //-----------------------------------------------------------------
20 //               AliAnalysisTaskLambdaNAOD  class
21 //  task for the investigation of (anti-)lambda-n bound state
22 //          uses the V0 finders, based on AODs or ESDS
23 //-----------------------------------------------------------------
24
25 class TF1;
26 class TH1F;
27 class TH2F;
28 class TH3F;
29 class THnSparse;
30
31 class TTree;
32
33 class AliAODInputHandler;
34 class AliAODEvent;
35 class AliAODVertex;
36 class AliAODv0;
37
38 class AliESDtrackCuts;
39
40 class AliESDInputHandler;
41 class AliESDEvent;
42 class AliESDVertex;
43 class AliESDv0;
44
45 #include <fstream>
46 #include "AliAnalysisTaskSE.h"
47 #include "THnSparse.h"
48 #include "AliStack.h"
49 #include "AliVTrack.h"
50
51 #define maxNofTracks 100000
52
53 class AliAnalysisTaskLambdaNAOD : public AliAnalysisTaskSE {
54  public:
55   AliAnalysisTaskLambdaNAOD();
56   AliAnalysisTaskLambdaNAOD(const char *name);
57   virtual ~AliAnalysisTaskLambdaNAOD();// {}
58   
59   virtual void   UserCreateOutputObjects();
60   virtual void   UserExec(Option_t *option);
61   virtual void   Terminate(const Option_t*);
62   Int_t  Initialize();
63   Int_t  SetupEvent();
64   void   ResetEvent();
65   void SetAnalysisType               (const char* analysisType          = "ESD") { fAnalysisType                = analysisType;               }
66
67
68   /** Types of pdgCode */
69   enum PdgCodeType_t { 
70     kPDGPionPlus,
71     kPDGPionMinus,
72     kPDGProton,
73     kPDGAntiProton,
74     kPDGDeuteron,
75     kPDGAntiDeuteron,
76     kPDGHelium3,
77     kPDGAntiHelium3,
78     kPDGLambda,
79     kPDGAntiLambda,
80     kPDGLambdaNeutron,
81     kPDGAntiLambdaNeutron,
82     kPDGHypertriton,
83     kPDGAntiHypertriton,
84     kPdgCodeMax  // Number of enum entries
85   };
86
87   /** Types of Mass */
88   enum MassType_t { 
89     kMassPion,
90     kMassProton,
91     kMassDeuteron,
92     kMassTriton,
93     kMassHelium3,
94     kMassMax  // Number of enum entries
95   };
96
97   /** Array of types of pdgCodes */
98   static const Int_t fgkPdgCode[];           //! transient
99
100   /** Array of types of pdgCodes */
101   static const Double_t fgkMass[];        //! transient
102
103  private:
104
105
106   TString         fAnalysisType;                  // "ESD" or "AOD" analysis type       
107
108   AliInputEventHandler *fEventHandler;            //for ESDs or AODs
109
110   AliESDtrackCuts    *fESDtrackCutsV0;                            // basic cut variables for v0's
111   AliESDpid          *fESDpid;                                  // basic TPC object for n-sigma cuts
112   AliPIDResponse     *fPIDResponse;                   //! PID response object
113
114   //
115    
116   
117   TTree             *fTreeV0;                          //!
118  
119   TH1F              *fHistNumberOfEvents;                      //! histo to count the number of events
120   TH1F              *fHistTriggerStat;                         //! Trigger statistics
121   TH1F              *fHistLambdaNeutronPtGen;                  //! for MC
122   TH1F              *fHistAntiLambdaNeutronPtGen;              //! for MC
123   TH1F              *fHistLambdaNeutronInvaMassGen;            //! for MC
124   TH1F              *fHistAntiLambdaNeutronInvaMassGen;        //! for MC
125   TH1F              *fHistLambdaNeutronDecayLengthGen;         //! for MC
126   TH1F              *fHistAntiLambdaNeutronDecayLengthGen;     //! for MC
127   TH1F              *fHistLambdaNeutronPtAso;                  //! for MC
128   TH1F              *fHistLambdaNeutronPtAsoCuts;              //! for MC
129   TH1F              *fHistAntiLambdaNeutronPtAso;              //! for MC
130   TH1F              *fHistAntiLambdaNeutronPtAsoCuts;          //! for MC
131   TH1F              *fHistLambdaNeutronInvaMassAso;            //! for MC
132   TH1F              *fHistAntiLambdaNeutronInvaMassAso;        //! for MC
133   TH1F              *fHistLambdaNeutronDecayLengthAso;         //! for MC
134   TH1F              *fHistAntiLambdaNeutronDecayLengthAso;     //! for MC
135
136   TH2F              *fof;                                      //! debug histo for OnTheFlyStatus
137   TH2F              *fHistArmenterosPodolanskiDeuteronPion;    //!
138   TH2F              *fHistArmenterosPodolanskiAntiDeuteronPion;//!
139
140   TH3F              *fHistDeDxQA;                              //! histo for a QA dE/dx
141
142   Int_t              fNTriggers;                               //! N Triggers used
143
144   Bool_t             fMCtrue;                                  //! flag if real data or MC is processed
145   Bool_t             fOnlyQA;                                  //! flag if only QA histograms should be filled
146   Bool_t             fTriggerFired[5];                         //! TriggerFired 0: MB | 1: CE | 2: SC | 3: EJE | 4: EGA
147
148
149
150   //Tree variables
151   //AliAODv0 *fV0object;                                         //! Tree variable
152   Int_t  fItrk;                                                //! Tree variable
153
154   Int_t fV0finder[maxNofTracks];                               //! Tree variable
155   Int_t fkMB[maxNofTracks];                                    //! Tree variable
156   Int_t fkCentral[maxNofTracks];                               //! Tree variable
157   Int_t fkSemiCentral[maxNofTracks];                           //! Tree variable
158   // Int_t fkEMCEJE[maxNofTracks];                                //! Tree variable
159   //Int_t fkEMCEGA[maxNofTracks];                                //! Tree variable 
160
161   Double_t fPtotN[maxNofTracks];                               //! Tree variable
162   Double_t fPtotP[maxNofTracks];                               //! Tree variable
163   Double_t fMotherPt[maxNofTracks];                            //! Tree variable
164
165   Double_t fdEdxN[maxNofTracks];                               //! Tree variable
166   Double_t fdEdxP[maxNofTracks];                               //! Tree variable
167   Double_t fSignN[maxNofTracks];                               //! Tree variable
168   Double_t fSignP[maxNofTracks];                               //! Tree variable
169
170   Float_t fDCAv0[maxNofTracks];                                //! Tree variable
171   Float_t fCosinePAv0[maxNofTracks];                           //! Tree variable
172   Float_t fDecayRadiusTree[maxNofTracks];                      //! Tree variable
173   Double_t fInvaMassDeuteronPionTree[maxNofTracks];            //! Tree variable
174   Int_t fChargeComboDeuteronPionTree[maxNofTracks];            //! Tree variable
175   Bool_t fIsCorrectlyAssociated[maxNofTracks];                 //! Tree variable
176
177   //Double_t fAmenterosAlphaTree[maxNofTracks];                  //! Tree variable
178   //Double_t fAmenterosQtTree[maxNofTracks];                     //! Tree variable
179   Int_t fRotationTree[maxNofTracks];                        //! Tree variable
180
181
182   
183   
184   TObjArray         *fOutputContainer;         //! output data container for the histogramms
185   //
186   void  BinLogAxis(const THnSparse *h, Int_t axisNumber); //define function for log axis for search for Anti-Alpha candidates 
187   //
188   
189   /** Check if event is triggred */
190   Bool_t   IsTriggered();
191   Bool_t   DeuteronPID(AliVTrack *trackP, AliVTrack *trackN, Double_t ptotP, Double_t ptotN, Int_t runNumber, Bool_t isDeuteron[3]);
192   Bool_t   PionPID(AliVTrack *trackP, AliVTrack *trackN, Double_t ptotP, Double_t ptotN, Int_t runNumber, Bool_t isPion[2]);
193   Bool_t   TrackCuts(AliVTrack *track, Bool_t testTrackCuts);
194   //Bool_t   FilterBit(AliVTrack *track, Bool_t testFilterBit);
195   Double_t MomentumInnerParam(AliVTrack *track, Double_t ptot);
196
197  
198   void               MCGenerated(AliStack* stack);             //! function to loop over the genrated particles
199   
200   void               MCTwoBodyDecay (AliStack* stack, const TParticle *tparticleMother, Long_t PDGMother, Long_t PDGFirstDaughter, Long_t PDGSecondDaughter, Double_t massFirstDaughter, Double_t massSecondDaughter);                         //! function to calculate the invariant mass of two daughters and the pt of the mother
201  
202   AliAnalysisTaskLambdaNAOD(const AliAnalysisTaskLambdaNAOD&); // not implemented
203   AliAnalysisTaskLambdaNAOD& operator=(const AliAnalysisTaskLambdaNAOD&); // not implemented
204   //
205   ClassDef(AliAnalysisTaskLambdaNAOD, 1); // example of analysis
206 };
207
208 #endif