13 #ifndef __STEBYEEVENTCUTS__H
14 #define __STEBYEEVENTCUTS__H
17 #include "StMuDSTMaker/COMMON/StMuDst.h"
18 #include "StMuDSTMaker/COMMON/StMuEvent.h"
19 #include "StMuDSTMaker/COMMON/StMuPrimaryVertex.h"
20 #include "StMuDSTMaker/COMMON/StMuL3EventSummary.h"
21 #include "StEStructCuts.h"
36 CutName mgoodprimaryfractionName;
41 char mRunPeriod[1024];
43 unsigned int mtWord[2];
46 float mpVertexRadius[2];
48 float mgoodtoffraction[2];
49 float mgoodprimaryfraction[2];
64 virtual bool loadBaseCuts(
const char* name,
const char** vals,
int nvals);
65 virtual void loadUserCuts(
const char* name,
const char** vals,
int nvals);
66 virtual void printCutStats(ostream& ofs);
69 bool goodTrigger(
StMuDst* muDst);
70 bool goodVertexTopology(
StMuDst* muDst);
71 bool goodPrimaryVertexZ(
float z );
72 bool goodVPDVertex(
float dz );
73 bool goodPrimaryVertexRadius(
float r );
74 bool hasPrimaryVertexRadiusCut();
75 bool goodCentrality(
float n);
76 bool goodToFFraction(
int ndEdx,
int nToF);
77 bool hasToFFractionCut();
78 bool goodPrimaryFraction(
int ndPrimary,
int nGlobal);
79 bool hasPrimaryFractionCut();
80 bool goodZVertSep(
float dz);
81 bool hasZVertSepCut();
82 bool goodZVertMatch(
float dz);
83 bool hasZVertMatchCut();
85 char* triggerWordName(){
return (
char*)mtWordName.name; };
86 char* primaryVertexZName() {
return (
char*) mpVertexZName.name; };
87 char* primaryVPDVertexName() {
return (
char*) mpVPDVertexName.name; };
88 char* primaryVertexRadiusName() {
return (
char*) mpVertexRadiusName.name; };
89 char* centralityName() {
return (
char*) mcentralityName.name; };
90 char* goodtoffractionName() {
return (
char*) mgoodtoffractionName.name; };
91 char* goodprimaryfractionName() {
return (
char*) mgoodprimaryfractionName.name; };
92 char* zVertSepName() {
return (
char*) mZVertSepName.name; };
93 char* zVertMatchName() {
return (
char*) mZVertMatchName.name; };
100 inline void StEStructEventCuts::loadUserCuts(
const char* name,
const char** vals,
int nvals){}
102 inline bool StEStructEventCuts::goodPrimaryVertexZ(
float z) {
103 mvalues[mpVertexZName.idx] = z;
104 if (mpVertexZ[0]==mpVertexZ[1] && mpVertexZ[0]==0) {
107 return (z>=mpVertexZ[0] && z<=mpVertexZ[1]);
110 inline bool StEStructEventCuts::goodVPDVertex(
float dz) {
111 mvalues[mpVPDVertexName.idx] = dz;
112 if (mpVPDVertex[0]==mpVPDVertex[1] && mpVPDVertex[0]==0) {
115 return (dz>=mpVPDVertex[0] && dz<=mpVPDVertex[1]);
118 inline bool StEStructEventCuts::goodPrimaryVertexRadius(
float r) {
119 mvalues[mpVertexRadiusName.idx] = r;
120 if (mpVertexRadius[0]==mpVertexRadius[1] && mpVertexRadius[0]==0) {
123 return (r>=mpVertexRadius[0] && r<=mpVertexRadius[1]);
125 inline bool StEStructEventCuts::hasPrimaryVertexRadiusCut() {
126 return (mpVertexRadius[1]!=0);
129 inline bool StEStructEventCuts::goodCentrality(
float c){
130 mvalues[mcentralityName.idx] = c;
131 return ( (mcentrality[0]==mcentrality[1] && mcentrality[0]==0) ||
132 (c>=mcentrality[0] && c<=mcentrality[1]) );
135 inline bool StEStructEventCuts::goodToFFraction(
int ndEdx,
int nToF) {
136 if (mgoodtoffraction[0]==mgoodtoffraction[1] && mgoodtoffraction[0]==0) {
143 float sToF = nToF - ndEdx * mgoodtoffraction[0];
144 if ((fabs(sToF) < mgoodtoffraction[1]) &&
145 (sToF > -0.5*ndEdx)) {
150 inline bool StEStructEventCuts::hasToFFractionCut() {
151 return (mgoodtoffraction[0]!=mgoodtoffraction[1]);
154 inline bool StEStructEventCuts::goodPrimaryFraction(
int nPrimary,
int nGlobal) {
155 if (mgoodprimaryfraction[0]==mgoodprimaryfraction[1] && mgoodprimaryfraction[0]==0) {
158 float dPrim = nGlobal/mgoodprimaryfraction[0] - nPrimary;
159 if (dPrim < mgoodprimaryfraction[1]) {
164 inline bool StEStructEventCuts::hasPrimaryFractionCut() {
165 return (mgoodprimaryfraction[0]!=mgoodprimaryfraction[1]);
168 inline bool StEStructEventCuts::goodZVertSep(
float dz){
169 mvalues[mZVertSepName.idx] = dz;
170 return ( (mZVertSep[0]==mZVertSep[1] && mZVertSep[0]==0) ||
171 (dz<mZVertSep[0] || mZVertSep[1]<dz) );
173 inline bool StEStructEventCuts::hasZVertSepCut() {
174 return (mZVertSep[0]!=mZVertSep[1]);
177 inline bool StEStructEventCuts::goodZVertMatch(
float dz){
179 mvalues[mZVertMatchName.idx] = dz;
180 return ( (mZVertMatch[0]==mZVertMatch[1] && mZVertMatch[0]==0) ||
181 (dz<mZVertMatch[0] || mZVertMatch[1]<dz) );
183 inline bool StEStructEventCuts::hasZVertMatchCut() {
184 return (mZVertMatch[0]!=mZVertMatch[1]);