27 #include "StFmsPointPair.h"
28 #include "StFmsPoint.h"
29 #include "St_base/StMessMgr.h"
32 static const char rcsid[] =
"$Id: StFmsPointPair.cxx,v 2.4 2017/11/20 20:01:49 smirnovd Exp $";
34 StFmsPointPair::StFmsPointPair() : mFpsPid(0), mConeRadius{0.100, 0.070, 0.030}
36 memset(mConeEnergy,0,
sizeof(mConeEnergy));
37 mFourMomentum.setPx(0.0);
38 mFourMomentum.setPy(0.0);
39 mFourMomentum.setPz(0.0);
40 mFourMomentum.setE(0.0);
52 StFmsPointPair::~StFmsPointPair() { }
56 mFourMomentum = mFourMomentum +
StLorentzVectorD((
double)p->fourMomentum().x(),
57 (double)p->fourMomentum().y(),
58 (double)p->fourMomentum().z(),
59 (double)p->fourMomentum().e());
60 mFpsPid += (p->fpsPid()/10)*pow(10,nPoints()-1);
64 if (v>=0 && v<nPoints())
return mPoints[v];
69 float StFmsPointPair::x()
const {
71 (mPoints[0]->XYZ().x() * mPoints[0]->energy() +
72 mPoints[1]->XYZ().x() * mPoints[1]->energy() ) /
73 (mPoints[0]->energy() + mPoints[1]->energy());
77 float StFmsPointPair::y()
const {
79 (mPoints[0]->XYZ().y() * mPoints[0]->energy() +
80 mPoints[1]->XYZ().y() * mPoints[1]->energy() ) /
81 (mPoints[0]->energy() + mPoints[1]->energy());
84 float StFmsPointPair::dgg()
const {
85 if (nPoints()!=2)
return -1.0;
86 return (mPoints[0]->XYZ() - mPoints[1]->XYZ()).mag();
89 float StFmsPointPair::zgg()
const {
90 if (nPoints()!=2)
return -1.0;
91 float e1=mPoints[0]->energy();
92 float e2=mPoints[1]->energy();
93 return fabs(e1-e2)/(e1+e2);
96 float StFmsPointPair::coneRadius(
int cone)
const {
97 if (cone>=0 && cone<kFmsPointMaxCone)
return mConeRadius[cone];
101 float StFmsPointPair::coneEnergy(
int cone)
const {
102 if (cone>=0 && cone<kFmsPointMaxCone)
return mConeEnergy[cone];
106 float StFmsPointPair::coneEnergyFraction(
int cone)
const {
107 if (cone>=0 && cone<kFmsPointMaxCone && mConeEnergy[cone]>0.0)
return energy()/mConeEnergy[cone];
111 void StFmsPointPair::setConeEnergy(
int cone,
float energy) {
112 if (cone>=0 && cone<kFmsPointMaxCone)
113 mConeEnergy[cone]=energy;
116 void StFmsPointPair::print(
int opt) {
117 cout << Form(
"StFmsPointPair: N=%3d E=%6.1f pT=%6.2f eta=%6.2f Zgg=%6.3f Dgg=%7.3f M=%6.3f ",
118 nPoints(),energy(),pT(),eta(),zgg(),dgg(),mass());
119 for(
int cone=0; cone<kFmsPointMaxCone; cone++) {
120 cout << Form(
"R%d=%6.3f ",
int(coneRadius(cone)*1000.0+0.5),coneEnergyFraction(cone));
122 cout << Form(
"PID=%d PointId: ",fpsPid());
123 for(
int i=0; i<nPoints(); i++) {
124 cout << Form(
"%3d ",mPoints[i]->
id());