AliPhysics  vAN-20150827 (3e81cbb)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnalysisTaskSELc2V0bachelor.h
Go to the documentation of this file.
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"
29 
31 
32 class TH1F;
33 class TClonesArray;
34 class AliAODRecoCascade;
35 
36 class AliAnalysisTaskSELc2V0bachelor : public AliAnalysisTaskSE
37 {
38 
39  public:
40 
42  AliAnalysisTaskSELc2V0bachelor(const Char_t* name, AliRDHFCutsLctoV0* cuts,
43  Bool_t useOnTheFly=kFALSE, Bool_t writeVariableTree=kTRUE, Bool_t additionalChecks=kFALSE, Bool_t trackRotation=kFALSE, Bool_t useTPCpid=kFALSE, Char_t sign=2);
45 
47  virtual void UserCreateOutputObjects();
48  virtual void Init();
49  virtual void LocalInit() {Init();}
50  virtual void UserExec(Option_t *option);
51  virtual void Terminate(Option_t *option);
52 
54  void FillLc2pK0Sspectrum(AliAODRecoCascadeHF *part, Int_t isLc,
55  Int_t &nSelectedAnal, AliRDHFCutsLctoV0 *cutsAnal,
56  TClonesArray *mcArray);
57 
58  void MakeAnalysisForLc2prK0S(TClonesArray *arrayLctopK0S,
59  TClonesArray *mcArray,
60  Int_t &nSelectedAnal, AliRDHFCutsLctoV0 *cutsAnal);
61 
63  void SetMC(Bool_t theMCon) {fUseMCInfo = theMCon;}
64  Bool_t GetMC() const {return fUseMCInfo;}
65 
67  void SetAdditionalChecks(Bool_t additionalChecks) {fAdditionalChecks = additionalChecks;}
68  Bool_t GetAdditionalChecks() const {return fAdditionalChecks;}
69 
70  void FillArmPodDistribution(AliAODRecoDecay *vZero,TString histoTitle, Bool_t isCandidateSelectedCuts, Bool_t isBachelorID);
71 
72  void SetUseOnTheFlyV0(Bool_t a) { fUseOnTheFlyV0=a; }
73  Bool_t GetUseOnTheFlyV0() { return fUseOnTheFlyV0; }
74 
75  Int_t MatchToMClabelC(AliAODRecoCascadeHF *candidate,TClonesArray *mcArray);
76 
77 
78  void SetNRotations(Int_t nRot=9) { fNRotations=nRot; }
79  Int_t GetNRotations() { return fNRotations; }
80 
81  void SetPtMinToFillTheTree(Double_t pTmin= 0.) { fPtMinToFillTheTree=pTmin; }
82  void SetPtMaxToFillTheTree(Double_t pTmax=999.) { fPtMaxToFillTheTree=pTmax; }
85 
86  void SetMinAngleForRot(Double_t min=5.*TMath::Pi()/6.) { fMinAngleForRot=min; }
87  void SetMaxAngleForRot(Double_t max=7.*TMath::Pi()/6.) { fMaxAngleForRot=max; }
88  Double_t GetMinAngleForRot() { return fMinAngleForRot; }
89  Double_t GetMaxAngleForRot() { return fMaxAngleForRot; }
90 
93 
95  void SetSign(Char_t sign) {fSign = sign;}
96  Char_t GetSign() const {return fSign;}
97 
98  private:
99 
100  void CheckEventSelection(AliAODEvent *aodEvent);
101  void CheckEventSelectionWithCandidates(AliAODEvent *aodEvent);
103  void FillTheTree(AliAODRecoCascadeHF *part, AliRDHFCutsLctoV0 *cutsAnal, TClonesArray *mcArray, Int_t isLc);
104  void DefineTreeVariables();
105 
106  Int_t MatchToMC(AliAODRecoCascadeHF *lc2bacV0,
107  Int_t *pdgDgLc2bacV0, Int_t *pdgDgV0,
108  TClonesArray *mcArray);
109 
110  Int_t SearchLcDaughter(TClonesArray *arrayMC, Int_t iii);
111 
113  void DefineK0SHistos();
114  void FillAnalysisHistograms(AliAODRecoCascadeHF *part, AliRDHFCutsLctoV0 *cutsAnal, TString appendthis);
115  void TrackRotation(AliRDHFCutsLctoV0 *cutsAnal, AliAODRecoCascadeHF *part, TString appendthis);
116 
119 
120  Double_t Det(Double_t a00,Double_t a01,
121  Double_t a10,Double_t a11) const;
122  Double_t Det(Double_t a00,Double_t a01,Double_t a02,
123  Double_t a10,Double_t a11,Double_t a12,
124  Double_t a20,Double_t a21,Double_t a22) const;
125  Double_t PropagateToDCA(AliAODv0 *v, AliAODTrack *bachelor, Double_t b,
126  Double_t &xVtxLc, Double_t &yVtxLc, Double_t &zVtxLc,
127  Double_t &pxVtxLc, Double_t &pyVtxLc, Double_t &pzVtxLc);
128 
129  Double_t GetAlpha(Double_t xyz[3],Double_t pxpypz[3]);
130 
131  Int_t SearchForCommonMother(TClonesArray *mcArray,
132  Int_t dgLabels[10],Int_t ndg,
133  Int_t &ndgCk, Int_t *pdgDg, Int_t &labelMother, Int_t &nDauCand) const;
134 
135  Bool_t fUseMCInfo;
136  TList *fOutput;
137  TList *fOutputAll;
138  TList *fOutputPIDBach;
139 
140  TH1F *fCEvents;
143  Bool_t fUseOnTheFlyV0;
145 
147  TTree *fVariablesTree;
149  AliAODVertex *fVtx1;
150  Float_t fBzkG;
152 
153  Bool_t fTrackRotation;
155 
156  Double_t fMinAngleForRot;
157  Double_t fMaxAngleForRot;
158  Double_t fMinMass;
159  Double_t fMaxMass;
160  Int_t fNRotations;
164  Char_t fSign;
165 
167  ClassDef(AliAnalysisTaskSELc2V0bachelor,8);
168 };
170 
171 #endif
172 
Bool_t fIsEventSelected
flag to analyze also on-the-fly V0 candidates
AliAnalysisTaskSELc2V0bachelor & operator=(const AliAnalysisTaskSELc2V0bachelor &source)
void SetAdditionalChecks(Bool_t additionalChecks)
set flag for additional checks
Double_t Det(Double_t a00, Double_t a01, Double_t a10, Double_t a11) const
Bool_t fAdditionalChecks
magnetic field value [kG]
void TrackRotation(AliRDHFCutsLctoV0 *cutsAnal, AliAODRecoCascadeHF *part, TString appendthis)
TTree * fVariablesTree
flag to decide whether to write the candidate variables on a tree variables
void SetPtMaxToFillTheTree(Double_t pTmax=999.)
void SetMC(Bool_t theMCon)
set MC usage
Double_t GetAlpha(Double_t xyz[3], Double_t pxpypz[3])
void SetMinAngleForRot(Double_t min=5.*TMath::Pi()/6.)
void FillTheTree(AliAODRecoCascadeHF *part, AliRDHFCutsLctoV0 *cutsAnal, TClonesArray *mcArray, Int_t isLc)
Int_t SearchForCommonMother(TClonesArray *mcArray, Int_t dgLabels[10], Int_t ndg, Int_t &ndgCk, Int_t *pdgDg, Int_t &labelMother, Int_t &nDauCand) const
Bool_t fWriteVariableTree
flag for event selected
TList * fOutputPIDBachTR
flag to check track rotation
AliNormalizationCounter * fCounter
Histogram to check selected events.
void MakeAnalysisForLc2prK0S(TClonesArray *arrayLctopK0S, TClonesArray *mcArray, Int_t &nSelectedAnal, AliRDHFCutsLctoV0 *cutsAnal)
Int_t MatchToMC(AliAODRecoCascadeHF *lc2bacV0, Int_t *pdgDgLc2bacV0, Int_t *pdgDgV0, TClonesArray *mcArray)
Bool_t fUseOnTheFlyV0
Cuts - sent to output slot 3.
TList * fOutputAll
User output slot 1 // general histos.
TList * fOutputPIDBach
User output slot 4 // histos without pid and cut on V0.
void SetSign(Char_t sign)
set MC usage
Int_t SearchLcDaughter(TClonesArray *arrayMC, Int_t iii)
TH1F * fCEvents
User output slot 5 // histos with PID on Bachelor.
void FillLc2pK0Sspectrum(AliAODRecoCascadeHF *part, Int_t isLc, Int_t &nSelectedAnal, AliRDHFCutsLctoV0 *cutsAnal, TClonesArray *mcArray)
histos
Double_t PropagateToDCA(AliAODv0 *v, AliAODTrack *bachelor, Double_t b, Double_t &xVtxLc, Double_t &yVtxLc, Double_t &zVtxLc, Double_t &pxVtxLc, Double_t &pyVtxLc, Double_t &pzVtxLc)
Int_t MatchToMClabelC(AliAODRecoCascadeHF *candidate, TClonesArray *mcArray)
Bool_t fTrackRotation
flag to fill additional histograms
Float_t * fCandidateVariables
! variables to be written to the tree
AliRDHFCutsLctoV0 * fAnalCuts
AliNormalizationCounter on output slot 2.
void FillArmPodDistribution(AliAODRecoDecay *vZero, TString histoTitle, Bool_t isCandidateSelectedCuts, Bool_t isBachelorID)
void CheckCandidatesAtDifferentLevels(AliAODRecoCascadeHF *part, AliRDHFCutsLctoV0 *cutsAnal)
Double_t fMinAngleForRot
User output slot 6 // histos with PID on Bachelor and track rotation.
void CheckEventSelectionWithCandidates(AliAODEvent *aodEvent)
void FillAnalysisHistograms(AliAODRecoCascadeHF *part, AliRDHFCutsLctoV0 *cutsAnal, TString appendthis)
void SetMaxAngleForRot(Double_t max=7.*TMath::Pi()/6.)
virtual void UserCreateOutputObjects()
Implementation of interface methods.