]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FEMTOSCOPY/AliFemtoUser/AliFemtoQPairCut.cxx
Removing not needed files
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemtoUser / AliFemtoQPairCut.cxx
1 /////////////////////////////////////////////////////////////////////////////
2 //                                                                         //
3 // AliFemtoQPairCut - a simple cut which selects pairs based on the values //
4 // of their respective q components                                        /
5 //                                                                         //
6 /////////////////////////////////////////////////////////////////////////////
7 /***************************************************************************
8  *
9  * $Id$
10  ***************************************************************************
11  *          
12  *
13  ***************************************************************************
14  *
15  * $Log$
16  * Revision 1.2.6.1  2007/11/01 17:10:38  akisiel
17  * Fix code rule conformace
18  *
19  * Revision 1.2  2007/05/22 09:01:42  akisiel
20  * Add the possibiloity to save cut settings in the ROOT file
21  *
22  * Revision 1.1  2007/05/16 10:25:06  akisiel
23  * Making the directory structure of AliFemtoUser flat. All files go into one common directory
24  *
25  * Revision 1.4  2007/05/03 09:46:10  akisiel
26  * Fixing Effective C++ warnings
27  *
28  * Revision 1.3  2007/04/27 07:25:59  akisiel
29  * Make revisions needed for compilation from the main AliRoot tree
30  *
31  * Revision 1.1.1.1  2007/04/25 15:38:41  panos
32  * Importing the HBT code dir
33  *
34  * Revision 1.1.1.1  2007/03/07 10:14:49  mchojnacki
35  * First version on CVS
36  *
37  *
38  **************************************************************************/
39
40 #include "AliFemtoQPairCut.h"
41 #include <string>
42 #include <cstdio>
43
44 #ifdef __ROOT__
45 ClassImp(AliFemtoQPairCut)
46 #endif
47     
48 //__________________
49 AliFemtoQPairCut::AliFemtoQPairCut():
50   fNPairsPassed(0),
51   fNPairsFailed(0)
52 {
53   // Default constructor
54   fNPairsPassed = fNPairsFailed = 0;
55   fQlong[0]=-1.0; fQlong[1]=100.0;
56   fQout[0]=-1.0;  fQout[1]=100.0;
57   fQside[0]=-1.0; fQside[1]=100.0;
58   fQinv[0]=-1.0;  fQinv[1]=100.0;
59 }
60 //__________________
61 AliFemtoQPairCut::~AliFemtoQPairCut()
62 {
63 //  /* no-op */
64 }
65 //__________________
66 bool AliFemtoQPairCut::Pass(const AliFemtoPair* pair)
67 {
68   // Select pairs based on their q values
69   //bool temp = true;
70   //temp ? fNPairsPassed++ : fNPairsFailed++;
71   if ((fabs(pair->QLongCMS())<fQlong[0])||(fabs(pair->QLongCMS())>fQlong[1]))
72   {
73         fNPairsFailed++;
74         return false;
75   }
76   if ((fabs(pair->QOutCMS())<fQout[0])||(fabs(pair->QOutCMS())>fQout[1]))
77   {
78         fNPairsFailed++;
79         return false;
80   }
81   if ((fabs(pair->QSideCMS())<fQside[0])||(fabs(pair->QSideCMS())>fQside[1]))
82   {
83         fNPairsFailed++;
84         return false;
85   }
86     if ((fabs(pair->KStar())<fQinv[0])||(fabs(pair->KStar())>fQinv[1]))
87   {
88         fNPairsFailed++;
89         return false;
90   }
91   fNPairsPassed++;
92   return true;
93 }
94 //__________________
95 AliFemtoString AliFemtoQPairCut::Report()
96 {
97   // Prepare a report
98   string stemp = "AliFemtoQ Pair Cut \n";
99   char ctemp[100];
100   sprintf(ctemp,"Number of pairs which passed:\t%ld  Number which failed:\t%ld\n",fNPairsPassed,fNPairsFailed);
101   stemp += ctemp;
102   AliFemtoString returnThis = stemp;
103   return returnThis;
104 }
105 //__________________
106 TList *AliFemtoQPairCut::ListSettings()
107 {
108   // return a list of settings in a writable form
109   TList *tListSetttings = new TList();
110   char buf[200];
111   snprintf(buf, 200, "AliFemtoQPairCut.qout.maximum=%lf", fQout[0]);
112   tListSetttings->AddLast(new TObjString(buf));
113
114   snprintf(buf, 200, "AliFemtoQPairCut.qout.minimum=%lf", fQout[1]);
115   tListSetttings->AddLast(new TObjString(buf));
116
117   snprintf(buf, 200, "AliFemtoQPairCut.qside.maximum=%lf", fQside[0]);
118   tListSetttings->AddLast(new TObjString(buf));
119
120   snprintf(buf, 200, "AliFemtoQPairCut.qside.minimum=%lf", fQside[1]);
121   tListSetttings->AddLast(new TObjString(buf));
122
123   snprintf(buf, 200, "AliFemtoQPairCut.qlong.maximum=%lf", fQlong[0]);
124   tListSetttings->AddLast(new TObjString(buf));
125
126   snprintf(buf, 200, "AliFemtoQPairCut.qlong.minimum=%lf", fQlong[1]);
127   tListSetttings->AddLast(new TObjString(buf));
128
129   snprintf(buf, 200, "AliFemtoQPairCut.qinv.maximum=%lf", fQinv[0]);
130   tListSetttings->AddLast(new TObjString(buf));
131
132   snprintf(buf, 200, "AliFemtoQPairCut.qinv.minimum=%lf", fQinv[1]);
133   tListSetttings->AddLast(new TObjString(buf));
134
135   return tListSetttings;
136 }