]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGUD/DIFFRACTIVE/xsAndTwoProng/AliAnalysisTaskCDMeson.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGUD / DIFFRACTIVE / xsAndTwoProng / AliAnalysisTaskCDMeson.h
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 // Select events according to gap conditions, analyze two track events in pp
17 // collisions
18 //
19 // Author:
20 //  Xianguo Lu <lu@physi.uni-heidelberg.de>
21 //  continued by
22 //  Felix Reidt <Felix.Reidt@cern.ch>
23
24 #ifndef ALIANALYSISTASKCDMESON_H
25 #define ALIANALYSISTASKCDMESON_H
26
27 #ifndef ALIANALYSISTASK_H
28 #include "AliAnalysisTaskSE.h"
29 #endif
30
31 #include "THnSparse.h" // forward declaration is not possible
32
33 class AliESDEvent;
34 class AliVTrack;
35 class AliPIDResponse;
36 class AliPhysicsSelection;
37
38 class TH1I;
39 class TH1F;
40 class TH2I;
41 class TH2F;
42 class TH2D;
43 class TList;
44 class TParticle;
45 class THnSparse;
46 class TObjString;
47 class TObjArray;
48
49 class AliCDMesonTracks;
50
51 class AliAnalysisTaskCDMeson : public AliAnalysisTaskSE
52 {
53 public:
54         AliAnalysisTaskCDMeson(const char* name, Long_t state = 0x0);
55         AliAnalysisTaskCDMeson();
56         virtual ~AliAnalysisTaskCDMeson();
57
58         virtual void UserCreateOutputObjects();
59         virtual void UserExec(Option_t *);
60
61 private:
62         enum { //
63                 kV0 = 0,
64                 kFMD,
65                 kSPD,
66                 kTPC,
67                 kV0FMD,
68                 kV0FMDSPD,
69                 kV0FMDSPDTPC,
70                 kTPCSPD,
71                 kTPCSPDFMD,
72                 kTPCSPDFMDV0,
73                 kSPDFMD,
74                 kSPDFMDV0,
75                 kMax
76         };
77
78         AliAnalysisTaskCDMeson(const AliAnalysisTaskCDMeson  &p);
79         AliAnalysisTaskCDMeson& operator=(const AliAnalysisTaskCDMeson  &p);
80
81         void FillEtaPhiMaps() const; // controls which event contributes to which map
82
83
84         // functions called by the UserExec(...), not to be called elsewhere!
85         //-------------------------------------------------------------------
86         Bool_t CheckInput();
87         void PostOutputs(); // cares about posting the output before exiting UserExec,
88         // WARNING: PostOutputs should only be used directly in the UserExec!!
89         void DoEmptyEventStudy(); // does the empty event study
90         Bool_t DetermineGap(); // determines the gap of all available detectors
91         void AnalyzeVtx(); // calcs the distance of the pri. vertex from tracks and SPD
92         void DoMultiplicityStudy(Int_t nMCprimaries);
93         // compares ITSTPC and ITSTPC+soft distribution and the multiplicity response
94         void DoTrackPair(Bool_t soft = kFALSE);
95         // analyses track pairs and prepares THnMother(Soft) input
96         Int_t DoMCTruth(); // analyses the MCtruth for corrections, returns #Primaries
97         void DoMCTrackPair(TParticle* particles[], Int_t gapCond, Int_t multiplicity);
98         // analyzes track pairs in MC truth
99         void DetermineMCprocessType(); // determines the MC process ID
100
101         // functions called by the DoTrackPair(...), not to be called elsewhere!
102         // ---------------------------------------------------------------------
103         Int_t DoPID(Int_t combCh); //retrieves the PID information for the current two
104         void FillMChists(Int_t combCh); //fills the MC histograms for two track events
105
106         // analysis task status
107         //---------------------
108         Bool_t fDoAOD; // true for running on AODs
109         Long_t fAnalysisStatus; // stores the status bits used to distinguish
110         // which histograms should be generated
111         TObjString *fAnalysisStatusString; // to be stored in the output list
112         Double_t fNoGapFraction; // fraction of no-gap events to be processed only
113                                  // used in case of ESD input
114         Double_t fReducedGapFraction; // fraction of events stored altough they
115                                       // show only the requested and not the refined
116                                       // gap
117         Double_t fMaxVtxDst; // maximum distance of the track and SPD vertex
118
119         // event information
120         //------------------
121         AliESDEvent *fESDEvent; // esd event object
122         AliAODEvent *fAODEvent; // esd event object
123         AliPIDResponse *fPIDResponse; // esd pid object
124         AliPhysicsSelection *fPhysicsSelection; // physics selection object
125         AliCDMesonTracks *fTracks; // object taking care about the track cuts
126         Double_t fVtxDst; // distance of the primary vertex from tracks and from SPD
127         Double_t fVtxZ; // z-position of the primary vertex from tracks
128         Int_t fResidualTracks; // tracks rejected by cuts within the event
129         Int_t fResidualTracklets; // SPD tracklets not assigned to tracks
130         Int_t fMCprocessType; // MC process type, 0 for data
131         Int_t fMCprocess; // detailed MC sub process information
132
133         // information about the trackpair which is currently processed
134         AliVTrack* fTrkPair[2]; // track objects
135
136         Int_t fRun; // number of the run which is about to be processed
137         Int_t fPIDmode; // selects set of PID cuts, 0 for 3sigma standard cuts,
138         //1 for LHC11f
139
140         // information stored for the PWA (addresses needed for the tree)
141         Float_t fTheta; // theta angle in the helicity frame
142         Float_t fPhi; // phi angle in the helicity frame
143         Float_t fMass; // mass of the two track system
144         Float_t fMomentum[3]; // momentum of the two track system
145         Int_t fCurrentGapCondition; // gap condition of the current event
146         Int_t fGapInformationWCent[kMax]; // gap condition for different detectors
147                                           // individually and their combinations
148                                           // requiring central act. from SPD FastOR
149         Int_t fGapInformation[kMax]; // same as above, without the requirement
150                                      // on central activity
151
152         // output objects
153         //---------------
154         THnSparseI *fGapRun; //contains the gap information of the different detectors
155         // per run (x-axis: run number, y-axis gap-state (bit encoded)
156
157         TList *fHist; // output list (contains all histograms)
158         THnSparseD *fThnMother; // THnSparse for mother pt and mass
159         THnSparseD *fThnMotherSoft; // same as above, using soft tracks as well
160         THnSparseD *fThnMultiplicity; // ThnSparse for multiplicity studies
161         THnSparseD *fThnMC; // THnSparse for MC mother pt and mass
162
163         THnSparseD *fThnEmptyEvents; // THnSparse used to analyse empty events
164         TTree *fPWAtree; // Tree containing information needed for PWA
165
166         // Multiplicity distributions for the different gap conditions
167         TH2D *fv0ntrk; //v0bit vs. nch
168         TH2D *fv0fmdntrk; //v0fmdbit vs. nch
169         TH2D *fv0fmdspdntrk; //v0fmdspdbit vs. nch
170         TH2D *fv0fmdspdtpcntrk; //v0fmdspdtpcbit vs. nch
171
172         // How many tracks are removed by the current cuts
173         TH2F *fv0Rmntrk; // V0 gap events vs. of removed tracks
174         TH2F *fv0fmdRmntrk; // V0-FMD gap events vs. of removed tracks
175         TH2F *fv0fmdspdRmntrk; // V0-FMD-SPD gap events vs. of removed tracks
176         TH2F *fv0fmdspdtpcRmntrk; // V0-FMD-SPD-TPC gap events vs. of removed tracks
177
178         TH2F *fMultStudy; // multiplicity after standard cuts and soft cuts vs. mult
179         TH2F *fMultStudyV0dg; // same for with events V0 Double-Gap
180         TH2F *fMultStudyV0FMDdg; // same for events with V0-FMD DG
181         TH2F *fMultStudyV0FMDSPDdg; // same for events with V0-FMD-SPD DG
182         TH2F *fMultStudyV0FMDSPDTPCdg; // same for events with V0-FMD-SPD-TPC DG
183
184         TH2F *fMultResponseMC; // multiplicity response MC to reconstruction
185         TH2F *fMultResponseV0dgMC; // same for events with V0 double gap
186         TH2F *fMultResponseV0FMDdgMC; // with V0-FMD DG
187         TH2F *fMultResponseV0FMDSPDdgMC; // with V0-FMD-SPD DG
188         TH2F *fMultResponseV0FMDSPDTPCdgMC; // with V0-FMD-SPD-TPC DG
189
190         TH2F *fMultRegionsMC; // multiplicity in the 3 regions of interest
191
192         TH1I *fhspdV0dg; // FastOR multiplicity in SPD FastOR with V0 double gap
193         TH1I *fhspdV0FMDdg; // with V0-FMD double gap
194         TH1I *fhspdV0FMDSPDdg; // with V0-FMD-SPD double gap
195         TH1I *fhspdV0FMDSPDTPCdg; // with V0-FMD-SPD double gap
196         TH1I *fhspdAfterCuts; // fast OR multiplicity after the event (vertex) cuts
197
198         TH1I *fGapResponseMCv0Dg; // gap status from MC and reconstruction for V0
199         TH1I *fGapResponseMCv0fmdDg; // for V0-FMD
200         TH1I *fGapResponseMCv0fmdspdDg; // for V0-FMD-SPD
201         TH1I *fGapResponseMCv0fmdspdtpcDg; // for V0-FMD-SPD-TPC
202
203         // Statistics flow diagrams
204         TH1I *fhspd; // distribution of fastOR-multiplicity
205         //SPD fastOR offline esdEvent->GetMultiplicity->TestFastOrFiredChips()
206         TH2I *fhfo; // histogram containing the SPD FastOR information ??
207         TH1I *fhpriVtxDist; // primary vertex distribution
208         TH1I *fhpriVtxPos; // position of the primary vertex (0 within range, 1 else)
209         TH1I *fhpriv; //primary vertex cut effect
210         TH1I *fhntrk; //n-trk-after-cut effect w/o requiring a gap-condition
211         TH1F *fhStatsFlow; // stepwise statistics flow
212         TH1F *fhFOchans; // hits in the different fastOR channels
213
214         TObjArray* fVZEROhists; // histograms for the VZERO trigger study
215
216         // eta-phi maps containing the ESDtracks
217         TH2F *fv0Map; // V0 gap events
218         TH2F *fv0fmdMap; // V0-FMD gap events
219         TH2F *fv0fmdspdMap; // V0-FMD-SPD gap events
220         TH2F *fv0fmdspdtpcMap; // V0-FMD-SPD-TPC gap events
221
222         // eta-phi maps containing the ESDtracks after the track cut
223         TH2F *fv0MapCutted; // V0 gap events
224         TH2F *fv0fmdMapCutted; // V0-FMD gap events
225         TH2F *fv0fmdspdMapCutted; // V0-FMD-SPD gap events
226         TH2F *fv0fmdspdtpcMapCutted; // V0-FMD-SPD-TPC gap events
227
228         TH2F *fHitMapSPDinner; // eta-phi map containing SPD FastOR hits (inner layer)
229         TH2F *fHitMapSPDouter; // eta-phi map containing SPD FastOR hits (outer layer)
230         TH2F *fHitMapSPDtrklt; // eta-phi map containing SPD hits based on tracklets
231         TH2F *fHitMapFMDa; // eta-phi-multiplicity map containing FMD hits at A side
232         TH2F *fHitMapFMDc; // eta-phi-multiplicity map containing FMD hits at C side
233
234         // Summed FMD
235         TH1F *fFMDsum1I; // FMD 1
236         TH1F *fFMDsum2I; // FMD 2 inner ring
237         TH1F *fFMDsum2O; // FMD 2 outer ring
238         TH1F *fFMDsum3I; // FMD 3 inner ring
239         TH1F *fFMDsum3O; // FMD 3 outer ring
240
241         // Vertex
242         TH1I *fPriVtxX; // x distribution of the primary vertex
243         TH1I *fPriVtxY; // y distribution of the primary vertex
244         TH1I *fPriVtxZ; // z distribution of the primary vertex
245         TH1I *fPriVtxDst; // distance distribution of the pri. vtx from SPD and tracks
246         TH1I *fPriVtxDstV0dg; // with V0 DG
247         TH1I *fPriVtxDstV0FMDdg; // with V0 FMD DG
248         TH1I *fPriVtxDstV0FMDSPDdg; // with V0 FMD SPD DG
249         TH1I *fPriVtxDstV0FMDSPDTPCdg; //  with V0 FMD SPD TPC DG
250
251         // TPC Gap
252         TH2F *fTPCGapDCAaSide; // dca distribution for tracks destroying the TPC gap
253         TH2F *fTPCGapDCAcSide; // for V0-FMD-SPD gap events on A and C side
254
255         // PID
256         // All events but double gap events
257         TH2F *fComb2trkPIDuls; // PID matrix on unlike-sign two particles events
258         TH2F *fComb2trkPIDls; // PID matrix on like-sign about two particles
259         // Full-gap events (V0-FMD-SPD-TPC)
260         TH2F *fComb2trkPIDulsDG; // PID matrix on unlike-sign two particles events
261         TH2F *fComb2trkPIDlsDG; // PID matrix on like-sign about two particles
262         // 'PID' in MC
263         // All events but double gap events
264         TH2F *fComb2trkPIDulsMC; // PID matrix on unlike-sign two particles events
265         TH2F *fComb2trkPIDlsMC; // PID matrix on like-sign about two particles
266         // Full-gap events (V0-FMD-SPD-TPC)
267         TH2F *fComb2trkPIDulsDGmc; // PID matrix on unlike-sign two particles events
268         TH2F *fComb2trkPIDlsDGmc; // PID matrix on like-sign about two particles
269
270         // MC Process
271         TH2F *fMCProcessUls; // Process fulfilling a gap condition with two
272         // unlike-sign particles
273         TH2F *fMCProcessLs; // same for like-sign particles
274
275         TH1F *fMAllTrackMass; // histogram for the invariant mass dist. of all tracks
276
277         ClassDef(AliAnalysisTaskCDMeson, 1);
278 };
279
280
281 #endif