Author: [log in to unmask] Date: Tue Mar 17 14:45:46 2015 New Revision: 2474 Log: Added the ability to access the GTP configuration from the DAQ configuration manager. Also converted all tabs to spaces in the package. Added: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/GTPConfig.java Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/AbstractConfig.java java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/ConfigurationManager.java java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/DAQConfig.java java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/DAQConfigDriver.java java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/ESBCutConfig.java java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/EvioDAQParser.java java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/FADCConfig.java java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/IDAQConfig.java java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/LBOCutConfig.java java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/PairTriggerConfig.java java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/SSPConfig.java java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/SinglesTriggerConfig.java java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/UBOCutConfig.java java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/ULBCutConfig.java Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/AbstractConfig.java ============================================================================= --- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/AbstractConfig.java (original) +++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/AbstractConfig.java Tue Mar 17 14:45:46 2015 @@ -11,74 +11,74 @@ * @author Kyle McCarty <[log in to unmask]> */ abstract class AbstractConfig<E> { - // Store the cut values. - private final List<E> values; - private boolean enabled = false; - - /** - * Instantiates an <code>AbstractConfig</code> with the indicated - * number of values. - * @param count - The number of values that the object should store. - */ - AbstractConfig(int count) { - // A configuration object must have at least one value. - if(count <= 0) { - throw new IllegalArgumentException("There must be at least one value."); - } - - // Instantiate the value array. - values = new ArrayList<E>(count); - for(int i = 0; i < count; i++) { values.add(null); } - } - - /** - * Gets the value of the cut with the associated value ID. - * @param valueIndex - The ID corresponding to the desired value. - * @return Returns the value as a parameterized <code>E</code> - * object. - */ - protected E getValue(int valueIndex) { - validateValueIndex(valueIndex); - return values.get(valueIndex); - } - - /** - * Indicates whether the object is enabled or not. - * @return Returns <code>true</code> if the object is enabled and - * <code>false</code> otherwise. - */ - public boolean isEnabled() { - return enabled; - } - - /** - * Sets the value corresponding to the argument value ID to a new - * object. - * @param valueIndex - The ID corresponding to the desired value. - * @param value - The new value. - */ - protected void setValue(int valueIndex, E value) { - validateValueIndex(valueIndex); - values.set(valueIndex, value); - } - - /** - * Sets whether the configuration object is enabled. - * @param state <code>true</code> means that the object is enabled - * and <code>false</code> that it is disabled. - */ - protected void setIsEnabled(boolean state) { - enabled = state; - } - - /** - * Throws an exception if the argument index does not correspond to - * any value. - * @param index - The index to check. - */ - private final void validateValueIndex(int index) { - if(index < 0 || index >= values.size()) { - throw new IndexOutOfBoundsException("Value index \"" + index + "\" is invalid."); - } - } + // Store the cut values. + private final List<E> values; + private boolean enabled = false; + + /** + * Instantiates an <code>AbstractConfig</code> with the indicated + * number of values. + * @param count - The number of values that the object should store. + */ + AbstractConfig(int count) { + // A configuration object must have at least one value. + if(count <= 0) { + throw new IllegalArgumentException("There must be at least one value."); + } + + // Instantiate the value array. + values = new ArrayList<E>(count); + for(int i = 0; i < count; i++) { values.add(null); } + } + + /** + * Gets the value of the cut with the associated value ID. + * @param valueIndex - The ID corresponding to the desired value. + * @return Returns the value as a parameterized <code>E</code> + * object. + */ + protected E getValue(int valueIndex) { + validateValueIndex(valueIndex); + return values.get(valueIndex); + } + + /** + * Indicates whether the object is enabled or not. + * @return Returns <code>true</code> if the object is enabled and + * <code>false</code> otherwise. + */ + public boolean isEnabled() { + return enabled; + } + + /** + * Sets the value corresponding to the argument value ID to a new + * object. + * @param valueIndex - The ID corresponding to the desired value. + * @param value - The new value. + */ + protected void setValue(int valueIndex, E value) { + validateValueIndex(valueIndex); + values.set(valueIndex, value); + } + + /** + * Sets whether the configuration object is enabled. + * @param state <code>true</code> means that the object is enabled + * and <code>false</code> that it is disabled. + */ + protected void setIsEnabled(boolean state) { + enabled = state; + } + + /** + * Throws an exception if the argument index does not correspond to + * any value. + * @param index - The index to check. + */ + private final void validateValueIndex(int index) { + if(index < 0 || index >= values.size()) { + throw new IndexOutOfBoundsException("Value index \"" + index + "\" is invalid."); + } + } } Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/ConfigurationManager.java ============================================================================= --- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/ConfigurationManager.java (original) +++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/ConfigurationManager.java Tue Mar 17 14:45:46 2015 @@ -17,84 +17,84 @@ * @see EvioDAQParser */ public class ConfigurationManager { - // Store the configuration object. - private static final DAQConfig DAQ_CONFIG = new DAQConfig(); - - // Track whether a DAQ configuration has been read yet. - private static boolean INITIALIZED = false; - - // Store listeners to alert other classes when an update occurs. - private static final List<ActionListener> AL_LIST = new ArrayList<ActionListener>(); - private static final ActionEvent EVENT = new ActionEvent(DAQ_CONFIG, ActionEvent.RESERVED_ID_MAX + 12, "update"); - - /** - * Gets an instance of the DAQ configuration settings object if it - * exists. If no configuration has been read, this will return - * <code>null</code> instead. - * @return Returns the DAQ settings as a <code>DAQConfig</code> - * object or <code>null</code>. - */ - public static final DAQConfig getInstance() { - if(INITIALIZED) { return DAQ_CONFIG; } - else { return null; } - } - - /** - * Adds a listener to track when updates occur in the DAQ settings. - * @param listener - The listener. - */ - public static final void addActionListener(ActionListener listener) { - if(listener != null) { AL_LIST.add(listener); } - } - - /** - * Gets the list of all listeners attached to the manager. - * @return Returns a <code>List</code> collection containing the - * <code>ActionListener</code> objects attached to the manager. - */ - public static final List<ActionListener> getActionListeners() { - return AL_LIST; - } - - /** - * Indicates whether a DAQ configuration has been received yet. - * If <code>false</code>, then calls to <code>getInstance</code> - * will return <code>null</code>. - * @return Returns <code>true</code> if a DAQ configuration has - * been read and <code>false</code> otherwise. - */ - public static final boolean isInitialized() { - return INITIALIZED; - } - - /** - * Removes an listener so that it will no longer receive updates - * when the DAQ configuration changes. - * @param listener - The listener to remove. - */ - public static final void removeActionListener(ActionListener listener) { - if(listener != null) { AL_LIST.remove(listener); } - } - - /** - * Updates the DAQ configuration with the given EVIO parser. The - * manager will also note that it is initialized and inform any - * associated listeners that an update has occurred. - * @param parser - The updated DAQ information. - */ - public static final void updateConfiguration(EvioDAQParser parser) { - DAQ_CONFIG.loadConfig(parser); - INITIALIZED = true; - updateListeners(); - } - - /** - * Sends an update event to all associated listeners. - */ - private static final void updateListeners() { - for(ActionListener al : AL_LIST) { - al.actionPerformed(EVENT); - } - } - -} + // Store the configuration object. + private static final DAQConfig DAQ_CONFIG = new DAQConfig(); + + // Track whether a DAQ configuration has been read yet. + private static boolean INITIALIZED = false; + + // Store listeners to alert other classes when an update occurs. + private static final List<ActionListener> AL_LIST = new ArrayList<ActionListener>(); + private static final ActionEvent EVENT = new ActionEvent(DAQ_CONFIG, ActionEvent.RESERVED_ID_MAX + 12, "update"); + + /** + * Gets an instance of the DAQ configuration settings object if it + * exists. If no configuration has been read, this will return + * <code>null</code> instead. + * @return Returns the DAQ settings as a <code>DAQConfig</code> + * object or <code>null</code>. + */ + public static final DAQConfig getInstance() { + if(INITIALIZED) { return DAQ_CONFIG; } + else { return null; } + } + + /** + * Adds a listener to track when updates occur in the DAQ settings. + * @param listener - The listener. + */ + public static final void addActionListener(ActionListener listener) { + if(listener != null) { AL_LIST.add(listener); } + } + + /** + * Gets the list of all listeners attached to the manager. + * @return Returns a <code>List</code> collection containing the + * <code>ActionListener</code> objects attached to the manager. + */ + public static final List<ActionListener> getActionListeners() { + return AL_LIST; + } + + /** + * Indicates whether a DAQ configuration has been received yet. + * If <code>false</code>, then calls to <code>getInstance</code> + * will return <code>null</code>. + * @return Returns <code>true</code> if a DAQ configuration has + * been read and <code>false</code> otherwise. + */ + public static final boolean isInitialized() { + return INITIALIZED; + } + + /** + * Removes an listener so that it will no longer receive updates + * when the DAQ configuration changes. + * @param listener - The listener to remove. + */ + public static final void removeActionListener(ActionListener listener) { + if(listener != null) { AL_LIST.remove(listener); } + } + + /** + * Updates the DAQ configuration with the given EVIO parser. The + * manager will also note that it is initialized and inform any + * associated listeners that an update has occurred. + * @param parser - The updated DAQ information. + */ + public static final void updateConfiguration(EvioDAQParser parser) { + INITIALIZED = false; + DAQ_CONFIG.loadConfig(parser); + INITIALIZED = true; + updateListeners(); + } + + /** + * Sends an update event to all associated listeners. + */ + private static final void updateListeners() { + for(ActionListener al : AL_LIST) { + al.actionPerformed(EVENT); + } + } +} Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/DAQConfig.java ============================================================================= --- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/DAQConfig.java (original) +++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/DAQConfig.java Tue Mar 17 14:45:46 2015 @@ -9,39 +9,49 @@ * @author Kyle McCarty <[log in to unmask]> */ public class DAQConfig extends IDAQConfig { - // Store the configuration objects. - private SSPConfig sspConfig = new SSPConfig(); - private FADCConfig fadcConfig = new FADCConfig(); - - /** - * Gets the configuration parameters for the FADC. - * @return Returns the FADC configuration. - */ - public FADCConfig getFADCConfig() { - return fadcConfig; - } - - /** - * Gets the configuration parameters for the SSP. - * @return Returns the SSP configuration. - */ - public SSPConfig getSSPConfig() { - return sspConfig; - } - - @Override - void loadConfig(EvioDAQParser parser) { - // Pass the configuration parser to the system-specific objects. - sspConfig.loadConfig(parser); - fadcConfig.loadConfig(parser); - } + // Store the configuration objects. + private SSPConfig sspConfig = new SSPConfig(); + private GTPConfig gtpConfig = new GTPConfig(); + private FADCConfig fadcConfig = new FADCConfig(); + + /** + * Gets the configuration parameters for the FADC. + * @return Returns the FADC configuration. + */ + public FADCConfig getFADCConfig() { + return fadcConfig; + } + + /** + * Gets the configuration parameters for the GTP. + * @return Returns the GTP configuration. + */ + public GTPConfig getGTPConfig() { + return gtpConfig; + } + + /** + * Gets the configuration parameters for the SSP. + * @return Returns the SSP configuration. + */ + public SSPConfig getSSPConfig() { + return sspConfig; + } + + @Override + void loadConfig(EvioDAQParser parser) { + // Pass the configuration parser to the system-specific objects. + sspConfig.loadConfig(parser); + gtpConfig.loadConfig(parser); + fadcConfig.loadConfig(parser); + } - @Override - public void printConfig() { - // Print the system-specific objects. - fadcConfig.printConfig(); - System.out.println(); - sspConfig.printConfig(); - } - -} + @Override + public void printConfig() { + // Print the system-specific objects. + fadcConfig.printConfig(); + System.out.println(); + sspConfig.printConfig(); + } + +} Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/DAQConfigDriver.java ============================================================================= --- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/DAQConfigDriver.java (original) +++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/DAQConfigDriver.java Tue Mar 17 14:45:46 2015 @@ -6,20 +6,20 @@ import org.lcsim.util.Driver; public class DAQConfigDriver extends Driver { - - @Override - public void process(EventHeader event) { - // Check if a trigger configuration bank exists. - if(event.hasCollection(EvioDAQParser.class, "TriggerConfig")) { - // Get the trigger configuration bank. There should only be - // one in the list. - List<EvioDAQParser> configList = event.get(EvioDAQParser.class, "TriggerConfig"); - EvioDAQParser daqConfig = configList.get(0); - - // Get the DAQ configuration and update it with the new - // configuration object. - ConfigurationManager.updateConfiguration(daqConfig); - } - } - + + @Override + public void process(EventHeader event) { + // Check if a trigger configuration bank exists. + if(event.hasCollection(EvioDAQParser.class, "TriggerConfig")) { + // Get the trigger configuration bank. There should only be + // one in the list. + List<EvioDAQParser> configList = event.get(EvioDAQParser.class, "TriggerConfig"); + EvioDAQParser daqConfig = configList.get(0); + + // Get the DAQ configuration and update it with the new + // configuration object. + ConfigurationManager.updateConfiguration(daqConfig); + } + } + } Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/ESBCutConfig.java ============================================================================= --- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/ESBCutConfig.java (original) +++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/ESBCutConfig.java Tue Mar 17 14:45:46 2015 @@ -10,43 +10,43 @@ * @author Kyle McCarty <[log in to unmask]> */ public class ESBCutConfig extends AbstractConfig<Double> { - private static final int ENERGY_SLOPE_THRESHOLD = 0; - private static final int PARAMETER_F = 1; - - /** - * Instantiates a new <code>ESBCutConfig</code> object. - */ - ESBCutConfig() { super(2); } - - /** - * Gets the lower bound of the cut. - * @return Returns the lower bound as a <code>double</code>. - */ - public double getLowerBound() { - return getValue(ENERGY_SLOPE_THRESHOLD); - } - - /** - * Gets the parameter F in the energy slope equation. - * @return Returns the parameter as a <code>double</code>. - */ - public double getParameterF() { - return getValue(PARAMETER_F); - } - - /** - * Sets the lower bound of the cut to the specified value. - * @param value - The new lower bound for the cut. - */ - void setLowerBound(double value) { - setValue(ENERGY_SLOPE_THRESHOLD, value); - } - - /** - * Sets the parameter F in the energy slope equation. - * @param value - The new parameter for the cut. - */ - void setParameterF(double value) { - setValue(PARAMETER_F, value); - } -} + private static final int ENERGY_SLOPE_THRESHOLD = 0; + private static final int PARAMETER_F = 1; + + /** + * Instantiates a new <code>ESBCutConfig</code> object. + */ + ESBCutConfig() { super(2); } + + /** + * Gets the lower bound of the cut. + * @return Returns the lower bound as a <code>double</code>. + */ + public double getLowerBound() { + return getValue(ENERGY_SLOPE_THRESHOLD); + } + + /** + * Gets the parameter F in the energy slope equation. + * @return Returns the parameter as a <code>double</code>. + */ + public double getParameterF() { + return getValue(PARAMETER_F); + } + + /** + * Sets the lower bound of the cut to the specified value. + * @param value - The new lower bound for the cut. + */ + void setLowerBound(double value) { + setValue(ENERGY_SLOPE_THRESHOLD, value); + } + + /** + * Sets the parameter F in the energy slope equation. + * @param value - The new parameter for the cut. + */ + void setParameterF(double value) { + setValue(PARAMETER_F, value); + } +} Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/EvioDAQParser.java ============================================================================= --- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/EvioDAQParser.java (original) +++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/EvioDAQParser.java Tue Mar 17 14:45:46 2015 @@ -13,97 +13,94 @@ import org.hps.conditions.ecal.EcalConditions; public class EvioDAQParser { - /* * Read/Parse/Save the DAQ trigger configuration settings. * These settings arrive in multiple banks, but they *should* be in the same event. - * + * * Currently this is set up to read SSP and ECAL configurations, * which is all that is currently available in EVIO as of Feb 28, 2015. * * GTP settings and Prescale factors will need to be added to this class when added to EVIO. - * + * * TODO: Error in EVIO format for Crate 39 for 2014 data requires another JEVIO workaround (realized Feb 16). * ** This was fixed in EVIO for data after run 4044. - * + * * TODO: Manually put in GTP settings based on run number for 2014 data. * TODO: Manually deal with change in format of SSP_HPS_SINGLES_NMIN (at 3312(?)). - * + * * TODO: Restructure, clean up.. * * @author <[log in to unmask]> */ - public int nBanks = 0; - public static final int BANK_TAG = 0xE10E; - + // need to know these in order to interpret DAQ strings: private static final int[] singlesIOsrc = { 20, 21 }; private static final int[] pairsIOsrc = { 22, 23 }; - - // Dump everything read from the DAQ Configuration Bank, minimal interpretation: - public Map<String,List<String>> configMap = new HashMap<String,List<String>>(); - - // link ECAL FADC channel settings to EcalChannels: - Map<EcalChannel,Float> GAIN = new HashMap<EcalChannel,Float>(); - Map<EcalChannel,Float> PEDESTAL = new HashMap<EcalChannel,Float>(); - Map<EcalChannel,Integer> THRESHOLD = new HashMap<EcalChannel,Integer>(); - -// private boolean debug = true; - private boolean debug = false; - - // FADC Config: - int fadcNSA = 0; - int fadcNSB = 0; - int fadcNPEAK = 0; - int fadcMODE = 0; - int fadcWIDTH = 0; - int fadcOFFSET = 0; - - // GTP Clustering Cut Values: - int clusterMinSeedEnergy = 0; - int clusterMinHitTimeDiff = 0; - int clusterMaxHitTimeDiff = 0; - - // Triggers Enabled: - boolean[] singlesEn = { false, false }; - boolean[] pairsEn = { false, false }; - - // Singles Cuts Enabled: - boolean[] singlesNhitsEn = { false, false }; - boolean[] singlesEnergyMinEn = { false, false }; - boolean[] singlesEnergyMaxEn = { false, false }; - - // Pairs Cuts Enabled: - boolean[] pairsEnergySumMaxMinEn = { false, false }; - boolean[] pairsEnergyDiffEn = { false, false }; - boolean[] pairsCoplanarityEn = { false, false }; - boolean[] pairsEnergyDistEn = { false, false }; - - // Singles Cut Values: - int[] singlesNhits = { 0, 0 }; - int[] singlesEnergyMin = { 0, 0 }; - int[] singlesEnergyMax = { 0, 0 }; - - // Pairs Cut Values: - int[] pairsNhitsMin = { 0, 0 }; - int[] pairsEnergyMin = { 0, 0 }; - int[] pairsEnergyMax = { 0, 0 }; - int[] pairsEnergySumMin = { 0, 0 }; - int[] pairsEnergySumMax = { 0, 0 }; - int[] pairsEnergyDiffMax = { 0, 0 }; - int[] pairsCoplanarityMax = { 0, 0 }; - int[] pairsTimeDiffMax = { 0, 0 }; - int[] pairsEnergyDistMin = { 0, 0 }; - - // Pairs Cut Parameters: - float[] pairsEnergyDistSlope = { 0, 0 }; - - // Have to remember the previous slot line in order to interpret the data: - private int thisFadcSlot = 0; - - // Cache local set of EcalChannels: + + // Dump everything read from the DAQ Configuration Bank, minimal interpretation: + Map<String,List<String>> configMap = new HashMap<String,List<String>>(); + + // link ECAL FADC channel settings to EcalChannels: + Map<EcalChannel,Float> GAIN = new HashMap<EcalChannel,Float>(); + Map<EcalChannel,Float> PEDESTAL = new HashMap<EcalChannel,Float>(); + Map<EcalChannel,Integer> THRESHOLD = new HashMap<EcalChannel,Integer>(); + + // private boolean debug = true; + private boolean debug = false; + + // FADC Config: + int fadcNSA = 0; + int fadcNSB = 0; + int fadcNPEAK = 0; + int fadcMODE = 0; + int fadcWIDTH = 0; + int fadcOFFSET = 0; + + // GTP Clustering Cut Values: + int gtpMinSeedEnergy = 0; + int gtpWindowBefore = 0; + int gtpWindowAfter = 0; + + // Triggers Enabled: + boolean[] singlesEn = { false, false }; + boolean[] pairsEn = { false, false }; + + // Singles Cuts Enabled: + boolean[] singlesNhitsEn = { false, false }; + boolean[] singlesEnergyMinEn = { false, false }; + boolean[] singlesEnergyMaxEn = { false, false }; + + // Pairs Cuts Enabled: + boolean[] pairsEnergySumMaxMinEn = { false, false }; + boolean[] pairsEnergyDiffEn = { false, false }; + boolean[] pairsCoplanarityEn = { false, false }; + boolean[] pairsEnergyDistEn = { false, false }; + + // Singles Cut Values: + int[] singlesNhits = { 0, 0 }; + int[] singlesEnergyMin = { 0, 0 }; + int[] singlesEnergyMax = { 0, 0 }; + + // Pairs Cut Values: + int[] pairsNhitsMin = { 0, 0 }; + int[] pairsEnergyMin = { 0, 0 }; + int[] pairsEnergyMax = { 0, 0 }; + int[] pairsEnergySumMin = { 0, 0 }; + int[] pairsEnergySumMax = { 0, 0 }; + int[] pairsEnergyDiffMax = { 0, 0 }; + int[] pairsCoplanarityMax = { 0, 0 }; + int[] pairsTimeDiffMax = { 0, 0 }; + int[] pairsEnergyDistMin = { 0, 0 }; + + // Pairs Cut Parameters: + float[] pairsEnergyDistSlope = { 0, 0 }; + + // Have to remember the previous slot line in order to interpret the data: + private int thisFadcSlot = 0; + + // Cache local set of EcalChannels: private EcalConditions ecalConditions = null; private List<EcalChannel> channels = new ArrayList<EcalChannel>(); @@ -112,308 +109,292 @@ for (int ii = 0; ii < 442; ii++) { channels.add(findChannel(ii+1)); } - } - - public void parse(int crate,int runNumber,String[] dump) { - + } + + public void parse(int crate, int runNumber, String[] dump) { nBanks++; - loadConfigMap(crate,dump); - if (debug) printMap(); + if (debug) printMap(); fixConfigMap2014Run(runNumber); parseConfigMap(); - if (nBanks>2 && debug) printVars(); - } - + if(nBanks > 2 && debug) { printVars(); } + } + /* * The first parsing routine. Just dumps the config strings * into a map whose keys are the first column in the config file. * Also treats some special cases. */ - private void loadConfigMap(int crate,String[] dump) { - - for (String dump1 : dump) { - for (String line : dump1.trim().split("\n")) { - - String[] cols=line.trim().split(" +",2); - if (cols.length < 2) continue; - - String key=cols[0]; - List<String> vals=new ArrayList<String> + private void loadConfigMap(int crate, String[] dump) { + for(String dump1 : dump) { + for(String line : dump1.trim().split("\n")) { + + String[] cols = line.trim().split(" +", 2); + if(cols.length < 2) continue; + + String key = cols[0]; + List<String> vals = new ArrayList<String> (Arrays.asList(cols[1].trim().split(" +"))); - + if (vals.size() < 1) { - continue; + continue; } // SPECIAL CASE: // parse the 16+1 column slot configurations. if (key.startsWith("FADC250")) { - parseFADC(crate,key.trim(),vals); + parseFADC(crate, key.trim(), vals); } // SPECIAL CASE: // figure out which triggers are enabled: - else if (key.startsWith("SSP_HPS_SET_IO_SRC")) { + else if(key.startsWith("SSP_HPS_SET_IO_SRC")) { int trig = Integer.valueOf(vals.get(1)); - for (int ii=0; ii<pairsIOsrc.length; ii++) - { - if (trig == singlesIOsrc[ii]) { - singlesEn[ii]=true; + for (int ii = 0; ii < pairsIOsrc.length; ii++) { + if(trig == singlesIOsrc[ii]) { + singlesEn[ii] = true; } - else if (trig == pairsIOsrc[ii]) { - pairsEn[ii]=true; + else if(trig == pairsIOsrc[ii]) { + pairsEn[ii] = true; } } } // GENERAL CASE: // Append trigger# onto key: - if (vals.size() > 1 && key.startsWith("SSP")) - { - key += "_"+vals.remove(0); + if(vals.size() > 1 && key.startsWith("SSP")) { + key += "_" + vals.remove(0); } // dump it into the map: - configMap.put(key,vals); - } - } - } + configMap.put(key, vals); + } + } + } + /* * This function parses the config map for the cases where the * config string has a simple format: * TAG VALUE * TAG TRIGGER VALUES */ - public void parseConfigMap() - { -// System.out.println("PARSECONFIGMAP .................."); - - fadcNSA=Integer.valueOf(getConfig("FADC250_NSA",0)); - fadcNSB=Integer.valueOf(getConfig("FADC250_NSB",0)); - fadcNPEAK=Integer.valueOf(getConfig("FADC250_NPEAK",0)); - fadcMODE=Integer.valueOf(getConfig("FADC250_MODE",0)); - fadcWIDTH=Integer.valueOf(getConfig("FADC250_W_WIDTH",0)); - fadcOFFSET=Integer.valueOf(getConfig("FADC250_W_OFFSET",0)); + public void parseConfigMap() { + fadcNSA = Integer.valueOf(getConfig("FADC250_NSA", 0)); + fadcNSB = Integer.valueOf(getConfig("FADC250_NSB", 0)); + fadcNPEAK = Integer.valueOf(getConfig("FADC250_NPEAK", 0)); + fadcMODE = Integer.valueOf(getConfig("FADC250_MODE", 0)); + fadcWIDTH = Integer.valueOf(getConfig("FADC250_W_WIDTH", 0)); + fadcOFFSET = Integer.valueOf(getConfig("FADC250_W_OFFSET", 0)); - clusterMinSeedEnergy=Integer.valueOf(getConfig("GTP_CLUSTER_PULSE_THRESHOLD",0)); - clusterMinHitTimeDiff=Integer.valueOf(getConfig("GTP_CLUSTER_PULSE_COIN",0)); - clusterMaxHitTimeDiff=Integer.valueOf(getConfig("GTP_CLUSTER_PULSE_COIN",1)); - - for (int ii=0; ii<2; ii++) { - - singlesNhitsEn[ii]=getBoolConfigSSP(ii,"SINGLES_NMIN",1); - singlesEnergyMinEn[ii]=getBoolConfigSSP(ii,"SINGLES_EMIN",1); - singlesEnergyMaxEn[ii]=getBoolConfigSSP(ii,"SINGLES_EMAX",1); - - pairsEnergySumMaxMinEn[ii]=getBoolConfigSSP(ii,"PAIRS_SUMMAX_MIN",2); - pairsEnergyDiffEn[ii]=getBoolConfigSSP(ii,"PAIRS_DIFFMAX",1); - pairsCoplanarityEn[ii]=getBoolConfigSSP(ii,"PAIRS_COPLANARITY",1); - pairsEnergyDistEn[ii]=getBoolConfigSSP(ii,"PAIRS_ENERGYDIST",1); - - singlesNhits[ii]=getIntConfigSSP(ii,"SINGLES_NMIN",0); - singlesEnergyMin[ii]=getIntConfigSSP(ii,"SINGLES_EMIN",0); - singlesEnergyMax[ii]=getIntConfigSSP(ii,"SINGLES_EMAX",0); - - pairsNhitsMin[ii]=getIntConfigSSP(ii,"PAIRS_NMIN",0); - pairsEnergyMin[ii]=getIntConfigSSP(ii,"PAIRS_EMIN",0); - pairsEnergyMax[ii]=getIntConfigSSP(ii,"PAIRS_EMAX",0); - pairsEnergySumMin[ii]=getIntConfigSSP(ii,"PAIRS_SUMMAX_MIN",1); - pairsEnergySumMax[ii]=getIntConfigSSP(ii,"PAIRS_SUMMAX_MIN",0); - pairsEnergyDiffMax[ii]=getIntConfigSSP(ii,"PAIRS_DIFFMAX",0); - pairsCoplanarityMax[ii]=getIntConfigSSP(ii,"PAIRS_COPLANARITY",0); - pairsTimeDiffMax[ii]=getIntConfigSSP(ii,"PAIRS_TIMECOINCIDENCE",0); - pairsEnergyDistSlope[ii]=getFloatConfigSSP(ii,"PAIRS_ENERGYDIST",0); - pairsEnergyDistMin[ii]=getIntConfigSSP(ii,"PAIRS_ENERGYDIST",1); - } -// System.out.println("DONE PARSECONFIGMAP."); - } - - - + gtpMinSeedEnergy = Integer.valueOf(getConfig("GTP_CLUSTER_PULSE_THRESHOLD", 0)); + gtpWindowBefore = Integer.valueOf(getConfig("GTP_CLUSTER_PULSE_COIN", 0)); + gtpWindowAfter = Integer.valueOf(getConfig("GTP_CLUSTER_PULSE_COIN", 1)); + + for(int ii = 0; ii < 2; ii++) { + singlesNhitsEn[ii] = getBoolConfigSSP(ii, "SINGLES_NMIN", 1); + singlesEnergyMinEn[ii] = getBoolConfigSSP(ii, "SINGLES_EMIN", 1); + singlesEnergyMaxEn[ii] = getBoolConfigSSP(ii, "SINGLES_EMAX", 1); + + pairsEnergySumMaxMinEn[ii] = getBoolConfigSSP(ii, "PAIRS_SUMMAX_MIN", 2); + pairsEnergyDiffEn[ii] = getBoolConfigSSP(ii, "PAIRS_DIFFMAX", 1); + pairsCoplanarityEn[ii] = getBoolConfigSSP(ii, "PAIRS_COPLANARITY", 1); + pairsEnergyDistEn[ii] = getBoolConfigSSP(ii, "PAIRS_ENERGYDIST", 1); + + singlesNhits[ii] = getIntConfigSSP(ii, "SINGLES_NMIN", 0); + singlesEnergyMin[ii] = getIntConfigSSP(ii, "SINGLES_EMIN", 0); + singlesEnergyMax[ii] = getIntConfigSSP(ii, "SINGLES_EMAX", 0); + + pairsNhitsMin[ii] = getIntConfigSSP(ii, "PAIRS_NMIN", 0); + pairsEnergyMin[ii] = getIntConfigSSP(ii, "PAIRS_EMIN", 0); + pairsEnergyMax[ii] = getIntConfigSSP(ii, "PAIRS_EMAX", 0); + pairsEnergySumMin[ii] = getIntConfigSSP(ii, "PAIRS_SUMMAX_MIN", 1); + pairsEnergySumMax[ii] = getIntConfigSSP(ii, "PAIRS_SUMMAX_MIN", 0); + pairsEnergyDiffMax[ii] = getIntConfigSSP(ii, "PAIRS_DIFFMAX", 0); + pairsCoplanarityMax[ii] = getIntConfigSSP(ii, "PAIRS_COPLANARITY", 0); + pairsTimeDiffMax[ii] = getIntConfigSSP(ii, "PAIRS_TIMECOINCIDENCE", 0); + pairsEnergyDistSlope[ii] = getFloatConfigSSP(ii, "PAIRS_ENERGYDIST", 0); + pairsEnergyDistMin[ii] = getIntConfigSSP(ii, "PAIRS_ENERGYDIST", 1); + } + } + + + /* * UNFINISHED. * This is a fixer-upper for before we had the full config in EVIO * or when there was a bug in it. */ private void fixConfigMap2014Run(int runNumber) { - if (runNumber>3470 || runNumber < 3100) return; - // TODO: port datacat/python/engrun/engrun_metadata.py + if(runNumber > 3470 || runNumber < 3100) { return; } + // TODO: port datacat/python/engrun/engrun_metadata.py // 1. SET GTP SETTINGS MANUALLY BASED ON RUN NUMBER // 2. FIX SINGLES_NMIN prior to 3312 - for (String key : configMap.keySet()) { - } - List<String> tmp=new ArrayList<String>(); - tmp.add("0"); - tmp.add("0"); - tmp.add("0"); - tmp.add("0"); - configMap.put("GTP_CLUSTER_THRESH",tmp); - configMap.put("GTP_TIMEDIFF",tmp); - } - - + for (String key : configMap.keySet()) { + } + List<String> tmp = new ArrayList<String>(); + tmp.add("0"); + tmp.add("0"); + tmp.add("0"); + tmp.add("0"); + configMap.put("GTP_CLUSTER_THRESH" ,tmp); + configMap.put("GTP_TIMEDIFF", tmp); + } /* * These treat the FADC config lines with 16+1 columns. * Must keep track of most recent FADC250_SLOT tag, since it's * not on the line with the data. */ - private void parseFADC(int crate,String key,List<String> vals) - { -// System.out.println(crate); + private void parseFADC(int crate, String key, List<String> vals) { + // System.out.println(crate); if (key.equals("FADC250_SLOT")) { - thisFadcSlot=Integer.valueOf(vals.get(0)); + thisFadcSlot = Integer.valueOf(vals.get(0)); } else if (key.equals("FADC250_ALLCH_TET")) { - setChannelParsInt(crate,thisFadcSlot,THRESHOLD,vals); + setChannelParsInt(crate, thisFadcSlot, THRESHOLD, vals); } else if (key.equals("FADC250_ALLCH_PED")) { - setChannelParsFloat(crate,thisFadcSlot,PEDESTAL,vals); + setChannelParsFloat(crate, thisFadcSlot, PEDESTAL, vals); } else if (key.equals("FADC250_ALLCH_GAIN")) { - setChannelParsFloat(crate,thisFadcSlot,GAIN,vals); - } - } - private void setChannelParsFloat(int crate,int slot,Map<EcalChannel,Float>map, List<String> vals) - { - for (int ii=0; ii<16; ii++) { - map.put(findChannel(crate,slot,ii),Float.valueOf(vals.get(ii))); - } - } - private void setChannelParsInt(int crate,int slot,Map<EcalChannel,Integer>map, List<String> vals) - { - for (int ii=0; ii<16; ii++) { - map.put(findChannel(crate,slot,ii),Integer.valueOf(vals.get(ii))); - } - } - - - + setChannelParsFloat(crate, thisFadcSlot, GAIN, vals); + } + } + + private void setChannelParsFloat(int crate, int slot, Map<EcalChannel, Float>map, List<String> vals) { + for (int ii = 0; ii < 16; ii++) { + map.put(findChannel(crate, slot, ii),Float.valueOf(vals.get(ii))); + } + } + + private void setChannelParsInt(int crate, int slot, Map<EcalChannel, Integer>map, List<String> vals) { + for (int ii = 0; ii < 16; ii++) { + map.put(findChannel(crate, slot, ii),Integer.valueOf(vals.get(ii))); + } + } public void printMap() { System.out.print("\nTriggerConfigMap::::::::::::::::::::::::::::\n"); for (String key : configMap.keySet()) { - System.out.printf("%s: ",key); + System.out.printf("%s: ", key); for (String val : configMap.get(key)) { - System.out.printf("%s ",val); + System.out.printf("%s ", val); } System.out.printf("\n"); } System.out.println("::::::::::::::::::::::::::::::::::::::::::::"); } - + public void printVars() - { + { System.out.println("\nTriggerConfigVars%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"); System.out.println(); - System.out.println(String.format("GTPMINSEED: %d",clusterMinSeedEnergy)); - System.out.println(String.format("GTPMINHITDT: %d",clusterMinHitTimeDiff)); - System.out.println(String.format("GTPMAXHITDT: %d",clusterMaxHitTimeDiff)); - System.out.println(); - System.out.println(String.format("FADC250_NSA: %d",fadcNSA)); - System.out.println(String.format("FADC250_NSB: %d",fadcNSB)); - System.out.println(String.format("FADC250_NPEAK: %d",fadcNPEAK)); - System.out.println(String.format("FADC250_MODE: %d",fadcMODE)); - System.out.println(String.format("FADC250_WIDTH: %d",fadcWIDTH)); - System.out.println(String.format("FADC250_OFFSET: %d",fadcOFFSET)); - for (EcalChannel cc : ecalConditions.getChannelCollection()) { + System.out.println(String.format("GTPMINSEED: %d", gtpMinSeedEnergy)); + System.out.println(String.format("GTPMINHITDT: %d", gtpWindowBefore)); + System.out.println(String.format("GTPMAXHITDT: %d", gtpWindowAfter)); + System.out.println(); + System.out.println(String.format("FADC250_NSA: %d", fadcNSA)); + System.out.println(String.format("FADC250_NSB: %d", fadcNSB)); + System.out.println(String.format("FADC250_NPEAK: %d", fadcNPEAK)); + System.out.println(String.format("FADC250_MODE: %d", fadcMODE)); + System.out.println(String.format("FADC250_WIDTH: %d", fadcWIDTH)); + System.out.println(String.format("FADC250_OFFSET: %d", fadcOFFSET)); + for(EcalChannel cc : ecalConditions.getChannelCollection()) { //System.out.print(String.format("SLOT%d CHAN%d --",cc.getSlot(),cc.getChannel())); - if (!PEDESTAL.containsKey(cc)) { + if(!PEDESTAL.containsKey(cc)) { System.out.println("\nP !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); } - if (!THRESHOLD.containsKey(cc)) { + if(!THRESHOLD.containsKey(cc)) { System.out.println("\nT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); } - if (!GAIN.containsKey(cc)) { + if(!GAIN.containsKey(cc)) { System.out.println("\nG !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); } //System.out.println(String.format(" %f %d %f", // PEDESTAL.get(cc),THRESHOLD.get(cc),GAIN.get(cc))); } - System.out.println(); - for (int ii=0; ii<2; ii++) - { - System.out.println(String.format("SINGLES_EN %d %b ",ii,singlesEn[ii])); - System.out.println(String.format("PAIRS_EN %d %b ",ii,pairsEn[ii])); - - System.out.println(String.format("SINGLES_NHITS_EN %d %b: ",ii,singlesNhitsEn[ii])); - System.out.println(String.format("SINGLES_EMIN_EN %d %b",ii,singlesEnergyMinEn[ii])); - System.out.println(String.format("SINGLES_EMAX_EN %d %b",ii,singlesEnergyMaxEn[ii])); - - System.out.println(String.format("PAIRS_SUMMAXMIN_EN %d %b",ii,pairsEnergySumMaxMinEn[ii])); - System.out.println(String.format("PAIRS_ENERGYDIFF_EN %d %b",ii,pairsEnergyDiffEn[ii])); - System.out.println(String.format("PAIRS_COP_EN %d %b",ii,pairsCoplanarityEn[ii])); - System.out.println(String.format("PAIRS_EDIST_EN %d %b",ii,pairsEnergyDistEn[ii])); - - System.out.println(String.format("SINGLES_NHTIS %d %d",ii,singlesNhits[ii])); - System.out.println(String.format("SINGLES_EMIN %d %d",ii,singlesEnergyMin[ii])); - System.out.println(String.format("SINGLES_EMAX %d %d",ii,singlesEnergyMax[ii])); - - System.out.println(String.format("PAIRS_NHITS %d %d",ii,pairsNhitsMin[ii])); - System.out.println(String.format("PAIRS_SUMMIN %d %d",ii,pairsEnergySumMin[ii])); - System.out.println(String.format("PAIRS_SUMMAX %d %d",ii,pairsEnergySumMax[ii])); - System.out.println(String.format("PAIRS_ENERGYDIFF %d %d",ii,pairsEnergyDiffMax[ii])); - System.out.println(String.format("PAIRS_COPMAX %d %d",ii,pairsCoplanarityMax[ii])); - System.out.println(String.format("PAIRS_TDIFFMAAX %d %d",ii,pairsTimeDiffMax[ii])); - System.out.println(String.format("PAIRS_EDISTMIN %d %d",ii,pairsEnergyDistMin[ii])); - System.out.println(String.format("PAIRS_EDISTSLOP %d %f",ii,pairsEnergyDistSlope[ii])); - } - System.out.println("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"); - } - - + + System.out.println(); + for(int ii = 0; ii < 2; ii++) { + System.out.println(String.format("SINGLES_EN %d %b ", ii, singlesEn[ii])); + System.out.println(String.format("PAIRS_EN %d %b ", ii, pairsEn[ii])); + + System.out.println(String.format("SINGLES_NHITS_EN %d %b: ", ii, singlesNhitsEn[ii])); + System.out.println(String.format("SINGLES_EMIN_EN %d %b", ii, singlesEnergyMinEn[ii])); + System.out.println(String.format("SINGLES_EMAX_EN %d %b", ii, singlesEnergyMaxEn[ii])); + + System.out.println(String.format("PAIRS_SUMMAXMIN_EN %d %b", ii, pairsEnergySumMaxMinEn[ii])); + System.out.println(String.format("PAIRS_ENERGYDIFF_EN %d %b", ii, pairsEnergyDiffEn[ii])); + System.out.println(String.format("PAIRS_COP_EN %d %b", ii, pairsCoplanarityEn[ii])); + System.out.println(String.format("PAIRS_EDIST_EN %d %b", ii, pairsEnergyDistEn[ii])); + + System.out.println(String.format("SINGLES_NHTIS %d %d", ii, singlesNhits[ii])); + System.out.println(String.format("SINGLES_EMIN %d %d", ii, singlesEnergyMin[ii])); + System.out.println(String.format("SINGLES_EMAX %d %d", ii, singlesEnergyMax[ii])); + + System.out.println(String.format("PAIRS_NHITS %d %d", ii, pairsNhitsMin[ii])); + System.out.println(String.format("PAIRS_SUMMIN %d %d", ii, pairsEnergySumMin[ii])); + System.out.println(String.format("PAIRS_SUMMAX %d %d", ii, pairsEnergySumMax[ii])); + System.out.println(String.format("PAIRS_ENERGYDIFF %d %d", ii, pairsEnergyDiffMax[ii])); + System.out.println(String.format("PAIRS_COPMAX %d %d", ii, pairsCoplanarityMax[ii])); + System.out.println(String.format("PAIRS_TDIFFMAAX %d %d", ii, pairsTimeDiffMax[ii])); + System.out.println(String.format("PAIRS_EDISTMIN %d %d", ii, pairsEnergyDistMin[ii])); + System.out.println(String.format("PAIRS_EDISTSLOP %d %f", ii, pairsEnergyDistSlope[ii])); + } + + System.out.println("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"); + } /* * Parsing wrappers to make rest of code easier. */ - public float getFloatConfigSSP(int itrig,String stub,int ival) { - return Float.valueOf(getConfigSSP(itrig,stub,ival)); - } - public int getIntConfigSSP(int itrig,String stub,int ival) { - return Integer.valueOf(getConfigSSP(itrig,stub,ival)); - } - public boolean getBoolConfigSSP(int itrig,String stub,int ival) { - return "1".equals(getConfigSSP(itrig,stub,ival)); - } - public String getConfigSSP(int itrig,String stub,int ival) { - String key="SSP_HPS_"+stub+"_"+itrig; - return getConfig(key,ival); - } + public float getFloatConfigSSP(int itrig, String stub, int ival) { + return Float.valueOf(getConfigSSP(itrig, stub, ival)); + } + + public int getIntConfigSSP(int itrig, String stub, int ival) { + return Integer.valueOf(getConfigSSP(itrig, stub, ival)); + } + + public boolean getBoolConfigSSP(int itrig, String stub, int ival) { + return "1".equals(getConfigSSP(itrig, stub, ival)); + } + + public String getConfigSSP(int itrig, String stub, int ival) { + String key = "SSP_HPS_" + stub + "_" + itrig; + return getConfig(key,ival); + } + public String getConfig(String key, int ival) { if (configMap.containsKey(key)) { - List<String> vals=configMap.get(key); - if (ival<vals.size()) { - return configMap.get(key).get(ival); - } else { - Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, - "ConfigMap TOO SHORT: "+ival+" "+configMap.get(key)); - return "0"; - } + List<String> vals = configMap.get(key); + if (ival < vals.size()) { + return configMap.get(key).get(ival); + } else { + Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, + "ConfigMap TOO SHORT: " + ival + " " + configMap.get(key)); + return "0"; + } } else { // this is only necessarily an error if we've read 3 banks: - if (nBanks>2) { - Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, - "ConfigMap MISSING KEY: "+key); - } - return "0"; - } - } - - - public EcalChannel findChannel(int crate,int fadcSlot,int fadcChan) - { + if(nBanks > 2) { + Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "ConfigMap MISSING KEY: " + key); + } + return "0"; + } + } + + public EcalChannel findChannel(int crate, int fadcSlot, int fadcChan) { for (EcalChannel cc : channels) { // EcalChannel follows different convention on crate numbering: - if ((cc.getCrate()-1)*2 == crate-37 && - cc.getSlot() == fadcSlot && cc.getChannel() == fadcChan) - { + if ((cc.getCrate() - 1) * 2 == crate - 37 && cc.getSlot() == fadcSlot && cc.getChannel() == fadcChan) { return cc; } } return null; } + public EcalChannel findChannel(int channel_id) { return ecalConditions.getChannelCollection().findChannel(channel_id); } -} +} Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/FADCConfig.java ============================================================================= --- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/FADCConfig.java (original) +++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/FADCConfig.java Tue Mar 17 14:45:46 2015 @@ -27,253 +27,253 @@ * @author Kyle McCarty <[log in to unmask]> */ public class FADCConfig extends IDAQConfig { - // Store basic FADC information. - private int mode = -1; - private int nsa = -1; - private int nsb = -1; - private int windowWidth = -1; - private int offset = -1; - private int maxPulses = -1; - - // Store a map of calorimeter channel number to crystal indices. - private Map<Point, Integer> indexChannelMap = new HashMap<Point, Integer>(); - - // Store crystal calibrations and energy conversion factors. - private float[] gains = new float[443]; - private float[] pedestals = new float[443]; - private int[] thresholds = new int[443]; - - @Override - void loadConfig(EvioDAQParser parser) { - // Store the basic FADC information. - mode = parser.fadcMODE; - nsa = parser.fadcNSA; - nsb = parser.fadcNSB; - windowWidth = parser.fadcWIDTH; - offset = parser.fadcOFFSET; - maxPulses = parser.fadcNPEAK; - - // Get the channel collection from the database. - DatabaseConditionsManager database = DatabaseConditionsManager.getInstance(); - EcalChannelCollection channels = database.getCachedConditions(EcalChannelCollection.class, "ecal_channels").getCachedData(); - - // Create a mapping of calorimeter crystal positions to their - // corresponding channels. Also place the mapped values into - // an array by their channel ID. - indexChannelMap.clear(); - for(EcalChannel ecalChannel : channels) { - // Map the channel IDs to the crystal position. - int channel = ecalChannel.getChannelId(); - int ix = ecalChannel.getX(); - int iy = ecalChannel.getY(); - indexChannelMap.put(new Point(ix, iy), new Integer(channel)); - - // Place the mapped values into the arrays. - gains[ecalChannel.getChannelId()] = parser.GAIN.get(ecalChannel); - pedestals[ecalChannel.getChannelId()] = parser.PEDESTAL.get(ecalChannel); - thresholds[ecalChannel.getChannelId()] = parser.THRESHOLD.get(ecalChannel); - } - } - - /** - * Gets the gain for a crystal. - * @param channel - The channel object corresponding to the crystal. - * @return Returns the gain as a <code>float</code> in units of MeV - * per ADC. - */ - public float getGain(EcalChannel channel) { - return getGain(channel.getChannelId()); - } - - /** - * Gets the gain for a crystal. - * @param channelID - The channel ID corresponding to the crystal. - * @return Returns the gain as a <code>float</code> in units of MeV - * per ADC. - */ - public float getGain(int channelID) { - validateChannelID(channelID); - return gains[channelID]; - } - - /** - * Gets the gain for a crystal. - * @param ix - The x-index of the crystal. - * @param iy - The y-index of the crystal. - * @return Returns the gain as a <code>float</code> in units of MeV - * per ADC. - */ - public float getGain(int ix, int iy) { - return getGain(new Point(ix, iy)); - } - - /** - * Gets the gain for a crystal. - * @param ixy - The a point representing the x/y-indices of the - * crystal. - * @return Returns the gain as a <code>float</code> in units of MeV - * per ADC. - */ - public float getGain(Point ixy) { - return getGain(indexChannelMap.get(ixy)); - } - - /** - * Gets the maximum number of pulses that the FADC will look for - * in a channel's window. - * @return Returns the maximum number of pulses. - */ - public int getMaxPulses() { - return maxPulses; - } - - /** - * Gets the mode in which FADC data is written. - * @return Returns the mode as an <code>int</code>; either 1, 3, - * or 7. - */ - public int getMode() { - return mode; - } - - /** - * Gets the number of samples (4 ns clock-cycles) that a pulse will - * be integrated by the FADC after a threshold-crossing event. - * @return Returns the samples as an <code>int</code> in clock-cycles. - */ - public int getNSA() { - return nsa; - } - - /** - * Gets the number of samples (4 ns clock-cycles) that a pulse will - * be integrated by the FADC before a threshold-crossing event. - * @return Returns the samples as an <code>int</code> in clock-cycles. - */ - public int getNSB() { - return nsb; - } - - /** - * Gets the pedestal for a crystal. - * @param channel - The channel object corresponding to the crystal. - * @return Returns the pedestal as a <code>float</code> in units - * of ADC. - */ - public float getPedestal(EcalChannel channel) { - return getPedestal(channel.getChannelId()); - } - - /** - * Gets the pedestal for a crystal. - * @param channelID - The channel ID corresponding to the crystal. - * @return Returns the pedestal as a <code>float</code> in units - * of ADC. - */ - public float getPedestal(int channelID) { - validateChannelID(channelID); - return pedestals[channelID]; - } - - /** - * Gets the pedestal for a crystal. - * @param ix - The x-index of the crystal. - * @param iy - The y-index of the crystal. - * @return Returns the pedestal as a <code>float</code> in units - * of ADC. - */ - public float getPedestal(int ix, int iy) { - return getPedestal(new Point(ix, iy)); - } - - /** - * Gets the pedestal for a crystal. - * @param ixy - The a point representing the x/y-indices of the - * crystal. - * @return Returns the pedestal as a <code>float</code> in units - * of ADC. - */ - public float getPedestal(Point ixy) { - return getPedestal(indexChannelMap.get(ixy)); - } - - /** - * Gets the threshold for a crystal. - * @param channel - The channel object corresponding to the crystal. - * @return Returns the threshold as a <code>int</code> in units - * of ADC. - */ - public int getThreshold(EcalChannel channel) { - return getThreshold(channel.getChannelId()); - } - - /** - * Gets the threshold for a crystal. - * @param channelID - The channel ID corresponding to the crystal. - * @return Returns the threshold as a <code>int</code> in units - * of ADC. - */ - public int getThreshold(int channelID) { - validateChannelID(channelID); - return thresholds[channelID]; - } - - /** - * Gets the threshold for a crystal. - * @param ix - The x-index of the crystal. - * @param iy - The y-index of the crystal. - * @return Returns the threshold as a <code>int</code> in units - * of ADC. - */ - public int getThreshold(int ix, int iy) { - return getThreshold(new Point(ix, iy)); - } - - /** - * Gets the threshold for a crystal. - * @param ixy - The a point representing the x/y-indices of the - * crystal. - * @return Returns the threshold as a <code>int</code> in units - * of ADC. - */ - public int getThreshold(Point ixy) { - return getThreshold(indexChannelMap.get(ixy)); - } - - /** - * Gets the length of the readout window for the FADC in nanoseconds. - * @return Returns the window length. - */ - public int getWindowWidth() { - return windowWidth; - } - - /** - * Gets the time in nanoseconds that the readout window is offset. - * @return Returns the offset time in nanoseconds. - */ - public int getWindowOffset() { - return offset; - } - - @Override - public void printConfig() { - System.out.println("FADC Configuration:"); - System.out.printf("\tMode :: %d%n", mode); - System.out.printf("\tNSA :: %d%n", nsa); - System.out.printf("\tNSB :: %d%n", nsb); - System.out.printf("\tWindow Width :: %d%n", windowWidth); - System.out.printf("\tWindow Offset :: %d%n", offset); - } - - /** - * Throws an exception if the argument channel ID is not within - * the allowed range. - * @param channelID - The channel ID to validate. - */ - private static final void validateChannelID(int channelID) { - if(channelID < 1 || channelID > 442) { - throw new IndexOutOfBoundsException(String.format("Channel ID \"%d\" is invalid. Channel IDs must be between 1 and 442.", channelID)); - } - } + // Store basic FADC information. + private int mode = -1; + private int nsa = -1; + private int nsb = -1; + private int windowWidth = -1; + private int offset = -1; + private int maxPulses = -1; + + // Store a map of calorimeter channel number to crystal indices. + private Map<Point, Integer> indexChannelMap = new HashMap<Point, Integer>(); + + // Store crystal calibrations and energy conversion factors. + private float[] gains = new float[443]; + private float[] pedestals = new float[443]; + private int[] thresholds = new int[443]; + + @Override + void loadConfig(EvioDAQParser parser) { + // Store the basic FADC information. + mode = parser.fadcMODE; + nsa = parser.fadcNSA; + nsb = parser.fadcNSB; + windowWidth = parser.fadcWIDTH; + offset = parser.fadcOFFSET; + maxPulses = parser.fadcNPEAK; + + // Get the channel collection from the database. + DatabaseConditionsManager database = DatabaseConditionsManager.getInstance(); + EcalChannelCollection channels = database.getCachedConditions(EcalChannelCollection.class, "ecal_channels").getCachedData(); + + // Create a mapping of calorimeter crystal positions to their + // corresponding channels. Also place the mapped values into + // an array by their channel ID. + indexChannelMap.clear(); + for(EcalChannel ecalChannel : channels) { + // Map the channel IDs to the crystal position. + int channel = ecalChannel.getChannelId(); + int ix = ecalChannel.getX(); + int iy = ecalChannel.getY(); + indexChannelMap.put(new Point(ix, iy), new Integer(channel)); + + // Place the mapped values into the arrays. + gains[ecalChannel.getChannelId()] = parser.GAIN.get(ecalChannel); + pedestals[ecalChannel.getChannelId()] = parser.PEDESTAL.get(ecalChannel); + thresholds[ecalChannel.getChannelId()] = parser.THRESHOLD.get(ecalChannel); + } + } + + /** + * Gets the gain for a crystal. + * @param channel - The channel object corresponding to the crystal. + * @return Returns the gain as a <code>float</code> in units of MeV + * per ADC. + */ + public float getGain(EcalChannel channel) { + return getGain(channel.getChannelId()); + } + + /** + * Gets the gain for a crystal. + * @param channelID - The channel ID corresponding to the crystal. + * @return Returns the gain as a <code>float</code> in units of MeV + * per ADC. + */ + public float getGain(int channelID) { + validateChannelID(channelID); + return gains[channelID]; + } + + /** + * Gets the gain for a crystal. + * @param ix - The x-index of the crystal. + * @param iy - The y-index of the crystal. + * @return Returns the gain as a <code>float</code> in units of MeV + * per ADC. + */ + public float getGain(int ix, int iy) { + return getGain(new Point(ix, iy)); + } + + /** + * Gets the gain for a crystal. + * @param ixy - The a point representing the x/y-indices of the + * crystal. + * @return Returns the gain as a <code>float</code> in units of MeV + * per ADC. + */ + public float getGain(Point ixy) { + return getGain(indexChannelMap.get(ixy)); + } + + /** + * Gets the maximum number of pulses that the FADC will look for + * in a channel's window. + * @return Returns the maximum number of pulses. + */ + public int getMaxPulses() { + return maxPulses; + } + + /** + * Gets the mode in which FADC data is written. + * @return Returns the mode as an <code>int</code>; either 1, 3, + * or 7. + */ + public int getMode() { + return mode; + } + + /** + * Gets the number of samples (4 ns clock-cycles) that a pulse will + * be integrated by the FADC after a threshold-crossing event. + * @return Returns the samples as an <code>int</code> in clock-cycles. + */ + public int getNSA() { + return nsa; + } + + /** + * Gets the number of samples (4 ns clock-cycles) that a pulse will + * be integrated by the FADC before a threshold-crossing event. + * @return Returns the samples as an <code>int</code> in clock-cycles. + */ + public int getNSB() { + return nsb; + } + + /** + * Gets the pedestal for a crystal. + * @param channel - The channel object corresponding to the crystal. + * @return Returns the pedestal as a <code>float</code> in units + * of ADC. + */ + public float getPedestal(EcalChannel channel) { + return getPedestal(channel.getChannelId()); + } + + /** + * Gets the pedestal for a crystal. + * @param channelID - The channel ID corresponding to the crystal. + * @return Returns the pedestal as a <code>float</code> in units + * of ADC. + */ + public float getPedestal(int channelID) { + validateChannelID(channelID); + return pedestals[channelID]; + } + + /** + * Gets the pedestal for a crystal. + * @param ix - The x-index of the crystal. + * @param iy - The y-index of the crystal. + * @return Returns the pedestal as a <code>float</code> in units + * of ADC. + */ + public float getPedestal(int ix, int iy) { + return getPedestal(new Point(ix, iy)); + } + + /** + * Gets the pedestal for a crystal. + * @param ixy - The a point representing the x/y-indices of the + * crystal. + * @return Returns the pedestal as a <code>float</code> in units + * of ADC. + */ + public float getPedestal(Point ixy) { + return getPedestal(indexChannelMap.get(ixy)); + } + + /** + * Gets the threshold for a crystal. + * @param channel - The channel object corresponding to the crystal. + * @return Returns the threshold as a <code>int</code> in units + * of ADC. + */ + public int getThreshold(EcalChannel channel) { + return getThreshold(channel.getChannelId()); + } + + /** + * Gets the threshold for a crystal. + * @param channelID - The channel ID corresponding to the crystal. + * @return Returns the threshold as a <code>int</code> in units + * of ADC. + */ + public int getThreshold(int channelID) { + validateChannelID(channelID); + return thresholds[channelID]; + } + + /** + * Gets the threshold for a crystal. + * @param ix - The x-index of the crystal. + * @param iy - The y-index of the crystal. + * @return Returns the threshold as a <code>int</code> in units + * of ADC. + */ + public int getThreshold(int ix, int iy) { + return getThreshold(new Point(ix, iy)); + } + + /** + * Gets the threshold for a crystal. + * @param ixy - The a point representing the x/y-indices of the + * crystal. + * @return Returns the threshold as a <code>int</code> in units + * of ADC. + */ + public int getThreshold(Point ixy) { + return getThreshold(indexChannelMap.get(ixy)); + } + + /** + * Gets the length of the readout window for the FADC in nanoseconds. + * @return Returns the window length. + */ + public int getWindowWidth() { + return windowWidth; + } + + /** + * Gets the time in nanoseconds that the readout window is offset. + * @return Returns the offset time in nanoseconds. + */ + public int getWindowOffset() { + return offset; + } + + @Override + public void printConfig() { + System.out.println("FADC Configuration:"); + System.out.printf("\tMode :: %d%n", mode); + System.out.printf("\tNSA :: %d%n", nsa); + System.out.printf("\tNSB :: %d%n", nsb); + System.out.printf("\tWindow Width :: %d%n", windowWidth); + System.out.printf("\tWindow Offset :: %d%n", offset); + } + + /** + * Throws an exception if the argument channel ID is not within + * the allowed range. + * @param channelID - The channel ID to validate. + */ + private static final void validateChannelID(int channelID) { + if(channelID < 1 || channelID > 442) { + throw new IndexOutOfBoundsException(String.format("Channel ID \"%d\" is invalid. Channel IDs must be between 1 and 442.", channelID)); + } + } } Added: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/GTPConfig.java ============================================================================= --- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/GTPConfig.java (added) +++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/GTPConfig.java Tue Mar 17 14:45:46 2015 @@ -0,0 +1,70 @@ +package org.hps.recon.ecal.daqconfig; + +/** + * Class <code>GTPConfig</code> stores GTP configuration settings + * parsed from the an EVIO file. This class manages the following + * properties: + * <ul> + * <li>Cluster verification window size (after seed)</li> + * <li>Cluster verification window size (before seed)</li> + * <li>Seed energy cut bounds</li> + * </ul> + * + * @author Kyle McCarty <[log in to unmask]> + */ +public class GTPConfig extends IDAQConfig { + // Store clustering configuration parameters. + private int windowBefore = -1; + private int windowAfter = -1; + private LBOCutConfig seedCut = new LBOCutConfig(); + + /** + * Gets the configuration for the seed energy cut. + * @return Returns the seed energy cut configuration. + */ + public LBOCutConfig getSeedEnergyCutConfig() { + return seedCut; + } + + /** + * Gets the size of the temporal cluster verification window for + * after a potential seed hit used for checking that a cluster is + * a spatiotemporal local maximum. Value is in clock-cycles (4 ns + * intervals). + * @return Returns the size window after the seed. + */ + public int getTimeWindowAfter() { + return windowAfter; + } + + /** + * Gets the size of the temporal cluster verification window for + * before a potential seed hit used for checking that a cluster + * is a spatiotemporal local maximum. Value is in clock-cycles + * (4 ns intervals). + * @return Returns the size window before the seed. + */ + public int getTimeWindowBefore() { + return windowBefore; + } + + @Override + void loadConfig(EvioDAQParser parser) { + // Load the clustering settings. + windowBefore = parser.gtpWindowBefore; + windowAfter = parser.gtpWindowAfter; + seedCut.setLowerBound(parser.gtpMinSeedEnergy / 1000.0); + } + + @Override + public void printConfig() { + // Print the configuration header. + System.out.println("GTP Configuration:"); + + // Print the GTP settings. + System.out.printf("\tTime Window Before :: %d clock-cycles%n", windowBefore); + System.out.printf("\tTime Window After :: %d clock-cycles%n", windowAfter); + System.out.printf("\tSeed Energy Min :: %5.3f GeV%n", seedCut.getLowerBound()); + } + +} Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/IDAQConfig.java ============================================================================= --- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/IDAQConfig.java (original) +++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/IDAQConfig.java Tue Mar 17 14:45:46 2015 @@ -10,15 +10,15 @@ * @author Kyle McCarty */ abstract class IDAQConfig { - /** - * Updates the stored settings based on the argument parser. - * @param parser - The EVIO DAQ bank parser. - */ - abstract void loadConfig(EvioDAQParser parser); - - /** - * Prints a textual representation of the configuration bank to the - * terminal. - */ - public abstract void printConfig(); -} + /** + * Updates the stored settings based on the argument parser. + * @param parser - The EVIO DAQ bank parser. + */ + abstract void loadConfig(EvioDAQParser parser); + + /** + * Prints a textual representation of the configuration bank to the + * terminal. + */ + public abstract void printConfig(); +} Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/LBOCutConfig.java ============================================================================= --- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/LBOCutConfig.java (original) +++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/LBOCutConfig.java Tue Mar 17 14:45:46 2015 @@ -9,26 +9,26 @@ * @author Kyle McCarty <[log in to unmask]> */ public class LBOCutConfig extends AbstractConfig<Double> { - private static final int LOWER_BOUND = 0; - - /** - * Instantiates a new <code>LBOCutConfig</code> object. - */ - LBOCutConfig() { super(1); } - - /** - * Gets the lower bound of the cut. - * @return Returns the lower bound as a <code>double</code>. - */ - public double getLowerBound() { - return getValue(LOWER_BOUND); - } - - /** - * Sets the lower bound of the cut to the specified value. - * @param value - The new lower bound for the cut. - */ - void setLowerBound(double value) { - setValue(LOWER_BOUND, value); - } -} + private static final int LOWER_BOUND = 0; + + /** + * Instantiates a new <code>LBOCutConfig</code> object. + */ + LBOCutConfig() { super(1); } + + /** + * Gets the lower bound of the cut. + * @return Returns the lower bound as a <code>double</code>. + */ + public double getLowerBound() { + return getValue(LOWER_BOUND); + } + + /** + * Sets the lower bound of the cut to the specified value. + * @param value - The new lower bound for the cut. + */ + void setLowerBound(double value) { + setValue(LOWER_BOUND, value); + } +} Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/PairTriggerConfig.java ============================================================================= --- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/PairTriggerConfig.java (original) +++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/PairTriggerConfig.java Tue Mar 17 14:45:46 2015 @@ -7,103 +7,102 @@ * @author Kyle McCarty <[log in to unmask]> */ public class PairTriggerConfig extends AbstractConfig<AbstractConfig<Double>> { - private static final int CUT_ENERGY_MIN = 0; - private static final int CUT_ENERGY_MAX = 1; - private static final int CUT_HIT_COUNT = 2; - private static final int CUT_ENERGY_SUM = 3; - private static final int CUT_ENERGY_DIFF = 4; - private static final int CUT_ENERGY_SLOPE = 5; - private static final int CUT_COPLANARITY = 6; - private static final int CUT_TIME_DIFF = 7; - - /** - * Creates a new <code>PairTriggerConfig</code> object. - */ - PairTriggerConfig() { - // Instantiate the superclass. - super(8); - - // Define the pair cuts. - setValue(CUT_ENERGY_MIN, new LBOCutConfig()); - setValue(CUT_ENERGY_MAX, new UBOCutConfig()); - setValue(CUT_HIT_COUNT, new LBOCutConfig()); - setValue(CUT_ENERGY_SUM, new ULBCutConfig()); - setValue(CUT_ENERGY_DIFF, new UBOCutConfig()); - setValue(CUT_ENERGY_SLOPE, new ESBCutConfig()); - setValue(CUT_COPLANARITY, new UBOCutConfig()); - setValue(CUT_TIME_DIFF, new UBOCutConfig()); - } - - /** - * Gets the configuration object for the cluster energy lower bound - * cut. Note that cuts are in units of GeV. - * @return Returns the configuration object for the cut. - */ - public LBOCutConfig getEnergyMinCutConfig() { - return (LBOCutConfig) getValue(CUT_ENERGY_MIN); - } - - /** - * Gets the configuration object for the cluster energy upper bound - * cut. Note that cuts are in units of GeV. - * @return Returns the configuration object for the cut. - */ - public UBOCutConfig getEnergyMaxCutConfig() { - return (UBOCutConfig) getValue(CUT_ENERGY_MAX); - } - - /** - * Gets the configuration object for the cluster hit count cut. - * Note that cuts are in units of calorimeter hits. - * @return Returns the configuration object for the cut. - */ - public LBOCutConfig getHitCountCutConfig() { - return (LBOCutConfig) getValue(CUT_HIT_COUNT); - } - - /** - * Gets the configuration object for the pair energy sum cut. Note - * that cuts are in units of GeV. - * @return Returns the configuration object for the cut. - */ - public ULBCutConfig getEnergySumCutConfig() { - return (ULBCutConfig) getValue(CUT_ENERGY_SUM); - } - - /** - * Gets the configuration object for the pair energy difference - * cut. Note that cuts are in units of GeV. - * @return Returns the configuration object for the cut. - */ - public UBOCutConfig getEnergyDifferenceCutConfig() { - return (UBOCutConfig) getValue(CUT_ENERGY_DIFF); - } - - /** - * Gets the configuration object for the pair energy slope cut. - * Note that cuts are in units of GeV and mm. - * @return Returns the configuration object for the cut. - */ - public ESBCutConfig getEnergySlopeCutConfig() { - return (ESBCutConfig) getValue(CUT_ENERGY_SLOPE); - } - - /** - * Gets the configuration object for the pair coplanarity cut. - * Note that cuts are in units of degrees. - * @return Returns the configuration object for the cut. - */ - public UBOCutConfig getCoplanarityCutConfig() { - return (UBOCutConfig) getValue(CUT_COPLANARITY); - } - - /** - * Gets the configuration object for the pair time coincidence cut. - * Note that cuts are in units of nanoseconds. - * @return Returns the configuration object for the cut. - */ - public UBOCutConfig getTimeDifferenceCutConfig() { - return (UBOCutConfig) getValue(CUT_TIME_DIFF); - } - + private static final int CUT_ENERGY_MIN = 0; + private static final int CUT_ENERGY_MAX = 1; + private static final int CUT_HIT_COUNT = 2; + private static final int CUT_ENERGY_SUM = 3; + private static final int CUT_ENERGY_DIFF = 4; + private static final int CUT_ENERGY_SLOPE = 5; + private static final int CUT_COPLANARITY = 6; + private static final int CUT_TIME_DIFF = 7; + + /** + * Creates a new <code>PairTriggerConfig</code> object. + */ + PairTriggerConfig() { + // Instantiate the superclass. + super(8); + + // Define the pair cuts. + setValue(CUT_ENERGY_MIN, new LBOCutConfig()); + setValue(CUT_ENERGY_MAX, new UBOCutConfig()); + setValue(CUT_HIT_COUNT, new LBOCutConfig()); + setValue(CUT_ENERGY_SUM, new ULBCutConfig()); + setValue(CUT_ENERGY_DIFF, new UBOCutConfig()); + setValue(CUT_ENERGY_SLOPE, new ESBCutConfig()); + setValue(CUT_COPLANARITY, new UBOCutConfig()); + setValue(CUT_TIME_DIFF, new UBOCutConfig()); + } + + /** + * Gets the configuration object for the cluster energy lower bound + * cut. Note that cuts are in units of GeV. + * @return Returns the configuration object for the cut. + */ + public LBOCutConfig getEnergyMinCutConfig() { + return (LBOCutConfig) getValue(CUT_ENERGY_MIN); + } + + /** + * Gets the configuration object for the cluster energy upper bound + * cut. Note that cuts are in units of GeV. + * @return Returns the configuration object for the cut. + */ + public UBOCutConfig getEnergyMaxCutConfig() { + return (UBOCutConfig) getValue(CUT_ENERGY_MAX); + } + + /** + * Gets the configuration object for the cluster hit count cut. + * Note that cuts are in units of calorimeter hits. + * @return Returns the configuration object for the cut. + */ + public LBOCutConfig getHitCountCutConfig() { + return (LBOCutConfig) getValue(CUT_HIT_COUNT); + } + + /** + * Gets the configuration object for the pair energy sum cut. Note + * that cuts are in units of GeV. + * @return Returns the configuration object for the cut. + */ + public ULBCutConfig getEnergySumCutConfig() { + return (ULBCutConfig) getValue(CUT_ENERGY_SUM); + } + + /** + * Gets the configuration object for the pair energy difference + * cut. Note that cuts are in units of GeV. + * @return Returns the configuration object for the cut. + */ + public UBOCutConfig getEnergyDifferenceCutConfig() { + return (UBOCutConfig) getValue(CUT_ENERGY_DIFF); + } + + /** + * Gets the configuration object for the pair energy slope cut. + * Note that cuts are in units of GeV and mm. + * @return Returns the configuration object for the cut. + */ + public ESBCutConfig getEnergySlopeCutConfig() { + return (ESBCutConfig) getValue(CUT_ENERGY_SLOPE); + } + + /** + * Gets the configuration object for the pair coplanarity cut. + * Note that cuts are in units of degrees. + * @return Returns the configuration object for the cut. + */ + public UBOCutConfig getCoplanarityCutConfig() { + return (UBOCutConfig) getValue(CUT_COPLANARITY); + } + + /** + * Gets the configuration object for the pair time coincidence cut. + * Note that cuts are in units of nanoseconds. + * @return Returns the configuration object for the cut. + */ + public UBOCutConfig getTimeDifferenceCutConfig() { + return (UBOCutConfig) getValue(CUT_TIME_DIFF); + } } Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/SSPConfig.java ============================================================================= --- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/SSPConfig.java (original) +++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/SSPConfig.java Tue Mar 17 14:45:46 2015 @@ -15,148 +15,147 @@ * @author Kyle McCarty <[log in to unmask]> */ public class SSPConfig extends IDAQConfig { - // Store trigger configuration parameters. - private PairTriggerConfig[] pairTrigger = { new PairTriggerConfig(), new PairTriggerConfig() }; - private SinglesTriggerConfig[] singlesTrigger = { new SinglesTriggerConfig(), new SinglesTriggerConfig() }; - - @Override - void loadConfig(EvioDAQParser parser) { - // Set the trigger parameters. - for(int triggerNum = 0; triggerNum < 2; triggerNum++) { - // Set whether the triggers are enabled or not. - singlesTrigger[triggerNum].setIsEnabled(parser.singlesEn[triggerNum]); - pairTrigger[triggerNum].setIsEnabled(parser.pairsEn[triggerNum]); - - // Set the cut enabled statuses for the singles trigger. - singlesTrigger[triggerNum].getEnergyMinCutConfig().setIsEnabled(parser.singlesEnergyMinEn[triggerNum]); - singlesTrigger[triggerNum].getEnergyMaxCutConfig().setIsEnabled(parser.singlesEnergyMaxEn[triggerNum]); - singlesTrigger[triggerNum].getHitCountCutConfig().setIsEnabled(parser.singlesNhitsEn[triggerNum]); - - // The pair trigger singles cuts are always enabled. - pairTrigger[triggerNum].getEnergyMinCutConfig().setIsEnabled(true); - pairTrigger[triggerNum].getEnergyMaxCutConfig().setIsEnabled(true); - pairTrigger[triggerNum].getHitCountCutConfig().setIsEnabled(true); - - // The pair trigger time difference cut is always enabled. - pairTrigger[triggerNum].getTimeDifferenceCutConfig().setIsEnabled(true); + // Store trigger configuration parameters. + private PairTriggerConfig[] pairTrigger = { new PairTriggerConfig(), new PairTriggerConfig() }; + private SinglesTriggerConfig[] singlesTrigger = { new SinglesTriggerConfig(), new SinglesTriggerConfig() }; + + @Override + void loadConfig(EvioDAQParser parser) { + // Set the trigger parameters. + for(int triggerNum = 0; triggerNum < 2; triggerNum++) { + // Set whether the triggers are enabled or not. + singlesTrigger[triggerNum].setIsEnabled(parser.singlesEn[triggerNum]); + pairTrigger[triggerNum].setIsEnabled(parser.pairsEn[triggerNum]); + + // Set the cut enabled statuses for the singles trigger. + singlesTrigger[triggerNum].getEnergyMinCutConfig().setIsEnabled(parser.singlesEnergyMinEn[triggerNum]); + singlesTrigger[triggerNum].getEnergyMaxCutConfig().setIsEnabled(parser.singlesEnergyMaxEn[triggerNum]); + singlesTrigger[triggerNum].getHitCountCutConfig().setIsEnabled(parser.singlesNhitsEn[triggerNum]); + + // The pair trigger singles cuts are always enabled. + pairTrigger[triggerNum].getEnergyMinCutConfig().setIsEnabled(true); + pairTrigger[triggerNum].getEnergyMaxCutConfig().setIsEnabled(true); + pairTrigger[triggerNum].getHitCountCutConfig().setIsEnabled(true); + + // The pair trigger time difference cut is always enabled. + pairTrigger[triggerNum].getTimeDifferenceCutConfig().setIsEnabled(true); - // Set the pair cut enabled statuses for the pair trigger. - pairTrigger[triggerNum].getEnergySumCutConfig().setIsEnabled(parser.pairsEnergySumMaxMinEn[triggerNum]); - pairTrigger[triggerNum].getEnergyDifferenceCutConfig().setIsEnabled(parser.pairsEnergyDiffEn[triggerNum]); - pairTrigger[triggerNum].getEnergySlopeCutConfig().setIsEnabled(parser.pairsEnergyDistEn[triggerNum]); - pairTrigger[triggerNum].getCoplanarityCutConfig().setIsEnabled(parser.pairsCoplanarityEn[triggerNum]); - - // Set the individual cut values. - singlesTrigger[triggerNum].getEnergyMinCutConfig().setLowerBound(parser.singlesEnergyMin[triggerNum] / 1000.0); - singlesTrigger[triggerNum].getEnergyMaxCutConfig().setUpperBound(parser.singlesEnergyMax[triggerNum] / 1000.0); - singlesTrigger[triggerNum].getHitCountCutConfig().setLowerBound(parser.singlesNhits[triggerNum]); - - // Set the individual cut values. - pairTrigger[triggerNum].getEnergyMinCutConfig().setLowerBound(parser.pairsEnergyMin[triggerNum] / 1000.0); - pairTrigger[triggerNum].getEnergyMaxCutConfig().setUpperBound(parser.pairsEnergyMax[triggerNum] / 1000.0); - pairTrigger[triggerNum].getHitCountCutConfig().setLowerBound(parser.pairsNhitsMin[triggerNum]); - pairTrigger[triggerNum].getEnergySumCutConfig().setLowerBound(parser.pairsEnergySumMin[triggerNum] / 1000.0); - pairTrigger[triggerNum].getEnergySumCutConfig().setUpperBound(parser.pairsEnergySumMax[triggerNum] / 1000.0); - pairTrigger[triggerNum].getEnergyDifferenceCutConfig().setUpperBound(parser.pairsEnergyDiffMax[triggerNum] / 1000.0); - pairTrigger[triggerNum].getEnergySlopeCutConfig().setLowerBound(parser.pairsEnergyDistMin[triggerNum] / 1000.0); - pairTrigger[triggerNum].getEnergySlopeCutConfig().setParameterF(parser.pairsEnergyDistSlope[triggerNum] / 1000.0); - pairTrigger[triggerNum].getCoplanarityCutConfig().setUpperBound(parser.pairsCoplanarityMax[triggerNum]); - pairTrigger[triggerNum].getTimeDifferenceCutConfig().setUpperBound(parser.pairsTimeDiffMax[triggerNum]); - } - } - - /** - * Gets the configuration parameters for the first singles trigger. - * @return Returns the first singles trigger configuration. - */ - public SinglesTriggerConfig getSingles1Config() { - return singlesTrigger[0]; - } - - /** - * Gets the configuration parameters for the second singles trigger. - * @return Returns the second singles trigger configuration. - */ - public SinglesTriggerConfig getSingles2Config() { - return singlesTrigger[1]; - } - - /** - * Gets the configuration parameters for the first pair trigger. - * @return Returns the first pair trigger configuration. - */ - public PairTriggerConfig getPair1Config() { - return pairTrigger[0]; - } - - /** - * Gets the configuration parameters for the second pair trigger. - * @return Returns the second trigger trigger configuration. - */ - public PairTriggerConfig getPair2Config() { - return pairTrigger[1]; - } - - @Override - public void printConfig() { - // Print the configuration header. - System.out.println("SSP Configuration:"); - - // Print the singles triggers. - for(int triggerNum = 0; triggerNum < 2; triggerNum++) { - System.out.printf("\tSingles Trigger %d%n", (triggerNum + 1)); - System.out.println("\t\tCluster Energy Lower Bound Cut"); - System.out.printf("\t\t\tEnabled :: %b%n", singlesTrigger[triggerNum].getEnergyMinCutConfig().isEnabled()); - System.out.printf("\t\t\tValue :: %5.3f GeV%n", singlesTrigger[triggerNum].getEnergyMinCutConfig().getLowerBound()); - - System.out.println("\t\tCluster Energy Upper Bound Cut"); - System.out.printf("\t\t\tEnabled :: %b%n", singlesTrigger[triggerNum].getEnergyMaxCutConfig().isEnabled()); - System.out.printf("\t\t\tValue :: %5.3f GeV%n", singlesTrigger[triggerNum].getEnergyMaxCutConfig().getUpperBound()); - - System.out.println("\t\tCluster Hit Count Cut"); - System.out.printf("\t\t\tEnabled :: %b%n", singlesTrigger[triggerNum].getHitCountCutConfig().isEnabled()); - System.out.printf("\t\t\tValue :: %1.0f hits%n", singlesTrigger[triggerNum].getHitCountCutConfig().getLowerBound()); - System.out.println(); - } - - // Print the pair triggers. - for(int triggerNum = 0; triggerNum < 2; triggerNum++) { - System.out.printf("\tPair Trigger %d%n", (triggerNum + 1)); - System.out.println("\t\tCluster Energy Lower Bound Cut"); - System.out.printf("\t\t\tEnabled :: %b%n", pairTrigger[triggerNum].getEnergyMinCutConfig().isEnabled()); - System.out.printf("\t\t\tValue :: %5.3f GeV%n", pairTrigger[triggerNum].getEnergyMinCutConfig().getLowerBound()); - - System.out.println("\t\tCluster Energy Upper Bound Cut"); - System.out.printf("\t\t\tEnabled :: %b%n", pairTrigger[triggerNum].getEnergyMaxCutConfig().isEnabled()); - System.out.printf("\t\t\tValue :: %5.3f GeV%n", pairTrigger[triggerNum].getEnergyMaxCutConfig().getUpperBound()); - - System.out.println("\t\tCluster Hit Count Cut"); - System.out.printf("\t\t\tEnabled :: %b%n", pairTrigger[triggerNum].getHitCountCutConfig().isEnabled()); - System.out.printf("\t\t\tValue :: %1.0f hits%n", pairTrigger[triggerNum].getHitCountCutConfig().getLowerBound()); - - System.out.println("\t\tPair Energy Sum Cut"); - System.out.printf("\t\t\tEnabled :: %b%n", pairTrigger[triggerNum].getEnergySumCutConfig().isEnabled()); - System.out.printf("\t\t\tMin :: %5.3f GeV%n", pairTrigger[triggerNum].getEnergySumCutConfig().getLowerBound()); - System.out.printf("\t\t\tMax :: %5.3f GeV%n", pairTrigger[triggerNum].getEnergySumCutConfig().getUpperBound()); - - System.out.println("\t\tPair Energy Difference Cut"); - System.out.printf("\t\t\tEnabled :: %b%n", pairTrigger[triggerNum].getEnergyDifferenceCutConfig().isEnabled()); - System.out.printf("\t\t\tValue :: %5.3f GeV%n", pairTrigger[triggerNum].getEnergyDifferenceCutConfig().getUpperBound()); - - System.out.println("\t\tPair Energy Slope Cut"); - System.out.printf("\t\t\tEnabled :: %b%n", pairTrigger[triggerNum].getEnergySlopeCutConfig().isEnabled()); - System.out.printf("\t\t\tValue :: %5.3f GeV%n", pairTrigger[triggerNum].getEnergySlopeCutConfig().getLowerBound()); - System.out.printf("\t\t\tParam F :: %6.4f GeV/mm%n", pairTrigger[triggerNum].getEnergySlopeCutConfig().getParameterF()); - - System.out.println("\t\tPair Coplanarity Cut"); - System.out.printf("\t\t\tEnabled :: %b%n", pairTrigger[triggerNum].getCoplanarityCutConfig().isEnabled()); - System.out.printf("\t\t\tValue :: %3.0f degrees%n", pairTrigger[triggerNum].getCoplanarityCutConfig().getUpperBound()); - - System.out.println("\t\tPair Time Coincidence Cut"); - System.out.printf("\t\t\tEnabled :: %b%n", pairTrigger[triggerNum].getTimeDifferenceCutConfig().isEnabled()); - System.out.printf("\t\t\tValue :: %1.0f clock-cycles%n", pairTrigger[triggerNum].getTimeDifferenceCutConfig().getUpperBound()); - System.out.println(); - } - } - -} + // Set the pair cut enabled statuses for the pair trigger. + pairTrigger[triggerNum].getEnergySumCutConfig().setIsEnabled(parser.pairsEnergySumMaxMinEn[triggerNum]); + pairTrigger[triggerNum].getEnergyDifferenceCutConfig().setIsEnabled(parser.pairsEnergyDiffEn[triggerNum]); + pairTrigger[triggerNum].getEnergySlopeCutConfig().setIsEnabled(parser.pairsEnergyDistEn[triggerNum]); + pairTrigger[triggerNum].getCoplanarityCutConfig().setIsEnabled(parser.pairsCoplanarityEn[triggerNum]); + + // Set the individual cut values. + singlesTrigger[triggerNum].getEnergyMinCutConfig().setLowerBound(parser.singlesEnergyMin[triggerNum] / 1000.0); + singlesTrigger[triggerNum].getEnergyMaxCutConfig().setUpperBound(parser.singlesEnergyMax[triggerNum] / 1000.0); + singlesTrigger[triggerNum].getHitCountCutConfig().setLowerBound(parser.singlesNhits[triggerNum]); + + // Set the individual cut values. + pairTrigger[triggerNum].getEnergyMinCutConfig().setLowerBound(parser.pairsEnergyMin[triggerNum] / 1000.0); + pairTrigger[triggerNum].getEnergyMaxCutConfig().setUpperBound(parser.pairsEnergyMax[triggerNum] / 1000.0); + pairTrigger[triggerNum].getHitCountCutConfig().setLowerBound(parser.pairsNhitsMin[triggerNum]); + pairTrigger[triggerNum].getEnergySumCutConfig().setLowerBound(parser.pairsEnergySumMin[triggerNum] / 1000.0); + pairTrigger[triggerNum].getEnergySumCutConfig().setUpperBound(parser.pairsEnergySumMax[triggerNum] / 1000.0); + pairTrigger[triggerNum].getEnergyDifferenceCutConfig().setUpperBound(parser.pairsEnergyDiffMax[triggerNum] / 1000.0); + pairTrigger[triggerNum].getEnergySlopeCutConfig().setLowerBound(parser.pairsEnergyDistMin[triggerNum] / 1000.0); + pairTrigger[triggerNum].getEnergySlopeCutConfig().setParameterF(parser.pairsEnergyDistSlope[triggerNum] / 1000.0); + pairTrigger[triggerNum].getCoplanarityCutConfig().setUpperBound(parser.pairsCoplanarityMax[triggerNum]); + pairTrigger[triggerNum].getTimeDifferenceCutConfig().setUpperBound(parser.pairsTimeDiffMax[triggerNum]); + } + } + + /** + * Gets the configuration parameters for the first singles trigger. + * @return Returns the first singles trigger configuration. + */ + public SinglesTriggerConfig getSingles1Config() { + return singlesTrigger[0]; + } + + /** + * Gets the configuration parameters for the second singles trigger. + * @return Returns the second singles trigger configuration. + */ + public SinglesTriggerConfig getSingles2Config() { + return singlesTrigger[1]; + } + + /** + * Gets the configuration parameters for the first pair trigger. + * @return Returns the first pair trigger configuration. + */ + public PairTriggerConfig getPair1Config() { + return pairTrigger[0]; + } + + /** + * Gets the configuration parameters for the second pair trigger. + * @return Returns the second trigger trigger configuration. + */ + public PairTriggerConfig getPair2Config() { + return pairTrigger[1]; + } + + @Override + public void printConfig() { + // Print the configuration header. + System.out.println("SSP Configuration:"); + + // Print the singles triggers. + for(int triggerNum = 0; triggerNum < 2; triggerNum++) { + System.out.printf("\tSingles Trigger %d%n", (triggerNum + 1)); + System.out.println("\t\tCluster Energy Lower Bound Cut"); + System.out.printf("\t\t\tEnabled :: %b%n", singlesTrigger[triggerNum].getEnergyMinCutConfig().isEnabled()); + System.out.printf("\t\t\tValue :: %5.3f GeV%n", singlesTrigger[triggerNum].getEnergyMinCutConfig().getLowerBound()); + + System.out.println("\t\tCluster Energy Upper Bound Cut"); + System.out.printf("\t\t\tEnabled :: %b%n", singlesTrigger[triggerNum].getEnergyMaxCutConfig().isEnabled()); + System.out.printf("\t\t\tValue :: %5.3f GeV%n", singlesTrigger[triggerNum].getEnergyMaxCutConfig().getUpperBound()); + + System.out.println("\t\tCluster Hit Count Cut"); + System.out.printf("\t\t\tEnabled :: %b%n", singlesTrigger[triggerNum].getHitCountCutConfig().isEnabled()); + System.out.printf("\t\t\tValue :: %1.0f hits%n", singlesTrigger[triggerNum].getHitCountCutConfig().getLowerBound()); + System.out.println(); + } + + // Print the pair triggers. + for(int triggerNum = 0; triggerNum < 2; triggerNum++) { + System.out.printf("\tPair Trigger %d%n", (triggerNum + 1)); + System.out.println("\t\tCluster Energy Lower Bound Cut"); + System.out.printf("\t\t\tEnabled :: %b%n", pairTrigger[triggerNum].getEnergyMinCutConfig().isEnabled()); + System.out.printf("\t\t\tValue :: %5.3f GeV%n", pairTrigger[triggerNum].getEnergyMinCutConfig().getLowerBound()); + + System.out.println("\t\tCluster Energy Upper Bound Cut"); + System.out.printf("\t\t\tEnabled :: %b%n", pairTrigger[triggerNum].getEnergyMaxCutConfig().isEnabled()); + System.out.printf("\t\t\tValue :: %5.3f GeV%n", pairTrigger[triggerNum].getEnergyMaxCutConfig().getUpperBound()); + + System.out.println("\t\tCluster Hit Count Cut"); + System.out.printf("\t\t\tEnabled :: %b%n", pairTrigger[triggerNum].getHitCountCutConfig().isEnabled()); + System.out.printf("\t\t\tValue :: %1.0f hits%n", pairTrigger[triggerNum].getHitCountCutConfig().getLowerBound()); + + System.out.println("\t\tPair Energy Sum Cut"); + System.out.printf("\t\t\tEnabled :: %b%n", pairTrigger[triggerNum].getEnergySumCutConfig().isEnabled()); + System.out.printf("\t\t\tMin :: %5.3f GeV%n", pairTrigger[triggerNum].getEnergySumCutConfig().getLowerBound()); + System.out.printf("\t\t\tMax :: %5.3f GeV%n", pairTrigger[triggerNum].getEnergySumCutConfig().getUpperBound()); + + System.out.println("\t\tPair Energy Difference Cut"); + System.out.printf("\t\t\tEnabled :: %b%n", pairTrigger[triggerNum].getEnergyDifferenceCutConfig().isEnabled()); + System.out.printf("\t\t\tValue :: %5.3f GeV%n", pairTrigger[triggerNum].getEnergyDifferenceCutConfig().getUpperBound()); + + System.out.println("\t\tPair Energy Slope Cut"); + System.out.printf("\t\t\tEnabled :: %b%n", pairTrigger[triggerNum].getEnergySlopeCutConfig().isEnabled()); + System.out.printf("\t\t\tValue :: %5.3f GeV%n", pairTrigger[triggerNum].getEnergySlopeCutConfig().getLowerBound()); + System.out.printf("\t\t\tParam F :: %6.4f GeV/mm%n", pairTrigger[triggerNum].getEnergySlopeCutConfig().getParameterF()); + + System.out.println("\t\tPair Coplanarity Cut"); + System.out.printf("\t\t\tEnabled :: %b%n", pairTrigger[triggerNum].getCoplanarityCutConfig().isEnabled()); + System.out.printf("\t\t\tValue :: %3.0f degrees%n", pairTrigger[triggerNum].getCoplanarityCutConfig().getUpperBound()); + + System.out.println("\t\tPair Time Coincidence Cut"); + System.out.printf("\t\t\tEnabled :: %b%n", pairTrigger[triggerNum].getTimeDifferenceCutConfig().isEnabled()); + System.out.printf("\t\t\tValue :: %1.0f clock-cycles%n", pairTrigger[triggerNum].getTimeDifferenceCutConfig().getUpperBound()); + System.out.println(); + } + } +} Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/SinglesTriggerConfig.java ============================================================================= --- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/SinglesTriggerConfig.java (original) +++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/SinglesTriggerConfig.java Tue Mar 17 14:45:46 2015 @@ -7,47 +7,47 @@ * @author Kyle McCarty <[log in to unmask]> */ public class SinglesTriggerConfig extends AbstractConfig<AbstractConfig<Double>> { - private static final int CUT_ENERGY_MIN = 0; - private static final int CUT_ENERGY_MAX = 1; - private static final int CUT_HIT_COUNT = 2; - - /** - * Creates a new <code>SinglesTriggerConfig</code> object. - */ - SinglesTriggerConfig() { - // Instantiate the base object. - super(3); - - // Define the singles cuts. - setValue(CUT_ENERGY_MIN, new LBOCutConfig()); - setValue(CUT_ENERGY_MAX, new UBOCutConfig()); - setValue(CUT_HIT_COUNT, new LBOCutConfig()); - } - - /** - * Gets the configuration object for the cluster energy lower bound - * cut. Note that cuts are in units of GeV. - * @return Returns the configuration object for the cut. - */ - public LBOCutConfig getEnergyMinCutConfig() { - return (LBOCutConfig) getValue(CUT_ENERGY_MIN); - } - - /** - * Gets the configuration object for the cluster energy upper bound - * cut. Note that cuts are in units of GeV. - * @return Returns the configuration object for the cut. - */ - public UBOCutConfig getEnergyMaxCutConfig() { - return (UBOCutConfig) getValue(CUT_ENERGY_MAX); - } - - /** - * Gets the configuration object for the cluster hit count cut. - * Note that cuts are in units of calorimeter hits. - * @return Returns the configuration object for the cut. - */ - public LBOCutConfig getHitCountCutConfig() { - return (LBOCutConfig) getValue(CUT_HIT_COUNT); - } + private static final int CUT_ENERGY_MIN = 0; + private static final int CUT_ENERGY_MAX = 1; + private static final int CUT_HIT_COUNT = 2; + + /** + * Creates a new <code>SinglesTriggerConfig</code> object. + */ + SinglesTriggerConfig() { + // Instantiate the base object. + super(3); + + // Define the singles cuts. + setValue(CUT_ENERGY_MIN, new LBOCutConfig()); + setValue(CUT_ENERGY_MAX, new UBOCutConfig()); + setValue(CUT_HIT_COUNT, new LBOCutConfig()); + } + + /** + * Gets the configuration object for the cluster energy lower bound + * cut. Note that cuts are in units of GeV. + * @return Returns the configuration object for the cut. + */ + public LBOCutConfig getEnergyMinCutConfig() { + return (LBOCutConfig) getValue(CUT_ENERGY_MIN); + } + + /** + * Gets the configuration object for the cluster energy upper bound + * cut. Note that cuts are in units of GeV. + * @return Returns the configuration object for the cut. + */ + public UBOCutConfig getEnergyMaxCutConfig() { + return (UBOCutConfig) getValue(CUT_ENERGY_MAX); + } + + /** + * Gets the configuration object for the cluster hit count cut. + * Note that cuts are in units of calorimeter hits. + * @return Returns the configuration object for the cut. + */ + public LBOCutConfig getHitCountCutConfig() { + return (LBOCutConfig) getValue(CUT_HIT_COUNT); + } } Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/UBOCutConfig.java ============================================================================= --- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/UBOCutConfig.java (original) +++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/UBOCutConfig.java Tue Mar 17 14:45:46 2015 @@ -9,26 +9,26 @@ * @author Kyle McCarty <[log in to unmask]> */ public class UBOCutConfig extends AbstractConfig<Double> { - private static final int UPPER_BOUND = 0; - - /** - * Instantiates a new <code>UBOCutConfig</code> object. - */ - UBOCutConfig() { super(1); } - - /** - * Gets the upper bound of the cut. - * @return Returns the upper bound as a <code>double</code>. - */ - public double getUpperBound() { - return getValue(UPPER_BOUND); - } - - /** - * Sets the upper bound of the cut to the specified value. - * @param value - The new upper bound for the cut. - */ - void setUpperBound(double value) { - setValue(UPPER_BOUND, value); - } -} + private static final int UPPER_BOUND = 0; + + /** + * Instantiates a new <code>UBOCutConfig</code> object. + */ + UBOCutConfig() { super(1); } + + /** + * Gets the upper bound of the cut. + * @return Returns the upper bound as a <code>double</code>. + */ + public double getUpperBound() { + return getValue(UPPER_BOUND); + } + + /** + * Sets the upper bound of the cut to the specified value. + * @param value - The new upper bound for the cut. + */ + void setUpperBound(double value) { + setValue(UPPER_BOUND, value); + } +} Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/ULBCutConfig.java ============================================================================= --- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/ULBCutConfig.java (original) +++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/daqconfig/ULBCutConfig.java Tue Mar 17 14:45:46 2015 @@ -9,43 +9,43 @@ * @author Kyle McCarty <[log in to unmask]> */ public class ULBCutConfig extends AbstractConfig<Double> { - private static final int LOWER_BOUND = 0; - private static final int UPPER_BOUND = 1; - - /** - * Instantiates a new <code>ULBCutConfig</code> object. - */ - ULBCutConfig() { super(2); } - - /** - * Gets the lower bound of the cut. - * @return Returns the lower bound as a <code>double</code>. - */ - public double getLowerBound() { - return getValue(LOWER_BOUND); - } - - /** - * Gets the upper bound of the cut. - * @return Returns the upper bound as a <code>double</code>. - */ - public double getUpperBound() { - return getValue(UPPER_BOUND); - } - - /** - * Sets the lower bound of the cut to the specified value. - * @param value - The new lower bound for the cut. - */ - void setLowerBound(double value) { - setValue(LOWER_BOUND, value); - } - - /** - * Sets the upper bound of the cut to the specified value. - * @param value - The new upper bound for the cut. - */ - void setUpperBound(double value) { - setValue(UPPER_BOUND, value); - } -} + private static final int LOWER_BOUND = 0; + private static final int UPPER_BOUND = 1; + + /** + * Instantiates a new <code>ULBCutConfig</code> object. + */ + ULBCutConfig() { super(2); } + + /** + * Gets the lower bound of the cut. + * @return Returns the lower bound as a <code>double</code>. + */ + public double getLowerBound() { + return getValue(LOWER_BOUND); + } + + /** + * Gets the upper bound of the cut. + * @return Returns the upper bound as a <code>double</code>. + */ + public double getUpperBound() { + return getValue(UPPER_BOUND); + } + + /** + * Sets the lower bound of the cut to the specified value. + * @param value - The new lower bound for the cut. + */ + void setLowerBound(double value) { + setValue(LOWER_BOUND, value); + } + + /** + * Sets the upper bound of the cut to the specified value. + * @param value - The new upper bound for the cut. + */ + void setUpperBound(double value) { + setValue(UPPER_BOUND, value); + } +}