20 #include "StHbtMaker/Cut/anglePairCut.h"
23 #include "StHbtMaker/Infrastructure/StHbtReactionPlaneAnalysis.h"
30 anglePairCut::anglePairCut(){
31 mNPairsPassed = mNPairsFailed = 0;
39 anglePairCut::anglePairCut(
char* title){
40 mNPairsPassed = mNPairsFailed = 0;
41 char TitT[100] =
"betaT";
43 mBetaT =
new StHbt1DHisto(TitT,
"Transverse Velocity",100,0,1);
44 char TitL[100] =
"betaL";
46 mBetaL =
new StHbt1DHisto(TitL,
"Longitudinal Velocity",100,0,1);
47 char TitT2[100] =
"betaT2";
49 mBetaT2 =
new StHbt1DHisto(TitT2,
"Transverse Velocity Squared",100,0,1);
50 char TitL2[100] =
"betaL2";
52 mBetaL2 =
new StHbt1DHisto(TitL2,
"Longitudinal Velocity Squared",100,0,1);
53 char TitTL[100] =
"betaTL";
55 mBetaTL =
new StHbt1DHisto(TitTL,
"Transverse*Longitudinal Velocity",100,0,1);
62 bool anglePairCut::Pass(
const StHbtPair* pair){
63 if ( (mAngle1[0]<0.0)&&(mAngle2[0]<0.0) )
return true;
67 double pxTotal = pair->fourMomentumSum().x();
68 double pyTotal = pair->fourMomentumSum().y();
69 double angle = atan2(pyTotal,pxTotal)*180.0/pi;
71 if (angle<0.0) angle+=360.0;
74 double RPangle = RPanal->ReactionPlane()*180.0/pi;
75 double angleDifference = angle-RPangle;
77 if (angleDifference<0.0) angleDifference+=360.0;
80 if ( (mAngle2[0]>360.0) && (mAngle2[1]>360.0) ) {
81 if (mAngle1[0]<mAngle1[1]) {
82 temp1 = ( (mAngle1[0]<angleDifference) &&
83 (angleDifference<mAngle1[1]) );
86 temp1 = ( (mAngle1[0]<angleDifference) ||
87 (angleDifference<mAngle1[1]) );
92 if ( (mAngle2[0]<360.0) || (mAngle2[1]<360.0) ) {
93 if (mAngle1[0]<mAngle1[1]) {
94 temp1 = ( (mAngle1[0]<angleDifference) &&
95 (angleDifference<mAngle1[1]) );
96 if (mAngle2[0]<mAngle2[1]) {
97 temp2 = ( (mAngle2[0]<angleDifference) &&
98 (angleDifference<mAngle2[1]) );
101 temp2 = ( (mAngle2[0]<angleDifference) ||
102 (angleDifference<mAngle2[1]) );
106 temp1 = ( (mAngle1[0]<angleDifference) ||
107 (angleDifference<mAngle1[1]) );
108 if (mAngle2[0]<mAngle2[1]) {
109 temp2 = ( (mAngle2[0]<angleDifference) &&
110 (angleDifference<mAngle2[1]) );
113 temp2 = ( (mAngle2[0]<angleDifference) ||
114 (angleDifference<mAngle2[1]) );
119 temp = temp1 || temp2;
120 if ( temp && mBetaT ) {
121 double pT = pair->fourMomentumSum().perp();
122 double pZ = pair->fourMomentumSum().pz();
123 double e = pair->fourMomentumSum().e();
127 mBetaT2->Fill( pT*pT/(e2) );
128 mBetaL2->Fill( pZ*pZ/(e2) );
129 mBetaTL->Fill( pT*pZ/(e2) );
131 temp ? mNPairsPassed++ : mNPairsFailed++;
135 StHbtString anglePairCut::Report(){
136 string Stemp =
"Angle Pair Cut - total dummy-- always returns true\n";
138 sprintf(Ctemp,
"Number of pairs which passed:\t%ld Number which failed:\t%ld\n",mNPairsPassed,mNPairsFailed);
140 StHbtString returnThis = Stemp;
144 double anglePairCut::EmissionAngle(
const StHbtPair *pair) {
145 double pxTotal = pair->fourMomentumSum().x();
146 double pyTotal = pair->fourMomentumSum().y();
147 double angle = atan2(pyTotal,pxTotal)*180.0/pi;
148 if (angle<0.0) angle+=360.0;
150 double RPangle = RPanal->ReactionPlane()*180.0/pi;
151 double angleDifference = angle-RPangle;
152 if (angleDifference<0.0) angleDifference+=360.0;
153 return angleDifference;