]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGUD/DIFFRACTIVE/xsAndTwoProng/AliCDMesonUtils.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGUD / DIFFRACTIVE / xsAndTwoProng / AliCDMesonUtils.h
CommitLineData
369562e9 1/*************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15//
16// AliCDMesonUtils
17// for
18// AliAnalysisTaskCDMeson
19//
20//
21// Author:
22// Xianguo Lu <lu@physi.uni-heidelberg.de>
23// continued by
24// Felix Reidt <Felix.Reidt@cern.ch>
25
26#ifndef ALICDMESONUTILS_H
27#define ALICDMESONUTILS_H
28
29#include <THnSparse.h> // forward declaration not possible
30
31
32#define STD_ALIROOT
33// if this is defined the code should run with a standard aliroot
34
35
36class TH1;
37class TH2;
38class TLorentzVector;
39class TParticle;
40class TVector3;
41class TObjArray;
42
43class AliVEvent;
44class AliESDEvent;
45class AliAODEvent;
46class AliESDtrack;
47class AliESDtrackCuts;
48class AliVTrack;
49class AliPIDResponse;
50
51class AliCDMesonTracks;
52
53class AliCDMesonUtils
54{
55public:
56 enum{
57 kInnerPixel = 0,
58 kOuterPixel,
59 kIPA,
60 kIPC,
61 kOPA,
62 kOPC
63 };
64
65 // ESD only
66 //---------
67
68 // cuts for ESD analysis
69 static Bool_t CutEvent(const AliESDEvent *ESDEvent, TH1 *hspd, TH1 *hpriv,
70 TH1* hpriVtxPos, TH1* hpriVtxDist, TH2 *hfo,
71 TH1* hfochans, Int_t &kfo, Int_t &nip, Int_t &nop,
72 TH1* hpriVtxX, TH1* hpriVtxY, TH1* hpriVtxZ);
73
74 // V0-AND/OR
75 static Bool_t V0AND(const AliESDEvent *ESDEvent) {
76 // were both V0 detectors A/C firing?
77 // (4 = AliCDMesonBase::kBinNG)
78 return (GetV0(ESDEvent) == 4);
79 }
80
81 static Bool_t V0OR(const AliESDEvent *ESDEvent) {
82 // did one of the V0 detectors fire?
83 // (1-4 => single or both detectors active)
84 return (GetV0(ESDEvent) > 0);
85 }
86
87 // VZERO study
88 static void DoVZEROStudy(const AliESDEvent *ESDEvent, TObjArray* hists,
34e8fe1d 89 Int_t run);
369562e9 90
91 // gap determination
92 static Int_t GetGapConfig(const AliESDEvent *ESDEvent, TH2 *hitMapSPDinner,
93 TH2 *hitMapSPDouter, TH2 *hitMapSPDtrklt,
94 TH2 *hitMapFMDa, TH2 *hitMapFMDc,
95 TH1 **fmdSums, TH2 *TPCGapDCAaSide,
96 TH2 *TPCGapDCAcSide);
97
98 static Int_t GetFastORmultiplicity(const AliESDEvent *ESDEvent);
99
100 static void GetSPDTrackletMult(const AliESDEvent *ESDEvent, Int_t& sum,
101 Int_t& forwardA, Int_t& forwardC,
102 Int_t& central);
103
34e8fe1d 104 static void SPDLoadGeom(Int_t run); // only needed for ESDs, not in AODs
369562e9 105
106 // functions needed for the empty event study (ESD only)
107 static Int_t GetEventType(const AliESDEvent *ESDEvent);
108 static void GetMultFMD(const AliESDEvent *ESDEvent, Int_t& fmdA,
109 Int_t& fmdC, Float_t *fmdSums);
110 static void GetMultSPD(const AliESDEvent *ESDEvent, Int_t& spdIA,
111 Int_t& spdIC, Int_t& spdOA, Int_t& spdOC);
112
113
114 // AOD only
115 //---------
116 static Bool_t CutEvent(const AliAODEvent *AODEvent, TH1 *hpriv, TH1* hpriVtxX,
117 TH1* hpriVtxY, TH1* hpriVtxZ, TH1* hpriVtxPos,
118 TH1* hpriVtxDist);
119
120
121 // independent
122 //------------
123 static void FillEtaPhiMap(const AliVEvent *event,
124 const AliCDMesonTracks* tracks, TH2 *map,
125 TH2 *map_c);
126 static void SwapTrack(const AliVTrack *trks[]);
127 static Int_t GetCombCh(const AliVTrack *trks[]);
128 static Int_t GetCombPID(AliPIDResponse *pid, const AliVTrack *trks[],
34e8fe1d 129 Int_t mode, TH2 *comb2trkPID = 0x0);
369562e9 130 static Int_t GetCombPID(const TParticle* particles[], TH2 *comb2trkPID = 0x0);
34e8fe1d 131 static void GetMassPtCtsOA(Int_t pid, const TVector3* momenta[],
369562e9 132 Double_t& mass, Double_t& pt, Double_t& cts,
133 Double_t& oa);
34e8fe1d 134 static void GetPWAinfo(Int_t pid, const AliVTrack *trks[],
369562e9 135 Float_t& theta, Float_t& phi, Float_t& mass,
136 Float_t momentum[]);
137 static void FillSPDtrkltMap(const AliVEvent *event, TH2 *hitMapSPDtrklt);
138
139private:
140 // ESD only
141 //---------
142
143 // Gap determination functions
144 static Int_t GetV0(const AliESDEvent *ESDEvent);
145 static Int_t GetFMD(const AliESDEvent *ESDEvent, TH2 *hitMapFMDa,
146 TH2 *hitMapFMDc, TH1** fmdSums);
147 static Int_t GetSPD(const AliESDEvent *ESDEvent, TH2 *hitMapSPDinner,
148 TH2 *hitMapSPDouter, TH2 *hitMapSPDtrklt);
149 static Int_t GetTPC(const AliESDEvent *ESDEvent, TH2 *TPCGapDCAaSide,
150 TH2 *TPCGapDCAcSide);
151 static Int_t GetZDC(const AliESDEvent *ESDEvent); // not used so far
152
153#ifdef STD_ALIROOT
154 // helpers for the FMD gap determination
155 static Int_t FMDHitCombinations(const AliESDEvent* ESDEvent, Int_t side);
156#endif
157
158 // helpers for the SPD gap determination
34e8fe1d 159 static Bool_t SPDLoc2Glo(Int_t id, const Double_t *loc, Double_t *glo);
160 static Int_t CheckChipEta(Int_t chipKey, TString scut,
369562e9 161 const Double_t vtxPos[], TH2 *hitMapSPDinner,
162 TH2 *hitMapSPDouter);
34e8fe1d 163 static void GetNFO(const AliESDEvent *ESDEvent, TString etacut,
369562e9 164 Int_t ctr[], TH2 *hitMapSPDinner, TH2 *hitMapSPDouter);
165
166 // AOD only
167 //---------
168
169
170 // independent
171 //----------
172 static Int_t GetPID(AliPIDResponse *pid, const AliVTrack *trk,
34e8fe1d 173 Int_t mode = 0);
174 static Int_t GetPID(Int_t pdgCode);
369562e9 175 static Int_t CombinePID(const Int_t pid[]);
176
177 static TLorentzVector GetKinematics(const Double_t *pa, const Double_t *pb,
34e8fe1d 178 Double_t ma, Double_t mb,
369562e9 179 Double_t & cts);
180 static Double_t GetOA(const Double_t *pa, const Double_t *pb);
181};
182
183#endif