Skip to content

Commit ba28805

Browse files
committed
cleanup
1 parent fd797d9 commit ba28805

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

‎common-tools/clas-detector/src/main/java/org/jlab/detector/serial/Occupancer.java‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
public class Occupancer extends ArrayList<Occupancer.OccupanceTable> {
2424

2525
static final String BANKDIR = ClasUtilsFile.getResourceDir("CLAS12DIR","etc/bankdefs/hipo4/singles/occupancy");
26-
static final SchemaFactory schema = new SchemaFactory();
27-
static { schema.initFromDirectory(ClasUtilsFile.getResourceDir("CLAS12DIR","etc/bankdefs/hipo4")); }
26+
static final SchemaFactory FULL_SCHEMA = new SchemaFactory();
27+
static { FULL_SCHEMA.initFromDirectory(ClasUtilsFile.getResourceDir("CLAS12DIR","etc/bankdefs/hipo4")); }
2828

29-
int nevents = 0;
3029
int prescale = 1000;
30+
int nevents = 0;
3131

3232
public Occupancer() {
3333
super();
@@ -42,6 +42,8 @@ public Occupancer(int prescale) {
4242

4343
private void init() {
4444
try {
45+
// Initialize OccupanceTable list, by reading occupancy bank filenames
46+
// and stripping ".json" suffix and "OCC::" prefix to get hit bank name:
4547
addAll(Files.list(Paths.get(BANKDIR))
4648
.filter(Files::isRegularFile)
4749
.map(p -> p.getFileName().toString())
@@ -82,8 +84,8 @@ public static class OccupanceTable {
8284
* @param hitBank name of the hit bank
8385
*/
8486
public OccupanceTable(String hitBank) {
85-
hitSchema = schema.getSchema(hitBank);
86-
occSchema = schema.getSchema("OCC::" + hitBank);
87+
hitSchema = FULL_SCHEMA.getSchema(hitBank);
88+
occSchema = FULL_SCHEMA.getSchema("OCC::" + hitBank);
8789
table = new IndexedTable(occSchema.hasEntry("order")?4:3, new String[]{"occ/F"});
8890
}
8991

@@ -93,8 +95,8 @@ public OccupanceTable(String hitBank) {
9395
* @param indexCount number of inidices in the hit bank
9496
*/
9597
public OccupanceTable(String hitBank, int indexCount) {
96-
hitSchema = schema.getSchema(hitBank);
97-
occSchema = schema.getSchema("OCC::" + hitBank);
98+
hitSchema = FULL_SCHEMA.getSchema(hitBank);
99+
occSchema = FULL_SCHEMA.getSchema("OCC::" + hitBank);
98100
table = new IndexedTable(indexCount, new String[]{"occ/F"});
99101
}
100102

‎common-tools/clas-detector/src/main/java/org/jlab/detector/serial/SerialHoncho.java‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ public void clear() {
6767
}
6868

6969
Event getUnixEvent(Bank config) {
70-
Bank unix = new Bank(schema.getSchema("RUN::unix"));
71-
unix.setRows(eventUnix.size());
70+
Bank unix = new Bank(schema.getSchema("RUN::unix"), eventUnix.size());
7271
int row = 0;
7372
for (int evno : eventUnix.keySet()) {
7473
unix.putInt("event", row, evno);

0 commit comments

Comments
 (0)