]>
Commit | Line | Data |
---|---|---|
a5709ac3 | 1 | ///////////////////////////////////////////////////////////////////////////////////// |
2 | // // | |
3 | // AliFemtoPairCutPt - a pair cut which checks if the sum of the transverse // | |
4 | // momenta of two particles fit within given range // | |
5 | // Authors: Malgorzata Janik, Warsaw University of Technology, majanik@cern.ch // | |
6 | // Lukasz Graczykowski, Warsaw University of Technology, lgraczyk@cern.ch // | |
7 | // // | |
8 | ///////////////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | #include "AliFemtoPairCutPt.h" | |
11 | #include <string> | |
12 | #include <cstdio> | |
13 | #include <TMath.h> | |
14 | ||
15 | #ifdef __ROOT__ | |
16 | ClassImp(AliFemtoPairCutPt) | |
17 | #endif | |
18 | ||
19 | //__________________ | |
20 | AliFemtoPairCutPt::AliFemtoPairCutPt(): | |
21 | AliFemtoPairCut(), | |
22 | fSumPtMin(0), | |
b84aaa8b | 23 | fSumPtMax(10000), |
24 | fNPairsFailed(0), | |
25 | fNPairsPassed(0) | |
a5709ac3 | 26 | { |
27 | ||
28 | } | |
29 | //__________________ | |
30 | AliFemtoPairCutPt::AliFemtoPairCutPt(double lo, double hi): | |
31 | AliFemtoPairCut(), | |
32 | fSumPtMin(lo), | |
b84aaa8b | 33 | fSumPtMax(hi), |
34 | fNPairsFailed(0), | |
35 | fNPairsPassed(0) | |
a5709ac3 | 36 | { |
37 | fSumPtMin=lo; | |
38 | fSumPtMax=hi; | |
39 | } | |
40 | //__________________ | |
41 | AliFemtoPairCutPt::AliFemtoPairCutPt(const AliFemtoPairCutPt& c) : | |
42 | AliFemtoPairCut(c), | |
43 | fSumPtMin(0), | |
b84aaa8b | 44 | fSumPtMax(0), |
45 | fNPairsFailed(0), | |
46 | fNPairsPassed(0) | |
a5709ac3 | 47 | { |
48 | fSumPtMin = c.fSumPtMin; | |
49 | fSumPtMax = c.fSumPtMax; | |
50 | } | |
51 | ||
52 | //__________________ | |
53 | AliFemtoPairCutPt::~AliFemtoPairCutPt(){ | |
54 | /* no-op */ | |
55 | } | |
56 | //__________________ | |
57 | bool AliFemtoPairCutPt::Pass(const AliFemtoPair* pair){ | |
58 | ||
59 | bool temp = true; | |
60 | ||
61 | double pt1 = pair->Track1()->Track()->Pt(); | |
62 | double pt2 = pair->Track2()->Track()->Pt(); | |
63 | ||
64 | double pt_sum = pt1 + pt2; | |
65 | ||
66 | if(pt_sum >= fSumPtMin && pt_sum <= fSumPtMax) | |
67 | temp = true; | |
68 | else | |
69 | temp = false; | |
70 | ||
71 | if(temp) | |
72 | fNPairsPassed++; | |
73 | else fNPairsFailed++; | |
74 | ||
75 | ||
76 | return temp; | |
77 | ||
78 | } | |
79 | //__________________ | |
80 | AliFemtoString AliFemtoPairCutPt::Report(){ | |
81 | // Prepare a report from the execution | |
82 | string stemp = "AliFemtoPairCutPt Pair Cut\n"; | |
83 | char ctemp[100]; | |
84 | stemp += ctemp; | |
b84aaa8b | 85 | snprintf(ctemp,100,"Number of pairs which passed:\t%ld Number which failed:\t%ld\n",(long int) fNPairsPassed,(long int) fNPairsFailed); |
a5709ac3 | 86 | stemp += ctemp; |
87 | AliFemtoString returnThis = stemp; | |
88 | return returnThis;} | |
89 | //__________________ | |
90 | ||
91 | TList *AliFemtoPairCutPt::ListSettings() | |
92 | { | |
93 | // return a list of settings in a writable form | |
94 | TList *tListSetttings = new TList(); | |
95 | char buf[200]; | |
96 | snprintf(buf, 200, "AliFemtoPairCutPt.sumptmin=%f", fSumPtMin); | |
97 | snprintf(buf, 200, "AliFemtoPairCutPr.sumptmax=%f", fSumPtMax); | |
98 | tListSetttings->AddLast(new TObjString(buf)); | |
99 | ||
100 | return tListSetttings; | |
101 | } | |
102 | ||
103 | void AliFemtoPairCutPt::SetMinSumPt(Double_t sumptmin) | |
104 | { | |
105 | fSumPtMin = sumptmin; | |
106 | } | |
107 | ||
108 | ||
109 | void AliFemtoPairCutPt::SetMaxSumPt(Double_t sumptmax) | |
110 | { | |
111 | fSumPtMax = sumptmax; | |
112 | } | |
113 |