13 #include "StEStructTrackCuts.h"
20 StEStructTrackCuts::StEStructTrackCuts(
const char* cutfileName):
StEStructCuts(cutfileName) { init(); };
22 StEStructTrackCuts::~StEStructTrackCuts() {};
24 void StEStructTrackCuts::init(){
26 strcpy(mcutTypeName,
"Track");
29 if(isLoaded())loadCuts();
33 void StEStructTrackCuts::initCuts(){
36 mcharge[0]=mcharge[1]=0;
37 mnfitpoints[0]=mnfitpoints[1]=0;
38 mnfitnmax[0]=mnfitnmax[1]=0;
39 mglobalDCA[0]=mglobalDCA[1]=0;
41 mdPtByPt[0]=mdPtByPt[1]=0;
47 mTOFEMass[0]=mTOFEMass[1]=0;
48 mnsigmaE[0]=mnsigmaE[1]=0;
49 mnsigmaPi[0]=mnsigmaPi[1]=0;
50 mnsigmaK[0]=mnsigmaK[1]=0;
51 mnsigmaP[0]=mnsigmaP[1]=0;
52 mhijingFragment[0]=mhijingFragment[1]=0;
58 void StEStructTrackCuts::initNames(){
60 strcpy(mflagName.name,
"Flag");
61 strcpy(mchargeName.name,
"Charge");
62 strcpy(mnfitpointsName.name,
"NFitPoints");
63 strcpy(mnfitnmaxName.name,
"NFitPerNMax");
64 strcpy(mglobalDCAName.name,
"GlobalDCA");
65 strcpy(mchi2Name.name,
"Chi2");
66 strcpy(mdPtByPtName.name,
"dPtByPt");
67 strcpy(mptName.name,
"Pt");
68 strcpy(mytName.name,
"Yt");
69 strcpy(mxtName.name,
"Xt") ;
70 strcpy(mphiName.name,
"Phi");
71 strcpy(metaName.name,
"Eta");
72 strcpy(mTOFEMassName.name,
"TOFEMass");
73 strcpy(mnsigmaEName.name,
"NSigmaElectron");
74 strcpy(mnsigmaPiName.name,
"NSigmaPion");
75 strcpy(mnsigmaKName.name,
"NSigmaKaon");
76 strcpy(mnsigmaPName.name,
"NSigmaProton");
77 strcpy(mhijingFragmentName.name,
"hijingFragment");
81 bool StEStructTrackCuts::loadBaseCuts(
const char* name,
const char** vals,
int nvals){
83 if(!strcmp(name,mflagName.name)){
84 mflag[0]=atoi(vals[0]); mflag[1]=atoi(vals[1]);
85 mflagName.idx = createCutHists(name,mflag);
89 if(!strcmp(name,mchargeName.name)){
90 mcharge[0]=atoi(vals[0]); mcharge[1]=atoi(vals[1]);
91 mchargeName.idx = createCutHists(name,mcharge);
95 if(!strcmp(name,mnfitpointsName.name)){
96 mnfitpoints[0]=atoi(vals[0]); mnfitpoints[1]=atoi(vals[1]);
97 mnfitpointsName.idx = createCutHists(name,mnfitpoints);
98 setRange(mnfitpointsName.name,mnfitpoints[0],mnfitpoints[1]);
102 if(!strcmp(name,mnfitnmaxName.name)){
103 mnfitnmax[0]=atof(vals[0]); mnfitnmax[1]=atof(vals[1]);
104 mnfitnmaxName.idx = createCutHists(name,mnfitnmax);
108 if(!strcmp(name,mglobalDCAName.name)){
109 mglobalDCA[0]=atof(vals[0]); mglobalDCA[1]=atof(vals[1]);
110 mglobalDCAName.idx = createCutHists(name,mglobalDCA);
114 if(!strcmp(name,mchi2Name.name)){
115 mchi2[0]=atof(vals[0]); mchi2[1]=atof(vals[1]);
116 mchi2Name.idx = createCutHists(name,mchi2);
120 if(!strcmp(name,mdPtByPtName.name)){
121 mdPtByPt[0]=atof(vals[0]); mdPtByPt[1]=atof(vals[1]);
122 mdPtByPtName.idx = createCutHists(name,mdPtByPt);
126 if(!strcmp(name,mptName.name)){
127 mpt[0]=atof(vals[0]); mpt[1]=atof(vals[1]);
128 mptName.idx = createCutHists(name,mpt);
129 setRange(mptName.name,mpt[0],mpt[1]);
133 if(!strcmp(name,mytName.name)){
134 myt[0]=atof(vals[0]); myt[1]=atof(vals[1]);
135 mytName.idx = createCutHists(name,myt);
136 setRange(mytName.name,myt[0],myt[1]);
140 if(!strcmp(name,mxtName.name)){
141 mxt[0]=atof(vals[0]); mxt[1]=atof(vals[1]);
142 mxtName.idx = createCutHists(name,mxt);
143 setRange(mxtName.name,mxt[0],mxt[1]);
147 if(!strcmp(name,mphiName.name)){
148 mphi[0]=(float)(M_PI*atof(vals[0])); mphi[1]=(float)(M_PI*atof(vals[1]));
149 mphiName.idx = createCutHists(name,mphi);
150 setRange(mphiName.name,mphi[0],mphi[1]);
154 if(!strcmp(name,metaName.name)){
155 meta[0]=atof(vals[0]); meta[1]=atof(vals[1]);
156 metaName.idx = createCutHists(name,meta);
157 setRange(metaName.name,meta[0],meta[1]);
161 if(!strcmp(name,mTOFEMassName.name)){
162 mTOFEMass[0]=atof(vals[0]); mTOFEMass[1]=atof(vals[1]);
163 mTOFEMassName.idx = createCutHists(name,mTOFEMass);
167 if(!strcmp(name,mnsigmaEName.name)){
168 mnsigmaE[0]=atof(vals[0]); mnsigmaE[1]=atof(vals[1]);
169 mnsigmaEName.idx = createCutHists(name,mnsigmaE);
173 if(!strcmp(name,mnsigmaPiName.name)){
174 mnsigmaPi[0]=atof(vals[0]); mnsigmaPi[1]=atof(vals[1]);
175 mnsigmaPiName.idx = createCutHists(name,mnsigmaPi);
179 if(!strcmp(name,mnsigmaKName.name)){
180 mnsigmaK[0]=atof(vals[0]); mnsigmaK[1]=atof(vals[1]);
181 mnsigmaKName.idx = createCutHists(name,mnsigmaK);
185 if(!strcmp(name,mnsigmaPName.name)){
186 mnsigmaP[0]=atof(vals[0]); mnsigmaP[1]=atof(vals[1]);
187 mnsigmaPName.idx = createCutHists(name,mnsigmaP);
191 if(!strcmp(name,mhijingFragmentName.name)){
197 sscanf(vals[0],
"%s\t",mFragmentType);
198 if (!strcmp(mFragmentType,
"projectileString")) {
199 mFragTypes[mNFragTypes] = 3;
201 }
else if (!strcmp(mFragmentType,
"targetString")) {
202 mFragTypes[mNFragTypes] = 13;
204 }
else if (!strcmp(mFragmentType,
"hardScatter")) {
205 mFragTypes[mNFragTypes] = 20;
207 }
else if (!strcmp(mFragmentType,
"softSea")) {
208 mFragTypes[mNFragTypes] = 30;
211 if (mhijingFragment[1]==0) {
212 mhijingFragment[0]=0; mhijingFragment[1]=50;
213 mhijingFragmentName.idx = createCutHists(name,mhijingFragment);
223 bool StEStructTrackCuts::goodFragment(
int ifragtype){
224 mvalues[mhijingFragmentName.idx] = ifragtype;
225 if (mNFragTypes == 0) {
228 for (
int it=0;it<mNFragTypes;it++) {
229 if (mFragTypes[it] == ifragtype) {
230 if (ifragtype == 20) {
240 void StEStructTrackCuts::printCutStats(ostream& ofs){
247 ofs<<mflagName.name<<
","<<mflag[0]<<
","<<mflag[1]<<
"\t\t\t"<<
" # track flag cut"<<endl;
248 ofs<<mchargeName.name<<
","<<mcharge[0]<<
","<<mcharge[1]<<
"\t\t\t"<<
" # charge cut"<<endl;
249 ofs<<mnfitpointsName.name<<
","<<mnfitpoints[0]<<
","<<mnfitpoints[1]<<
"\t\t"<<
" # fit points cut"<<endl;
250 ofs<<mnfitnmaxName.name<<
","<<mnfitnmax[0]<<
","<<mnfitnmax[1]<<
"\t\t"<<
" # fitpoints per possible cut"<<endl;
251 ofs<<mglobalDCAName.name<<
","<<mglobalDCA[0]<<
","<<mglobalDCA[1]<<
"\t\t\t"<<
" # global DCA cut"<<endl;
252 ofs<<mchi2Name.name<<
","<<mchi2[0]<<
","<<mchi2[1]<<
"\t\t\t"<<
" # chi square cut"<<endl;
253 ofs<<mdPtByPtName.name<<
","<<mdPtByPt[0]<<
","<<mdPtByPt[1]<<
"\t\t\t"<<
" # sigma for determination of sign of charge"<<endl;
254 ofs<<mptName.name<<
","<<mpt[0]<<
","<<mpt[1]<<
"\t\t\t"<<
" # pt cut"<<endl;
255 ofs<<mytName.name<<
","<<myt[0]<<
","<<myt[1]<<
"\t\t\t"<<
" # yt cut"<<endl;
256 ofs<<mphiName.name<<
","<<mphi[0]/M_PI<<
","<<mphi[1]/M_PI<<
"\t\t\t"<<
" # phi cut in factor of pi"<<endl;
257 ofs<<metaName.name<<
","<<meta[0]<<
","<<meta[1]<<
"\t\t\t"<<
" # eta cut"<<endl;
258 ofs<<mTOFEMassName.name<<
","<<mTOFEMass[0]<<
","<<mTOFEMass[1]<<
"\t\t"<<
" # num TOF electron Mass cut"<<endl;
259 ofs<<mnsigmaEName.name<<
","<<mnsigmaE[0]<<
","<<mnsigmaE[1]<<
"\t\t"<<
" # num sigma electron cut"<<endl;
260 ofs<<mnsigmaPiName.name<<
","<<mnsigmaPi[0]<<
","<<mnsigmaPi[1]<<
"\t\t\t"<<
" # num sigma Pion cut"<<endl;
261 ofs<<mnsigmaKName.name<<
","<<mnsigmaK[0]<<
","<<mnsigmaK[1]<<
"\t\t\t"<<
" # num sigma Kaon cut"<<endl;
262 ofs<<mnsigmaPName.name<<
","<<mnsigmaP[0]<<
","<<mnsigmaP[1]<<
"\t\t"<<
" # num sigma proton cut"<<endl;