Skip to content

Commit 754f30c

Browse files
Merge branch 'development' into urwtFix
2 parents b084947 + d1eaa84 commit 754f30c

73 files changed

Lines changed: 968 additions & 560 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bin/install-clara

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44

55
# Default versions:
6-
grapes=2.20
6+
grapes=2.21
77
clara=5.0.2
88

99
function error() {

common-tools/clara-io/pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
<groupId>org.jlab.clas</groupId>
66
<artifactId>clara-io</artifactId>
7-
<version>13.7.0-SNAPSHOT</version>
7+
<version>13.7.1-SNAPSHOT</version>
88
<packaging>jar</packaging>
99

1010
<parent>
1111
<groupId>org.jlab.clas</groupId>
1212
<artifactId>common-tools</artifactId>
13-
<version>13.7.0-SNAPSHOT</version>
13+
<version>13.7.1-SNAPSHOT</version>
1414
</parent>
1515

1616
<dependencies>
@@ -44,25 +44,25 @@
4444
<dependency>
4545
<groupId>org.jlab.clas</groupId>
4646
<artifactId>clas-io</artifactId>
47-
<version>13.7.0-SNAPSHOT</version>
47+
<version>13.7.1-SNAPSHOT</version>
4848
</dependency>
4949

5050
<dependency>
5151
<groupId>org.jlab.clas</groupId>
5252
<artifactId>clas-detector</artifactId>
53-
<version>13.7.0-SNAPSHOT</version>
53+
<version>13.7.1-SNAPSHOT</version>
5454
</dependency>
5555

5656
<dependency>
5757
<groupId>org.jlab.clas</groupId>
5858
<artifactId>clas-analysis</artifactId>
59-
<version>13.7.0-SNAPSHOT</version>
59+
<version>13.7.1-SNAPSHOT</version>
6060
</dependency>
6161

6262
<dependency>
6363
<groupId>org.jlab.clas</groupId>
6464
<artifactId>clas-utils</artifactId>
65-
<version>13.7.0-SNAPSHOT</version>
65+
<version>13.7.1-SNAPSHOT</version>
6666
</dependency>
6767

6868
<dependency>

common-tools/clas-analysis/pom.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
<groupId>org.jlab.clas</groupId>
66
<artifactId>clas-analysis</artifactId>
7-
<version>13.7.0-SNAPSHOT</version>
7+
<version>13.7.1-SNAPSHOT</version>
88
<packaging>jar</packaging>
99

1010
<parent>
1111
<groupId>org.jlab.clas</groupId>
1212
<artifactId>common-tools</artifactId>
13-
<version>13.7.0-SNAPSHOT</version>
13+
<version>13.7.1-SNAPSHOT</version>
1414
</parent>
1515

1616
<dependencies>
@@ -38,49 +38,49 @@
3838
<dependency>
3939
<groupId>org.jlab.clas</groupId>
4040
<artifactId>clas-utils</artifactId>
41-
<version>13.7.0-SNAPSHOT</version>
41+
<version>13.7.1-SNAPSHOT</version>
4242
</dependency>
4343

4444
<dependency>
4545
<groupId>org.jlab.clas</groupId>
4646
<artifactId>clas-physics</artifactId>
47-
<version>13.7.0-SNAPSHOT</version>
47+
<version>13.7.1-SNAPSHOT</version>
4848
</dependency>
4949

5050
<dependency>
5151
<groupId>org.jlab.clas</groupId>
5252
<artifactId>clas-io</artifactId>
53-
<version>13.7.0-SNAPSHOT</version>
53+
<version>13.7.1-SNAPSHOT</version>
5454
</dependency>
5555

5656
<dependency>
5757
<groupId>org.jlab.clas</groupId>
5858
<artifactId>clas-geometry</artifactId>
59-
<version>13.7.0-SNAPSHOT</version>
59+
<version>13.7.1-SNAPSHOT</version>
6060
</dependency>
6161

6262
<dependency>
6363
<groupId>org.jlab.clas</groupId>
6464
<artifactId>clas-jcsg</artifactId>
65-
<version>13.7.0-SNAPSHOT</version>
65+
<version>13.7.1-SNAPSHOT</version>
6666
</dependency>
6767

6868
<dependency>
6969
<groupId>org.jlab.clas</groupId>
7070
<artifactId>clas-detector</artifactId>
71-
<version>13.7.0-SNAPSHOT</version>
71+
<version>13.7.1-SNAPSHOT</version>
7272
</dependency>
7373

7474
<dependency>
7575
<groupId>org.jlab.clas</groupId>
7676
<artifactId>clas-reco</artifactId>
77-
<version>13.7.0-SNAPSHOT</version>
77+
<version>13.7.1-SNAPSHOT</version>
7878
</dependency>
7979

8080
<dependency>
8181
<groupId>org.jlab.clas</groupId>
8282
<artifactId>swim-tools</artifactId>
83-
<version>13.7.0-SNAPSHOT</version>
83+
<version>13.7.1-SNAPSHOT</version>
8484
</dependency>
8585

8686
</dependencies>

common-tools/clas-analysis/src/main/java/org/jlab/analysis/efficiency/Truth.java

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.ArrayList;
44
import java.util.Arrays;
55
import java.util.List;
6+
import java.util.Map;
67
import java.util.TreeMap;
78
import org.jlab.jnp.hipo4.data.Bank;
89
import org.jlab.jnp.hipo4.data.Event;
@@ -15,8 +16,7 @@
1516

1617
/**
1718
* Efficiency matrix calculator based solely on the MC::GenMatch truth-matching
18-
* bank (which is purely hit-based), and a pid assignment match in MC::Particle
19-
* and REC::Particle.
19+
* bank, and a pid assignment match in MC::Particle and REC::Particle.
2020
*
2121
* @author baltzell
2222
*/
@@ -188,17 +188,62 @@ public String toMarkdown() {
188188
return s.toString();
189189
}
190190

191+
private static Map<Integer,Float> parseEfficiencyString(String arg) {
192+
TreeMap<Integer,Float> m = new TreeMap<>();
193+
if (arg.contains(",")) {
194+
for (String s : arg.split(","))
195+
m.putAll(parseEfficiencyString(s));
196+
}
197+
else if (arg.contains(":")) {
198+
String[] x = arg.split(":");
199+
try {
200+
if (x.length == 2) m.put(Integer.valueOf(x[0]), Float.valueOf(x[1]));
201+
else throw new RuntimeException("Invalid pid specification: "+arg);
202+
}
203+
catch (NumberFormatException e) {
204+
throw new RuntimeException("Invalid pid specification: "+arg);
205+
}
206+
}
207+
return m;
208+
}
209+
210+
private boolean checkEfficiencies(Map<Integer,Float> pids) {
211+
boolean good = true;
212+
for (int pid : pids.keySet()) {
213+
if (get(pid, pid) < pids.get(pid)) {
214+
System.err.println(String.format(
215+
">>> trutheff: pid %d efficiency is %f, below %f limit",
216+
pid, get(pid,pid), pids.get(pid)));
217+
good = false;
218+
}
219+
}
220+
return good;
221+
}
222+
223+
/**
224+
* Efficiency cut values specificed as pid1:eff1[pid2:eff2[...]]
225+
* For example, 2212:0.9,11:0.95 is 90% for proton and 95% for electron.
226+
* @param arg
227+
* @return whether all efficiency cuts pass
228+
*/
229+
public boolean checkEfficiencies(String arg) {
230+
return checkEfficiencies(parseEfficiencyString(arg));
231+
}
232+
191233
public static void main(String[] args) {
192234
OptionParser o = new OptionParser("trutheff");
235+
o.addOption("-e", "", "efficiency requirement (e.g. 321:0.9,11:0.95");
193236
o.setRequiresInputList(true);
194237
o.parse(args);
238+
Map<Integer,Float> pids = parseEfficiencyString(o.getOption("-e").stringValue());
195239
HipoReader r = new HipoReader();
196240
r.open(o.getInputList().get(0));
197241
Truth t = new Truth(r.getSchemaFactory());
198242
t.add(o.getInputList());
199-
System.out.println(t.toTable());
200-
System.out.println(t.toJson());
201243
System.out.println(t.toMarkdown());
244+
System.out.println(t.toJson());
245+
System.out.println(t.toTable());
246+
if (!t.checkEfficiencies(pids)) System.exit(7);
202247
}
203248

204249
}

