Skip to content

Commit 39be4ff

Browse files
baltzellraffaelladevita
authored andcommitted
add deuteron EB test
1 parent 946d00e commit 39be4ff

File tree

5 files changed

+36
-16
lines changed

5 files changed

+36
-16
lines changed

validation/advanced-tests/run-eb-tests.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ case $webFileStub in
7676
;;
7777
electronneutronC)
7878
;;
79+
electrondeuteronC)
80+
;;
7981
*)
8082
echo Invalid input evio file: $webFileStub
8183
exit 1

validation/advanced-tests/src/eb/EBTwoTrackTest.java

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

validation/advanced-tests/src/eb/scripts/gemc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ then
1212
fi
1313

1414
run=11
15-
nEvents=100
15+
nEvents=1000
1616
gcard=$GEMC/../config/clas12-default.gcard
1717

1818
gemc \

validation/advanced-tests/src/eb/scripts/gen.groovy

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ double torusScale = -1.0;
1919
double solenoidScale = 1.0;
2020
boolean isCentral = false;
2121
boolean isForwardTagger = false;
22-
int nEvents = 100;
22+
int nEvents = 1000;
2323

2424
// parse command line options:
2525
def cli=new CliBuilder(usage:"gen.groovy -pid <#> [options]", stopAtNonOption:false);//, formatter:hf);
@@ -67,6 +67,9 @@ switch (Math.abs(pid)) {
6767
case 22:
6868
fileStub+="gamma";
6969
break;
70+
case 45:
71+
fileStub+="deuteron";
72+
break;
7073
default:
7174
throw new RuntimeException("Invalid PID: "+pid);
7275
break;

validation/advanced-tests/src/eb/scripts/list.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ electronprotonC -pid 2212 -cd
99
electronkaonC -pid 321 -cd
1010
electronpionC -pid 211 -cd
1111
electronneutronC -pid 2112 -cd
12+
electrondeuteronC -pid 45 -cd
1213
electronFTpion -pid -211 -ft
1314
electronFTproton -pid -2212 -ft
1415
electronFTkaon -pid -321 -ft

0 commit comments

Comments
 (0)