00001
00002
00003
00004
00005 #include "stdlib.h"
00006 #include <stdio.h>
00007 #include "math.h"
00008 #include "StFmsPi0Filter.h"
00009 #include "StGenParticle.h"
00010
00021
00022 static StFmsPi0Filter fmsFilter;
00023
00085
00086
00087 StFmsPi0Filter::StFmsPi0Filter(): StMCFilter("fmsfilt")
00088 {
00089 mEtaMin=2.8; mEtaMax=4.1; mPtMin=1.0;
00090 cout << "StFmsPi0Filter::StFmsPi0Filter Setting Default parameters"<<endl;
00091 cout << "StFmsPi0Filter::StFmsPi0Filter EtaMin="<<mEtaMin<<endl;
00092 cout << "StFmsPi0Filter::StFmsPi0Filter EtaMax="<<mEtaMax<<endl;
00093 cout << "StFmsPi0Filter::StFmsPi0Filter PtMin= "<<mPtMin<<endl;
00094 };
00095
00096
00097 int StFmsPi0Filter::RejectGT(const StGenParticleMaster &ptl) const
00098 {
00099
00100 const StGenParticle *tk=0;
00101 int n = ptl.Size();
00102 int ntk=0;
00103 for (int i=0;i<n;i++) {
00104 tk = ptl(i); if (!tk) continue;
00105 if (tk->GetPdgCode()==111 &&
00106 tk->Eta() > mEtaMin &&
00107 tk->Eta() < mEtaMax &&
00108 tk->Pt() > mPtMin ){
00109 double p[4];
00110 tk->Momentum(p);
00111 #ifdef __DEBUG__
00112 printf("PI0!!! %3d St=%3d Pid=%5d Gid=%3d P=%7.2f %7.2f %7.2f %7.2f pt=%7.2f eta=%7.2f\n",
00113 i,tk->GetStatusCode(),tk->GetPdgCode(),tk->GetGeaCode(),
00114 p[0],p[1],p[2],p[3],tk->Pt(),tk->Eta()
00115 );
00116 #endif
00117 ntk++;
00118 }
00119 }
00120 if (ntk==0) {return 1;}
00121
00122 printf("Accepted/Total EG=%10d/%10d GT=%10d/%10d GE=%10d/%10d\n",
00123 GetNTotEG()-1-GetNRejEG(),GetNTotEG(),
00124 GetNTotGT()-GetNRejGT(),GetNTotGT(),
00125 GetNTotGE()-GetNRejGE(),GetNTotGE());
00126 return 0;
00127 }
00128
00129 int StFmsPi0Filter::RejectEG(const StGenParticleMaster &ptl) const
00130 {
00131
00132 return 0;
00133 }
00134
00135 int StFmsPi0Filter::RejectGE(const StGenParticleMaster &ptl) const
00136 {
00137
00138 return 0;
00139 }
00140
00141 void StFmsPi0Filter::ChangeConfig(string attr, float val)
00142 {
00143 if (attr == "EtaMin"){
00144 cout << "StFmsPi0Filter::ChangeConfig() Setting EtaMin to " << val << endl;
00145 mEtaMin = val;
00146 } else if (attr == "EtaMax"){
00147 cout << "StFmsPi0Filter::ChangeConfig() Setting EtaMax to " << val << endl;
00148 mEtaMax = val;
00149 } else if (attr == "PtMin"){
00150 cout << "StFmsPi0Filter::ChangeConfig() Setting PtMin to " << val << endl;
00151 mPtMin = val;
00152 } else {
00153 cout << "StFmsPi0Filter::ChangeConfig() Unknown parameter " << attr << endl;
00154 }
00155 }