2323public 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
0 commit comments