]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoPairCutPt.cxx
Split: fixed incpaths for ANALYSISalice -> OADB
[u/mrichter/AliRoot.git] / PWGCF / FEMTOSCOPY / AliFemtoUser / AliFemtoPairCutPt.cxx
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),
23   fSumPtMax(10000),
24   fNPairsFailed(0),
25   fNPairsPassed(0)
26 {
27
28 }
29 //__________________
30 AliFemtoPairCutPt::AliFemtoPairCutPt(double lo, double hi):
31   AliFemtoPairCut(),
32   fSumPtMin(lo),
33   fSumPtMax(hi),
34   fNPairsFailed(0),
35   fNPairsPassed(0)
36 {
37   fSumPtMin=lo;
38   fSumPtMax=hi;
39 }
40 //__________________
41 AliFemtoPairCutPt::AliFemtoPairCutPt(const AliFemtoPairCutPt& c) : 
42   AliFemtoPairCut(c),
43   fSumPtMin(0),
44   fSumPtMax(0),
45   fNPairsFailed(0),
46   fNPairsPassed(0)
47
48   fSumPtMin = c.fSumPtMin;
49   fSumPtMax = c.fSumPtMax;
50 }
51 AliFemtoPairCutPt& AliFemtoPairCutPt::operator=(const AliFemtoPairCutPt& c)
52 {
53   if (this != &c) {
54     fSumPtMin = c.fSumPtMin;
55     fSumPtMax = c.fSumPtMax;
56   }
57
58   return *this;
59
60 }
61
62 //__________________
63 AliFemtoPairCutPt::~AliFemtoPairCutPt(){
64   /* no-op */
65 }
66 //__________________
67 bool AliFemtoPairCutPt::Pass(const AliFemtoPair* pair){
68
69   bool temp = true;
70
71   double pt1 = pair->Track1()->Track()->Pt();
72   double pt2 = pair->Track2()->Track()->Pt();
73
74   double pt_sum = pt1 + pt2;
75
76   if(pt_sum >= fSumPtMin && pt_sum <= fSumPtMax)
77     temp = true;
78   else
79     temp = false;
80
81   if(temp) 
82     fNPairsPassed++;
83   else fNPairsFailed++;
84
85
86   return temp;
87   
88 }
89 //__________________
90 AliFemtoString AliFemtoPairCutPt::Report(){
91   // Prepare a report from the execution
92   string stemp = "AliFemtoPairCutPt Pair Cut\n";  
93   char ctemp[100];
94   stemp += ctemp;
95   snprintf(ctemp,100,"Number of pairs which passed:\t%ld  Number which failed:\t%ld\n",(long int) fNPairsPassed,(long int) fNPairsFailed);
96   stemp += ctemp;
97   AliFemtoString returnThis = stemp;
98   return returnThis;}
99 //__________________
100
101 TList *AliFemtoPairCutPt::ListSettings()
102 {
103   // return a list of settings in a writable form
104   TList *tListSetttings = new TList();
105   char buf[200];
106   snprintf(buf, 200, "AliFemtoPairCutPt.sumptmin=%f", fSumPtMin);
107   snprintf(buf, 200, "AliFemtoPairCutPr.sumptmax=%f", fSumPtMax);
108   tListSetttings->AddLast(new TObjString(buf));
109
110   return tListSetttings;
111 }
112
113 void AliFemtoPairCutPt::SetMinSumPt(Double_t sumptmin)
114 {
115   fSumPtMin = sumptmin;
116 }
117
118  
119 void AliFemtoPairCutPt::SetMaxSumPt(Double_t sumptmax)
120 {
121   fSumPtMax = sumptmax;
122 }
123