Skip to content

Commit 5b192da

Browse files
authored
Merge branch 'JeffersonLab:development' into feat/electron-vertex
2 parents 696f7fc + f9027cf commit 5b192da

23 files changed

Lines changed: 1120 additions & 342 deletions

File tree

‎.github/workflows/orca.yml‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: orca
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ development ]
7+
tags: [ '*' ]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
orca:
15+
# do not run on forks or dependabot PRs
16+
if: |
17+
github.event_name == 'push' ||
18+
(github.event_name == 'pull_request' &&
19+
github.event.pull_request.head.repo.full_name == github.repository &&
20+
github.actor != 'dependabot[bot]')
21+
uses: JeffersonLab/acro/.github/workflows/orca.yml@main
22+
with:
23+
ref_var: REF_COATJAVA # controls which git ref variable gets set to the triggering ref
24+
pipeline_timeout: 3600 # maximum time to allow the pipeline to run (seconds)
25+
secrets:
26+
orca_project_id: ${{ secrets.ORCA_PROJECT_ID }}
27+
orca_project_token: ${{ secrets.ORCA_PROJECT_TOKEN }}
28+
orca_trigger_token: ${{ secrets.ORCA_TRIGGER_TOKEN }}

‎bin/run-clara‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,9 @@ shift $((OPTIND-1))
5252
inputs=$@
5353

5454
# Configure JVM memory settings (overridedable via $JAVA_OPTS):
55-
if [ -z ${large+x} ]
56-
then
57-
gb_max=$((threads<3?threads+2:threads+2-threads/4))
58-
gb_init=$((threads<3?threads:threads-threads/3))
59-
else
60-
gb_max=$((threads<3?threads+2:threads+2-threads/8))
61-
gb_init=$((threads<3?threads:threads-threads/6))
62-
fi
55+
gb_init=$((threads))
56+
gb_max=$((threads+2))
57+
[ $threads -gt 1 ] && ! [ -z ${large+x} ] && gb_max=$((threads*2))
6358
java_opts="-Xms${gb_init}g -Xmx${gb_max}g"
6459

6560
# Check configuration:

