00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "StHbtMaker/Cut/anglePairCut.h"
00021 #include <string>
00022 #include <cstdio>
00023 #include "StHbtMaker/Infrastructure/StHbtReactionPlaneAnalysis.h"
00024
00025 #ifdef __ROOT__
00026 ClassImp(anglePairCut)
00027 #endif
00028
00029
00030 anglePairCut::anglePairCut(){
00031 mNPairsPassed = mNPairsFailed = 0;
00032 mBetaT = 0;
00033 mBetaL = 0;
00034 mBetaT2 = 0;
00035 mBetaL2 = 0;
00036 mBetaTL = 0;
00037 }
00038
00039 anglePairCut::anglePairCut(char* title){
00040 mNPairsPassed = mNPairsFailed = 0;
00041 char TitT[100] = "betaT";
00042 strcat(TitT,title);
00043 mBetaT = new StHbt1DHisto(TitT,"Transverse Velocity",100,0,1);
00044 char TitL[100] = "betaL";
00045 strcat(TitL,title);
00046 mBetaL = new StHbt1DHisto(TitL,"Longitudinal Velocity",100,0,1);
00047 char TitT2[100] = "betaT2";
00048 strcat(TitT2,title);
00049 mBetaT2 = new StHbt1DHisto(TitT2,"Transverse Velocity Squared",100,0,1);
00050 char TitL2[100] = "betaL2";
00051 strcat(TitL2,title);
00052 mBetaL2 = new StHbt1DHisto(TitL2,"Longitudinal Velocity Squared",100,0,1);
00053 char TitTL[100] = "betaTL";
00054 strcat(TitTL,title);
00055 mBetaTL = new StHbt1DHisto(TitTL,"Transverse*Longitudinal Velocity",100,0,1);
00056 }
00057
00058
00059
00060
00061
00062 bool anglePairCut::Pass(const StHbtPair* pair){
00063 if ( (mAngle1[0]<0.0)&&(mAngle2[0]<0.0) ) return true;
00064 bool temp = false;
00065 bool temp1 = false;
00066 bool temp2 = false;
00067 double pxTotal = pair->fourMomentumSum().x();
00068 double pyTotal = pair->fourMomentumSum().y();
00069 double angle = atan2(pyTotal,pxTotal)*180.0/pi;
00070
00071 if (angle<0.0) angle+=360.0;
00072
00073 StHbtReactionPlaneAnalysis* RPanal = (StHbtReactionPlaneAnalysis*) myAnalysis;
00074 double RPangle = RPanal->ReactionPlane()*180.0/pi;
00075 double angleDifference = angle-RPangle;
00076
00077 if (angleDifference<0.0) angleDifference+=360.0;
00078
00079
00080 if ( (mAngle2[0]>360.0) && (mAngle2[1]>360.0) ) {
00081 if (mAngle1[0]<mAngle1[1]) {
00082 temp1 = ( (mAngle1[0]<angleDifference) &&
00083 (angleDifference<mAngle1[1]) );
00084 }
00085 else {
00086 temp1 = ( (mAngle1[0]<angleDifference) ||
00087 (angleDifference<mAngle1[1]) );
00088 }
00089 }
00090
00091
00092 if ( (mAngle2[0]<360.0) || (mAngle2[1]<360.0) ) {
00093 if (mAngle1[0]<mAngle1[1]) {
00094 temp1 = ( (mAngle1[0]<angleDifference) &&
00095 (angleDifference<mAngle1[1]) );
00096 if (mAngle2[0]<mAngle2[1]) {
00097 temp2 = ( (mAngle2[0]<angleDifference) &&
00098 (angleDifference<mAngle2[1]) );
00099 }
00100 else {
00101 temp2 = ( (mAngle2[0]<angleDifference) ||
00102 (angleDifference<mAngle2[1]) );
00103 }
00104 }
00105 else {
00106 temp1 = ( (mAngle1[0]<angleDifference) ||
00107 (angleDifference<mAngle1[1]) );
00108 if (mAngle2[0]<mAngle2[1]) {
00109 temp2 = ( (mAngle2[0]<angleDifference) &&
00110 (angleDifference<mAngle2[1]) );
00111 }
00112 else {
00113 temp2 = ( (mAngle2[0]<angleDifference) ||
00114 (angleDifference<mAngle2[1]) );
00115 }
00116 }
00117 }
00118
00119 temp = temp1 || temp2;
00120 if ( temp && mBetaT ) {
00121 double pT = pair->fourMomentumSum().perp();
00122 double pZ = pair->fourMomentumSum().pz();
00123 double e = pair->fourMomentumSum().e();
00124 double e2 = e*e;
00125 mBetaT->Fill(pT/e);
00126 mBetaL->Fill(pZ/e);
00127 mBetaT2->Fill( pT*pT/(e2) );
00128 mBetaL2->Fill( pZ*pZ/(e2) );
00129 mBetaTL->Fill( pT*pZ/(e2) );
00130 }
00131 temp ? mNPairsPassed++ : mNPairsFailed++;
00132 return temp;
00133 }
00134
00135 StHbtString anglePairCut::Report(){
00136 string Stemp = "Angle Pair Cut - total dummy-- always returns true\n";
00137 char Ctemp[100];
00138 sprintf(Ctemp,"Number of pairs which passed:\t%ld Number which failed:\t%ld\n",mNPairsPassed,mNPairsFailed);
00139 Stemp += Ctemp;
00140 StHbtString returnThis = Stemp;
00141 return returnThis;
00142 }
00143
00144 double anglePairCut::EmissionAngle(const StHbtPair *pair) {
00145 double pxTotal = pair->fourMomentumSum().x();
00146 double pyTotal = pair->fourMomentumSum().y();
00147 double angle = atan2(pyTotal,pxTotal)*180.0/pi;
00148 if (angle<0.0) angle+=360.0;
00149 StHbtReactionPlaneAnalysis* RPanal = (StHbtReactionPlaneAnalysis*) myAnalysis;
00150 double RPangle = RPanal->ReactionPlane()*180.0/pi;
00151 double angleDifference = angle-RPangle;
00152 if (angleDifference<0.0) angleDifference+=360.0;
00153 return angleDifference;
00154 }
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164