@@ -53,6 +53,7 @@ public class EBTwoTrackTest {
5353 int epCount = 0 ;
5454 int egCount = 0 ;
5555 int enCount = 0 ;
56+ int edCount = 0 ;
5657
5758 int nFtPhotons = 0 ;
5859 int nFtElectrons = 0 ;
@@ -149,6 +150,10 @@ else if (ss.equals("electronneutronC")) {
149150 isCentral =true ;
150151 hadronPDG =2112 ;
151152 }
153+ else if (ss .equals ("electrondeuteronC" )) {
154+ isCentral =true ;
155+ hadronPDG =45 ;
156+ }
152157 else if (ss .equals ("electrongammaFT" )) {
153158 isForwardTagger =true ;
154159 ftPDG =22 ;
@@ -413,16 +418,18 @@ private void checkResults() {
413418
414419 final double twoTrackFrac = (double )nTwoTrackEvents / nEvents ;
415420
416- final double eEff = (double )eCount / nNegTrackEvents ;
417- final double pEff = (double )epCount / eposCount ;
421+ final double eEff = (double )eCount / nNegTrackEvents ;
422+ final double pEff = (double )epCount / eposCount ;
418423 final double piEff = (double )epiCount / eposCount ;
419424 final double kEff = (double )ekCount / eposCount ;
425+ final double dEff = (double )edCount / eposCount ;
420426 final double gEff = (double )egCount / nNegTrackEvents ;
421427 final double nEff = (double )enCount / nNegTrackEvents ;
422428
423- final double epEff = (double )epCount / nTwoTrackEvents ;
429+ final double epEff = (double )epCount / nTwoTrackEvents ;
424430 final double epiEff = (double )epiCount / nTwoTrackEvents ;
425- final double ekEff = (double )ekCount / nTwoTrackEvents ;
431+ final double ekEff = (double )ekCount / nTwoTrackEvents ;
432+ final double edEff = (double )edCount / nTwoTrackEvents ;
426433
427434 System .out .println ("\n #############################################################" );
428435 System .out .println (String .format ("\n # Events = %d" ,nEvents ));
@@ -435,12 +442,14 @@ private void checkResults() {
435442 System .out .println (String .format ("eEff = %.3f" ,eEff ));
436443 System .out .println (String .format ("pEff = %.3f" ,pEff ));
437444 System .out .println (String .format ("piEff = %.3f" ,piEff ));
438- System .out .println (String .format ("kEff = %.3f\n " ,kEff ));
445+ System .out .println (String .format ("kEff = %.3f" ,kEff ));
446+ System .out .println (String .format ("dEff = %.3f\n " ,dEff ));
439447 System .out .println (String .format ("gEff = %.3f" ,gEff ));
440448 System .out .println (String .format ("nEff = %.3f\n " ,nEff ));
441449 System .out .println (String .format ("epEff = %.3f" ,epEff ));
442450 System .out .println (String .format ("epiEff = %.3f" ,epiEff ));
443- System .out .println (String .format ("ekEff = %.3f\n " ,ekEff ));
451+ System .out .println (String .format ("ekEff = %.3f" ,ekEff ));
452+ System .out .println (String .format ("edEff = %.3f\n " ,edEff ));
444453 System .out .println (String .format ("misid = %.3f" ,(float )nMisid /eposCount ));
445454 System .out .println (String .format ("missing = %.3f" ,(float )nMissing /eposCount ));
446455 System .out .println ("\n #############################################################" );
@@ -468,6 +477,10 @@ private void checkResults() {
468477 if (isCentral ) assertEquals (nEff >0.095 ,true );
469478 else assertEquals (nEff >0.55 ,true );
470479 break ;
480+ case 45 :
481+ if (isCentral ) assertEquals (dEff >0.85 ,true );
482+ else assertEquals (dEff >0.55 ,true );
483+ break ;
471484 default :
472485 throw new RuntimeException ("Not ready for pid=" +hadronPDG );
473486 }
@@ -597,6 +610,7 @@ else if (!isCentral && trkBank.getInt("sector",ii)==hadronSector) {
597610 boolean foundPion = false ;
598611 boolean foundPhoton = false ;
599612 boolean foundNeutron = false ;
613+ boolean foundDeuteron = false ;
600614
601615 // check particle bank:
602616 if (recPartBank !=null ) {
@@ -634,6 +648,7 @@ else if (sector==hadronSector) {
634648 else if (pid ==321 ) foundKaon =true ;
635649 else if (pid ==22 ) foundPhoton =true ;
636650 else if (pid ==2112 ) foundNeutron =true ;
651+ else if (pid ==45 ) foundDeuteron =true ;
637652 }
638653 }
639654 }
@@ -653,15 +668,18 @@ else if (sector==hadronSector) {
653668 if (foundProton ) epCount ++;
654669 if (foundKaon ) ekCount ++;
655670 if (foundPion ) epiCount ++;
671+ if (foundDeuteron ) edCount ++;
656672
657673 // FIXME
658674 if ( (hadronPDG ==2212 && !foundProton ) ||
659675 (hadronPDG ==321 && !foundKaon ) ||
660- (hadronPDG ==211 && !foundPion ) ) {
676+ (hadronPDG ==211 && !foundPion ) ||
677+ (hadronPDG ==45 && !foundDeuteron ) ) {
661678
662- if (hadronPDG ==2212 && (foundPion || foundKaon )) nMisid ++;
663- else if (hadronPDG ==321 && (foundProton || foundPion )) nMisid ++;
664- else if (hadronPDG ==211 && (foundProton || foundKaon )) nMisid ++;
679+ if (hadronPDG ==2212 && (foundPion || foundKaon || foundDeuteron )) nMisid ++;
680+ else if (hadronPDG ==321 && (foundProton || foundPion || foundDeuteron )) nMisid ++;
681+ else if (hadronPDG ==211 && (foundProton || foundKaon || foundDeuteron )) nMisid ++;
682+ else if (hadronPDG ==45 && (foundProton || foundKaon || foundPion )) nMisid ++;
665683 else {
666684 nMissing ++;
667685 if (debug ) {
@@ -673,10 +691,6 @@ else if (sector==hadronSector) {
673691 }
674692 }
675693
676- // CVT tracks could make this happen:
677- //if (foundProton && nPosTracks==0) {
678- // System.err.println("WHAT");
679- //}
680694 }
681695
682696}
0 commit comments