]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGUD/DIFFRACTIVE/xsAndTwoProng/AliCDMesonBase.h
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGUD / DIFFRACTIVE / xsAndTwoProng / AliCDMesonBase.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 // AliCDMesonBase
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 ALICDMESONBASE_H
27 #define ALICDMESONBASE_H
28
29 #include "THnSparse.h"
30
31 class TH2;
32 class TH2F;
33 class TH1F;
34 class TList;
35 class TObjArray;
36
37 class AliCDMesonBase
38 {
39 public:
40         enum{
41                 // combined charged
42                 kBinPM = 1, // unlike-sign
43                 kBinPPMM, // like-sign
44
45                 // pid results (used for single particles and pairs)
46                 kBinPionE = 1, // pions with exclusion cut
47                 kBinPion, // pions without exclusion cut but TPC and TOF
48                 kBinSinglePion, // one pion identified, the other particle unidentified
49                 kBinKaonE, // same for kaons ...
50                 kBinKaon,
51                 kBinSingleKaon,
52                 kBinProtonE, // protons
53                 kBinProton,
54                 kBinSingleProton,
55                 kBinElectronE, // and electrons
56                 kBinElectron,
57                 kBinSingleElectron,
58                 kBinPIDUnknown, // could not be identified
59
60                 // gap Conditions
61                 kBinDG = 1, // double gap
62                 kBinGC, // single gap c side
63                 kBinGA, // single gap a side
64                 kBinNG, // no gap
65
66
67                 // event types used for the empty event studies
68                 kBinEventI = 1, // Beam-Beam Interaction
69                 kBinEventA, // Beam from A-side
70                 kBinEventC, // Beam from C-side
71                 kBinEventAC, // Beam from one side (there is no separation in 2011)
72                 kBinEventE, // no beam (empty event)
73                 kBinEventUnknown,
74
75                 // StatsFlow histogram entries
76                 // names for the bins are specified in the .cxx-file
77                 kBinTotalInput = 0,
78                 kBinGoodInput,
79                 kBinV0OR,
80                 kBinV0AND,
81                 kBinEventsAfterCuts,
82                 kBinEventsWithOutPileUp,
83                 kBinv0Gap,
84                 kBinv0fmdGap,
85                 kBinv0fmdspdGap,
86                 kBinv0fmdspdtpcGap,
87                 kBinv0fmdspdtpczdcGap,
88                 kBinfmdGap,
89                 kBinspdGap,
90                 kBintpcGap,
91                 kBintpcspdGap,
92                 kBintpcspdfmdGap,
93                 kBintpcspdfmdv0Gap,
94                 kBinspdfmdGap,
95                 kBinspdfmdv0Gap,
96                 kBinTwoTrackEvents,
97                 kBinThreeTrackEvents,
98                 kBinPionEvents,
99                 kBinKaonEvents,
100                 kBinProtonEvents,
101                 kBinElectronEvents,
102                 kBinUnknownPIDEvents,
103                 kBinResidualTracks,
104                 kBinResidualTracklets,
105                 kBinCDonlyEvents,
106                 kBinLastValue, // used to specify the correct histogram width
107
108
109                 // MC event/process types
110                 kBinND = 0, // used for data as well, "Non-Diffractive"
111                 kBinCD, // central diffractive
112                 kBinSD, // single diffractive
113                 kBinDD, // double diffractive
114
115
116                 // gap-condition bits used in AliAnalysisTaskCDMeson::fGapRun
117                 kBitBaseLine = (1<<0),
118
119                 kBitV0A  = (1<<1),
120                 kBitV0C  = (1<<2),
121                 kBitFMDA = (1<<3),
122                 kBitFMDC = (1<<4),
123
124                 kBitSPDA = (1<<5),
125                 kBitSPDC = (1<<6),
126                 kBitTPCA = (1<<7),
127                 kBitTPCC = (1<<8),
128
129                 kBitZDCA   = (1<<9),
130                 kBitZDCC   = (1<<10),
131                 kBitCentAct = (1<<11),
132                 kBitGapMax = (1<<12),
133
134
135                 // analysis task status bits
136                 // do not change the order in order to be backward compatible!
137                 kBitConfigurationSet = (1<<0), // if not set everything is active
138                 kBitImposeZDCGap = (1<<1), // excluding the ZDC gap
139                 kBitEtaPhiMaps = (1<<2),
140                 kBitEtaPhiMapsWithCuts = (1<<3),
141                 kBitStatsFlow = (1<<4),
142                 kBitMultPerGapHists = (1<<5),
143                 kBitRmMultPerGapHists = (1<<6),
144                 kBitTHnMother = (1<<7),
145                 kBitFastORStudy = (1<<8), // also not active by default
146                 kBitHitMapSPD = (1<<9),
147                 kBitHitMapFMD = (1<<10),
148                 kBitVtxStudies = (1<<11),
149                 kBitEEStudy = (1<<12),
150                 kBitPIDStudy = (1<<13),
151                 kBitMCProcess = (1<<14),
152                 kBitFMDsum = (1<<15),
153                 kBitSoftTracks = (1<<16),
154                 kBitPWAtree = (1<<17),
155                 kBitTHnMC = (1<<18),
156                 kBitMultResponseMC = (1<<19),
157                 kBitMultStudy = (1<<20),
158                 kBitReadPreprocessedGap = (1<<21), // not active by default as well
159                 kBitReduceGapEvents = (1<<22),
160                 kBitVZEROStudy = (1<<23),
161                 kBitTPCGapStudy = (1<<24),
162                 kBitAllTrackMass = (1<<25),
163                 kBitCDonly = (1<<26),
164                 kBitFastORmultStudy = (1<<27),
165                 kBitConfigurationVersion = (1<<28) // always set, last bit
166         };
167
168         static Int_t GetGapBin(TString tag, Int_t gapcg,
169                                Bool_t checkCentralActivity = kTRUE);
170
171         static THnSparseD* GetThnMother(TString name = "CDMeson_Mother");
172         static void FillThnMother(THnSparseD *thn, Double_t vNch,
173                                   Double_t vCombCh, Double_t vCombPID,
174                                   Double_t vV0, Double_t vFMD,
175                                   Double_t vSPD, Double_t vTPC,
176                                   Double_t vMass, Double_t vPt,
177                                   Double_t vOA, Double_t vCTS,
178                                   Double_t vDaughterPt,
179                                   Double_t vTrackResiduals,
180                                   Double_t vVertexZ,
181                                   Double_t vProcessType,
182                                   Double_t vVertexCoincidence,
183                                   Double_t vTrkltResiduals);
184         static Int_t GetAxisMother(TString name);
185
186         static THnSparseD* GetThnEmptyEvents();
187         static void FillThnEmptyEvents(THnSparseD *thn, Int_t eventType,
188                                        Int_t multFMDA, Int_t multFMDC,
189                                        Int_t multSPDIA, Int_t multSPDIC,
190                                        Int_t multSPDOA, Int_t multSPDOC,
191                                        Int_t multSPDtrklA,
192                                        Int_t multSPDtrklC, Int_t fmdSum1I,
193                                        Int_t fmdSum2I, Int_t fmdSum20,
194                                        Int_t fmdSum3I, Int_t fmdSum3O/*,
195                                        Int_t multTPC,
196                                        Int_t multTPCdiffVertex */);
197         static Int_t GetAxisEmptyEvents(TString name);
198
199         static THnSparseD* GetThnMultiplicity();
200         static void FillThnMultiplicity(THnSparseD *thn, Double_t vNch,
201                                         Double_t vNsoft,
202                                         Double_t vNcombined,
203                                         Double_t vV0, Double_t vFMD,
204                                         Double_t vSPD, Double_t vTPC,
205                                         Double_t vNresidualTracks,
206                                         Double_t vNresidualTracklets,
207                                         Double_t vVertexZ,
208                                         Double_t vVerticesDistance,
209                                         Double_t vProcessType);
210         static Int_t GetAxisMultiplicity(TString name);
211
212         static TH1F* GetHistStatsFlow();
213         static TH2F* GetHistPIDStudies(TString name);
214         static TObjArray* GetHistVZEROStudies(TList* l);
215
216         static void GetGapTriggers(THnSparseI* gaprun, Int_t gapCondition,
217                                    Int_t run, Double_t& triggers,
218                                    Double_t& total);
219
220         static void GetNoGapTriggers(THnSparseI* gaprun, Int_t gapCondition,
221                                      Int_t run, Double_t& triggers,
222                                      Double_t& total);
223 private:
224         static void CheckRange(Double_t &var, Double_t min, Double_t max);
225         static Int_t GetAxis(TString thntit, TString name);
226         static TString GetTitleMother();
227         static TString GetTitleEmptyEvents();
228         static TString GetTitleMultiplicity();
229
230         //== INVARIANT MASS DISTRIBUTIONS (ThnMother) ================================
231         //-- event characteristics
232         // number of charged primary particles - combined => can be w/ soft tracks
233         static const Int_t fgkNNcombined;      // number of bins
234         static const Double_t fgkMinNcombined; // lower border
235         static const Double_t fgkMaxNcombined; // upper border (#bins + lower border)
236
237         // unlike sign or like sign charged?
238         static const Int_t fgkNCombCh;      // kBinPPMM = number of bins
239         static const Double_t fgkMinCombCh; // kBinPM = lower border
240         static const Double_t fgkMaxCombCh; // kBinPPMM + kBinPM = upper border
241
242         // two track PID, take care the enum changed from time to time
243         static const Int_t fgkNCombPID;      // kBinPIDUnknown = number of bins
244         static const Double_t fgkMinCombPID; // kBinPionE = lower border
245         static const Double_t fgkMaxCombPID; // ...  = upper border
246
247         // gap configuration, used for different detectors
248         static const Int_t fgkNGapConfig;      // kBinNG = number of bins
249         static const Double_t fgkMinGapConfig; // kBinDG = lower border
250         static const Double_t fgkMaxGapConfig; // kBinNG + kBinDG = upper border
251
252         //-- mother kinematics
253         // invariant mass of the two-track system
254         static const Int_t fgkNMass;      // number of bins
255         static const Double_t fgkMinMass; // lower border
256         static const Double_t fgkMaxMass; // upper border
257
258         // transverse momentum of the two-track system
259         static const Int_t fgkNMotherPt;      // number of bins
260         static const Double_t fgkMinMotherPt; // lower border
261         static const Double_t fgkMaxMotherPt; // upper border
262
263         // cosine theta* (opening angle of the two daugther tracks in the
264         // centre-of-mass system of the two-track/mother system)
265         // **no meaning full variable**
266         static const Int_t fgkNCTS;      // number of bins
267         static const Double_t fgkMinCTS; // lower border
268         static const Double_t fgkMaxCTS; // upper border
269
270         // opening angle in the lab frame
271         static const Int_t fgkNOA;      // number of bins
272         static const Double_t fgkMinOA; // lower border
273         static const Double_t fgkMaxOA; // upper border
274
275         //-- daughter kinematics
276         // transverse momentum of one of the two daughter particles
277         // (randomly selected)
278         static const Int_t fgkNDaughterPt;      // number of bins
279         static const Double_t fgkMinDaughterPt; // lower border
280         static const Double_t fgkMaxDaughterPt; // upper border
281
282         // pseudo rapidity of one of the two daughter particles
283         // (randomly selected)
284         //static const Int_t fgkNDaughterEta;      // number of bins
285         //static const Double_t fgkMinDaughterEta; // lower border
286         //static const Double_t fgkMaxDaughterEta; // upper border
287
288         //-- Event quality information
289         // boolean values to reduce output size
290
291         // are there tracks in addition to the ones selected using AliCDMesonTracks
292         static const Int_t fgkNTrackResiduals;     // number of bins
293         static const Double_t fgkMinTrackResiduals; // lower border
294         static const Double_t fgkMaxTrackResiduals; // upper border
295
296         // vertex with in +/-4cm (0 = no, 1 = yes)
297         static const Int_t fgkNVertexZinRng;      // number of bins
298         static const Double_t fgkMinVertexZinRng; // lower border
299         static const Double_t fgkMaxVertexZinRng; // upper border
300
301         // are the vertices from SPD and tracks within 0.5cm? (0 = no, 1 = yes)
302         static const Int_t fgkNVertexCoincidence;      // number of bins
303         static const Double_t fgkMinVertexCoincidence; // lower border
304         static const Double_t fgkMaxVertexCoincidence; // upper border
305
306         // are there SPD tracklets which are not assigned to tracks? (0 = no, 1 = yes)
307         static const Int_t fgkNTrackletResiduals;      // number of bins
308         static const Double_t fgkMinTrackletResiduals; // lower border
309         static const Double_t fgkMaxTrackletResiduals; // upper border
310
311         //-- MC event information
312         static const Int_t fgkNProcessType;      // kBinDD = number of bins
313         static const Double_t fgkMinProcessType; // kBinND = lower border
314         static const Double_t fgkMaxProcessType; // kBinDD = upper border
315
316
317         //== EMPTY EVENT STUDY (ThnEmptyEvents) ======================================
318         // event type
319         static const Int_t fgkNEventType;      // kBinEventE = number of bins
320         static const Double_t fgkMinEventType; // kBinEventI = lower border
321         static const Double_t fgkMaxEventType; // kBinEventE+kBinEventI = u. b.
322
323         // multiplicities (reused for different detectors and ways of counting)
324         static const Int_t fgkNMult;     // number of bins
325         static const Double_t fgkMinMult; // lower border
326         static const Double_t fgkMaxMult; // upper border
327
328         // multplicities - extended range
329         // (reused for different detectors and ways of counting)
330         static const Int_t fgkNMultW;      // number of bins
331         static const Double_t fgkMinMultW; // lower border
332         static const Double_t fgkMaxMultW; // upper border
333
334         //== MULTIPLICITY STUDY (TnnMultiplicity) ====================================
335         // number of ITSTPC tracks in event
336         static const Int_t fgkNNch;      // number of bins
337         static const Double_t fgkMinNch; // lower border
338         static const Double_t fgkMaxNch; // upper border
339
340         // number of ITS standalone tracks in event
341         static const Int_t fgkNNsoft;      // number of bins
342         static const Double_t fgkMinNsoft; // lower border
343         static const Double_t fgkMaxNsoft; // upper border
344
345         // combined multiplicity
346         static const Int_t fgkNNcomb;      // number of bins
347         static const Double_t fgkMinNcomb; // lower border
348         static const Double_t fgkMaxNcomb; // upper border
349
350         // gap configuration is reused from THnMother
351
352         // number of residual tracks
353         static const Int_t fgkNNresidualTracks;      // number of bins
354         static const Double_t fgkMinNresidualTracks; // lower border
355         static const Double_t fgkMaxNresidualTracks; // upper border
356
357         // number of residual tracklets
358         static const Int_t fgkNNresidualTracklets;      // number of bins
359         static const Double_t fgkMinNresidualTracklets; // lower border
360         static const Double_t fgkMaxNresidualTracklets; // upper border
361
362         // vertex z-position
363         static const Int_t fgkNVertexZ;      // number of bins
364         static const Double_t fgkMinVertexZ; // lower border
365         static const Double_t fgkMaxVertexZ; // upper border
366
367         // SPD and track vertex distance
368         static const Int_t fgkNVerticesDistance;      // number of bins
369         static const Double_t fgkMinVerticesDistance; // lower border
370         static const Double_t fgkMaxVerticesDistance; // upper border
371
372         // MC process type is resued from THnMother
373 };
374
375 #endif