4 /**************************************************************************
5 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
7 * Author: The ALICE Off-line Project. *
8 * Contributors are mentioned in the code where appropriate. *
10 * Permission to use, copy, modify and distribute this software and its *
11 * documentation strictly for non-commercial purposes is hereby granted *
12 * without fee, provided that the above copyright notice appears in all *
13 * copies and that both the copyright notice and this permission notice *
14 * appear in the supporting documentation. The authors make no claims *
15 * about the suitability of this software for any purpose. It is *
16 * provided "as is" without express or implied warranty. *
17 **************************************************************************/
22 // Secondary vertexing construction Class
23 // Construct secondary vertex from Beauty hadron with electron and
24 // hadrons, then apply selection criteria
28 //#include <TObject.h>
31 #ifndef ROOT_THnSparse
32 #include <THnSparse.h>
44 class AliHFEtrackFilter;
50 //________________________________________________________________
51 class AliHFEsecVtx : public TObject {
55 AliHFEsecVtx(const AliHFEsecVtx &p); // copy constructor
56 AliHFEsecVtx &operator=(const AliHFEsecVtx &); // assignment operator
57 virtual ~AliHFEsecVtx();
59 void CreateHistograms(TList * const qaList);
61 void Process(AliVTrack *track);
63 Bool_t HasMCData() const { return TestBit(kHasMCData); };
64 Bool_t IsAODanalysis() const { return TestBit(kAODanalysis); };
65 Bool_t IsESDanalysis() const { return !TestBit(kAODanalysis); };
67 void SetHasMCData(Bool_t hasMCdata = kTRUE) { SetBit(kHasMCData,hasMCdata); };
68 void SetAODAnalysis() { SetBit(kAODanalysis, kTRUE); };
69 void SetESDAnalysis() { SetBit(kAODanalysis, kFALSE); };
70 void SetEvent(AliESDEvent* const ESD){fESD1=ESD;}; // set ESD pointer
71 void SetEventAOD(AliAODEvent* const AOD){fAOD1=AOD;}; // set ESD pointer
72 void SetMCEvent(AliMCEvent* const mcEvent){fMCEvent=mcEvent;}; // set stack pointer
73 void SetMCArray(TClonesArray* const mcarry){fMCArray=mcarry;} // set mcarray pointer
74 void SetUseMCPID(Bool_t usemcpid){fUseMCPID=usemcpid;};
75 void SetMCQA(AliHFEmcQA * const mcqa){fMCQA=mcqa;}; // set mcqa pointer
78 Int_t GetMCPID(const AliESDtrack *track); // return MC pid
79 Int_t GetMCPDG(const AliVTrack *track); // return MC pid
80 Int_t GetPairOriginESD(AliESDtrack* track1, AliESDtrack* track2); // return pair origin as a pdg code
81 Int_t GetPairOriginAOD(AliAODTrack* track1, AliAODTrack* track2); // return pair origin as a pdg code
82 Int_t GetPairCode(const AliVTrack* const track1, const AliVTrack* const track2); // return corresponding pair code to pdg code
83 Int_t GetElectronSource(Int_t mclabel); // return origin of the electron
84 Int_t GetPDG(AliVTrack *track); // return pdg
85 void GetESDPID(AliESDtrack *track, Int_t &recpid, Double_t &recprob); //return esd pid likelihood
86 void GetPrimaryCondition();
87 void RecalcPrimvtx(Int_t nkftrk, const Int_t * const, const AliKFParticle * const); //recalculate primary vertex
89 TClonesArray *HFEpairs();
90 TClonesArray *HFEsecvtxs();
92 void AddHFEpairToArray(const AliHFEpairs* const pair);
93 void AddHFEsecvtxToArray(const AliHFEsecVtxs* const secvtx);
96 void InitHFEsecvtxs();
98 void DeleteHFEpairs();
99 void DeleteHFEsecvtxs();
101 void PairAnalysis(AliVTrack* ESDtrack1, AliVTrack* ESDtrack2, Int_t index2); // do e-h analysis
102 void RunSECVTX(AliVTrack *track); // run secondary vertexing algorithm
104 void MakeContainer(); // make containers
105 void MakeHistos(Int_t step); // make histograms for different steps
106 void FillHistos(Int_t step, const AliESDtrack *track); // fill histograms for different steps
110 void FindSECVTXCandid(AliVTrack *track);
111 void CalcSECVTXProperty(AliVTrack* track1, AliVTrack* track2, AliVTrack* track3); // calculated distinctive variables
112 void CalcSECVTXProperty(AliVTrack* track1, AliVTrack* track2, AliVTrack* track3, AliVTrack* track4); // calculated distinctive variables
114 void Fill4TrkSECVTX(AliVTrack* track, Int_t ipair, Int_t jpair, Int_t kpair);
115 void Fill3TrkSECVTX(AliVTrack* track, Int_t ipair, Int_t jpair);
116 void Fill2TrkSECVTX(AliVTrack* track, AliHFEpairs *pair);
120 kHasMCData = BIT(15), // bitset for mc data usage
121 kAODanalysis = BIT(16) // bitset for aod analysis
123 enum {kAll, kDirectCharm, kDirectBeauty, kBeautyCharm, kGamma, kPi0, kElse, kBeautyGamma, kBeautyPi0, kBeautyElse, kMisID}; // electron origin
124 enum {kCharm=4, kBeauty=5}; // quark flavor
126 AliHFEtrackFilter *fFilter; // filter Tracks to combine the signal track with
127 AliESDEvent* fESD1; // ESD pointer
128 AliAODEvent* fAOD1; // AOD pointer
129 AliMCEvent* fMCEvent; // MCEvent pointer
131 AliHFEmcQA* fMCQA; // mcqa pointer
133 Bool_t fUseMCPID; // if use MC pid
135 TString fkSourceLabel[10]; // electron source label
137 Int_t fNparents; // number of heavy hadrons to be considered
138 Int_t fParentSelect[2][7]; // heavy hadron species
139 Double_t fPtRng[7]; // pt ranges to consider pt dependant dca cut
140 Double_t fDcaCut[6]; // pt dependant dca cut
142 Int_t fNoOfHFEpairs; // number of e-h pairs
143 Int_t fNoOfHFEsecvtxs; // number of secondary vertexes
144 Int_t fArethereSecVtx; // checker
146 TClonesArray *fHFEpairs; //! Array of pair
147 TClonesArray *fHFEsecvtxs; //! Array of secondary vertexes
148 TClonesArray *fMCArray; //! mc array pointer
150 Double_t fPVx; // primary vertex copy x
151 Double_t fPVy; // primary vertex copy y
152 Double_t fPVx2; // recalculated primary vertex x
153 Double_t fPVy2; // recalculated primary vertex y
154 Double_t fCosPhi; // cos of opening angle of two pair vertex
155 Double_t fSignedLxy; // signed Lxy of secondary vertex
156 Double_t fSignedLxy2; // signed Lxy of secondary vertex based on recalculated primary vertex
157 Double_t fKFchi2; // chi2 of secondary vertex
158 Double_t fInvmass; // invariant mass of secondary vertex
159 Double_t fInvmassSigma; // invariant mass sigma of secondary vertex
160 Double_t fKFip; // impact parameter of secondary vertex track
161 Double_t fKFip2; // impact parameter of secondary vertex track based on recalculated primary vertex
163 Int_t fNsectrk2prim; // # of secvtx tracks contributing to primvtx calculation
165 Double_t fVtxchi2Tightcut; // pair vertex chi2 cut
166 Double_t fVtxchi2Loosecut; // secvtx vertex chi2 cut
168 THnSparseF *fPairQA; // qa histos for pair analysis
169 THnSparseF *fSecvtxQA; // qa histos for secvtx
170 TList *fSecVtxList; // list for secondary vertexing outputs
172 ClassDef(AliHFEsecVtx,0);