1 #include "StHbtMaker/Cut/evansPairCut.h"
10 evansPairCut::evansPairCut(){
11 mNPairsPassed = mNPairsFailed = 0;
21 bool evansPairCut::Pass(
const StHbtPair* pair){
25 void evansPairCut::ParityPairCuts(ParityBuff *Plus, ParityBuff *Minus){
42 vector <int> PlusIsGood;
43 vector <int> MinusIsGood;
45 double cosSqAngleCut = cos(AngleCut)*cos(AngleCut);
47 int newPlusSize = Plus->size();
48 int newMinusSize = Minus->size();
50 double pCut = (pCutDistance*2.0)/( (0.5)*(0.5)*(0.3)*Bfield);
52 cout <<
"begin evans Pair Cut "<< newPlusSize<<
" plus and "<< newMinusSize<<
" minus tracks"<< endl;
54 {
for (
int jjj = 0; jjj < newPlusSize; jjj++){
55 PlusIsGood.push_back(1);
57 {
for (
int jjj = 0; jjj < newMinusSize; jjj++){
58 MinusIsGood.push_back(1);
63 {
for (
int bbb = 0; bbb < newPlusSize; bbb++){
64 FirstTrack = ((*Plus)[bbb]).vect();
65 {
for (
int hhh = 0; hhh < newMinusSize; hhh++){
66 SecondTrack = ((*Minus)[hhh]).vect();
67 if (FirstTrack.z()*SecondTrack.z() > 0. ){
68 FdotS = FirstTrack.dot(SecondTrack);
69 if ( ( (FdotS*FdotS) / (FirstTrack.mag2()* SecondTrack.mag2()) > cosSqAngleCut ) && (FdotS > 0 ) ){
70 if (fabs(1.0/FirstTrack.mag()-1.0/SecondTrack.mag()) < pCut){
81 {
for (
int bbb = 0; bbb < newPlusSize; bbb++){
82 FirstTrack = ((*Plus)[bbb]).vect();
83 {
for (
int hhh = (bbb+1); hhh < newPlusSize; hhh++){
84 SecondTrack = ((*Plus)[hhh]).vect();
85 if (FirstTrack.z()*SecondTrack.z() > 0. ){
86 FdotS = FirstTrack.dot(SecondTrack);
87 if ( ( (FdotS*FdotS) / (FirstTrack.mag2()* SecondTrack.mag2()) > cosSqAngleCut ) && (FdotS > 0 ) ){
88 if (fabs(1.0/FirstTrack.mag()-1.0/SecondTrack.mag()) < pCut){
99 {
for (
int bbb = 0; bbb < newMinusSize; bbb++){
100 FirstTrack = ((*Minus)[bbb]).vect();
101 {
for (
int hhh = (bbb+1); hhh < newMinusSize; hhh++){
102 SecondTrack = ((*Minus)[hhh]).vect();
103 if (FirstTrack.z()*SecondTrack.z() > 0. ){
104 FdotS = FirstTrack.dot(SecondTrack);
105 if ( ( (FdotS*FdotS) / (FirstTrack.mag2()* SecondTrack.mag2()) > cosSqAngleCut ) && (FdotS > 0 ) ){
106 if (fabs(1.0/FirstTrack.mag()-1.0/SecondTrack.mag()) < pCut){
107 MinusIsGood[bbb] = 0;
108 MinusIsGood[hhh] = 0;
117 unsigned int jjj = 0;
118 while (jjj < (*Plus).size()){
119 if (PlusIsGood[jjj]==0){
120 (*Plus).erase((*Plus).begin()+jjj);
121 PlusIsGood.erase(PlusIsGood.begin()+jjj);
128 while (jjj < (*Minus).size()){
129 if (MinusIsGood[jjj]==0){
130 (*Minus).erase((*Minus).begin()+jjj);
131 MinusIsGood.erase(MinusIsGood.begin()+jjj);
143 cout <<
"end evans Pair Cut with "<< (*Plus).size()<<
" plus and "<< (*Minus).size() <<
" minus tracks"<< endl;
147 StHbtString evansPairCut::Report(){
148 string Stemp =
"evans Pair Cut Report\n";
152 StHbtString returnThis = Stemp;