Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .containers/coatjava.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ ARG REF_NAME=development
# build coatjava
RUN java --version && cd /opt && \
git clone https://code.jlab.org/hallb/alert/coatjava.git && cd coatjava && \
git fetch origin && git checkout ${REF_NAME} && ./build-coatjava.sh --quiet
git fetch origin && git checkout ${REF_NAME} && ./build-coatjava.sh --quiet && \
./install-clara /opt/clara
14 changes: 14 additions & 0 deletions .containers/coatjava.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Bootstrap: docker
From: codecr.jlab.org/hallb/alert/coatjava/coatjava:{{ REF_NAME }}


%environment
export CLAS12DIR=/opt/coatjava/coatjava

%help
This is a clas12 coatjava container used to run coatjava on HPC systems
and do rapid development.

%labels
Author Whitney Armstrong [email protected]
REF_NAME {{ REF_NAME }}
14 changes: 14 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ workflow:

variables:
KUBERNETES_MEMORY_LIMIT: "8Gi"
REF_NAME: ${CI_COMMIT_REF_NAME}

default:
image: ubuntu:noble
Expand Down Expand Up @@ -69,3 +70,16 @@ shared_for_alert_tests:
project: hallb/alert/atof/shared_for_alert
strategy: depend

coatjava:singularity:
image: eicweb.phy.anl.gov:4567/containers/image_recipes/ubuntu_dind:latest
tags:
- silicon
allow_failure: true
script:
- apptainer build --build-arg REF_NAME=${REF_NAME} coatjava.sif .containers/coatjava.def
- ls -lrth
artifacts:
paths:
- coatjava.sif


3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ http://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-

-->


[Coatjava Apptainer](https://code.jlab.org/hallb/alert/coatjava/-/jobs/artifacts/development/raw/coatjava.sif?job=coatjava%3Asingularity)

Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ public Bank getDataBankTDCPetiroc(String name, DetectorType type){
tdcBANK.putByte("order", i, (byte) tdcDGTZ.get(i).getDescriptor().getOrder());
tdcBANK.putInt("TDC", i, tdcDGTZ.get(i).getTDCData(0).getTime());
tdcBANK.putInt("ToT", i, tdcDGTZ.get(i).getTDCData(0).getToT());
tdcBANK.putLong("timestamp", i, tdcDGTZ.get(i).getTDCData(0).getTimeStamp());
tdcBANK.putInt("trigger", i, tdcDGTZ.get(i).getTrigger());
//System.err.println("event: " + tdcDGTZ.get(i).toString());
}
return tdcBANK;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1063,24 +1063,36 @@ public List<DetectorDataDgtz> getDataEntries_57657(Integer crate, EvioNode node

int position = 0;
while(position<cdatatypes.size()-4){
Byte slot = (Byte) cdataitems.get(position+0);
Integer trig_num = (Integer) cdataitems.get(position+1);
Byte slot = (Byte) cdataitems.get(position+0);
Integer trig_num = (Integer) cdataitems.get(position+1);
Long time_stamp = (Long) cdataitems.get(position+2);
Integer nchannels = (Integer) cdataitems.get(position+3);
position += 4;
int counter = 0;
Integer nchannels = (Integer) cdataitems.get(position+3);
int counter = 0;

position += 4; // slot, trig,time,nchannels
//
while(counter<nchannels){
Byte channel = (Byte) cdataitems.get(position+0);
Integer tdc = (Integer) cdataitems.get(position+1);
// width over threshold
Integer tot = (Integer) cdataitems.get(position+2);


// Not sure what is going on here yet...
DetectorDataDgtz bank = new DetectorDataDgtz(crate,slot.intValue(),channel.intValue());
bank.addTDC(new TDCData(tdc,tot));
DetectorDataDgtz bank = new DetectorDataDgtz(
crate, slot.intValue(), channel.intValue());
// the "bank" has a timestamp.
// the tdc also can have a timestamp.
// the tdc is added tot he "bank"
// the "bank" is added to the "entries" (array of DetectorDataDgtz)
// "entries" List<DetectorDataDgtz> -> "bank" DetectorDataDgtz -> "tdc" TDCData
// there is a redundancy in timestamp: the same value is stored in TDCData and the DetectorDataDgz
//
bank.setTimeStamp(time_stamp);
bank.setTrigger(trig_num);;
TDCData tdc_data = new TDCData(tdc, tot);
tdc_data.setTimeStamp(time_stamp).setOrder(counter);
bank.addTDC(tdc_data);
entries.add(bank);
position += 3;
position += 3; // channel,tdc,tot
counter++;
//System.err.println("event: " + bank.toString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
*/
public class DetectorDataDgtz implements Comparable<DetectorDataDgtz> {

private final List<ADCData> adcStore = new ArrayList<>();
private final List<TDCData> tdcStore = new ArrayList<>();
private final List<VTPData> vtpStore = new ArrayList<>();
private final List<SCALERData> scalerStore = new ArrayList<>();
private Long timeStamp = 0L;
private final List<ADCData> adcStore = new ArrayList<>();
private final List<TDCData> tdcStore = new ArrayList<>();
private final List<VTPData> vtpStore = new ArrayList<>();
private final List<SCALERData> scalerStore = new ArrayList<>();
private Long timeStamp = 0L;
private int trigger = 0; // Trigger number ( usually only 1 trigger due to rol2(?) );


private final DetectorDescriptor descriptor = new DetectorDescriptor();

public DetectorDataDgtz(){
Expand Down Expand Up @@ -66,6 +68,9 @@ public long getTimeStamp(){
public DetectorDescriptor getDescriptor(){
return this.descriptor;
}

public int getTrigger() { return trigger;}
public DetectorDataDgtz setTrigger(int trig) { trigger = trig;return this;}

@Override
public String toString(){
Expand Down Expand Up @@ -330,19 +335,22 @@ public int compareTo(ADCData o) {
*/
public static class TDCData implements Comparable<TDCData>{

private int tdcOrder = 0; // Used for sorting
private int tdcTime = 0;
private int tdcToT = 0; // Time over threshold
private int tdcOrder = 0; // Used for sorting
private int tdcTime = 0;
private int tdcToT = 0; // Time over threshold
private Long timeStamp = 0L;

public TDCData() {}
public TDCData(int time) { this.tdcTime = time;}
public TDCData(int time, int ToT) { this.tdcTime = time; this.tdcToT = ToT;}
public int getTime() { return this.tdcTime;}
public int getToT() { return this.tdcToT;}
public int getOrder() { return tdcOrder;}
public long getTimeStamp(){ return this.timeStamp; }
public TDCData setOrder(int order) { tdcOrder = order;return this;}
public TDCData setTime(short time) { tdcTime = time;return this;}
public TDCData setToT(short ToT) { tdcToT = ToT;return this;}
public TDCData setTimeStamp(long time){ timeStamp = time;return this; }

@Override
public String toString(){
Expand Down
4 changes: 3 additions & 1 deletion etc/bankdefs/hipo4/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@
{ "name":"component" , "type":"S", "info":"signal (1-2)"},
{ "name":"order" , "type":"B", "info":"order: 2 - TDCL , 3 - TDCR"},
{ "name":"TDC" , "type":"I", "info":"TDC value"},
{ "name":"ToT" , "type":"I", "info":"Time Over Threshold"}
{ "name":"ToT" , "type":"I", "info":"Time Over Threshold"},
{ "name":"timestamp" , "type":"L", "info":"timestamp"},
{ "name":"trigger" , "type":"I", "info":"trigger number"}
]
},
{
Expand Down