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 etc/bankdefs/hipo4/dc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"info": "reconstructed hits using DC wire positions",
"entries": [
{"name":"id", "type":"S", "info":"id of the hit"},
{"name": "indexTDC", "type":"S", "info":"inex in the bank DC::TDC"},
{"name":"indexTDC", "type":"S", "info":"index in the bank DC::TDC"},
{"name":"status", "type":"S", "info":"id of the hit"},
{"name":"sector", "type":"B", "info":"DC sector"},
{"name":"superlayer", "type":"B", "info":"DC superlayer (1...6)"},
Expand Down Expand Up @@ -62,6 +62,7 @@
"info": "reconstructed hits using DC wire positions",
"entries": [
{"name":"id", "type":"S", "info":"id of the hit"},
{"name":"indexTDC", "type":"S", "info":"index in the bank DC::TDC"},
{"name":"status", "type":"S", "info":"id of the hit"},
{"name":"sector", "type":"B", "info":"DC sector"},
{"name":"superlayer", "type":"B", "info":"DC superlayer (1...6)"},
Expand Down
1 change: 1 addition & 0 deletions etc/bankdefs/hipo4/dcnn.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"info": "reconstructed hits using DC wire positions",
"entries": [
{"name":"id", "type":"S", "info":"id of the hit"},
{"name":"indexTDC", "type":"S", "info":"index in the bank DC::TDC"},
{"name":"status", "type":"S", "info":"id of the hit"},
{"name":"sector", "type":"B", "info":"DC sector"},
{"name":"superlayer", "type":"B", "info":"DC superlayer (1...6)"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.jlab.io.base.DataEvent;
import org.jlab.detector.banks.RawDataBank;
import org.jlab.geom.detector.alert.AHDC.AlertDCDetector;
import org.jlab.rec.alert.constants.CalibrationConstantsLoader;
import org.jlab.rec.constants.CalibrationConstantsLoader;

public class HitReader {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package org.jlab.rec.alert.constants;
package org.jlab.rec.constants;

import org.jlab.detector.calib.utils.ConstantsManager;
import org.jlab.detector.calib.utils.DatabaseConstantProvider;
import org.jlab.utils.groups.IndexedTable;

import java.util.HashMap;
import java.util.Map;
import java.lang.Integer;
import java.lang.Double;

/**
* This class loads constants from CCDB
Expand All @@ -26,20 +24,19 @@ public CalibrationConstantsLoader() {

// Maps for constants from database
// AHDC
public static Map<Integer, double[]> AHDC_TIME_OFFSETS = new HashMap<Integer,double[]>(); ///< AHDC Parameters for timing offsets
public static Map<Integer, double[]> AHDC_TIME_TO_DISTANCE = new HashMap<Integer,double[]>(); ///< AHDC Parameters for time to distance
public static Map<Integer, double[]> AHDC_RAW_HIT_CUTS = new HashMap<Integer,double[]>(); ///< AHDC Parameters for raw hit cuts
public static Map<Integer, double[]> AHDC_TIME_OFFSETS = new HashMap<>(); ///< AHDC Parameters for timing offsets
public static Map<Integer, double[]> AHDC_TIME_TO_DISTANCE = new HashMap<>(); ///< AHDC Parameters for time to distance
public static Map<Integer, double[]> AHDC_RAW_HIT_CUTS = new HashMap<>(); ///< AHDC Parameters for raw hit cuts

// ATOF
public static Map<Integer, double[]> ATOF_EFFECTIVE_VELOCITY = new HashMap<Integer,double[]>(); ///< ATOF Parameters for effective velocity
public static Map<Integer, double[]> ATOF_TIME_WALK = new HashMap<Integer,double[]>(); ///< ATOF Parameters for time walk
public static Map<Integer, double[]> ATOF_ATTENUATION_LENGTH = new HashMap<Integer,double[]>(); ///< ATOF Parameters for attenuation lenght
public static Map<Integer, double[]> ATOF_TIME_OFFSETS = new HashMap<Integer,double[]>(); ///< ATOF Parameters for timing offsets
public static Map<Integer, double[]> ATOF_EFFECTIVE_VELOCITY = new HashMap<>(); ///< ATOF Parameters for effective velocity
public static Map<Integer, double[]> ATOF_TIME_WALK = new HashMap<>(); ///< ATOF Parameters for time walk
public static Map<Integer, double[]> ATOF_ATTENUATION_LENGTH = new HashMap<>(); ///< ATOF Parameters for attenuation lenght
public static Map<Integer, double[]> ATOF_TIME_OFFSETS = new HashMap<>(); ///< ATOF Parameters for timing offsets

public static synchronized void Load(int runno, String var, ConstantsManager manager) {
public static synchronized void Load(int runno, ConstantsManager manager) {

//System.out.println("*Loading calibration constants*");
manager.setVariation(var);

IndexedTable ahdc_timeOffsets = manager.getConstants(runno, "/calibration/alert/ahdc/time_offsets");
IndexedTable ahdc_time2distance = manager.getConstants(runno, "/calibration/alert/ahdc/time_to_distance");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@
import org.jlab.rec.ahdc.PreCluster.PreClusterFinder;
import org.jlab.rec.ahdc.Track.Track;
import org.jlab.rec.ahdc.Mode;
import org.jlab.rec.alert.constants.CalibrationConstantsLoader;

import java.io.File;
import java.util.*;
import org.jlab.detector.calib.utils.DatabaseConstantProvider;
import org.jlab.geom.detector.alert.AHDC.AlertDCDetector;
import org.jlab.geom.detector.alert.AHDC.AlertDCFactory;
import org.jlab.rec.constants.CalibrationConstantsLoader;

/** AHDCEngine reconstruction service.
*
Expand Down Expand Up @@ -102,7 +101,9 @@ public boolean init() {
"/calibration/alert/atof/time_offsets"
};
requireConstants(Arrays.asList(alertTables));


this.getConstantsManager().setVariation("default");

this.registerOutputBank("AHDC::hits","AHDC::preclusters","AHDC::clusters","AHDC::track","AHDC::kftrack","AHDC::mc","AHDC::ai:prediction");

return true;
Expand Down Expand Up @@ -137,7 +138,7 @@ public boolean processDataEvent(DataEvent event) {
// Load the constants
//-------------------
if(Run!=newRun) {
CalibrationConstantsLoader.Load(newRun,"default",this.getConstantsManager());
CalibrationConstantsLoader.Load(newRun, this.getConstantsManager());
Run = newRun;
}
}
Expand Down