15 #include "StFlowCutEvent.h"
16 #include "StFlowCutTrack.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;
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;
54 StFlowCutEvent::StFlowCutEvent() {
60 StFlowCutEvent::~StFlowCutEvent() {
65 Bool_t StFlowCutEvent::CheckEvent(
StEvent* pEvent) {
67 if (!pEvent)
return kFALSE;
70 Long_t nvtx = pEvent->numberOfPrimaryVertices();
76 if (!pVertex)
return kFALSE;
79 Long_t mult = pVertex->numberOfDaughters();
80 if (mMultCuts[1] > mMultCuts[0] &&
81 (mult < mMultCuts[0] || mult >= mMultCuts[1])) {
92 Float_t vertexX = vertex.x();
93 if (mVertexXCuts[1] > mVertexXCuts[0] &&
94 (vertexX < mVertexXCuts[0] || vertexX >= mVertexXCuts[1])) {
100 Float_t vertexY = vertex.y();
101 if (mVertexYCuts[1] > mVertexYCuts[0] &&
102 (vertexY < mVertexYCuts[0] || vertexY >= mVertexYCuts[1])) {
108 Float_t vertexZ = vertex.z();
109 if (mVertexZCuts[1] > mVertexZCuts[0] &&
110 (vertexZ < mVertexZCuts[0] || vertexZ >= mVertexZCuts[1])) {
118 if (pEvent->runId() > 4000000 ) {
119 flowTriggerBitMap = 0;
120 Float_t ctbMult = 0.;
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);
136 pEvent->triggerIdCollection()->nominal()->isTrigger(15007)
139 flowTriggerBitMap += 1;
142 pEvent->triggerIdCollection()->nominal()->isTrigger(25007)
144 flowTriggerBitMap += 1;
147 pEvent->triggerIdCollection()->nominal()->isTrigger(35004) ||
148 pEvent->triggerIdCollection()->nominal()->isTrigger(35007) ||
149 ( pEvent->triggerIdCollection()->nominal()->isTrigger(35001) &&
151 ( pEvent->triggerIdCollection()->nominal()->isTrigger(35009) &&
154 flowTriggerBitMap += 1;
161 pEvent->triggerIdCollection()->nominal()->isTrigger(15105)
163 flowTriggerBitMap += 2;;
165 pEvent->triggerIdCollection()->nominal()->isTrigger(25105)
167 flowTriggerBitMap += 2;
171 if (mTriggerCut==0 && (flowTriggerBitMap &2 || flowTriggerBitMap &1) ){
173 }
else if (mTriggerCut==1 && (flowTriggerBitMap &1) ){
175 }
else if (mTriggerCut==2 && (flowTriggerBitMap &2) ){
187 if (pEvent->l3Trigger() && pEvent->l3Trigger()->l3EventSummary() &&
188 !(pEvent->l3Trigger()->l3EventSummary()->unbiasedTrigger())) {
196 UInt_t triggerWord = pTrigger->triggerWord();
198 switch (triggerWord) {
199 case 4096: mTriggersFound = 1;
break;
200 case 4352: mTriggersFound = 2;
break;
201 case 61952: mTriggersFound = 3;
break;
202 default: mTriggersFound = 10;
break;
205 if (mTriggerCut && mTriggersFound != mTriggerCut) {
220 if (!pPicoEvent)
return kFALSE;
223 Int_t mult = pPicoEvent->OrigMult();
224 if (mMultCuts[1] > mMultCuts[0] &&
225 (mult < mMultCuts[0] || mult >= mMultCuts[1])) {
232 UInt_t triggerWord = pPicoEvent->L0TriggerWord();
234 if (pPicoEvent->CenterOfMassEnergy() > 60. && pPicoEvent->CenterOfMassEnergy() < 65. ) {
235 if (!( (triggerWord == 35004 || triggerWord == 35007) ||
236 ((triggerWord == 35001 || triggerWord == 35009) && pPicoEvent->CTB() > 15) )) {
244 switch (triggerWord) {
245 case 4096: mTriggersFound = 1;
break;
246 case 4352: mTriggersFound = 2;
break;
247 case 61952: mTriggersFound = 3;
break;
248 default: mTriggersFound = 10;
break;
252 if (mTriggerCut && mTriggersFound != mTriggerCut) {
259 Int_t cent = pPicoEvent->CalcCentrality();
260 if (mCentCuts[0] && mCentCuts[1] >= mCentCuts[0] &&
261 (cent < mCentCuts[0] || cent > mCentCuts[1])) {
270 Float_t vertexX = pPicoEvent->VertexX();
271 if (mVertexXCuts[1] > mVertexXCuts[0] &&
272 (vertexX < mVertexXCuts[0] || vertexX >= mVertexXCuts[1])) {
278 Float_t vertexY = pPicoEvent->VertexY();
279 if (mVertexYCuts[1] > mVertexYCuts[0] &&
280 (vertexY < mVertexYCuts[0] || vertexY >= mVertexYCuts[1])) {
286 Float_t vertexZ = pPicoEvent->VertexZ();
287 if (mVertexZCuts[1] > mVertexZCuts[0] &&
288 (vertexZ < mVertexZCuts[0] || vertexZ >= mVertexZCuts[1])) {
299 Bool_t StFlowCutEvent::CheckEvent(
StMuDst* pMu) {
301 if (!pMu)
return kFALSE;
305 if (!pMuEvent)
return kFALSE;
322 Int_t mult = pMuTracks->GetEntries();
323 if (mMultCuts[1] > mMultCuts[0] &&
324 (mult < mMultCuts[0] || mult >= mMultCuts[1])) {
333 Int_t centrality = 0;
335 flowTriggerBitMap = 0;
341 pMuEvent->triggerIdCollection().nominal().isTrigger(15007)
344 flowTriggerBitMap += 1;
345 cent = Flow::cent200Year4Full;
348 pMuEvent->triggerIdCollection().nominal().isTrigger(25007)
350 flowTriggerBitMap += 1;
351 cent = Flow::cent200Year4Half;
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 )
361 flowTriggerBitMap += 1;
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;
376 pMuEvent->triggerIdCollection().nominal().isTrigger(15105)
378 flowTriggerBitMap += 2;
379 cent = Flow::cent200Year4Full;
381 pMuEvent->triggerIdCollection().nominal().isTrigger(25105)
383 flowTriggerBitMap += 2;
384 cent = Flow::cent200Year4Half;
388 if (mTriggerCut==0 && (flowTriggerBitMap &2 || flowTriggerBitMap &1) ){
390 }
else if (mTriggerCut==1 && (flowTriggerBitMap &1) ){
392 }
else if (mTriggerCut==2 && (flowTriggerBitMap &2) ){
401 if (pMuEvent->runId() > 8000000) {
402 tracks = pMuEvent->grefmult();
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; }
418 if (mCentCuts[0] && mCentCuts[1] >= mCentCuts[0] &&
419 (centrality < mCentCuts[0] || centrality > mCentCuts[1])) {
429 if (mVertexXCuts[1] > mVertexXCuts[0] &&
430 (vertexX < mVertexXCuts[0] || vertexX >= mVertexXCuts[1])) {
437 if (mVertexYCuts[1] > mVertexYCuts[0] &&
438 (vertexY < mVertexYCuts[0] || vertexY >= mVertexYCuts[1])) {
445 if (mVertexZCuts[1] > mVertexZCuts[0] &&
446 (vertexZ < mVertexZCuts[0] || vertexZ >= mVertexZCuts[1])) {
458 Bool_t StFlowCutEvent::CheckEtaSymmetry(
StEvent* pEvent) {
463 if (((StFlowCutTrack::EtaSymPosTpc() == 0 || StFlowCutTrack::EtaSymNegTpc() == 0) &&
464 !(StFlowCutTrack::EtaSymPosTpc() == 0 && StFlowCutTrack::EtaSymNegTpc() == 0)) ||
465 ((StFlowCutTrack::EtaSymPosFtpc() == 0 || StFlowCutTrack::EtaSymNegFtpc() == 0) &&
466 !(StFlowCutTrack::EtaSymPosFtpc() == 0 && StFlowCutTrack::EtaSymNegFtpc() == 0))) {
472 float etaSymPosTpcN = (float)StFlowCutTrack::EtaSymPosTpc();
473 float etaSymNegTpcN = (float)StFlowCutTrack::EtaSymNegTpc();
474 float etaSymTpc = (etaSymPosTpcN - etaSymNegTpcN) / (etaSymPosTpcN + etaSymNegTpcN);
476 float etaSymPosFtpcN = (float)StFlowCutTrack::EtaSymPosFtpc();
477 float etaSymNegFtpcN = (float)StFlowCutTrack::EtaSymNegFtpc();
478 float etaSymFtpc = (etaSymPosFtpcN - etaSymNegFtpcN) / (etaSymPosFtpcN + etaSymNegFtpcN);
479 StFlowCutTrack::EtaSymClear();
482 if (!pVertex)
return kFALSE;
484 Float_t vertexZ = vertex.z();
486 etaSymTpc += (Flow::etaSymZSlopeTpc * vertexZ);
487 etaSymTpc *= ::sqrt((
double)(etaSymPosTpcN + etaSymNegTpcN));
489 etaSymFtpc += (Flow::etaSymZSlopeFtpc * vertexZ);
490 etaSymFtpc *= ::sqrt((
double)(etaSymPosFtpcN + etaSymNegFtpcN));
492 if (mEtaSymTpcCuts[1] > mEtaSymTpcCuts[0] &&
493 (etaSymTpc < mEtaSymTpcCuts[0] || etaSymTpc >= mEtaSymTpcCuts[1])) {
499 else if (mEtaSymFtpcCuts[1] > mEtaSymFtpcCuts[0] &&
500 (etaSymFtpc < mEtaSymFtpcCuts[0] || etaSymFtpc >= mEtaSymFtpcCuts[1])) {
516 if (((StFlowCutTrack::EtaSymPosTpc() == 0 || StFlowCutTrack::EtaSymNegTpc() == 0) &&
517 !(StFlowCutTrack::EtaSymPosTpc() == 0 && StFlowCutTrack::EtaSymNegTpc() == 0)) ||
518 ((StFlowCutTrack::EtaSymPosFtpc() == 0 || StFlowCutTrack::EtaSymNegFtpc() == 0) &&
519 !(StFlowCutTrack::EtaSymPosFtpc() == 0 && StFlowCutTrack::EtaSymNegFtpc() == 0))) {
525 float etaSymPosTpcN = (float)StFlowCutTrack::EtaSymPosTpc();
526 float etaSymNegTpcN = (float)StFlowCutTrack::EtaSymNegTpc();
527 float etaSymTpc = (etaSymPosTpcN - etaSymNegTpcN) / (etaSymPosTpcN + etaSymNegTpcN);
529 float etaSymPosFtpcN = (float)StFlowCutTrack::EtaSymPosFtpc();
530 float etaSymNegFtpcN = (float)StFlowCutTrack::EtaSymNegFtpc();
531 float etaSymFtpc = (etaSymPosFtpcN - etaSymNegFtpcN) / (etaSymPosFtpcN + etaSymNegFtpcN);
532 StFlowCutTrack::EtaSymClear();
534 Float_t vertexZ = pPicoEvent->VertexZ();
536 etaSymTpc += (Flow::etaSymZSlopeTpc * vertexZ);
537 etaSymTpc *= ::sqrt((
double)(etaSymPosTpcN + etaSymNegTpcN));
539 etaSymFtpc += (Flow::etaSymZSlopeFtpc * vertexZ);
540 etaSymFtpc *= ::sqrt((
double)(etaSymPosFtpcN + etaSymNegFtpcN));
542 if (mEtaSymTpcCuts[1] > mEtaSymTpcCuts[0] &&
543 (etaSymTpc < mEtaSymTpcCuts[0] || etaSymTpc >= mEtaSymTpcCuts[1])) {
549 else if (mEtaSymFtpcCuts[1] > mEtaSymFtpcCuts[0] &&
550 (etaSymFtpc < mEtaSymFtpcCuts[0] || etaSymFtpc >= mEtaSymFtpcCuts[1])) {
561 Bool_t StFlowCutEvent::CheckEtaSymmetry(
StMuEvent* pMuEvent) {
566 if (((StFlowCutTrack::EtaSymPosTpc() == 0 || StFlowCutTrack::EtaSymNegTpc() == 0) &&
567 !(StFlowCutTrack::EtaSymPosTpc() == 0 && StFlowCutTrack::EtaSymNegTpc() == 0)) ||
568 ((StFlowCutTrack::EtaSymPosFtpc() == 0 || StFlowCutTrack::EtaSymNegFtpc() == 0) &&
569 !(StFlowCutTrack::EtaSymPosFtpc() == 0 && StFlowCutTrack::EtaSymNegFtpc() == 0))) {
575 float etaSymPosTpcN = (float)StFlowCutTrack::EtaSymPosTpc();
576 float etaSymNegTpcN = (float)StFlowCutTrack::EtaSymNegTpc();
577 float etaSymTpc = (etaSymPosTpcN - etaSymNegTpcN) / (etaSymPosTpcN + etaSymNegTpcN);
579 float etaSymPosFtpcN = (float)StFlowCutTrack::EtaSymPosFtpc();
580 float etaSymNegFtpcN = (float)StFlowCutTrack::EtaSymNegFtpc();
581 float etaSymFtpc = (etaSymPosFtpcN - etaSymNegFtpcN) / (etaSymPosFtpcN + etaSymNegFtpcN);
582 StFlowCutTrack::EtaSymClear();
585 Float_t vertexZ = vertex.z();
587 etaSymTpc += (Flow::etaSymZSlopeTpc * vertexZ);
588 etaSymTpc *= ::sqrt((
double)(etaSymPosTpcN + etaSymNegTpcN));
590 etaSymFtpc += (Flow::etaSymZSlopeFtpc * vertexZ);
591 etaSymFtpc *= ::sqrt((
double)(etaSymPosFtpcN + etaSymNegFtpcN));
593 if (mEtaSymTpcCuts[1] > mEtaSymTpcCuts[0] &&
594 (etaSymTpc < mEtaSymTpcCuts[0] || etaSymTpc >= mEtaSymTpcCuts[1])) {
600 else if (mEtaSymFtpcCuts[1] > mEtaSymFtpcCuts[0] &&
601 (etaSymFtpc < mEtaSymFtpcCuts[0] || etaSymFtpc >= mEtaSymFtpcCuts[1])) {
613 void StFlowCutEvent::PrintCutList() {
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;
641 cout <<
"# Good Events = " << mGoodEventN <<
", " << setprecision(3) <<
642 (float)mGoodEventN/(
float)mEventN/perCent <<
"%" << endl;
643 cout <<
"#######################################################" << endl;
StThreeVectorF primaryVertexPosition(int vtx_id=-1) const
The StMuDst is supposed to be structured in 'physical events'. Therefore there is only 1 primary vert...
static TObjArray * primaryTracks()
returns pointer to a list of tracks belonging to the selected primary vertex
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)
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)