Skip to content

Commit 1cc14ef

Browse files
raffaelladevitatongtongcao
authored andcommitted
mc for DC2 reconstruction (#906)
* switched EB tests to new gemc files generated with t2d from rg variations, ficed issue with electrongammaFT test * updated DC unit test event, now can be ggemc output file
1 parent c4fcdcf commit 1cc14ef

File tree

5 files changed

+25
-14
lines changed

5 files changed

+25
-14
lines changed

common-tools/clas-analysis/src/main/java/org/jlab/analysis/physics/TestEvent.java

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,20 @@ public static void main(String args[]) {
2121
}
2222

2323
public static HipoDataEvent get(DetectorType t) {
24+
SchemaFactory sf = new SchemaFactory();
25+
sf.initFromDirectory(CLASResources.getResourcePath("etc/bankdefs/hipo4"));
26+
2427
HipoReader reader = new HipoReader();
2528
String dir = CLASResources.getResourcePath("etc/data/test");
2629
String stub = t.getName().toLowerCase();
2730
reader.open(String.format("%s/%s.hipo",dir,stub));
31+
2832
Event e = new Event();
2933
reader.getEvent(e, 0);
30-
return new HipoDataEvent(e,reader.getSchemaFactory());
34+
if(t==DetectorType.DC)
35+
return getDCSector1ElectronEvent(e);
36+
else
37+
return new HipoDataEvent(e,sf);
3138
}
3239

3340
private static void write() {
@@ -47,15 +54,21 @@ private static void write(String path, Event e) {
4754
}
4855
}
4956

50-
public static HipoDataEvent getDCSector1ElectronEvent(int event) {
51-
HipoReader reader = new HipoReader();
52-
reader.open(CLASResources.getResourcePath("etc/data/test/dc.hipo"));
53-
Event e = new Event();
54-
reader.getEvent(e, event);
55-
return new HipoDataEvent(e,reader.getSchemaFactory());
57+
public static HipoDataEvent getDCSector1ElectronEvent(Event e) {
58+
SchemaFactory sf = new SchemaFactory();
59+
sf.initFromDirectory(CLASResources.getResourcePath("etc/bankdefs/hipo4"));
60+
61+
Bank mcPart = new Bank(sf.getSchema("MC::Particle"));
62+
e.read(mcPart);
63+
Bank recEvent = new Bank(sf.getSchema("RECHB::Event"), 1);
64+
recEvent.putFloat("startTime", 0, mcPart.getByte("vt", 0));
65+
e.write(recEvent);
66+
67+
return new HipoDataEvent(e,sf);
5668
}
57-
58-
public static HipoDataEvent getDCSector1ElectronEvent(SchemaFactory schemaFactory) {
69+
70+
@Deprecated
71+
public static HipoDataEvent getDCSector1ElectronEvent(SchemaFactory schemaFactory) {
5972
Event testEvent = new Event();
6073

6174
// this event is based on a gemc event with

etc/data/test/dc.hipo

-319 KB
Binary file not shown.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
webDir=http://clasweb.jlab.org/clas12offline/distribution/coatjava/validation_files/eb
4-
webVersion=5.11-fid-tm-r11
4+
webVersion=5.11-fid-tm-dc2-r11
55
webDir=$webDir/$webVersion
66

77
# coatjava must already be built at ../../coatjava/

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,7 @@ else if (ss.equals("electrondeuteronC")) {
155155
hadronPDG=45;
156156
}
157157
else if (ss.equals("electrongammaFT")) {
158-
isForwardTagger=true;
159-
ftPDG=22;
160-
hadronPDG=11;
158+
hadronPDG=22;
161159
}
162160
else udfFileType=true;
163161

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ if (isForwardTagger) {
111111
pgen2.setRange(
112112
3.0, 8.0,
113113
2.5, 4.5,
114-
-10.0, 10.0);
114+
110.0, 130.0);
115115
}
116116
else if (pid==-22 || pid==-211 || pid==-2212 || pid==-321) {
117117
// electron in FT

0 commit comments

Comments
 (0)