]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGHF/vertexingHF/AliAnalysisTaskSELc2V0bachelor.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGHF / vertexingHF / AliAnalysisTaskSELc2V0bachelor.h
1 #ifndef ALIANALYSISTASKSELC2V0BACHELOR_H
2 #define ALIANALYSISTASKSELC2V0BACHELOR_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 #include "TROOT.h"
21 #include "TSystem.h"
22
23 #include "AliAnalysisTaskSE.h"
24 #include "AliAODEvent.h"
25 #include "AliPID.h"
26 #include "AliAODTrack.h"
27 #include "AliRDHFCutsLctoV0.h"
28 #include "AliNormalizationCounter.h"
29
30 class TH1F;
31 class TClonesArray;
32 class AliAODRecoCascade;
33
34 class AliAnalysisTaskSELc2V0bachelor : public AliAnalysisTaskSE 
35 {
36   
37  public:
38   
39   AliAnalysisTaskSELc2V0bachelor();
40   AliAnalysisTaskSELc2V0bachelor(const Char_t* name, AliRDHFCutsLctoV0* cuts,
41                                  Bool_t useOnTheFly=kFALSE, Bool_t writeVariableTree=kTRUE, Bool_t additionalChecks=kFALSE, Bool_t trackRotation=kFALSE);
42   virtual ~AliAnalysisTaskSELc2V0bachelor();
43
44   // Implementation of interface methods  
45   virtual void UserCreateOutputObjects();
46   virtual void Init();
47   virtual void LocalInit() {Init();}
48   virtual void UserExec(Option_t *option);
49   virtual void Terminate(Option_t *option);
50  
51   // histos
52   void FillLc2pK0Sspectrum(AliAODRecoCascadeHF *part, Int_t isLc,
53                            Int_t &nSelectedAnal, AliRDHFCutsLctoV0 *cutsAnal,
54                            TClonesArray *mcArray);
55
56   void MakeAnalysisForLc2prK0S(TClonesArray *arrayLctopK0S,
57                                TClonesArray *mcArray,
58                                Int_t &nSelectedAnal, AliRDHFCutsLctoV0 *cutsAnal);
59  
60   // set MC usage
61   void SetMC(Bool_t theMCon) {fUseMCInfo = theMCon;}
62   Bool_t GetMC() const {return fUseMCInfo;}
63
64   // set flag for additional checks
65   void SetAdditionalChecks(Bool_t additionalChecks) {fAdditionalChecks = additionalChecks;}
66   Bool_t GetAdditionalChecks() const {return fAdditionalChecks;}
67
68   void FillArmPodDistribution(AliAODRecoDecay *vZero,TString histoTitle, Bool_t isCandidateSelectedCuts, Bool_t isBachelorID);
69
70   void SetK0SAnalysis(Bool_t a) {fIsK0SAnalysis=a;}
71   Bool_t GetK0SAnalysis() const {return fIsK0SAnalysis;}
72
73   void SetUseOnTheFlyV0(Bool_t a) { fUseOnTheFlyV0=a; }
74   Bool_t GetUseOnTheFlyV0() { return fUseOnTheFlyV0; }
75
76   Int_t MatchToMClabelC(AliAODRecoCascadeHF *candidate,TClonesArray *mcArray);
77
78
79   void SetNRotations(Int_t nRot=9) { fNRotations=nRot; }
80   Int_t GetNRotations() { return fNRotations; }
81
82   void SetPtMinToFillTheTree(Double_t pTmin=  0.) { fPtMinToFillTheTree=pTmin; }
83   void SetPtMaxToFillTheTree(Double_t pTmax=999.) { fPtMaxToFillTheTree=pTmax; }
84   Double_t GetPtMinToFillTheTree() { return fPtMinToFillTheTree; }
85   Double_t GetPtMaxToFillTheTree() { return fPtMaxToFillTheTree; }
86
87   void SetMinAngleForRot(Double_t min=5.*TMath::Pi()/6.) { fMinAngleForRot=min; }
88   void SetMaxAngleForRot(Double_t max=7.*TMath::Pi()/6.) { fMaxAngleForRot=max; }
89   Double_t GetMinAngleForRot() { return fMinAngleForRot; }
90   Double_t GetMaxAngleForRot() { return fMaxAngleForRot; }
91
92  private:
93   
94   void CheckEventSelection(AliAODEvent *aodEvent);
95   void CheckEventSelectionWithCandidates(AliAODEvent *aodEvent);
96   void CheckCandidatesAtDifferentLevels(AliAODRecoCascadeHF *part,AliRDHFCutsLctoV0* cutsAnal);
97   void FillTheTree(AliAODRecoCascadeHF *part, AliRDHFCutsLctoV0 *cutsAnal, TClonesArray *mcArray, Int_t isLc);
98   void DefineTreeVariables();
99
100   Int_t MatchToMC(AliAODRecoCascadeHF *lc2bacV0,
101                   Int_t *pdgDgLc2bacV0, Int_t *pdgDgV0,
102                   TClonesArray *mcArray);
103
104   Int_t SearchLcDaughter(TClonesArray *arrayMC, Int_t iii);
105
106   void DefineGeneralHistograms();
107   void DefineAnalysisHistograms();
108   void DefineK0SHistos();
109   void FillAnalysisHistograms(AliAODRecoCascadeHF *part, AliRDHFCutsLctoV0 *cutsAnal, TString appendthis);
110   void TrackRotation(AliRDHFCutsLctoV0 *cutsAnal, AliAODRecoCascadeHF *part, TString appendthis);
111
112   AliAnalysisTaskSELc2V0bachelor(const AliAnalysisTaskSELc2V0bachelor &source);
113   AliAnalysisTaskSELc2V0bachelor& operator=(const AliAnalysisTaskSELc2V0bachelor& source); 
114   
115   Double_t Det(Double_t a00,Double_t a01,
116                Double_t a10,Double_t a11) const;
117   Double_t Det(Double_t a00,Double_t a01,Double_t a02,
118                Double_t a10,Double_t a11,Double_t a12,
119                Double_t a20,Double_t a21,Double_t a22) const;
120   Double_t PropagateToDCA(AliAODv0 *v, AliAODTrack *bachelor, Double_t b,
121                           Double_t &xVtxLc, Double_t &yVtxLc, Double_t &zVtxLc,
122                           Double_t &pxVtxLc, Double_t &pyVtxLc, Double_t &pzVtxLc);
123
124   Double_t GetAlpha(Double_t xyz[3],Double_t pxpypz[3]);
125
126   Int_t SearchForCommonMother(TClonesArray *mcArray,
127                               Int_t dgLabels[10],Int_t ndg,
128                               Int_t &ndgCk, Int_t *pdgDg, Int_t &labelMother, Int_t &nDauCand) const;
129
130   Bool_t fUseMCInfo;          // Use MC info
131   TList *fOutput;             // User output slot 1 // general histos
132   TList *fOutputAll;          // User output slot 4 // histos without pid and cut on V0
133   TList *fOutputPIDBach;      // User output slot 5 // histos with PID on Bachelor
134
135   TH1F *fCEvents;                    // Histogram to check selected events
136   Bool_t fIsK0SAnalysis;             // switch between Lpi and K0Sp
137   AliNormalizationCounter *fCounter; // AliNormalizationCounter on output slot 2
138   AliRDHFCutsLctoV0 *fAnalCuts;      // Cuts - sent to output slot 3
139   //TList *fListCuts;                  // list of cuts
140   Bool_t fUseOnTheFlyV0;             // flag to analyze also on-the-fly V0 candidates
141   Bool_t fIsEventSelected;           // flag for event selected
142
143   Bool_t    fWriteVariableTree;       // flag to decide whether to write the candidate variables on a tree variables
144   TTree    *fVariablesTree;           //! tree of the candidate variables after track selection on output slot 4
145   Float_t *fCandidateVariables;       //! variables to be written to the tree
146   AliAODVertex *fVtx1;                // primary vertex
147   Float_t fBzkG;                      // magnetic field value [kG]
148   Bool_t fAdditionalChecks;           // flag to fill additional histograms
149
150   Bool_t fTrackRotation;              // flag to check track rotation
151   TList *fOutputPIDBachTR;            // User output slot 6 // histos with PID on Bachelor and track rotation
152
153   Double_t fMinAngleForRot;//=5*TMath::Pi()/6;
154   Double_t fMaxAngleForRot;//=7*TMath::Pi()/6;
155   Double_t fMinMass;//=mLcPDG-0.250;
156   Double_t fMaxMass;//=mLcPDG+0.250;
157   Int_t fNRotations;//=9;
158   Double_t fPtMinToFillTheTree;//0.
159   Double_t fPtMaxToFillTheTree;//999.
160
161   ClassDef(AliAnalysisTaskSELc2V0bachelor,7); // class for Lc->p K0
162 };
163
164 #endif
165