1 #ifndef ALIANALYSISTASKSELC2V0BACHELOR_H
2 #define ALIANALYSISTASKSELC2V0BACHELOR_H
3 /**************************************************************************
4 * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
6 * Author: The ALICE Off-line Project. *
7 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
23 #include "AliAnalysisTaskSE.h"
24 #include "AliAODEvent.h"
26 #include "AliAODTrack.h"
27 #include "AliRDHFCutsLctoV0.h"
28 #include "AliNormalizationCounter.h"
32 class AliAODRecoCascade;
34 class AliAnalysisTaskSELc2V0bachelor : public AliAnalysisTaskSE
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();
44 // Implementation of interface methods
45 virtual void UserCreateOutputObjects();
47 virtual void LocalInit() {Init();}
48 virtual void UserExec(Option_t *option);
49 virtual void Terminate(Option_t *option);
52 void FillLc2pK0Sspectrum(AliAODRecoCascadeHF *part, Int_t isLc,
53 Int_t &nSelectedAnal, AliRDHFCutsLctoV0 *cutsAnal,
54 TClonesArray *mcArray);
56 void MakeAnalysisForLc2prK0S(TClonesArray *arrayLctopK0S,
57 TClonesArray *mcArray,
58 Int_t &nSelectedAnal, AliRDHFCutsLctoV0 *cutsAnal);
61 void SetMC(Bool_t theMCon) {fUseMCInfo = theMCon;}
62 Bool_t GetMC() const {return fUseMCInfo;}
64 // set flag for additional checks
65 void SetAdditionalChecks(Bool_t additionalChecks) {fAdditionalChecks = additionalChecks;}
66 Bool_t GetAdditionalChecks() const {return fAdditionalChecks;}
68 void FillArmPodDistribution(AliAODv0 *vZero, TString histoTitle, TList *histoList);
70 void SetK0SAnalysis(Bool_t a) {fIsK0SAnalysis=a;}
71 Bool_t GetK0SAnalysis() const {return fIsK0SAnalysis;}
73 void SetUseOnTheFlyV0(Bool_t a) { fUseOnTheFlyV0=a; }
74 Bool_t GetUseOnTheFlyV0() { return fUseOnTheFlyV0; }
76 Int_t MatchToMClabelC(AliAODRecoCascadeHF *candidate,TClonesArray *mcArray);
80 void CheckEventSelection(AliAODEvent *aodEvent);
81 void CheckEventSelectionWithCandidates(AliAODEvent *aodEvent);
82 void CheckCandidatesAtDifferentLevels(AliAODRecoCascadeHF *part,AliRDHFCutsLctoV0* cutsAnal);
83 void FillTheTree(AliAODRecoCascadeHF *part, AliRDHFCutsLctoV0 *cutsAnal, TClonesArray *mcArray, Int_t isLc);
84 void DefineTreeVariables();
86 Int_t MatchToMC(AliAODRecoCascadeHF *lc2bacV0,
87 Int_t *pdgDgLc2bacV0, Int_t *pdgDgV0,
88 TClonesArray *mcArray);
90 Int_t SearchLcDaughter(TClonesArray *arrayMC, Int_t iii);
92 void DefineGeneralHistograms();
93 void DefineAnalysisHistograms();
94 void DefineK0SHistos();
95 void FillAnalysisHistograms(AliAODRecoCascadeHF *part, Bool_t isBachelorID, TString appendthis);
96 void TrackRotation(AliRDHFCutsLctoV0 *cutsAnal, AliAODRecoCascadeHF *part, TString appendthis);
98 AliAnalysisTaskSELc2V0bachelor(const AliAnalysisTaskSELc2V0bachelor &source);
99 AliAnalysisTaskSELc2V0bachelor& operator=(const AliAnalysisTaskSELc2V0bachelor& source);
101 Double_t Det(Double_t a00,Double_t a01,
102 Double_t a10,Double_t a11) const;
103 Double_t Det(Double_t a00,Double_t a01,Double_t a02,
104 Double_t a10,Double_t a11,Double_t a12,
105 Double_t a20,Double_t a21,Double_t a22) const;
106 Double_t PropagateToDCA(AliAODv0 *v, AliAODTrack *bachelor, Double_t b,
107 Double_t &xVtxLc, Double_t &yVtxLc, Double_t &zVtxLc,
108 Double_t &pxVtxLc, Double_t &pyVtxLc, Double_t &pzVtxLc);
110 Double_t GetAlpha(Double_t xyz[3],Double_t pxpypz[3]);
112 Int_t SearchForCommonMother(TClonesArray *mcArray,
113 Int_t dgLabels[10],Int_t ndg,
114 Int_t &ndgCk, Int_t *pdgDg, Int_t &labelMother, Int_t &nDauCand) const;
116 Bool_t fUseMCInfo; // Use MC info
117 TList *fOutput; // User output slot 1 // general histos
118 TList *fOutputAll; // User output slot 4 // histos without pid and cut on V0
119 TList *fOutputPIDBach; // User output slot 5 // histos with PID on Bachelor
121 TH1F *fCEvents; // Histogram to check selected events
122 Bool_t fIsK0SAnalysis; // switch between Lpi and K0Sp
123 AliNormalizationCounter *fCounter; // AliNormalizationCounter on output slot 2
124 AliRDHFCutsLctoV0 *fAnalCuts; // Cuts - sent to output slot 3
125 //TList *fListCuts; // list of cuts
126 Bool_t fUseOnTheFlyV0; // flag to analyze also on-the-fly V0 candidates
127 Bool_t fIsEventSelected; // flag for event selected
129 Bool_t fWriteVariableTree; // flag to decide whether to write the candidate variables on a tree variables
130 TTree *fVariablesTree; //! tree of the candidate variables after track selection on output slot 4
131 Float_t *fCandidateVariables; //! variables to be written to the tree
132 AliAODVertex *fVtx1; // primary vertex
133 Float_t fBzkG; // magnetic field value [kG]
134 Bool_t fAdditionalChecks; // flag to fill additional histograms
136 Bool_t fTrackRotation; // flag to check track rotation
137 TList *fOutputPIDBachTR; // User output slot 6 // histos with PID on Bachelor and track rotation
139 Double_t fMinAngleForRot;//=5*TMath::Pi()/6;
140 Double_t fMaxAngleForRot;//=7*TMath::Pi()/6;
141 Double_t fMinMass;//=mLcPDG-0.250;
142 Double_t fMaxMass;//=mLcPDG+0.250;
143 Int_t fNRotations;//=9;
145 ClassDef(AliAnalysisTaskSELc2V0bachelor,6); // class for Lc->p K0