7 #include "StMCFilter/StGenParticle.h"
8 #include "StMCFilter/StBemcGammaFilter.h"
45 if(attr ==
"ConeRadius")
47 cout <<
"StBemcGammaFilter::parseConfig() - Setting mConeRadius to " << val << endl;
50 else if(attr ==
"SeedThreshold")
52 cout <<
"StBemcGammaFilter::parseConfig() - Setting mSeedThreshold to " << val << endl;
55 else if(attr ==
"ClusterThreshold")
57 cout <<
"StBemcGammaFilter::parseConfig() - Setting mClusterThreshold to " << val << endl;
60 else if(attr ==
"EtaLow")
62 cout <<
"StBemcGammaFilter::parseConfig() - Setting mEtaLow to " << val << endl;
65 else if(attr ==
"EtaHigh")
67 cout <<
"StBemcGammaFilter::parseConfig() - Setting mEtaHigh to " << val << endl;
70 else if(attr ==
"MaxVertex")
72 cout <<
"StBemcGammaFilter::parseConfig() - Setting mMaxVertex to " << val << endl;
77 cout <<
"StBemcGammaFilter::parseConfig() - " << attr <<
" is not an existing parameter!" << endl;
94 double p[4] = {0, 0, 0, 0};
95 double v[3] = {0, 0, 0};
104 double particleEt = 0;
105 double detectorEt = 0;
106 double detectorEta = 0;
107 double detectorPhi = 0;
112 double rSmd = 230.705;
113 double rSmd2 = rSmd * rSmd;
121 double pi = 3.141592653589793;
123 map<double, kinematics> seedTracks;
124 map<double, kinematics> eventTracks;
127 for(
int i = 0; i < ptl.Size(); ++i)
134 if(track->GetStatusCode() != 1)
continue;
136 id = track->GetPdgCode();
144 hadronFlag = abs(
id) != 22 && abs(
id) != 111 && abs(
id) != 221 && abs(
id) != 11;
145 hadronFlag &=
id != -2212 &&
id != -2112;
147 if(hadronFlag) E *= 0.85;
153 pT2 = p[0] * p[0] + p[1] * p[1];
154 particleEt = E * sqrt( pT2 / (pT2 + p[2] * p[2]) );
157 pdotv = p[0] * v[0] + p[1] + v[1];
158 pcrossv = p[0] * v[1] - p[1] * v[0];
159 N = ( - pdotv + sqrt( pT2 * rSmd2 - pcrossv ) ) / pT2;
161 for(
unsigned int j = 0; j < 3; ++j) p[j] = N * p[j] + v[j];
163 rho2 = p[0] * p[0] + p[1] * p[1];
165 detectorEt = E * sqrt( rho2 / (rho2 + p[2] * p[2] ) );
166 detectorEta = - log( sqrt(rho2) / ( sqrt( rho2 + p[2] * p[2] ) + p[2] ) );
167 detectorPhi = atan2(p[1], p[0]);
170 if(detectorEta <
mEtaLow)
continue;
171 if(detectorEta >
mEtaHigh)
continue;
177 eventTracks[detectorPhi] =
kinematics(particleEt, detectorEta, detectorPhi);
184 map<double, kinematics>::iterator itSeed;
185 map<double, kinematics>::iterator itEvent;
196 itEvent = eventTracks.begin();
198 for(itSeed = seedTracks.begin(); itSeed != seedTracks.end(); ++itSeed)
209 while(itEvent != eventTracks.begin())
211 if(itEvent->first > phiLeft) --itEvent;
220 map<double, kinematics>::reverse_iterator rit = eventTracks.rbegin();
221 if(rit->first > phiLeft + 2 * pi)
225 phiLeft = phiLeft + 2 * pi;
226 phiRight = phiRight + 2 * pi;
229 while(rit->first > phiLeft) ++rit;
234 itEvent = (++rit).base();
241 while(itEvent->first < phiLeft) ++itEvent;
246 while(itEvent->first < phiRight)
249 dEta = itSeed->second.eta - itEvent->second.eta;
250 dPhi = acos( cos( itSeed->first - itEvent->first) );
251 R = sqrt( dEta * dEta + dPhi * dPhi );
259 if(itEvent == eventTracks.end())
263 phiLeft = phiLeft - 2 * pi;
264 phiRight = phiRight - 2 * pi;
266 itEvent = eventTracks.begin();
double mEtaHigh
Maximum detector eta.
double mConeRadius
Cone radius of cluster.
double mClusterThreshold
Cluster E_{T} threshold for clustering finding.
Abstract base class for particles related to common /HEPEVT/.
void parseConfig(std::string, float)
int RejectGT(const StGenParticleMaster &ptl) const
double mSeedThreshold
Seed energy threshold for cluster finding.
double mMaxVertex
Maximum vertex magnitude in cm.
double mEtaLow
Minimum detector eta.
StBemcGammaFilter()
Constructor.
Sparse class to hold track kinematics.