Skip to content

Commit

Permalink
resolve merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
baltzell committed Nov 19, 2024
2 parents eb393b7 + d1f48d3 commit 75926d3
Show file tree
Hide file tree
Showing 98 changed files with 1,104 additions and 4,124 deletions.
25 changes: 25 additions & 0 deletions .containers/coatjava.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#syntax=docker/dockerfile:1

FROM ubuntu:noble

LABEL name="coatjava"
LABEL maintainer="Whitney Armstrong <[email protected]>"
LABEL architecture="amd64"

USER root


RUN apt update && apt upgrade -y
RUN apt install cmake vim maven groovy git ca-certificates wget curl python-is-python3 \
openjdk-17-jdk openjdk-17-jre openjdk-17-jdk-headless openjdk-17-jre-headless \
python3-sqlalchemy -y && update-ca-certificates

# CA certificates
ADD https://pki.jlab.org/JLabCA.crt /etc/ssl/certs/JLabCA.crt
#RUN trust anchor --store /image/JLabCA.crt

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 --nomaps
31 changes: 31 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_PIPELINE_SOURCE == "web"'
- if: '$CI_PIPELINE_SOURCE == "webide"'
- if: '$CI_COMMIT_BRANCH == "master"'
- if: '$CI_COMMIT_BRANCH == "development"'
- if: '$CI_COMMIT_TAG'

default:
image: ubuntu:noble
retry: 2

coatjava_build:
image: gcr.io/kaniko-project/executor:debug
script:
- echo "${CI_COMMIT_REF_NAME}"
- >-
/kaniko/executor
--context $CI_PROJECT_DIR/docker
--dockerfile $CI_PROJECT_DIR/.containers/coatjava.Dockerfile
--destination $CI_REGISTRY_IMAGE/coatjava:${CI_COMMIT_REF_NAME}
--build-arg REF_NAME=${CI_COMMIT_REF_NAME}
alert_testing:
needs: ["coatjava_build"]
variables:
REF_NAME: "$CI_COMMIT_REF_NAME"
trigger:
project: hallb/alert/c12
strategy: depend
2 changes: 1 addition & 1 deletion bin/run-clara
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ do
p) prefix=$OPTARG ;;
c) CLARA_HOME=$OPTARG ;;
t) threads=$OPTARG && echo $threads | grep -q -E '^[0-9]+$' || error "-t must be an integer, threads" ;;
n) nevents="-e $OPTARG" && echo $nevents | grep -q -E '^-e [0-9]+$' || error "-n must be an integer, events" ;;
n) nevents="-e $OPTARG" && echo "$nevents" | grep -q -E '^-e [0-9]+$' || error "-n must be an integer, events" ;;
m) merge=1 ;;
h) echo -e "\n$usage" && echo -e $info && exit 0 ;;
esac
Expand Down
4 changes: 2 additions & 2 deletions common-tools/clara-io/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jlab.clas</groupId>
<artifactId>clara-io</artifactId>
<version>11.0.3-SNAPSHOT</version>
<version>11.0.5-SNAPSHOT</version>
<packaging>jar</packaging>

<parent>
<groupId>org.jlab.clas</groupId>
<artifactId>clas12rec</artifactId>
<relativePath>../../parent/pom.xml</relativePath>
<version>11.0.3-SNAPSHOT</version>
<version>11.0.5-SNAPSHOT</version>
</parent>

<dependencies>
Expand Down
20 changes: 10 additions & 10 deletions common-tools/clas-analysis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,63 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jlab.clas</groupId>
<artifactId>clas-analysis</artifactId>
<version>11.0.3-SNAPSHOT</version>
<version>11.0.5-SNAPSHOT</version>
<packaging>jar</packaging>

<parent>
<groupId>org.jlab.clas</groupId>
<artifactId>clas12rec</artifactId>
<relativePath>../../parent/pom.xml</relativePath>
<version>11.0.3-SNAPSHOT</version>
<version>11.0.5-SNAPSHOT</version>
</parent>

<dependencies>
<dependency>
<groupId>org.jlab.clas</groupId>
<artifactId>clas-utils</artifactId>
<version>11.0.3-SNAPSHOT</version>
<version>11.0.5-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.jlab.clas</groupId>
<artifactId>clas-physics</artifactId>
<version>11.0.3-SNAPSHOT</version>
<version>11.0.5-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.jlab.clas</groupId>
<artifactId>clas-io</artifactId>
<version>11.0.3-SNAPSHOT</version>
<version>11.0.5-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.jlab.clas</groupId>
<artifactId>clas-geometry</artifactId>
<version>11.0.3-SNAPSHOT</version>
<version>11.0.5-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.jlab.clas</groupId>
<artifactId>clas-jcsg</artifactId>
<version>11.0.3-SNAPSHOT</version>
<version>11.0.5-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.jlab.clas</groupId>
<artifactId>swim-tools</artifactId>
<version>11.0.3-SNAPSHOT</version>
<version>11.0.5-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.jlab.clas</groupId>
<artifactId>clas-detector</artifactId>
<version>11.0.3-SNAPSHOT</version>
<version>11.0.5-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.jlab.clas</groupId>
<artifactId>clas-reco</artifactId>
<version>11.0.3-SNAPSHOT</version>
<version>11.0.5-SNAPSHOT</version>
</dependency>
</dependencies>