common-tools/clas-decay-tools/pom.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
<groupId>org.jlab.clas</groupId>
66
<artifactId>clas-decay-tools</artifactId>
7-
<version>13.7.0-SNAPSHOT</version>
7+
<version>13.7.1-SNAPSHOT</version>
88
<packaging>jar</packaging>
99

1010
<parent>
1111
<groupId>org.jlab.clas</groupId>
1212
<artifactId>common-tools</artifactId>
13-
<version>13.7.0-SNAPSHOT</version>
13+
<version>13.7.1-SNAPSHOT</version>
1414
</parent>
1515

1616
<dependencies>
@@ -21,54 +21,54 @@
2121
<dependency>
2222
<groupId>org.jlab.clas</groupId>
2323
<artifactId>swim-tools</artifactId>
24-
<version>13.7.0-SNAPSHOT</version>
24+
<version>13.7.1-SNAPSHOT</version>
2525
<type>jar</type>
2626
</dependency>
2727
<dependency>
2828
<groupId>cnuphys</groupId>
2929
<artifactId>swimmer</artifactId>
30-
<version>13.7.0-SNAPSHOT</version>
30+
<version>13.7.1-SNAPSHOT</version>
3131
</dependency>
3232
<dependency>
3333
<groupId>cnuphys</groupId>
3434
<artifactId>magfield</artifactId>
35-
<version>13.7.0-SNAPSHOT</version>
35+
<version>13.7.1-SNAPSHOT</version>
3636
</dependency>
3737
<dependency>
3838
<groupId>org.jlab.clas12.detector</groupId>
3939
<artifactId>clas12detector-vtx</artifactId>
40-
<version>13.7.0-SNAPSHOT</version>
40+
<version>13.7.1-SNAPSHOT</version>
4141
<type>jar</type>
4242
</dependency>
4343
<dependency>
4444
<groupId>org.jlab.clas</groupId>
4545
<artifactId>clas-reco</artifactId>
46-
<version>13.7.0-SNAPSHOT</version>
46+
<version>13.7.1-SNAPSHOT</version>
4747
</dependency>
4848
<dependency>
4949
<groupId>org.jlab.clas</groupId>
5050
<artifactId>clas-utils</artifactId>
51-
<version>13.7.0-SNAPSHOT</version>
51+
<version>13.7.1-SNAPSHOT</version>
5252
</dependency>
5353
<dependency>
5454
<groupId>org.jlab.clas</groupId>
5555
<artifactId>clas-detector</artifactId>
56-
<version>13.7.0-SNAPSHOT</version>
56+
<version>13.7.1-SNAPSHOT</version>
5757
</dependency>
5858
<dependency>
5959
<groupId>org.jlab.clas</groupId>
6060
<artifactId>clas-io</artifactId>
61-
<version>13.7.0-SNAPSHOT</version>
61+
<version>13.7.1-SNAPSHOT</version>
6262
</dependency>
6363
<dependency>
6464
<groupId>org.jlab.clas</groupId>
6565
<artifactId>clas-physics</artifactId>
66-
<version>13.7.0-SNAPSHOT</version>
66+
<version>13.7.1-SNAPSHOT</version>
6767
</dependency>
6868
<dependency>
6969
<groupId>org.jlab.clas</groupId>
7070
<artifactId>clas-geometry</artifactId>
71-
<version>13.7.0-SNAPSHOT</version>
71+
<version>13.7.1-SNAPSHOT</version>
7272
</dependency>
7373
</dependencies>
7474
</project>

