StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFmsPi0Filter.cxx
1 // @(#)root/eg:$Id: StFmsPi0Filter.cxx,v 1.4 2011/01/07 16:57:18 jwebb Exp $
2 // Author: Victor Perev 17/03/2009
3 
4 //______________________________________________________________________________
5 #include "stdlib.h"
6 #include <stdio.h>
7 #include "math.h"
8 #include "StFmsPi0Filter.h"
9 #include "StGenParticle.h"
10 
21 
22 static StFmsPi0Filter fmsFilter;
23 
85 
86 
88 {
89  mEtaMin=2.8; mEtaMax=4.1; mPtMin=1.0;
90  cout << "StFmsPi0Filter::StFmsPi0Filter Setting Default parameters"<<endl;
91  cout << "StFmsPi0Filter::StFmsPi0Filter EtaMin="<<mEtaMin<<endl;
92  cout << "StFmsPi0Filter::StFmsPi0Filter EtaMax="<<mEtaMax<<endl;
93  cout << "StFmsPi0Filter::StFmsPi0Filter PtMin= "<<mPtMin<<endl;
94 };
95 
96 //______________________________________________________________________________
98 {
99  //ptl.Print("************** In RejectGT ************** ");
100  const StGenParticle *tk=0;
101  int n = ptl.Size();
102  int ntk=0;
103  for (int i=0;i<n;i++) {
104  tk = ptl(i); if (!tk) continue;
105  if (tk->GetPdgCode()==111 &&
106  tk->Eta() > mEtaMin &&
107  tk->Eta() < mEtaMax &&
108  tk->Pt() > mPtMin ){
109  double p[4];
110  tk->Momentum(p);
111 #ifdef __DEBUG__
112  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",
113  i,tk->GetStatusCode(),tk->GetPdgCode(),tk->GetGeaCode(),
114  p[0],p[1],p[2],p[3],tk->Pt(),tk->Eta()
115  );
116 #endif
117  ntk++;
118  }
119  }
120  if (ntk==0) {return 1;}
121 
122  printf("Accepted/Total EG=%10d/%10d GT=%10d/%10d GE=%10d/%10d\n",
123  GetNTotEG()-1-GetNRejEG(),GetNTotEG(),
126  return 0;
127 }
128 //______________________________________________________________________________
130 {
131  //ptl.Print("************** In RejectEG ************** ");
132  return 0;
133 }
134 //______________________________________________________________________________
136 {
137  //ptl.Print("************** In RejectGE ************** ");
138  return 0;
139 }
140 //______________________________________________________________________________
141 void StFmsPi0Filter::ChangeConfig(string attr, float val)
142 {
143  if (attr == "EtaMin"){
144  cout << "StFmsPi0Filter::ChangeConfig() Setting EtaMin to " << val << endl;
145  mEtaMin = val;
146  } else if (attr == "EtaMax"){
147  cout << "StFmsPi0Filter::ChangeConfig() Setting EtaMax to " << val << endl;
148  mEtaMax = val;
149  } else if (attr == "PtMin"){
150  cout << "StFmsPi0Filter::ChangeConfig() Setting PtMin to " << val << endl;
151  mPtMin = val;
152  } else {
153  cout << "StFmsPi0Filter::ChangeConfig() Unknown parameter " << attr << endl;
154  }
155 }
static int GetNRejEG()
Number of rejected GE events.
Definition: StMCFilter.h:80
Abstract base class for particles related to common /HEPEVT/.
static int GetNRejGT()
Number of rejected GT events.
Definition: StMCFilter.h:82
int RejectGE(const StGenParticleMaster &ptl) const
Rejection at GEANT End, No GEANT output.
static int GetNTotGE()
Number of total GE events.
Definition: StMCFilter.h:78
static int GetNRejGE()
Number of rejected GE events.
Definition: StMCFilter.h:84
int RejectEG(const StGenParticleMaster &ptl) const
Rejection inside of EventGenerator (Pythia)
static int GetNTotGT()
Number of total GT events.
Definition: StMCFilter.h:76
static int GetNTotEG()
Number of total EG events.
Definition: StMCFilter.h:74
int RejectGT(const StGenParticleMaster &ptl) const
Rejection of GEANT Tracking.