StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFlowSelection.h
1 //
3 // $Id: StFlowSelection.h,v 1.19 2010/03/05 16:49:46 posk Exp $
4 //
5 // Author: Art Poskanzer and Raimond Snellings, LBNL, Mar 2000
6 //
7 // Description: Class for making selections
8 //
10 
11 #ifndef _StFlowSelection_INCLUDED_
12 #define _StFlowSelection_INCLUDED_
13 #include <Stiostream.h>
14 #include <string.h>
15 #include <stdlib.h>
16 #include "Rtypes.h"
17 #include "StObject.h"
18 #include "StFlowConstants.h"
19 class StFlowTrack;
20 class StFlowEvent;
21 
22 class StFlowSelection : public StObject {
23 
24  public:
25 
27  virtual ~StFlowSelection();
28 
29  Char_t* PidPart();
30  Int_t Sel() const;
31  Int_t Har() const;
32  Int_t Sub() const;
33  Bool_t Select(StFlowEvent*);
34  Bool_t Select(StFlowTrack*);
35  Bool_t SelectPart(StFlowTrack*);
36  Float_t PtMaxPart() const;
37  Int_t PtBinsPart() const;
38  void PrintList() const;
39  void SetPidPart(const Char_t*);
40  void SetPtPart(const Float_t, const Float_t);
41  void SetPtBinsPart(const Int_t);
42  void SetPPart(const Float_t, const Float_t);
43  void SetEtaPart(const Float_t, const Float_t);
44  void SetYPart(const Float_t, const Float_t);
45  void SetFitPtsPart(const Int_t, const Int_t);
46  void SetDedxPtsPart(const Int_t, const Int_t);
47  void SetFitOverMaxPtsPart(const Float_t, const Float_t);
48  void SetChiSqPart(const Float_t, const Float_t);
49  void SetDcaGlobalPart(const Float_t, const Float_t);
50  void SetHarmonic(const Int_t&);
51  void SetSelection(const Int_t&);
52  void SetSubevent(const Int_t&);
53 
54  private:
55 
56  // h+, h-, pi-, pi+, pi, k+, k-, k, pr+, pr-, pr, d+, d-, d, e+, e-, e
57  Char_t mPidPart[10]; // PID for particles wrt plane
58  Float_t mPtPart[2]; // for parts. wrt plane
59  Int_t mPtBinsPart; // for parts. wrt plane
60  Float_t mPPart[2]; // for parts. wrt plane
61  Float_t mEtaPart[2]; // for parts. wrt plane
62  Float_t mYPart[2]; // for parts. wrt plane
63  Int_t mFitPtsPart[2]; // for parts. wrt plane
64  Int_t mDedxPtsPart[2]; // for parts. wrt plane
65  Float_t mFitOverMaxPtsPart[2]; // for parts. wrt plane
66  Float_t mChiSqPart[2]; // for parts. wrt plane
67  Float_t mDcaGlobalPart[2]; // for parts. wrt plane
68 
69  Int_t mHarmonic;
70  Int_t mSelection;
71  Int_t mSubevent;
72 
73  ClassDef(StFlowSelection,1) // macro for rootcint
74 };
75 
76 inline Char_t* StFlowSelection::PidPart() { return mPidPart; }
77 
78 inline Float_t StFlowSelection::PtMaxPart() const { return mPtPart[1]; }
79 
80 inline Int_t StFlowSelection::PtBinsPart() const { return mPtBinsPart; }
81 
82 inline Int_t StFlowSelection::Sel() const { return mSelection; }
83 
84 inline Int_t StFlowSelection::Har() const { return mHarmonic; }
85 
86 inline Int_t StFlowSelection::Sub() const { return mSubevent; }
87 
88 inline void StFlowSelection::SetPidPart(const Char_t* pid) {
89  strncpy(mPidPart, pid, 9); mPidPart[9] = '\0'; }
90 
91 inline void StFlowSelection::SetPtPart(const Float_t lo, const Float_t hi) {
92  mPtPart[0] = lo; mPtPart[1] = hi; }
93 
94 inline void StFlowSelection::SetPtBinsPart(const Int_t bins) {
95  mPtBinsPart = bins; }
96 
97 inline void StFlowSelection::SetPPart(const Float_t lo, const Float_t hi) {
98  mPPart[0] = lo; mPPart[1] = hi; }
99 
100 inline void StFlowSelection::SetEtaPart(const Float_t lo, const Float_t hi) {
101  mEtaPart[0] = lo; mEtaPart[1] = hi; }
102 
103 inline void StFlowSelection::SetYPart(const Float_t lo, const Float_t hi) {
104  mYPart[0] = lo; mYPart[1] = hi; }
105 
106 inline void StFlowSelection::SetFitPtsPart(const Int_t lo, const Int_t hi) {
107  mFitPtsPart[0] = lo; mFitPtsPart[1] = hi; }
108 
109 inline void StFlowSelection::SetDedxPtsPart(const Int_t lo, const Int_t hi) {
110  mDedxPtsPart[0] = lo; mDedxPtsPart[1] = hi; }
111 
112 inline void StFlowSelection::SetFitOverMaxPtsPart(const Float_t lo, const Float_t hi) {
113  mFitOverMaxPtsPart[0] = lo; mFitOverMaxPtsPart[1] = hi; }
114 
115 inline void StFlowSelection::SetChiSqPart(const Float_t lo, const Float_t hi) {
116  mChiSqPart[0] = lo; mChiSqPart[1] = hi; }
117 
118 inline void StFlowSelection::SetDcaGlobalPart(const Float_t lo, const Float_t hi) {
119  mDcaGlobalPart[0] = lo; mDcaGlobalPart[1] = hi; }
120 
121 inline void StFlowSelection::SetHarmonic(const Int_t& harN) {
122  if (harN < 0 || harN >= Flow::nHars) {
123  cout << "### Harmonic " << harN << " not valid" << endl;
124  mHarmonic = 0;
125  } else { mHarmonic = harN; } }
126 
127 inline void StFlowSelection::SetSelection(const Int_t& selN) {
128  if (selN < 0 || selN >= Flow::nSels) {
129  cout << "### Selection " << selN << " not valid" << endl;
130  mSelection = 0;
131  } else { mSelection = selN; } }
132 
133 inline void StFlowSelection::SetSubevent(const Int_t& subN) {
134  if (subN < -1 || subN > Flow::nSubs) {
135  cout << "### Subevent " << subN << " not valid" << endl;
136  mSubevent = -1;
137  } else { mSubevent = subN; } }
138 
139 #endif
140 
142 //
143 // $Log: StFlowSelection.h,v $
144 // Revision 1.19 2010/03/05 16:49:46 posk
145 // Compatable with ROOT 5.22
146 //
147 // Revision 1.18 2003/09/02 17:58:12 perev
148 // gcc 3.2 updates + WarnOff
149 //
150 // Revision 1.17 2003/05/15 06:08:41 aihong
151 // default PID is changed from none to NA, SetDedxPtsPart() added
152 //
153 // Revision 1.16 2002/01/31 01:04:55 posk
154 // *** empty log message ***
155 //
156 // Revision 1.15 2001/12/18 19:22:38 posk
157 // "proton" and "antiproton" changed to "pr+" and "pr-".
158 // Compiles on Solaris.
159 //
160 // Revision 1.14 2001/11/09 21:11:00 posk
161 // Switched from CERNLIB to TMath. Little q is now normalized.
162 //
163 // Revision 1.13 2001/05/22 20:18:01 posk
164 // Now can do pseudorapidity subevents.
165 //
166 // Revision 1.12 2000/12/12 20:22:06 posk
167 // Put log comments at end of files.
168 // Deleted persistent StFlowEvent (old micro DST).
169 //
170 //
171 // Revision 1.10 2000/09/16 22:20:34 snelling
172 // Added selection on P and global DCA and fixed rapidity calulation
173 //
174 // Revision 1.9 2000/09/15 22:51:34 posk
175 // Added pt weighting for event plane calcualtion.
176 //
177 // Revision 1.8 2000/09/15 01:20:03 snelling
178 // Added methods for P and Y and added selection on Y
179 //
180 // Revision 1.7 2000/09/13 00:32:27 snelling
181 // Added selections for particles correlated with reaction plane
182 //
183 // Revision 1.6 2000/08/31 18:58:27 posk
184 // For picoDST, added version number, runID, and multEta for centrality.
185 // Added centrality cut when reading picoDST.
186 // Added pt and eta selections for particles corr. wrt event plane.
187 //
188 // Revision 1.5 2000/08/09 21:38:23 snelling
189 // PID added
190 //
191 // Revision 1.4 2000/05/26 21:29:33 posk
192 // Protected Track data members from overflow.
193 //
194 // Revision 1.3 2000/05/12 22:42:05 snelling
195 // Additions for persistency and minor fix
196 //
197 // Revision 1.2 2000/03/28 23:21:04 posk
198 // Allow multiple instances of the AnalysisMaker.
199 //
200 // Revision 1.1 2000/03/15 23:28:54 posk
201 // Added StFlowSelection.
202 //