common-tools/clas-detector/pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44

55
<groupId>org.jlab.clas</groupId>
66
<artifactId>clas-detector</artifactId>
7-
<version>13.7.0-SNAPSHOT</version>
7+
<version>13.7.1-SNAPSHOT</version>
88
<packaging>jar</packaging>
99

1010
<parent>
1111
<groupId>org.jlab.clas</groupId>
1212
<artifactId>common-tools</artifactId>
13-
<version>13.7.0-SNAPSHOT</version>
13+
<version>13.7.1-SNAPSHOT</version>
1414
</parent>
1515

1616
<dependencies>
1717
<dependency>
1818
<groupId>org.jlab.clas</groupId>
1919
<artifactId>clas-utils</artifactId>
20-
<version>13.7.0-SNAPSHOT</version>
20+
<version>13.7.1-SNAPSHOT</version>
2121
</dependency>
2222

2323
<dependency>
@@ -43,19 +43,19 @@
4343
<dependency>
4444
<groupId>org.jlab.clas</groupId>
4545
<artifactId>clas-io</artifactId>
46-
<version>13.7.0-SNAPSHOT</version>
46+
<version>13.7.1-SNAPSHOT</version>
4747
</dependency>
4848

4949
<dependency>
5050
<groupId>org.jlab.clas</groupId>
5151
<artifactId>clas-geometry</artifactId>
52-
<version>13.7.0-SNAPSHOT</version>
52+
<version>13.7.1-SNAPSHOT</version>
5353
</dependency>
5454

