]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/vertexingHF/AliAnalysisTaskSELc2V0bachelor.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGHF / vertexingHF / AliAnalysisTaskSELc2V0bachelor.h
CommitLineData
992ba7d8 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
992ba7d8 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"
992ba7d8 27#include "AliRDHFCutsLctoV0.h"
28#include "AliNormalizationCounter.h"
29
a578b2da 30class TH1F;
53c91ed7 31class TClonesArray;
32class AliAODRecoCascade;
a578b2da 33
992ba7d8 34class AliAnalysisTaskSELc2V0bachelor : public AliAnalysisTaskSE
35{
36
37 public:
38
39 AliAnalysisTaskSELc2V0bachelor();
43c7bace 40 AliAnalysisTaskSELc2V0bachelor(const Char_t* name, AliRDHFCutsLctoV0* cuts,
516f546e 41 Bool_t useOnTheFly=kFALSE, Bool_t writeVariableTree=kTRUE, Bool_t additionalChecks=kFALSE, Bool_t trackRotation=kFALSE);
992ba7d8 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,
a578b2da 53 Int_t &nSelectedAnal, AliRDHFCutsLctoV0 *cutsAnal,
54 TClonesArray *mcArray);
992ba7d8 55
43c7bace 56 void MakeAnalysisForLc2prK0S(TClonesArray *arrayLctopK0S,
992ba7d8 57 TClonesArray *mcArray,
992ba7d8 58 Int_t &nSelectedAnal, AliRDHFCutsLctoV0 *cutsAnal);
59
992ba7d8 60 // set MC usage
61 void SetMC(Bool_t theMCon) {fUseMCInfo = theMCon;}
62 Bool_t GetMC() const {return fUseMCInfo;}
63
43c7bace 64 // set flag for additional checks
65 void SetAdditionalChecks(Bool_t additionalChecks) {fAdditionalChecks = additionalChecks;}
66 Bool_t GetAdditionalChecks() const {return fAdditionalChecks;}
67
b833016c 68 void FillArmPodDistribution(AliAODRecoDecay *vZero,TString histoTitle, Bool_t isCandidateSelectedCuts, Bool_t isBachelorID);
992ba7d8 69
43c7bace 70 void SetK0SAnalysis(Bool_t a) {fIsK0SAnalysis=a;}
71 Bool_t GetK0SAnalysis() const {return fIsK0SAnalysis;}
992ba7d8 72
0dbd1d4f 73 void SetUseOnTheFlyV0(Bool_t a) { fUseOnTheFlyV0=a; }
74 Bool_t GetUseOnTheFlyV0() { return fUseOnTheFlyV0; }
992ba7d8 75
53c91ed7 76 Int_t MatchToMClabelC(AliAODRecoCascadeHF *candidate,TClonesArray *mcArray);
77
b833016c 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
992ba7d8 92 private:
93
43c7bace 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
ff12b981 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
43c7bace 106 void DefineGeneralHistograms();
107 void DefineAnalysisHistograms();
ff12b981 108 void DefineK0SHistos();
b833016c 109 void FillAnalysisHistograms(AliAODRecoCascadeHF *part, AliRDHFCutsLctoV0 *cutsAnal, TString appendthis);
516f546e 110 void TrackRotation(AliRDHFCutsLctoV0 *cutsAnal, AliAODRecoCascadeHF *part, TString appendthis);
ff12b981 111
992ba7d8 112 AliAnalysisTaskSELc2V0bachelor(const AliAnalysisTaskSELc2V0bachelor &source);
113 AliAnalysisTaskSELc2V0bachelor& operator=(const AliAnalysisTaskSELc2V0bachelor& source);
114
43c7bace 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
14fe9f43 126 Int_t SearchForCommonMother(TClonesArray *mcArray,
127 Int_t dgLabels[10],Int_t ndg,
516f546e 128 Int_t &ndgCk, Int_t *pdgDg, Int_t &labelMother, Int_t &nDauCand) const;
14fe9f43 129
992ba7d8 130 Bool_t fUseMCInfo; // Use MC info
43c7bace 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
992ba7d8 134
a578b2da 135 TH1F *fCEvents; // Histogram to check selected events
43c7bace 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
0dbd1d4f 140 Bool_t fUseOnTheFlyV0; // flag to analyze also on-the-fly V0 candidates
141 Bool_t fIsEventSelected; // flag for event selected
992ba7d8 142
a578b2da 143 Bool_t fWriteVariableTree; // flag to decide whether to write the candidate variables on a tree variables
43c7bace 144 TTree *fVariablesTree; //! tree of the candidate variables after track selection on output slot 4
a578b2da 145 Float_t *fCandidateVariables; //! variables to be written to the tree
146 AliAODVertex *fVtx1; // primary vertex
147 Float_t fBzkG; // magnetic field value [kG]
43c7bace 148 Bool_t fAdditionalChecks; // flag to fill additional histograms
a578b2da 149
516f546e 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;
b833016c 158 Double_t fPtMinToFillTheTree;//0.
159 Double_t fPtMaxToFillTheTree;//999.
516f546e 160
b833016c 161 ClassDef(AliAnalysisTaskSELc2V0bachelor,7); // class for Lc->p K0
992ba7d8 162};
163
164#endif
165