StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFlowCutEvent.cxx
1 //
3 // $Id: StFlowCutEvent.cxx,v 1.46 2010/09/30 19:30:23 posk Exp $
4 //
5 // Author: Art Poskanzer and Raimond Snellings, LBNL, Oct 1999
6 // MuDst enabled by Kirill Filimonov, LBNL, Jun 2002
7 // year4 triggers by Paul Sorenson, LBNL, Feb 2005
8 //
9 // Description: Class for applying event cuts
10 //
12 
13 #include <Stiostream.h>
14 #include <stdlib.h>
15 #include "StFlowCutEvent.h"
16 #include "StFlowCutTrack.h"
17 #include "StEvent.h"
18 #include "StFlowPicoEvent.h"
19 #include "StEventTypes.h"
20 #include "PhysicalConstants.h"
21 #include "SystemOfUnits.h"
22 #include "StThreeVectorF.hh"
23 #include "StFlowConstants.h"
24 #include "StMuDSTMaker/COMMON/StMuEvent.h"
25 #include "StMuDSTMaker/COMMON/StMuTrack.h"
26 #define PR(x) cout << "##### FlowCutEvent: " << (#x) << " = " << (x) << endl;
27 
28 ClassImp(StFlowCutEvent)
29 
30 //-----------------------------------------------------------------------
31 
32 Int_t StFlowCutEvent::mCentCuts[2] = {0, 0};
33 Int_t StFlowCutEvent::mMultCuts[2] = {10, 10000};
34 Float_t StFlowCutEvent::mVertexXCuts[2] = {-1., 1.};
35 Float_t StFlowCutEvent::mVertexYCuts[2] = {-1., 1.};
36 Float_t StFlowCutEvent::mVertexZCuts[2] = {-75., 75.};
37 UInt_t StFlowCutEvent::mEventN = 0;
38 UInt_t StFlowCutEvent::mGoodEventN = 0;
39 UInt_t StFlowCutEvent::mCentCut = 0;
40 UInt_t StFlowCutEvent::mMultCut = 0;
41 UInt_t StFlowCutEvent::mVertexXCut = 0;
42 UInt_t StFlowCutEvent::mVertexYCut = 0;
43 UInt_t StFlowCutEvent::mVertexZCut = 0;
44 Float_t StFlowCutEvent::mEtaSymTpcCuts[2] = {-3., 3.};
45 UInt_t StFlowCutEvent::mEtaSymTpcCutN = 0;
46 Float_t StFlowCutEvent::mEtaSymFtpcCuts[2] = {-5., 5.};
47 UInt_t StFlowCutEvent::mEtaSymFtpcCutN = 0;
48 UInt_t StFlowCutEvent::mTriggerCut = 1;
49 UInt_t StFlowCutEvent::mTriggerCutN = 0;
50 UInt_t StFlowCutEvent::mTriggersFound = 10;
51 UInt_t StFlowCutEvent::flowTriggerBitMap = 0;
52 //-----------------------------------------------------------------------
53 
54 StFlowCutEvent::StFlowCutEvent() {
55  // To apply event cuts
56 }
57 
58 //-----------------------------------------------------------------------
59 
60 StFlowCutEvent::~StFlowCutEvent() {
61 }
62 
63 //-----------------------------------------------------------------------
64 
65 Bool_t StFlowCutEvent::CheckEvent(StEvent* pEvent) {
66  // Returns kTRUE if StEvent survives all the cuts
67  if (!pEvent) return kFALSE;
68 
69  // Primary vertex
70  Long_t nvtx = pEvent->numberOfPrimaryVertices();
71  if (nvtx == 0) {
72  // cout << "FlowCutEvent: no Vertex " << endl;
73  return kFALSE;
74  }
75  StPrimaryVertex* pVertex = pEvent->primaryVertex(0);
76  if (!pVertex) return kFALSE;
77 
78  // Multiplicity
79  Long_t mult = pVertex->numberOfDaughters();
80  if (mMultCuts[1] > mMultCuts[0] &&
81  (mult < mMultCuts[0] || mult >= mMultCuts[1])) {
82  mMultCut++;
83  return kFALSE;
84  }
85 
86  // update normal event counter
87  mEventN++;
88 
89  const StThreeVectorF& vertex = pVertex->position();
90 
91  // Vertex x
92  Float_t vertexX = vertex.x();
93  if (mVertexXCuts[1] > mVertexXCuts[0] &&
94  (vertexX < mVertexXCuts[0] || vertexX >= mVertexXCuts[1])) {
95  mVertexXCut++;
96  return kFALSE;
97  }
98 
99  // Vertex y
100  Float_t vertexY = vertex.y();
101  if (mVertexYCuts[1] > mVertexYCuts[0] &&
102  (vertexY < mVertexYCuts[0] || vertexY >= mVertexYCuts[1])) {
103  mVertexYCut++;
104  return kFALSE;
105  }
106 
107  // Vertex z
108  Float_t vertexZ = vertex.z();
109  if (mVertexZCuts[1] > mVertexZCuts[0] &&
110  (vertexZ < mVertexZCuts[0] || vertexZ >= mVertexZCuts[1])) {
111  mVertexZCut++;
112  return kFALSE;
113  }
114 
116  // Check the for acceptable trigger words
117 
118  if (pEvent->runId() > 4000000 ) { // trigger collections were used
119  flowTriggerBitMap = 0;
120  Float_t ctbMult = 0.;
121  StTriggerDetectorCollection *triggers = pEvent->triggerDetectorCollection();
122  if (triggers) {
123  StCtbTriggerDetector &CTB = triggers->ctb();
124  // get CTB
125  for (UInt_t slat = 0; slat < CTB.numberOfSlats(); slat++) {
126  for (UInt_t tray = 0; tray < CTB.numberOfTrays(); tray++) {
127  ctbMult += CTB.mips(tray,slat,0);
128  }
129  }
130  }
131 
133  // Add new minbias triggers to look for here
135  if ( // year 4 full field minbias triggers
136  pEvent->triggerIdCollection()->nominal()->isTrigger(15007)
137  // || pEvent->triggerIdCollection().nominal().isTrigger(15003)
138  ){
139  flowTriggerBitMap += 1;
140  }
141  else if ( // year 4 half field minbias triggers
142  pEvent->triggerIdCollection()->nominal()->isTrigger(25007)
143  ){
144  flowTriggerBitMap += 1;
145  }
146  else if ( // 62 GeV triggers
147  pEvent->triggerIdCollection()->nominal()->isTrigger(35004) ||
148  pEvent->triggerIdCollection()->nominal()->isTrigger(35007) ||
149  ( pEvent->triggerIdCollection()->nominal()->isTrigger(35001) &&
150  ctbMult > 15 ) ||
151  ( pEvent->triggerIdCollection()->nominal()->isTrigger(35009) &&
152  ctbMult > 15 )
153  ){
154  flowTriggerBitMap += 1;
155  }
156 
158  // Add new central triggers to look for here
160  if ( // year 4 full field central triggers
161  pEvent->triggerIdCollection()->nominal()->isTrigger(15105)
162  ){
163  flowTriggerBitMap += 2;;
164  } else if ( // year 4 half field central
165  pEvent->triggerIdCollection()->nominal()->isTrigger(25105)
166  ){
167  flowTriggerBitMap += 2;
168  }
169 
170  //Make selection from trigger bit map
171  if (mTriggerCut==0 && (flowTriggerBitMap &2 || flowTriggerBitMap &1) ){
172  mTriggersFound = 0;
173  } else if (mTriggerCut==1 && (flowTriggerBitMap &1) ){
174  mTriggersFound = 1;
175  } else if (mTriggerCut==2 && (flowTriggerBitMap &2) ){
176  mTriggersFound = 2;
177  } else {//an unsupported trigger cut selection was made (0, 1, and 2)
178  mTriggerCutN++;
179  return kFALSE;
180  }
181 
182  }
183 
185  // before run 4 triggerWords were used
186  else {
187  if (pEvent->l3Trigger() && pEvent->l3Trigger()->l3EventSummary() &&
188  !(pEvent->l3Trigger()->l3EventSummary()->unbiasedTrigger())) {
189  // cout << "FlowCutEvent: L3 biased trigger event " << endl;
190  return kFALSE;
191  }
192 
193  StL0Trigger* pTrigger = pEvent->l0Trigger();
194 
195  if (pTrigger) {
196  UInt_t triggerWord = pTrigger->triggerWord();
197 
198  switch (triggerWord) {
199  case 4096: mTriggersFound = 1; break; // minbias
200  case 4352: mTriggersFound = 2; break; // central
201  case 61952: mTriggersFound = 3; break; // laser
202  default: mTriggersFound = 10; break; // no clue
203  }
204  }
205  if (mTriggerCut && mTriggersFound != mTriggerCut) {
206  mTriggerCutN++;
207  return kFALSE;
208  }
209  }
210 
211  mGoodEventN++;
212  return kTRUE;
213 }
214 
215 //-----------------------------------------------------------------------
216 
217 Bool_t StFlowCutEvent::CheckEvent(StFlowPicoEvent* pPicoEvent) {
218  // Returns kTRUE if picoevent survives all the cuts
219 
220  if (!pPicoEvent) return kFALSE;
221 
222  // Multiplicity
223  Int_t mult = pPicoEvent->OrigMult();
224  if (mMultCuts[1] > mMultCuts[0] &&
225  (mult < mMultCuts[0] || mult >= mMultCuts[1])) {
226  mMultCut++;
227  return kFALSE;
228  }
229 
230  //This is obsolete!!!! There is no trigger word after year 4
231  // Trigger
232  UInt_t triggerWord = pPicoEvent->L0TriggerWord();
233 
234  if (pPicoEvent->CenterOfMassEnergy() > 60. && pPicoEvent->CenterOfMassEnergy() < 65. ) { // 62 GeV
235  if (!( (triggerWord == 35004 || triggerWord == 35007) ||
236  ((triggerWord == 35001 || triggerWord == 35009) && pPicoEvent->CTB() > 15) )) {
237  mTriggersFound = 10; // no clue
238  } else {
239  mTriggersFound = 1; // minbias
240  }
241  }
242 
243  else {
244  switch (triggerWord) {
245  case 4096: mTriggersFound = 1; break; // minbias
246  case 4352: mTriggersFound = 2; break; // central
247  case 61952: mTriggersFound = 3; break; // laser
248  default: mTriggersFound = 10; break; // no clue
249  }
250  }
251 
252  if (mTriggerCut && mTriggersFound != mTriggerCut) {
253  mTriggerCutN++;
254  return kFALSE;
255  }
256 
257  // Centrality
258  // Centrality=0 is not retievable
259  Int_t cent = pPicoEvent->CalcCentrality();
260  if (mCentCuts[0] && mCentCuts[1] >= mCentCuts[0] &&
261  (cent < mCentCuts[0] || cent > mCentCuts[1])) {
262  mCentCut++;
263  return kFALSE;
264  }
265 
266  // update normal event counter
267  mEventN++;
268 
269  // Vertex x
270  Float_t vertexX = pPicoEvent->VertexX();
271  if (mVertexXCuts[1] > mVertexXCuts[0] &&
272  (vertexX < mVertexXCuts[0] || vertexX >= mVertexXCuts[1])) {
273  mVertexXCut++;
274  return kFALSE;
275  }
276 
277  // Vertex y
278  Float_t vertexY = pPicoEvent->VertexY();
279  if (mVertexYCuts[1] > mVertexYCuts[0] &&
280  (vertexY < mVertexYCuts[0] || vertexY >= mVertexYCuts[1])) {
281  mVertexYCut++;
282  return kFALSE;
283  }
284 
285  // Vertex z
286  Float_t vertexZ = pPicoEvent->VertexZ();
287  if (mVertexZCuts[1] > mVertexZCuts[0] &&
288  (vertexZ < mVertexZCuts[0] || vertexZ >= mVertexZCuts[1])) {
289  mVertexZCut++;
290  return kFALSE;
291  }
292 
293  mGoodEventN++;
294  return kTRUE;
295 }
296 
297 //-----------------------------------------------------------------------
298 
299 Bool_t StFlowCutEvent::CheckEvent(StMuDst* pMu) {
300  // Returns kTRUE if muevent survives all the cuts
301  if (!pMu) return kFALSE;
302 
303  StMuEvent* pMuEvent = pMu->event();
304  TObjArray* pMuTracks = pMu->primaryTracks();
305  if (!pMuEvent) return kFALSE;
306 
307  // Primary vertex
308  // The following lines were introduced to get rid of events without a primary vertex.
309  // These events are possible since the FTPC uses (0., 0., 0.) as a nominal vertex position
310  // if no vertex is found. (This was requested by UPC.) If in such an event tracks are found
311  // they'll make it into the MuDst. Unfortunately a proper scheme to exclude those events is missing.
312  // By cutting on the vertex position we eliminated those events.
313  // THIS WILL REMOVE SIMPLE SIMULATED EVENTS AS WELL!
314  if (TMath::Abs(pMuEvent->primaryVertexPosition().x()) < 1.e-5 &&
315  TMath::Abs(pMuEvent->primaryVertexPosition().y()) < 1.e-5 &&
316  TMath::Abs(pMuEvent->primaryVertexPosition().z()) < 1.e-5) {
317  // cout << "FlowCutEvent: no Vertex " << endl;
318  return kFALSE;
319  }
320 
321  // Multiplicity
322  Int_t mult = pMuTracks->GetEntries();
323  if (mMultCuts[1] > mMultCuts[0] &&
324  (mult < mMultCuts[0] || mult >= mMultCuts[1])) {
325  mMultCut++;
326  return kFALSE;
327  }
328 
330  // Check the for acceptable trigger words and set the
331  // correct Flow::centrality array
332  Int_t* cent = 0;
333  Int_t centrality = 0; // Centrality=0 is not retrievable
334 
335  flowTriggerBitMap = 0;
336 
338  // Add new minbias triggers to look for here
340  if ( // year 4 full field minbias triggers
341  pMuEvent->triggerIdCollection().nominal().isTrigger(15007)
342  // || pMuEvent->triggerIdCollection().nominal().isTrigger(15003)
343  ){
344  flowTriggerBitMap += 1;
345  cent = Flow::cent200Year4Full; // full field
346  }
347  else if ( // year 4 half field minbias triggers
348  pMuEvent->triggerIdCollection().nominal().isTrigger(25007)
349  ){
350  flowTriggerBitMap += 1;
351  cent = Flow::cent200Year4Half; // half field
352  }
353  else if ( // 62 GeV triggers
354  pMuEvent->triggerIdCollection().nominal().isTrigger(35004) ||
355  pMuEvent->triggerIdCollection().nominal().isTrigger(35007) ||
356  ( pMuEvent->triggerIdCollection().nominal().isTrigger(35001) &&
357  pMuEvent->ctbMultiplicity() > 15 ) ||
358  ( pMuEvent->triggerIdCollection().nominal().isTrigger(35009) &&
359  pMuEvent->ctbMultiplicity() > 15 )
360  ){
361  flowTriggerBitMap += 1;
362  cent = Flow::cent62; // 62.4 GeV data
363  }
364  else if ( // year7
365  pMuEvent->triggerIdCollection().nominal().isTrigger(200001)||
366  pMuEvent->triggerIdCollection().nominal().isTrigger(200003)||
367  pMuEvent->triggerIdCollection().nominal().isTrigger(200013)) {
368  flowTriggerBitMap += 1;
369  cent = Flow::cent200Year7; // 200 GeV year 7 data
370  }
371 
373  // Add new central triggers to look for here
375  if ( // year 4 full field central triggers
376  pMuEvent->triggerIdCollection().nominal().isTrigger(15105)
377  ){
378  flowTriggerBitMap += 2;
379  cent = Flow::cent200Year4Full; // full field
380  } else if ( // year 4 half field central
381  pMuEvent->triggerIdCollection().nominal().isTrigger(25105)
382  ){
383  flowTriggerBitMap += 2;
384  cent = Flow::cent200Year4Half; // half field
385  }
386 
387  //Make selection from trigger bit map
388  if (mTriggerCut==0 && (flowTriggerBitMap &2 || flowTriggerBitMap &1) ){
389  mTriggersFound = 0;
390  } else if (mTriggerCut==1 && (flowTriggerBitMap &1) ){
391  mTriggersFound = 1;
392  } else if (mTriggerCut==2 && (flowTriggerBitMap &2) ){
393  mTriggersFound = 2;
394  } else {//an unsupported trigger cut selection was made (0, 1, and 2)
395  mTriggerCutN++;
396  return kFALSE;
397  }
398 
399  //Int_t tracks = pMuEvent->refMult();
400  Int_t tracks;
401  if (pMuEvent->runId() > 8000000) { // year 7
402  tracks = pMuEvent->grefmult();
403  } else {
404  tracks = pMuEvent->refMult();
405  }
406 
407  if (tracks < cent[0]) { centrality = 0; }
408  else if (tracks < cent[1]) { centrality = 1; }
409  else if (tracks < cent[2]) { centrality = 2; }
410  else if (tracks < cent[3]) { centrality = 3; }
411  else if (tracks < cent[4]) { centrality = 4; }
412  else if (tracks < cent[5]) { centrality = 5; }
413  else if (tracks < cent[6]) { centrality = 6; }
414  else if (tracks < cent[7]) { centrality = 7; }
415  else if (tracks < cent[8]) { centrality = 8; }
416  else { centrality = 9; }
417 
418  if (mCentCuts[0] && mCentCuts[1] >= mCentCuts[0] &&
419  (centrality < mCentCuts[0] || centrality > mCentCuts[1])) {
420  mCentCut++;
421  return kFALSE;
422  }
423 
424  // update normal event counter
425  mEventN++;
426 
427  // Vertex x
428  Float_t vertexX = pMuEvent->primaryVertexPosition().x();
429  if (mVertexXCuts[1] > mVertexXCuts[0] &&
430  (vertexX < mVertexXCuts[0] || vertexX >= mVertexXCuts[1])) {
431  mVertexXCut++;
432  return kFALSE;
433  }
434 
435  // Vertex y
436  Float_t vertexY = pMuEvent->primaryVertexPosition().y();
437  if (mVertexYCuts[1] > mVertexYCuts[0] &&
438  (vertexY < mVertexYCuts[0] || vertexY >= mVertexYCuts[1])) {
439  mVertexYCut++;
440  return kFALSE;
441  }
442 
443  // Vertex z
444  Float_t vertexZ = pMuEvent->primaryVertexPosition().z();
445  if (mVertexZCuts[1] > mVertexZCuts[0] &&
446  (vertexZ < mVertexZCuts[0] || vertexZ >= mVertexZCuts[1])) {
447  mVertexZCut++;
448  return kFALSE;
449  }
450 
451  mGoodEventN++;
452  return kTRUE;
453 
454 }
455 
456 //-----------------------------------------------------------------------
457 
458 Bool_t StFlowCutEvent::CheckEtaSymmetry(StEvent* pEvent) {
459  // Returns kTRUE if StEvent survives this Eta symmetry cut
460  // Call at the end of the event after doing CheckTrack for each track
461  // If kFALSE you should delete the last event
462 
463  if (((StFlowCutTrack::EtaSymPosTpc() == 0 || StFlowCutTrack::EtaSymNegTpc() == 0) && // at least one half is empty
464  !(StFlowCutTrack::EtaSymPosTpc() == 0 && StFlowCutTrack::EtaSymNegTpc() == 0)) || // but not both halves
465  ((StFlowCutTrack::EtaSymPosFtpc() == 0 || StFlowCutTrack::EtaSymNegFtpc() == 0) && // at least one FTPC is empty
466  !(StFlowCutTrack::EtaSymPosFtpc() == 0 && StFlowCutTrack::EtaSymNegFtpc() == 0))) { // but not both FTPCs
467  // This looks ugly because there is no XOR and events w/o the FTPC or TPC switched on will be cut, otherwise.
468  return kFALSE; // possible beam gas event
469  }
470 
471  // Tpc
472  float etaSymPosTpcN = (float)StFlowCutTrack::EtaSymPosTpc();
473  float etaSymNegTpcN = (float)StFlowCutTrack::EtaSymNegTpc();
474  float etaSymTpc = (etaSymPosTpcN - etaSymNegTpcN) / (etaSymPosTpcN + etaSymNegTpcN);
475  // Ftpc
476  float etaSymPosFtpcN = (float)StFlowCutTrack::EtaSymPosFtpc();
477  float etaSymNegFtpcN = (float)StFlowCutTrack::EtaSymNegFtpc();
478  float etaSymFtpc = (etaSymPosFtpcN - etaSymNegFtpcN) / (etaSymPosFtpcN + etaSymNegFtpcN);
479  StFlowCutTrack::EtaSymClear();
480 
481  StPrimaryVertex* pVertex = pEvent->primaryVertex(0);
482  if (!pVertex) return kFALSE;
483  const StThreeVectorF& vertex = pVertex->position();
484  Float_t vertexZ = vertex.z();
485  // Tpc
486  etaSymTpc += (Flow::etaSymZSlopeTpc * vertexZ); // correction for acceptance
487  etaSymTpc *= ::sqrt((double)(etaSymPosTpcN + etaSymNegTpcN)); // corrected for statistics
488  // Ftpc
489  etaSymFtpc += (Flow::etaSymZSlopeFtpc * vertexZ); // corrected for acceptance
490  etaSymFtpc *= ::sqrt((double)(etaSymPosFtpcN + etaSymNegFtpcN)); // corrected for statistics
491 
492  if (mEtaSymTpcCuts[1] > mEtaSymTpcCuts[0] &&
493  (etaSymTpc < mEtaSymTpcCuts[0] || etaSymTpc >= mEtaSymTpcCuts[1])) {
494  mEtaSymTpcCutN++;
495  mGoodEventN--;
496  return kFALSE;
497  }
498 
499  else if (mEtaSymFtpcCuts[1] > mEtaSymFtpcCuts[0] &&
500  (etaSymFtpc < mEtaSymFtpcCuts[0] || etaSymFtpc >= mEtaSymFtpcCuts[1])) {
501  mEtaSymFtpcCutN++;
502  mGoodEventN--;
503  return kFALSE;
504  }
505 
506  return kTRUE;
507 }
508 
509 //-----------------------------------------------------------------------
510 
511 Bool_t StFlowCutEvent::CheckEtaSymmetry(StFlowPicoEvent* pPicoEvent) {
512  // Returns kTRUE if picoevent survives this Eta symmetry cut
513  // Call at the end of the event after doing CheckTrack for each track
514  // If kFALSE you should delete the last event
515 
516  if (((StFlowCutTrack::EtaSymPosTpc() == 0 || StFlowCutTrack::EtaSymNegTpc() == 0) && // at least one half is empty
517  !(StFlowCutTrack::EtaSymPosTpc() == 0 && StFlowCutTrack::EtaSymNegTpc() == 0)) || // but not both halves
518  ((StFlowCutTrack::EtaSymPosFtpc() == 0 || StFlowCutTrack::EtaSymNegFtpc() == 0) && // at least one FTPC is empty
519  !(StFlowCutTrack::EtaSymPosFtpc() == 0 && StFlowCutTrack::EtaSymNegFtpc() == 0))) { // but not both FTPCs
520  // This looks ugly because there is no XOR and events w/o the FTPC or TPC switched on will be cut, otherwise.
521  return kFALSE; // possible beam gas event
522  }
523 
524  // Tpc
525  float etaSymPosTpcN = (float)StFlowCutTrack::EtaSymPosTpc();
526  float etaSymNegTpcN = (float)StFlowCutTrack::EtaSymNegTpc();
527  float etaSymTpc = (etaSymPosTpcN - etaSymNegTpcN) / (etaSymPosTpcN + etaSymNegTpcN);
528  // Ftpc
529  float etaSymPosFtpcN = (float)StFlowCutTrack::EtaSymPosFtpc();
530  float etaSymNegFtpcN = (float)StFlowCutTrack::EtaSymNegFtpc();
531  float etaSymFtpc = (etaSymPosFtpcN - etaSymNegFtpcN) / (etaSymPosFtpcN + etaSymNegFtpcN);
532  StFlowCutTrack::EtaSymClear();
533 
534  Float_t vertexZ = pPicoEvent->VertexZ();
535  // Tpc
536  etaSymTpc += (Flow::etaSymZSlopeTpc * vertexZ); // correction for acceptance
537  etaSymTpc *= ::sqrt((double)(etaSymPosTpcN + etaSymNegTpcN)); // corrected for statistics
538  // Ftpc
539  etaSymFtpc += (Flow::etaSymZSlopeFtpc * vertexZ); // correctly corrected for acceptance
540  etaSymFtpc *= ::sqrt((double)(etaSymPosFtpcN + etaSymNegFtpcN)); // corrected for statistics
541 
542  if (mEtaSymTpcCuts[1] > mEtaSymTpcCuts[0] &&
543  (etaSymTpc < mEtaSymTpcCuts[0] || etaSymTpc >= mEtaSymTpcCuts[1])) {
544  mEtaSymTpcCutN++;
545  mGoodEventN--;
546  return kFALSE;
547  }
548 
549  else if (mEtaSymFtpcCuts[1] > mEtaSymFtpcCuts[0] &&
550  (etaSymFtpc < mEtaSymFtpcCuts[0] || etaSymFtpc >= mEtaSymFtpcCuts[1])) {
551  mEtaSymFtpcCutN++;
552  mGoodEventN--;
553  return kFALSE;
554  }
555 
556  return kTRUE;
557 }
558 
559 //-----------------------------------------------------------------------
560 
561 Bool_t StFlowCutEvent::CheckEtaSymmetry(StMuEvent* pMuEvent) {
562  // Returns kTRUE if muevent survives this Eta symmetry cut
563  // Call at the end of the event after doing CheckTrack for each track
564  // If kFALSE you should delete the last event
565 
566  if (((StFlowCutTrack::EtaSymPosTpc() == 0 || StFlowCutTrack::EtaSymNegTpc() == 0) && // at least one half is empty
567  !(StFlowCutTrack::EtaSymPosTpc() == 0 && StFlowCutTrack::EtaSymNegTpc() == 0)) || // but not both halves
568  ((StFlowCutTrack::EtaSymPosFtpc() == 0 || StFlowCutTrack::EtaSymNegFtpc() == 0) && // at least one FTPC is empty
569  !(StFlowCutTrack::EtaSymPosFtpc() == 0 && StFlowCutTrack::EtaSymNegFtpc() == 0))) { // but not both FTPCs
570  // This looks ugly because there is no XOR and events w/o the FTPC or TPC switched on will be cut, otherwise.
571  return kFALSE; // possible beam gas event
572  }
573 
574  // Tpc
575  float etaSymPosTpcN = (float)StFlowCutTrack::EtaSymPosTpc();
576  float etaSymNegTpcN = (float)StFlowCutTrack::EtaSymNegTpc();
577  float etaSymTpc = (etaSymPosTpcN - etaSymNegTpcN) / (etaSymPosTpcN + etaSymNegTpcN);
578  // Ftpc
579  float etaSymPosFtpcN = (float)StFlowCutTrack::EtaSymPosFtpc();
580  float etaSymNegFtpcN = (float)StFlowCutTrack::EtaSymNegFtpc();
581  float etaSymFtpc = (etaSymPosFtpcN - etaSymNegFtpcN) / (etaSymPosFtpcN + etaSymNegFtpcN);
582  StFlowCutTrack::EtaSymClear();
583 
584  const StThreeVectorF& vertex = pMuEvent->primaryVertexPosition();
585  Float_t vertexZ = vertex.z();
586  // Tpc
587  etaSymTpc += (Flow::etaSymZSlopeTpc * vertexZ); // correction for acceptance
588  etaSymTpc *= ::sqrt((double)(etaSymPosTpcN + etaSymNegTpcN)); // corrected for statistics
589  // Ftpc
590  etaSymFtpc += (Flow::etaSymZSlopeFtpc * vertexZ); // correction for acceptance
591  etaSymFtpc *= ::sqrt((double)(etaSymPosFtpcN + etaSymNegFtpcN)); // corrected for statistics
592 
593  if (mEtaSymTpcCuts[1] > mEtaSymTpcCuts[0] &&
594  (etaSymTpc < mEtaSymTpcCuts[0] || etaSymTpc >= mEtaSymTpcCuts[1])) {
595  mEtaSymTpcCutN++;
596  mGoodEventN--;
597  return kFALSE;
598  }
599 
600  else if (mEtaSymFtpcCuts[1] > mEtaSymFtpcCuts[0] &&
601  (etaSymFtpc < mEtaSymFtpcCuts[0] || etaSymFtpc >= mEtaSymFtpcCuts[1])) {
602  mEtaSymFtpcCutN++;
603  mGoodEventN--;
604  return kFALSE;
605  }
606 
607  return kTRUE;
608 
609 }
610 
611 //-----------------------------------------------------------------------
612 
613 void StFlowCutEvent::PrintCutList() {
614  // Prints the list of cuts
615 
616  cout << "#######################################################" << endl;
617  cout << "# Primary Vertex Triggered Events= " << mEventN << endl;
618  cout << "# Event Cut List:" << endl;
619  cout << "# Mult cuts= " << mMultCuts[0] << ", " << mMultCuts[1]
620  << " :\t Events Cut= " << mMultCut << endl;
621  cout << "# Centrality cuts= " << mCentCuts[0] << ", " << mCentCuts[1]
622  << " :\t Events Cut= " << mCentCut << endl;
623  cout << "# VertexX cuts= " << mVertexXCuts[0] << ", " << mVertexXCuts[1]
624  << " :\t Events Cut= " << mVertexXCut << "\t (" << setprecision(3) <<
625  (float)mVertexXCut/(float)mEventN/perCent << "% cut)" << endl;
626  cout << "# VertexY cuts= " << mVertexYCuts[0] << ", " << mVertexYCuts[1]
627  << " :\t Events Cut= " << mVertexYCut << "\t (" << setprecision(3) <<
628  (float)mVertexYCut/(float)mEventN/perCent << "% cut)" << endl;
629  cout << "# VertexZ cuts= " << mVertexZCuts[0] << ", " << mVertexZCuts[1]
630  << " :\t Events Cut= " << mVertexZCut << "\t (" << setprecision(3) <<
631  (float)mVertexZCut/(float)mEventN/perCent << "% cut)" << endl;
632  cout << "# EtaSymTpc cuts= " << mEtaSymTpcCuts[0] << ", " << mEtaSymTpcCuts[1]
633  << " :\t Events Cut= " << mEtaSymTpcCutN << "\t (" << setprecision(3) <<
634  (float)mEtaSymTpcCutN/(float)mEventN/perCent << "% cut)" << endl;
635  cout << "# EtaSymFtpc cuts= " << mEtaSymFtpcCuts[0] << ", " << mEtaSymFtpcCuts[1]
636  << " :\t Events Cut= " << mEtaSymFtpcCutN << "\t (" << setprecision(3) <<
637  (float)mEtaSymFtpcCutN/(float)mEventN/perCent << "% cut)" << endl;
638 // cout << "# Trigger cut= " << mTriggerCut
639 // << " :\t\t Events Cut= " << mTriggerCutN << "\t (" << setprecision(3) <<
640 // (float)mTriggerCutN/(float)mEventN/perCent << "% cut)" << endl;
641  cout << "# Good Events = " << mGoodEventN << ", " << setprecision(3) <<
642  (float)mGoodEventN/(float)mEventN/perCent << "%" << endl;
643  cout << "#######################################################" << endl;
644 
645 }
646 
648 //
649 // $Log: StFlowCutEvent.cxx,v $
650 // Revision 1.46 2010/09/30 19:30:23 posk
651 // Instead of reversing the weight for negative pseudrapidity for odd harmonics,
652 // it is now done only for the first harmonic.
653 // Recentering is now done for all harmonics.
654 //
655 // Revision 1.45 2009/08/04 23:00:27 posk
656 // Reads year 7 MuDsts.
657 //
658 // Revision 1.44 2007/02/06 18:57:48 posk
659 // In Lee Yang Zeros method, introduced recentering of Q vector.
660 // Reactivated eta symmetry cut.
661 //
662 // Revision 1.43 2006/07/06 20:29:45 posk
663 // Changed the dynamic_cast of GetInputDS("MuDst") to a const cast.
664 //
665 // Revision 1.42 2006/07/06 16:50:12 posk
666 // Commented out lines added in version 1.41.
667 //
668 // Revision 1.41 2006/05/02 21:47:47 jeromel
669 // Bug fix: un-protected call to method
670 //
671 // Revision 1.40 2006/02/22 19:27:03 posk
672 // Changes needed for the MuDst
673 // Stopped using eventSummary()
674 //
675 // Revision 1.39 2005/03/03 17:22:01 posk
676 // Initialized pFlowEvent in the constructors.
677 //
678 // Revision 1.38 2005/02/11 23:22:10 posk
679 // Made TriggersFound() work for pico files.
680 //
681 // Revision 1.37 2005/02/08 22:13:08 psoren
682 // initialized flowTriggerBitMap=0 for each event
683 //
684 // Revision 1.36 2005/02/08 20:57:36 psoren
685 // trigger and centrality selections were updated for all runs after run 4 to be compatible with trigger collections. Added TriggersFound() and GetFlowTriggerBitMap() functions.
686 //
687 // Revision 1.35 2004/08/24 20:24:32 oldi
688 // Minor modifications to avoid compiler warnings.
689 // Small bug fix (didn't affect anyone yet).
690 //
691 // Revision 1.34 2004/07/07 22:31:06 oldi
692 // Fix of a severe bug which threw away about 1/3 of all events by cutting on
693 // vertex_x < 0 && vertex_y < 0 && vertex_z < 0 instead of fabs(...) < 0.
694 // Thanks to Kirill, who found this (and suffered most).
695 //
696 // Revision 1.33 2004/05/31 20:09:35 oldi
697 // PicoDst format changed (Version 7) to hold ZDC SMD information.
698 // Trigger cut modified to comply with TriggerCollections.
699 // Centrality definition for 62 GeV data introduced.
700 // Minor bug fixes.
701 //
702 // Revision 1.32 2004/05/05 21:13:45 aihong
703 // Gang's code for ZDC-SMD added
704 //
705 // Revision 1.31 2003/09/02 17:58:11 perev
706 // gcc 3.2 updates + WarnOff
707 //
708 // Revision 1.30 2003/07/30 22:05:28 oldi
709 // To get rid of beam gas events events with one empty FTPC or one empty half of
710 // the TPC are removed.
711 //
712 // Revision 1.29 2003/02/25 19:28:38 posk
713 // Changed a few unimportant default cuts.
714 //
715 // Revision 1.28 2003/01/10 16:41:53 oldi
716 // Several changes to comply with FTPC tracks:
717 // - Switch to include/exclude FTPC tracks introduced.
718 // The same switch changes the range of the eta histograms.
719 // - Eta symmetry plots for FTPC tracks added and separated from TPC plots.
720 // - PhiWgts and related histograms for FTPC tracks split in FarEast, East,
721 // West, FarWest (depending on vertex.z()).
722 // - Psi_Diff plots for 2 different selections and the first 2 harmonics added.
723 // - Cut to exclude mu-events with no primary vertex introduced.
724 // (This is possible for UPC events and FTPC tracks.)
725 // - Global DCA cut for FTPC tracks added.
726 // - Global DCA cuts for event plane selection separated for TPC and FTPC tracks.
727 // - Charge cut for FTPC tracks added.
728 //
729 // Revision 1.27 2002/06/10 22:50:56 posk
730 // pt and eta weighting now default.
731 // DcaGlobalPart default now 0 to 1 cm.
732 // Event cut order changed.
733 //
734 // Revision 1.26 2002/06/07 22:18:37 kirill
735 // Introduced MuDst reader
736 //
737 // Revision 1.25 2002/05/24 11:04:18 snelling
738 // Added a cut to remove the events triggered by L3
739 //
740 // Revision 1.24 2002/03/15 16:43:21 snelling
741 // Added a method to recalculate the centrality in StFlowPicoEvent
742 //
743 // Revision 1.23 2002/01/30 13:04:10 oldi
744 // Trigger cut implemented.
745 //
746 // Revision 1.22 2001/05/22 20:17:13 posk
747 // Now can do pseudorapidity subevents.
748 //
749 // Revision 1.21 2000/12/12 20:22:05 posk
750 // Put log comments at end of files.
751 // Deleted persistent StFlowEvent (old micro DST).
752 //
753 // Revision 1.20 2000/11/30 16:40:20 snelling
754 // Protection agains loading probability pid caused it not to work anymore
755 // therefore protection removed again
756 //
757 // Revision 1.19 2000/09/05 16:11:30 snelling
758 // Added global DCA, electron and positron
759 //
760 // Revision 1.18 2000/08/31 18:58:17 posk
761 // For picoDST, added version number, runID, and multEta for centrality.
762 // Added centrality cut when reading picoDST.
763 // Added pt and eta selections for particles corr. wrt event plane.
764 //
765 // Revision 1.17 2000/08/10 23:00:19 posk
766 // New centralities. pt and eta cuts.
767 //
768 // Revision 1.15 2000/07/14 23:49:03 snelling
769 // Changed to ConstIterator for new StEvent and removed comparison int uint
770 //
771 // Revision 1.14 2000/07/12 17:54:33 posk
772 // Added chi2 and dca cuts. Multiplied EtaSym by ::sqrt(mult).
773 // Apply cuts when reading picoevent file.
774 //
775 // Revision 1.13 2000/06/30 14:48:29 posk
776 // Using MessageMgr, changed Eta Symmetry cut.
777 //
778 // Revision 1.12 2000/06/01 18:26:32 posk
779 // Increased precision of Track integer data members.
780 //
781 // Revision 1.11 2000/05/26 21:29:26 posk
782 // Protected Track data members from overflow.
783 //
784 // Revision 1.9 2000/03/02 23:02:38 posk
785 // Changed extensions from .hh and .cc to .h and .cxx .
786 //
787 // Revision 1.5 1999/12/15 22:01:22 posk
788 // Added StFlowConstants.hh
789 //
790 // Revision 1.4 1999/12/04 00:10:30 posk
791 // Works with the new StEvent
792 //
793 // Revision 1.3 1999/11/30 18:52:47 snelling
794 // First modification for the new StEvent
795 //
796 // Revision 1.2 1999/11/24 18:17:09 posk
797 // Put the methods which act on the data in with the data in StFlowEvent.
798 //
799 // Revision 1.1 1999/11/05 00:06:41 posk
800 // First versions of Flow cut classes.
801 //
StThreeVectorF primaryVertexPosition(int vtx_id=-1) const
The StMuDst is supposed to be structured in &#39;physical events&#39;. Therefore there is only 1 primary vert...
Definition: StMuEvent.cxx:221
static TObjArray * primaryTracks()
returns pointer to a list of tracks belonging to the selected primary vertex
Definition: StMuDst.h:301
unsigned short refMult(int vtx_id=-1)
Reference multiplicity of charged particles as defined in StEventUtilities/StuRefMult.hh for vertex vtx_id (-1 is default index from StMuDst)
Definition: StMuEvent.cxx:195
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:320