‎common-tools/clas-detector/src/main/java/org/jlab/detector/base/DetectorDescriptor.java‎

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,36 @@
66
*/
77
public class DetectorDescriptor implements Comparable<DetectorDescriptor> {
88

9-
private DetectorType detectorType = DetectorType.UNDEFINED;
9+
private DetectorType detectorType = DetectorType.UNDEFINED;
1010
private Integer hw_CRATE = 0;
1111
private Integer hw_SLOT = 0;
1212
private Integer hw_CHANNEL = 0;
13-
13+
1414
private Integer dt_SECTOR = 0;
1515
private Integer dt_LAYER = 0;
1616
private Integer dt_COMPONENT = 0;
17-
18-
private Integer dt_ORDER = 0; // This is the order in the bank
19-
// defines ADCL,ADCR,TDCL,TDCR (1,2,3,4)
20-
21-
public DetectorDescriptor(){
22-
23-
}
24-
17+
18+
// FIXME: Is this correct?
19+
// This order in the bank defines ADCL,ADCR,TDCL,TDCR (1,2,3,4):
20+
private Integer dt_ORDER = 0;
21+
22+
public DetectorDescriptor() {}
23+
2524
public DetectorDescriptor(DetectorType type){
2625
this.detectorType = type;
2726
}
28-
27+
2928
public DetectorDescriptor(String name){
3029
this.detectorType = DetectorType.getType(name);
3130
}
32-
31+
3332
public DetectorDescriptor getCopy(){
3433
DetectorDescriptor newDesc = new DetectorDescriptor(this.detectorType);
3534
newDesc.setCrateSlotChannel(this.getCrate(), this.getSlot(), this.getChannel());
3635
newDesc.setSectorLayerComponent(this.getSector(), this.getLayer(), this.getComponent());
37-
3836
return newDesc;
3937
}
40-
38+
4139
public int getCrate(){ return this.hw_CRATE;}
4240
public int getChannel() { return this.hw_CHANNEL;}
4341
public int getComponent(){ return this.dt_COMPONENT;}
@@ -49,25 +47,25 @@ public DetectorDescriptor getCopy(){
4947
public void setSector(int sector){
5048
this.dt_SECTOR=sector;
5149
}
52-
50+
5351
public void setOrder(int order){
5452
this.dt_ORDER = order;
5553
if(this.dt_ORDER<0||this.dt_ORDER>3){
5654
System.err.println("----> error : detector descriptor order must be [1..4]");
5755
this.dt_ORDER = 0;
5856
}
5957
}
60-
58+
6159
public int[] getCSC() {
6260
return new int[]{hw_CRATE,hw_SLOT,hw_CHANNEL};
6361
}
6462

6563
public int[] getSLCO() {
6664
return new int[]{dt_SECTOR,dt_LAYER,dt_COMPONENT,dt_ORDER};
6765
}
68-
66+
6967
public DetectorType getType(){ return this.detectorType;}
70-
68+
7169
public final void setType(DetectorType type){
7270
this.detectorType = type;
7371
}
@@ -88,19 +86,33 @@ public final void setSectorLayerComponent(int sector, int layer, int comp){
8886
this.dt_COMPONENT = comp;
8987
}
9088

89+
public final void setSectorLayerComponentOrder(int sector, int layer, int comp, int order) {
90+
this.dt_SECTOR = sector;
91+
this.dt_LAYER = layer;
92+
this.dt_COMPONENT = comp;
93+
this.dt_ORDER = order;
94+
}
95+
96+
public final void setSectorLayerComponentOrderType(int sector, int layer, int comp, int order, int type) {
97+
this.dt_SECTOR = sector;
98+
this.dt_LAYER = layer;
99+
this.dt_COMPONENT = comp;
100+
this.dt_ORDER = order;
101+
this.detectorType = DetectorType.getType(type);
102+
}
103+
91104
public static int generateHashCode(int s, int l, int c){
92105
return ((s<<24)&0xFF000000)|
93106
((l<<16)&0x00FF0000)|(c&0x0000FFFF);
94107
}
95-
108+
96109
public int getHashCode(){
97110
int hash = ((this.dt_SECTOR<<24)&0xFF000000)|
98111
((this.dt_LAYER<<16)&0x00FF0000)| ((this.dt_ORDER<<12) & 0x0000F000) |
99112
(this.dt_COMPONENT&0x00000FFF);
100113
return hash;
101114
}
102-
103-
115+
104116
public void copy(DetectorDescriptor desc){
105117
this.hw_SLOT = desc.hw_SLOT;
106118
this.hw_CRATE = desc.hw_CRATE;
@@ -110,16 +122,15 @@ public void copy(DetectorDescriptor desc){
110122
this.dt_LAYER = desc.dt_LAYER;
111123
this.dt_COMPONENT = desc.dt_COMPONENT;
112124
}
113-
125+
114126
public boolean compare(DetectorDescriptor desc){
115127
if(this.detectorType.equals(desc.detectorType)&&
116128
this.dt_SECTOR.equals(desc.dt_SECTOR)&&
117129
this.dt_LAYER.equals(desc.dt_LAYER)&&
118130
this.dt_COMPONENT.equals(desc.dt_COMPONENT)) return true;
119131
return false;
120132
}
121-
122-
133+
123134
public static String getName(String base, int... ids){
124135
StringBuilder str = new StringBuilder();
125136
str.append(base);
@@ -128,15 +139,15 @@ public static String getName(String base, int... ids){
128139
if(ids.length>2) str.append(String.format("_C_%d", ids[2]));
129140
return str.toString();
130141
}
131-
142+
132143
public static String getTitle(String base, int... ids){
133144
StringBuilder str = new StringBuilder();
134145
if(ids.length>0) str.append(String.format(" SECTOR %d", ids[0]));
135146
if(ids.length>1) str.append(String.format(" LAYER %d", ids[1]));
136147
if(ids.length>2) str.append(String.format(" UNIT %d", ids[2]));
137148
return str.toString();
138149
}
139-
150+
140151
@Override
141152
public String toString(){
142153
return String.format("D [%6s ] C/S/C [%4d %4d %4d ] S/L/C [%4d %4d %4d ] ORDER = %2d",

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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package org.jlab.detector.decode;
22

3+
import java.util.stream.Collectors;
4+
import org.jlab.utils.groups.IndexedTable;
35
import org.jlab.detector.base.DetectorType;
46
import org.jlab.detector.calib.utils.ConstantsManager;
5-
import org.jlab.utils.groups.IndexedTable;
67

78
/**
89
*
@@ -24,6 +25,7 @@ public void add(DetectorType dt, IndexedTable it) {
2425
int slot = IndexedTable.DEFAULT_GENERATOR.getIndex(hash, 1);
2526
int channel = IndexedTable.DEFAULT_GENERATOR.getIndex(hash, 2);
2627

28+
// first one wins, print error message for loser:
2729
if (hasEntryByHash(hash)) {
2830
System.err.print("TranslationTable: found CCDB overlap for ");
2931
System.err.println(String.format("type %d/%s versus %s and c/s/c=%d/%d/%d",
@@ -36,17 +38,24 @@ public void add(DetectorType dt, IndexedTable it) {
3638
addEntry(crate, slot, channel);
3739

3840
// add each column's entry to the new row:
39-
for (int column=0; column<it.getEntryMap().values().size(); column++) {
40-
int value = it.getIntValueByHash(column, hash);
41-
setIntValueByHash(value, column, hash);
42-
}
41+
for (int column=0; column<it.getEntryMap().values().size(); column++)
42+
setIntValueByHash(it.getIntValueByHash(column, hash), column, hash);
4343

4444
// add the new detector type, as the last column:
4545
setIntValueByHash(dt.getDetectorId(), it.getEntryMap().values().size(), hash);
4646
}
4747
}
4848
}
4949

50+
public void dump() {
51+
for (Object key : getList().getMap().keySet()) {
52+
int[] idx = IndexedTable.DEFAULT_GENERATOR.getIndices((long)key, 0,1,2);
53+
System.out.print(String.format("%d/%d/%d ", idx[0],idx[1],idx[2]));
54+
System.out.print(getIntegersByHash((long)key).stream().
55+
map(String::valueOf).collect(Collectors.joining("/")));
56+
System.out.print("\n");
57+
}
58+
}
5059

5160
public static final DetectorType[] TYPES = new DetectorType[]{
5261
DetectorType.FTCAL,DetectorType.FTHODO,DetectorType.FTTRK,
@@ -70,8 +79,9 @@ public static void main(String[] args) {
7079
ConstantsManager conman = new ConstantsManager();
7180
conman.init(STYPES);
7281
TranslationTable tt = new TranslationTable();
73-
for (int i=0; i<STYPES.length; i++)
82+
for (int i=0; i<TYPES.length; i++)
7483
tt.add(TYPES[i],conman.getConstants(18779,STYPES[i]));
7584
tt.show();
85+
tt.dump();
7686
}
7787
}

‎common-tools/clas-detector/src/main/java/org/jlab/detector/pulse/HipoExtractor.java‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,35 +92,35 @@ protected void update(int n, IndexedTable it, Bank wfBank, Bank adcBank) {
9292
}
9393

9494
protected static void copyIndices(Bank src, Bank dest, int isrc, int idest) {
95-
dest.putByte("sector", idest, src.getByte("sector",isrc));
96-
dest.putByte("layer", idest, src.getByte("layer",isrc));
97-
dest.putShort("component", idest, src.getShort("component",isrc));
98-
dest.putByte("order", idest, src.getByte("order",isrc));
95+
dest.putByte(0, idest, src.getByte(0,isrc));
96+
dest.putByte(1, idest, src.getByte(1,isrc));
97+
dest.putShort(2, idest, src.getShort(2,isrc));
98+
dest.putByte(3, idest, src.getByte(3,isrc));
9999
dest.putShort("windex", idest, (short)isrc);
100100
}
101101

102102
protected static void copyIndices(DataBank src, DataBank dest, int isrc, int idest) {
103-
dest.setByte("sector", idest, src.getByte("sector",isrc));
104-
dest.setByte("layer", idest, src.getByte("layer",isrc));
105-
dest.setShort("component", idest, src.getShort("component",isrc));
106-
dest.setByte("order", idest, src.getByte("order",isrc));
103+
dest.setByte(0, idest, src.getByte(0,isrc));
104+
dest.setByte(1, idest, src.getByte(1,isrc));
105+
dest.setShort(2, idest, src.getShort(2,isrc));
106+
dest.setByte(3, idest, src.getByte(3,isrc));
107107
dest.setShort("windex", idest, (short)isrc);
108108
}
109109

110110
protected static int[] getIndices(Bank bank, int row) {
111111
return new int[] {
112-
bank.getShort("sector", row),
113-
bank.getShort("layer", row),
114-
bank.getShort("component", row),
115-
bank.getShort("order", row)};
112+
bank.getShort(0, row),
113+
bank.getShort(1, row),
114+
bank.getShort(2, row),
115+
bank.getShort(3, row)};
116116
}
117117

118118
protected static int[] getIndices(DataBank bank, int row) {
119119
return new int[] {
120-
bank.getShort("sector", row),
121-
bank.getShort("layer", row),
122-
bank.getShort("component", row),
123-
bank.getShort("order", row)};
120+
bank.getShort(0, row),
121+
bank.getShort(1, row),
122+
bank.getShort(2, row),
123+
bank.getShort(3, row)};
124124
}
125125

126126
protected List<Pulse> getPulses(int n, IndexedTable it, DataBank wfBank) {

0 commit comments

Comments
 (0)