5555
<dependency>
5656
<groupId>org.jlab.clas</groupId>
5757
<artifactId>clas-logging</artifactId>
58-
<version>13.7.0-SNAPSHOT</version>
58+
<version>13.7.1-SNAPSHOT</version>
5959
</dependency>
6060

6161
<dependency>

common-tools/clas-detector/src/main/java/org/jlab/detector/decode/CLASDecoder.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
* @author gavalian
3131
*/
3232
public class CLASDecoder {
33+
34+
// truncate EVIO waveforms longer than this:
35+
final static int MAX_BANK_WF_LENGTH = 30;
3336

3437
protected DetectorEventDecoder detectorDecoder = null;
3538
protected SchemaFactory schemaFactory = new SchemaFactory();
@@ -203,7 +206,7 @@ public Bank getDataBankWF(String name, DetectorType type) {
203206
b.putLong( 4, i, a.get(i).getADCData(0).getTimeStamp());
204207
b.putInt("time", i, (int)a.get(i).getADCData(0).getTime());
205208
DetectorDataDgtz.ADCData xxx = a.get(i).getADCData(0);
206-
for (int j=0; j<xxx.getPulseSize(); ++j)
209+
for (int j=0; j<xxx.getPulseSize() && j<MAX_BANK_WF_LENGTH; ++j)
207210
b.putShort(j+5, i, xxx.getPulseValue(j));
208211
}
209212
return b;

common-tools/clas-geometry/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
<groupId>org.jlab.clas</groupId>
66
<artifactId>clas-geometry</artifactId>
7-
<version>13.7.0-SNAPSHOT</version>
7+
<version>13.7.1-SNAPSHOT</version>
88
<packaging>jar</packaging>
99

1010
<parent>
1111
<groupId>org.jlab.clas</groupId>
1212
<artifactId>common-tools</artifactId>
13-
<version>13.7.0-SNAPSHOT</version>
13+
<version>13.7.1-SNAPSHOT</version>
1414
</parent>
1515

1616
<dependencies>

0 commit comments

Comments
 (0)