AliPhysics  64f4410 (64f4410)
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 #include "TVector.h"
23 
24 #include "AliAnalysisTaskSE.h"
25 #include "AliAODEvent.h"
26 #include "AliPID.h"
27 #include "AliAODTrack.h"
28 #include "AliRDHFCutsLctoV0.h"
30 #include <vector>
31 
33 
34 class TH1F;
35 class TClonesArray;
36 class AliAODRecoCascade;
37 
39 {
40 
41  public:
42 
45  Bool_t useOnTheFly=kFALSE, Bool_t writeVariableTree=kTRUE, Bool_t additionalChecks=kFALSE, Bool_t trackRotation=kFALSE, Bool_t useTPCpid=kFALSE, Char_t sign=2, Bool_t checkOrigin=kFALSE);
47 
49  virtual void UserCreateOutputObjects();
50  virtual void Init();
51  virtual void LocalInit() {Init();}
52  virtual void UserExec(Option_t *option);
53  virtual void Terminate(Option_t *option);
54 
57  Int_t &nSelectedAnal, AliRDHFCutsLctoV0 *cutsAnal,
58  TClonesArray *mcArray, Int_t originLc);
59 
60  void MakeAnalysisForLc2prK0S(AliAODEvent* aodEvent,TClonesArray *arrayLctopK0S,
61  TClonesArray *mcArray,
62  Int_t &nSelectedAnal, AliRDHFCutsLctoV0 *cutsAnal);
63 
64  void MakeSingleAnalysisForSystK0SP(AliAODEvent* aodEvent,TClonesArray *mcArray,
65  AliRDHFCutsLctoV0 *cutsAnal);
66 
68  Int_t GetPoolIndex(Double_t zvert, Double_t mult);
69  void DoEventMixing(AliAODEvent* aodEvent,TClonesArray *mcArray, AliRDHFCutsLctoV0 *cutsAnal);
70  void FillMixedBackground(std::vector<TVector * > mixTypePVars, AliAODEvent *aod, AliRDHFCutsLctoV0 *cutsAnal);
71  void DoRotationFromTrack(AliAODEvent* aodEvent,TClonesArray *mcArray, AliRDHFCutsLctoV0 *cutsAnal);
72 
74  void SetMC(Bool_t theMCon) {fUseMCInfo = theMCon;}
75  Bool_t GetMC() const {return fUseMCInfo;}
76 
78  void SetAdditionalChecks(Bool_t additionalChecks) {fAdditionalChecks = additionalChecks;}
80 
81  void SetFillSubSampleHist(Bool_t subChecks) {fFillSubSampleHist = subChecks;}
83 
84  void FillArmPodDistribution(AliAODRecoDecay *vZero,TString histoTitle, Bool_t isCandidateSelectedCuts, Bool_t isBachelorID);
85 
88 
89  Int_t MatchToMClabelC(AliAODRecoCascadeHF *candidate,TClonesArray *mcArray);
90 
91 
92  void SetNRotations(Int_t nRot=9) { fNRotations=nRot; }
94 
99 
100  void SetMinAngleForRot(Double_t min=5.*TMath::Pi()/6.) { fMinAngleForRot=min; }
101  void SetMaxAngleForRot(Double_t max=7.*TMath::Pi()/6.) { fMaxAngleForRot=max; }
104 
107 
109  void SetSign(Char_t sign) {fSign = sign;}
110  Char_t GetSign() const {return fSign;}
111 
112  void SetCheckOrigin(Bool_t origin) {fCheckOrigin = origin;}
114 
115 
116  void ReconstructSecVtx(Bool_t dummy=kTRUE) {fReconstructSecVtx=dummy;}
118 
121 
123 
124  private:
125 
126  void CheckEventSelection(AliAODEvent *aodEvent);
129  void FillTheTree(AliAODRecoCascadeHF *part, AliRDHFCutsLctoV0 *cutsAnal, TClonesArray *mcArray, Int_t isLc, Int_t originLc);
130  void DefineTreeVariables();
131 
133  Int_t *pdgDgLc2bacV0, Int_t *pdgDgV0,
134  TClonesArray *mcArray);
135 
136  Int_t SearchLcDaughter(TClonesArray *arrayMC, Int_t iii);
137 
139  void DefineK0SHistos();
141  void FillAnalysisHistograms(AliAODRecoCascadeHF *part, AliRDHFCutsLctoV0 *cutsAnal, TString appendthis);
142  void TrackRotation(AliRDHFCutsLctoV0 *cutsAnal, AliAODRecoCascadeHF *part, TString appendthis);
143 
146 
147  Double_t Det(Double_t a00,Double_t a01,
148  Double_t a10,Double_t a11) const;
149  Double_t Det(Double_t a00,Double_t a01,Double_t a02,
150  Double_t a10,Double_t a11,Double_t a12,
151  Double_t a20,Double_t a21,Double_t a22) const;
152  Double_t PropagateToDCA(AliAODv0 *v, AliAODTrack *bachelor, Double_t b,
153  Double_t &xVtxLc, Double_t &yVtxLc, Double_t &zVtxLc,
154  Double_t &pxVtxLc, Double_t &pyVtxLc, Double_t &pzVtxLc);
155 
156  Double_t GetAlpha(Double_t xyz[3],Double_t pxpypz[3]);
157 
158  Int_t SearchForCommonMother(TClonesArray *mcArray,
159  Int_t dgLabels[10],Int_t ndg,
160  Int_t &ndgCk, Int_t *pdgDg, Int_t &labelMother, Int_t &nDauCand) const;
161 
166 
167  TH1F *fCEvents;
174 
178  AliAODVertex *fVtx1;
182 
185 
197 
199 
200  // Mixed event (track level)
204  Double_t fZvtxBins[100]; // [fNzVtxBinsDim]
206  Double_t fCentBins[100]; // [fNCentBinsDim]
209  std::vector<Int_t> fNextResVec;
210  std::vector<Bool_t> fReservoirsReady;
211  std::vector<std::vector< std::vector< TVector * > > > fReservoirP;
212 
214  ClassDef(AliAnalysisTaskSELc2V0bachelor,14);
215 };
217 
218 #endif
219 
void FillTheTree(AliAODRecoCascadeHF *part, AliRDHFCutsLctoV0 *cutsAnal, TClonesArray *mcArray, Int_t isLc, Int_t originLc)
Bool_t fIsEventSelected
flag to activate protection against AOD-dAOD mismatch.
AliAnalysisTaskSELc2V0bachelor & operator=(const AliAnalysisTaskSELc2V0bachelor &source)
double Double_t
Definition: External.C:58
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)
void FillLc2pK0Sspectrum(AliAODRecoCascadeHF *part, Int_t isLc, Int_t &nSelectedAnal, AliRDHFCutsLctoV0 *cutsAnal, TClonesArray *mcArray, Int_t originLc)
histos
TTree * fVariablesTree
flag to decide whether to write the candidate variables on a tree variables
void SetPtMaxToFillTheTree(Double_t pTmax=999.)
char Char_t
Definition: External.C:18
void MakeSingleAnalysisForSystK0SP(AliAODEvent *aodEvent, TClonesArray *mcArray, AliRDHFCutsLctoV0 *cutsAnal)
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.)
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
void FillMixedBackground(std::vector< TVector * > mixTypePVars, AliAODEvent *aod, AliRDHFCutsLctoV0 *cutsAnal)
AliNormalizationCounter * fCounter
Event counter for sub sample test.
void DoRotationFromTrack(AliAODEvent *aodEvent, TClonesArray *mcArray, AliRDHFCutsLctoV0 *cutsAnal)
Int_t fGenerateBGEventFromTracks
Analyze p,K,D for syst (0:off, 1:on, 2:only single ana)
Double_t fCentBins[100]
number of centrality bins
std::vector< Bool_t > fReservoirsReady
! Vector storing if the reservoirs are ready
int Int_t
Definition: External.C:63
Int_t MatchToMC(AliAODRecoCascadeHF *lc2bacV0, Int_t *pdgDgLc2bacV0, Int_t *pdgDgV0, TClonesArray *mcArray)
Bool_t fUseOnTheFlyV0
Cuts - sent to output slot 3.
float Float_t
Definition: External.C:68
TList * fOutputAll
User output slot 1 // general histos.
Int_t fNzVtxBins
maximum number of events to be used in event mixing
Int_t fEventCounter
Histogram to check selected events.
TList * fOutputPIDBach
User output slot 4 // histos without pid and cut on V0.
Bool_t fFillSubSampleHist
flag to fill additional histograms
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.
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)
std::vector< Int_t > fNextResVec
pool index
Int_t MatchToMClabelC(AliAODRecoCascadeHF *candidate, TClonesArray *mcArray)
Bool_t fTrackRotation
flag to fill subsample histograms
void MakeAnalysisForLc2prK0S(AliAODEvent *aodEvent, TClonesArray *arrayLctopK0S, TClonesArray *mcArray, Int_t &nSelectedAnal, AliRDHFCutsLctoV0 *cutsAnal)
Float_t * fCandidateVariables
! variables to be written to the tree
Int_t fNumberOfEventsForMixing
flag for (1) event mixing or (2) track rotation from tracks
Double_t fZvtxBins[100]
number of z vrtx bins
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)
Int_t GetPoolIndex(Double_t zvert, Double_t mult)
Double_t fMinAngleForRot
User output slot 6 // histos with PID on Bachelor and track rotation.
const char Option_t
Definition: External.C:48
void CheckEventSelectionWithCandidates(AliAODEvent *aodEvent)
bool Bool_t
Definition: External.C:53
std::vector< std::vector< std::vector< TVector * > > > fReservoirP
! reservoir
void DoEventMixing(AliAODEvent *aodEvent, TClonesArray *mcArray, AliRDHFCutsLctoV0 *cutsAnal)
void FillAnalysisHistograms(AliAODRecoCascadeHF *part, AliRDHFCutsLctoV0 *cutsAnal, TString appendthis)
void SetMaxAngleForRot(Double_t max=7.*TMath::Pi()/6.)
Int_t fAODProtection
flag to analyze also on-the-fly V0 candidates
virtual void UserCreateOutputObjects()
Implementation of interface methods.