Skip to content

Commit

Permalink
changes suggested by TongTong
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahgaiser committed May 29, 2024
1 parent 2f4cb53 commit 3a45d66
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 194 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import org.lcsim.event.RawTrackerHit;
import org.lcsim.geometry.Detector;
import org.lcsim.geometry.subdetector.HPSEcal3;
import org.hps.record.daqconfig.ConfigurationManager;
import org.hps.record.daqconfig.DAQConfig;
import org.hps.record.daqconfig2019.ConfigurationManager2019;
import org.hps.record.daqconfig2019.DAQConfig2019;
import org.hps.record.daqconfig2019.FADCConfigEcal2019;
Expand All @@ -29,28 +31,27 @@ public class EcalDigitizationWithPulserDataMergingReadoutDriver extends Digitiza
// The DAQ configuration manager for FADC parameters.
private FADCConfigEcal2019 config = new FADCConfigEcal2019();
private boolean configStat = false; // Indicates if DAQ configuration is loaded

// The number of nanoseconds in a clock-cycle (sample).
private static final int nsPerSample = 4;



/** Stores the conditions for this subdetector. */
private EcalConditions ecalConditions = null;

/** Stores the channel collection for this subdetector. */
private EcalChannelCollection geoMap = new EcalChannelCollection();

public EcalDigitizationWithPulserDataMergingReadoutDriver() {
// Set the default values for each subdetector-dependent
// parameter.
setGeometryName("Ecal");

setInputHitCollectionName("EcalHits");
setOutputHitCollectionName("EcalRawHits");
setTruthRelationsCollectionName("EcalTruthRelations");
setTriggerPathTruthRelationsCollectionName("TriggerPathTruthRelations");
setReadoutHitCollectionName("EcalReadoutHits");

setPhotoelectronsPerMeV(EcalUtils.photoelectronsPerMeV);
setPulseTimeParameter(9.6);
}
Expand Down Expand Up @@ -85,57 +86,86 @@ public void actionPerformed(ActionEvent e) {
}
});
}
}


}

/**
* Sets whether or not the DAQ configuration is applied into the driver
* the EvIO data stream or whether to read the configuration from data files.
*
* @param state - <code>true</code> indicates that the DAQ configuration is
* applied into the readout system, and <code>false</code> that it
* is not applied into the readout system.
*/
public void setDaqConfiguration2016AppliedintoReadout(boolean state) {
// If the DAQ configuration should be read, attach a listener
// to track when it updates.
if (state) {
ConfigurationManager.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
// Get the DAQ configuration.
DAQConfig daq = ConfigurationManager.getInstance();

// Load the DAQ settings from the configuration manager.
numSamplesAfter = daq.getFADCConfig().getNSA() / nsPerSample;
numSamplesBefore = daq.getFADCConfig().getNSB() / nsPerSample;
readoutWindow = daq.getFADCConfig().getWindowWidth() / nsPerSample;

// Get the FADC configuration.
configStat = true;
}
});
}
}

@Override
public void detectorChanged(Detector detector) {
// Get a copy of the calorimeter conditions for the detector.
ecalConditions = DatabaseConditionsManager.getInstance().getEcalConditions();

// Store the calorimeter conditions table for converting between
// geometric IDs and channel objects.
geoMap = DatabaseConditionsManager.getInstance().getCachedConditions(EcalChannelCollection.class, "ecal_channels").getCachedData();

// Run the superclass method.
super.detectorChanged(detector);
}

@Override
protected Set<Long> getChannelIDs() {
return getSubdetector().getNeighborMap().keySet();
}

@Override
protected Long getID(RawTrackerHit hit) {
return hit.getCellID();
}

@Override
protected double getGainConditions(long cellID) {
return findChannel(cellID).getGain().getGain();
}

@Override
protected double getNoiseConditions(long channelID) {
return findChannel(channelID).getCalibration().getNoise();
}

protected double getPedestalConditions(long cellID) {
return findChannel(cellID).getCalibration().getPedestal();

}

@Override
protected double getTimeShiftConditions(long cellID) {
return findChannel(cellID).getTimeShift().getTimeShift();
}

@Override
protected int getTimestampFlag() {
return ReadoutTimestamp.SYSTEM_ECAL;
}

/**
* Gets the channel parameters for a given channel ID.
* @param cellID - The <code>long</code> ID value that represents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
same collection name as the input truth data. If a truth handler
driver also outputs data into this collection, the two will merge.
-->
<driver name="EcalDigitizationWithPulserDataMergingDriver" type="org.hps.digi.EcalDigitizationWithPulserDataMergingReadout2016Driver">
<driver name="EcalDigitizationWithPulserDataMergingDriver" type="org.hps.digi.EcalDigitizationWithPulserDataMergingReadoutDriver">
<!-- LCIO Collection Names -->
<inputHitCollectionName>EcalHits</inputHitCollectionName>
<inputPulserDataCollectionName>PulserDataEcalReadoutHits</inputPulserDataCollectionName>
Expand All @@ -141,7 +141,7 @@
<truthRelationsCollectionName>EcalTruthRelations</truthRelationsCollectionName>
<triggerPathTruthRelationsCollectionName>TriggerPathTruthRelations</triggerPathTruthRelationsCollectionName>

<daqConfigurationAppliedintoReadout>true</daqConfigurationAppliedintoReadout>
<daqConfiguration2016AppliedintoReadout>true</daqConfiguration2016AppliedintoReadout>

<!-- Driver Parameters -->
<mode>1</mode> <!-- Allowed values: 1, 3, or 7. -->
Expand All @@ -154,10 +154,6 @@
selecting a readout window equal to (readoutLatency - 64).
-->
<readoutOffset>10</readoutOffset> <!-- Units of 4 ns clock-cycles. -->
<readoutWindow>50</readoutWindow> <!-- Units of 4 ns clock-cycles. -->
<numberSamplesAfter>25</numberSamplesAfter> <!-- Units of 4 ns clock-cycles. -->
<numberSamplesBefore>5</numberSamplesBefore> <!-- Units of 4 ns clock-cycles. -->
<integrationThreshold>18</integrationThreshold> <!-- Units of ADC. -->

<!--
The digitization driver produces as output a list of ADC values
Expand Down Expand Up @@ -254,26 +250,6 @@

<!-- Units of GeV. -->
<seedEnergyLow>0.100</seedEnergyLow>
<!-- Units of cluster hits. -->
<minHitCount>2</minHitCount>
<!-- Units of 4 ns clock-cycles. -->
<pairCoincidence>3</pairCoincidence>
<!-- Units of GeV. -->
<clusterEnergyLow>0.150</clusterEnergyLow>
<!-- Units of GeV. -->
<clusterEnergyHigh>1.400</clusterEnergyHigh>
<!-- Units of GeV. -->
<energySumLow>0.600</energySumLow>
<!-- Units of GeV. -->
<energySumHigh>2.000</energySumHigh>
<!-- Units of GeV. -->
<energyDifferenceHigh>1.1</energyDifferenceHigh>
<!-- Units of degrees. -->
<coplanarityHigh>35</coplanarityHigh>
<!-- Units of GeV / mm. -->
<energySlopeParamF>0.0055</energySlopeParamF>
<!-- Units of GeV. -->
<energySlopeLow>0.700</energySlopeLow>
</driver>

<driver name="SvtDigitizationWithPulserDataMergingDriver" type="org.hps.digi.SvtDigitizationWithPulserDataMergingReadoutDriver">
Expand Down

0 comments on commit 3a45d66

Please sign in to comment.