Expand Down
10 changes: 5 additions & 5 deletions common-tools/clas-detector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jlab.clas</groupId>
<artifactId>clas-detector</artifactId>
<version>11.0.3-SNAPSHOT</version>
<version>11.0.5-SNAPSHOT</version>
<packaging>jar</packaging>

<parent>
<groupId>org.jlab.clas</groupId>
<artifactId>clas12rec</artifactId>
<relativePath>../../parent/pom.xml</relativePath>
<version>11.0.3-SNAPSHOT</version>
<version>11.0.5-SNAPSHOT</version>
</parent>

<dependencies>
<dependency>
<groupId>org.jlab.clas</groupId>
<artifactId>clas-utils</artifactId>
<version>11.0.3-SNAPSHOT</version>
<version>11.0.5-SNAPSHOT</version>
</dependency>

<dependency>
Expand All @@ -29,13 +29,13 @@
<dependency>
<groupId>org.jlab.clas</groupId>
<artifactId>clas-io</artifactId>
<version>11.0.3-SNAPSHOT</version>
<version>11.0.5-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.jlab.clas</groupId>
<artifactId>clas-geometry</artifactId>
<version>11.0.3-SNAPSHOT</version>
<version>11.0.5-SNAPSHOT</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public enum DetectorType {
BAND (21, "BAND"),
RASTER (22, "RASTER"),
URWELL (23, "URWELL"),
AHDC (24, "AHDC"),
ATOF (25, "ATOF"),
TARGET (100, "TARGET"),
MAGNETS (101, "MAGNETS"),
ECIN (110, "ECIN"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ public List<DetectorDataDgtz> getEntriesADC(DetectorType type,
public List<DetectorDataDgtz> getEntriesTDC(DetectorType type){
return getEntriesTDC(type,dataList);
}

/**
* returns TDC entries from decoded data for given detector type
* @param type detector type
Expand Down Expand Up @@ -290,6 +291,31 @@ public Bank getDataBankTDC(String name, DetectorType type){
return tdcBANK;
}

public Bank getDataBankTDCPetiroc(String name, DetectorType type){

List<DetectorDataDgtz> tdcDGTZ = this.getEntriesTDC(type);
if(schemaFactory.hasSchema(name)==false){
System.out.println("WARNING: No schema for TDC type : " + type);
return null;
}
Bank tdcBANK = new Bank(schemaFactory.getSchema(name), tdcDGTZ.size());

if(tdcBANK==null) return null;

// Not sure why the schemea information isn't used here.
for(int i = 0; i < tdcDGTZ.size(); i++){
tdcBANK.putByte("sector", i, (byte) tdcDGTZ.get(i).getDescriptor().getSector());
tdcBANK.putByte("layer", i, (byte) tdcDGTZ.get(i).getDescriptor().getLayer());
tdcBANK.putShort("component", i, (short) tdcDGTZ.get(i).getDescriptor().getComponent());
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());
//System.err.println("event: " + tdcDGTZ.get(i).toString());
}
return tdcBANK;
}


public Bank getDataBankTimeStamp(String name, DetectorType type) {

List<DetectorDataDgtz> tdcDGTZ = this.getEntriesTDC(type);
Expand All @@ -300,7 +326,8 @@ public Bank getDataBankTimeStamp(String name, DetectorType type) {
int hash = ((desc.getCrate()<<8)&0xFF00) | (desc.getSlot()&0x00FF);
if(tsMap.containsKey(hash)) {
if(tsMap.get(hash).getTimeStamp() != tdc.getTimeStamp())
System.out.println("WARNING: inconsistent timestamp for DCRB crate/slot " + desc.getCrate() + "/" + desc.getSlot());
System.out.println("WARNING: inconsistent timestamp for DCRB crate/slot "
+ desc.getCrate() + "/" + desc.getSlot());
}
else {
tsMap.put(hash, tdc);
Expand Down Expand Up @@ -393,16 +420,29 @@ public Event getDataEvent(){

Event event = new Event();

String[] adcBankNames = new String[]{"FTOF::adc","ECAL::adc","FTCAL::adc","FTHODO::adc","FTTRK::adc",
"HTCC::adc","BST::adc","CTOF::adc","CND::adc","LTCC::adc","BMT::adc",
"FMT::adc","HEL::adc","RF::adc","BAND::adc","RASTER::adc"};
DetectorType[] adcBankTypes = new DetectorType[]{DetectorType.FTOF,DetectorType.ECAL,DetectorType.FTCAL,DetectorType.FTHODO,DetectorType.FTTRK,
DetectorType.HTCC,DetectorType.BST,DetectorType.CTOF,DetectorType.CND,DetectorType.LTCC,DetectorType.BMT,
DetectorType.FMT,DetectorType.HEL,DetectorType.RF,DetectorType.BAND, DetectorType.RASTER};

String[] tdcBankNames = new String[]{"FTOF::tdc","ECAL::tdc","DC::tdc","HTCC::tdc","LTCC::tdc","CTOF::tdc","CND::tdc","RF::tdc","RICH::tdc","BAND::tdc"};
DetectorType[] tdcBankTypes = new DetectorType[]{DetectorType.FTOF,DetectorType.ECAL,
DetectorType.DC,DetectorType.HTCC,DetectorType.LTCC,DetectorType.CTOF,DetectorType.CND,DetectorType.RF,DetectorType.RICH,DetectorType.BAND};
String[] adcBankNames = new String[]{"FTOF::adc","ECAL::adc","FTCAL::adc",
"FTHODO::adc", "FTTRK::adc",
"HTCC::adc","BST::adc","CTOF::adc",
"CND::adc","LTCC::adc","BMT::adc",
"FMT::adc","HEL::adc","RF::adc",
"BAND::adc","RASTER::adc",
"AHDC::adc"};
DetectorType[] adcBankTypes = new DetectorType[]{DetectorType.FTOF,DetectorType.ECAL,DetectorType.FTCAL,
DetectorType.FTHODO,DetectorType.FTTRK,
DetectorType.HTCC,DetectorType.BST,DetectorType.CTOF,
DetectorType.CND,DetectorType.LTCC,DetectorType.BMT,
DetectorType.FMT,DetectorType.HEL,DetectorType.RF,
DetectorType.BAND, DetectorType.RASTER,
DetectorType.AHDC};

String[] tdcBankNames = new String[]{"FTOF::tdc","ECAL::tdc","DC::tdc",
"HTCC::tdc","LTCC::tdc","CTOF::tdc",
"CND::tdc","RF::tdc","RICH::tdc",
"BAND::tdc"};
DetectorType[] tdcBankTypes = new DetectorType[]{DetectorType.FTOF,DetectorType.ECAL,
DetectorType.DC,DetectorType.HTCC,DetectorType.LTCC,
DetectorType.CTOF,DetectorType.CND,DetectorType.RF,
DetectorType.RICH,DetectorType.BAND};

for(int i = 0; i < adcBankTypes.length; i++){
Bank adcBank = getDataBankADC(adcBankNames[i],adcBankTypes[i]);
Expand All @@ -421,6 +461,18 @@ public Event getDataEvent(){
}
}
}
try {
// Do ATOF
Bank tdcBank = getDataBankTDCPetiroc("ATOF::tdc",DetectorType.ATOF);
if(tdcBank!=null){
if(tdcBank.getRows()>0){
event.write(tdcBank);
}
}
} catch(Exception e) {
e.printStackTrace();
}


try {
Bank tsBank = getDataBankTimeStamp("DC::jitter", DetectorType.DC);
Expand All @@ -432,10 +484,10 @@ public Event getDataEvent(){
} catch(Exception e) {
e.printStackTrace();
}

/**
* Adding un-decoded banks to the event
*/

try {
Bank adcBankUD = this.getDataBankUndecodedADC("RAW::adc", DetectorType.UNDEFINED);
if(adcBankUD!=null){
Expand Down Expand Up @@ -671,6 +723,8 @@ public Bank createHelicityDecoderBank(EvioDataEvent event) {
public static void main(String[] args){

OptionParser parser = new OptionParser("decoder");

parser.setDescription("CLAS12 Data Decoder");
parser.addOption("-n", "-1", "maximum number of events to process");
parser.addOption("-c", "2", "compression type (0-NONE, 1-LZ4 Fast, 2-LZ4 Best, 3-GZIP)");
parser.addOption("-d", "0","debug mode, set >0 for more verbose output");
Expand Down Expand Up @@ -721,8 +775,8 @@ public static void main(String[] args){
writer.setCompressionType(compression);
writer.getSchemaFactory().initFromDirectory(ClasUtilsFile.getResourceDir("CLAS12DIR", "etc/bankdefs/hipo4"));

Bank rawScaler = new Bank(writer.getSchemaFactory().getSchema("RAW::scaler"));
Bank rawRunConf = new Bank(writer.getSchemaFactory().getSchema("RUN::config"));
Bank rawScaler = new Bank(writer.getSchemaFactory().getSchema("RAW::scaler"));
Bank rawRunConf = new Bank(writer.getSchemaFactory().getSchema("RUN::config"));
Bank helicityAdc = new Bank(writer.getSchemaFactory().getSchema("HEL::adc"));
Event scalerEvent = new Event();

Expand Down
Loading

0 comments on commit 75926d3

Please sign in to comment.