Skip to content

Commit

Permalink
Merge branch 'master' of github.com:JeffersonLab/hps-java into saveRory
Browse files Browse the repository at this point in the history
Getting things done.
  • Loading branch information
[email protected] committed Jun 21, 2024
2 parents 05259ab + 9e1f266 commit 9743272
Show file tree
Hide file tree
Showing 147 changed files with 69,662 additions and 413 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ target/

# ignore user VS Code settings
.vscode

# ignore local user documentation
html/
16 changes: 0 additions & 16 deletions conditions/src/main/scripts/mysql_backup.sh

This file was deleted.

17 changes: 0 additions & 17 deletions conditions/src/main/scripts/mysql_backup_tables_only.sh

This file was deleted.

2 changes: 0 additions & 2 deletions conditions/src/main/scripts/mysql_console.sh

This file was deleted.

10,070 changes: 10,070 additions & 0 deletions detector-data/detectors/HPS_Run2021Pass1_v4/HPS_Run2021Pass1_v4.lcdd

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions detector-data/detectors/HPS_Run2021Pass1_v4/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Start at HPS_Run2021Pass1_v1
L6Ssp80
L7Ssp140
L7SsRwp2
L6SsRwp1
L7SsRwm1
This gets the top slot side looking a lot better

Now focusing on Top hole side
L7ShTum130 gets a large number of hits on track and significant improve to neg track chi2 in top

shift stereo sensor du in bottom to move x hits so x at ecal is shifted by 5 mm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
samplingFraction: 1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
samplingFraction: 1.0
788 changes: 788 additions & 0 deletions detector-data/detectors/HPS_Run2021Pass1_v4/compact.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name: HPS_Run2021Pass1_v4

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions detector-data/detectors/HPS_Run2021Pass1_v4_1pt92GeV/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Start at HPS_Run2021Pass1_v1
L6Ssp80
L7Ssp140
L7SsRwp2
L6SsRwp1
L7SsRwm1
This gets the top slot side looking a lot better

Now focusing on Top hole side
L7ShTum130 gets a large number of hits on track and significant improve to neg track chi2 in top

shift stereo sensor du in bottom to move x hits so x at ecal is shifted by 5 mm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
samplingFraction: 1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
samplingFraction: 1.0
788 changes: 788 additions & 0 deletions detector-data/detectors/HPS_Run2021Pass1_v4_1pt92GeV/compact.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name: HPS_Run2021Pass1_v4_1pt92GeV
20 changes: 20 additions & 0 deletions detector-data/detectors/HPS_Run2021Pass1_v5/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Start at HPS_Run2021Pass1_v1
L6Ssp80
L7Ssp140
L7SsRwp2
L6SsRwp1
L7SsRwm1
This gets the top slot side looking a lot better

Now focusing on Top hole side
L7ShTum130 gets a large number of hits on track and significant improve to neg track chi2 in top

shift stereo sensor du in bottom to move x hits so x at ecal is shifted by 5 mm

use physics run 14770 and do kf based momentum constraint freeing L5 and L6 top sensors in Tu and Rw

use physics run 14770 and do kf based momentum constraint freeing L6 tu and L7 turw top slot sensors

use fee skim of run 14770 and do kf based momentum constraint free L5 6 7 tu top slot sensors

use fee skim of run 14770, remove layer 7 top hits, and do kf based momentum constraint free L5 6 tu top slot/hole sensors and L6 top slot rw

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions detector-data/detectors/HPS_Run2021Pass1_v5_1pt92GeV/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Start at HPS_Run2021Pass1_v1
L6Ssp80
L7Ssp140
L7SsRwp2
L6SsRwp1
L7SsRwm1
This gets the top slot side looking a lot better

Now focusing on Top hole side
L7ShTum130 gets a large number of hits on track and significant improve to neg track chi2 in top

shift stereo sensor du in bottom to move x hits so x at ecal is shifted by 5 mm

use physics run 14770 and do kf based momentum constraint freeing L5 and L6 top sensors in Tu and Rw

use physics run 14770 and do kf based momentum constraint freeing L6 tu and L7 turw top slot sensors

use fee skim of run 14770 and do kf based momentum constraint free L5 6 7 tu top slot sensors

use fee skim of run 14770, remove layer 7 top hits, and do kf based momentum constraint free L5 6 tu top slot/hole sensors and L6 top slot rw
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
samplingFraction: 1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
samplingFraction: 1.0
788 changes: 788 additions & 0 deletions detector-data/detectors/HPS_Run2021Pass1_v5_1pt92GeV/compact.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name: HPS_Run2021Pass1_v5_1pt92GeV
Original file line number Diff line number Diff line change
Expand Up @@ -504,13 +504,7 @@ public void process(EventHeader event) {
// If noise should be added, calculate a random value for
// the noise and add it to the truth energy deposition.
if(addNoise) {
// Calculate a randomized noise value.
double noiseSigma = Math.sqrt(Math.pow(getNoiseConditions(hitCellID) * getGainConditions(hitCellID) * EcalUtils.MeV, 2)
+ hit.getRawEnergy() * EcalUtils.MeV / pePerMeV);
double noise = RandomGaussian.getGaussian(0, noiseSigma);

// Increment the truth energy deposition by this amount.
energyAmplitude += noise;
energyAmplitude += getAmplitudeFluctuation(hit);
}

// Simulate the pulse for each position in the preamp
Expand All @@ -531,6 +525,13 @@ public void process(EventHeader event) {
// a value of maxVolt.
double currentValue = voltageBuffer.getValue(i) * ((Math.pow(2, nBit) - 1) / maxVolt);

// If noise should be added, calculate a random value for
// the noise and add it to the ADC value.
if(addNoise) {
double sigma = getNoiseConditions(hitCellID);
currentValue += RandomGaussian.getGaussian(0, sigma);
}

// An ADC value is not allowed to exceed 4095. If a
// larger value is observed, 4096 (overflow) is given
// instead. (This corresponds to >2 Volts.)
Expand Down Expand Up @@ -1026,6 +1027,16 @@ private static final void addDaughtersToSet(MCParticle particle, Set<MCParticle>
*/
protected abstract int getTimestampFlag();

/**
* Generate photoelectron/amplification noise for a pulse's amplitude.
* @param hit - The hit for which to generate a fluctuation.
* @return Returns a fluctuation in units GeV.
*/
protected double getAmplitudeFluctuation(CalorimeterHit hit) {
double sigma = Math.sqrt(hit.getRawEnergy() * EcalUtils.MeV / pePerMeV);
return RandomGaussian.getGaussian(0, sigma);
}

@Override
protected Collection<TriggeredLCIOData<?>> getOnTriggerData(double triggerTime) {
// Create a list to store the extra collections.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.hps.conditions.ecal.EcalChannelConstants;
import org.hps.conditions.ecal.EcalConditions;
import org.hps.readout.ReadoutTimestamp;
import org.hps.recon.ecal.EcalUtils;
import org.lcsim.event.RawTrackerHit;
import org.lcsim.geometry.Detector;
import org.lcsim.geometry.subdetector.HPSEcal3;
Expand Down Expand Up @@ -50,7 +51,7 @@ public EcalDigitizationWithPulserDataMergingReadoutDriver() {
setTriggerPathTruthRelationsCollectionName("TriggerPathTruthRelations");
setReadoutHitCollectionName("EcalReadoutHits");

setPhotoelectronsPerMeV(32.8);
setPhotoelectronsPerMeV(EcalUtils.photoelectronsPerMeV);
setPulseTimeParameter(9.6);
}

Expand Down Expand Up @@ -81,7 +82,6 @@ public void actionPerformed(ActionEvent e) {
// Get the FADC configuration.
config = daq.getEcalFADCConfig();
configStat = true;
integrationThreshold = config.getThreshold((int)10);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ public HodoscopeDigitizationWithPulserDataMergingReadoutDriver() {
setNumberSamplesBefore(6);
setPulseTimeParameter(4.0);
setPhotoelectronsPerMeV(10.0);

setIntegrationThreshold(12);
}

/**
Expand Down Expand Up @@ -106,7 +108,6 @@ public void actionPerformed(ActionEvent e) {
// Get the FADC configuration.
config = daq.getHodoFADCConfig();
configStat = true;
integrationThreshold = config.getThreshold((int)10);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ public void detectorChanged(Detector detector) {
// Reinstantiate the buffers.
resetBuffers();
}

@Override
public void process(EventHeader event) {
/*
Expand Down Expand Up @@ -390,15 +390,10 @@ public void process(EventHeader event) {

// If noise should be added, calculate a random value for
// the noise and add it to the truth energy deposition.

if(addNoise) {
// Calculate a randomized noise value.
double noiseSigma = Math.sqrt(Math.pow(getNoiseConditions(hit.getCellID()) * getGainConditions(hit.getCellID()) * EcalUtils.MeV, 2)
+ hit.getRawEnergy() * EcalUtils.MeV / pePerMeV);
double noise = RandomGaussian.getGaussian(0, noiseSigma);

// Increment the truth energy deposition by this amount.
energyAmplitude += noise;
}
energyAmplitude += getAmplitudeFluctuation(hit);
}

// Check to see if the hit time seems valid. This is done
// by calculating the time of the next readout cycle in
Expand All @@ -414,11 +409,12 @@ public void process(EventHeader event) {
// pulse buffer for the subdetector channel on which the
// hit occurred.
for(int i = 0; i < BUFFER_LENGTH; i++) {

// Calculate the voltage deposition for the current
// buffer time.
double voltageDeposition = energyAmplitude * pulseAmplitude((i + 1) * READOUT_PERIOD + readoutTime()
- (ReadoutDataManager.getCurrentTime() + hit.getTime()) - getTimeShiftConditions(hit.getCellID()), hit.getCellID());

// Increase the current buffer time's voltage value
// by the calculated amount.
voltageBuffer.addToCell(i, voltageDeposition);
Expand Down Expand Up @@ -464,9 +460,16 @@ private void readHits(List<RawCalorimeterHit> newHits, List<LCRelation> newTruth
// a value of maxVolt.
double currentValue = voltageBuffer.getValue() * ((Math.pow(2, nBit) - 1) / maxVolt);

// Get the pedestal for the channel.
int pedestal = (int) Math.round(getPedestalConditions(cellID));
// If noise should be added, calculate a random value for
// the noise and add it to the ADC value.
if(addNoise) {
double sigma = getNoiseConditions(cellID);
currentValue += RandomGaussian.getGaussian(0, sigma);
}

// Get the pedestal for the channel.
int pedestal = (int) Math.round(getPedestalConditions(cellID));

// An ADC value is not allowed to exceed 4095. If a
// larger value is observed, 4096 (overflow) is given
// instead. (This corresponds to >2 Volts.)
Expand Down Expand Up @@ -847,16 +850,16 @@ private static final void addDaughtersToSet(MCParticle particle, Set<MCParticle>
/**
* Gets the gain for the indicated subdetector channel.
* @param channelID - The channel ID.
* @return Returns the value of the gain in units of ADC/MeV as a
* @return Returns the value of the gain in units of MeV/ADC as a
* <code>double</code>.
*/
protected abstract double getGainConditions(long channelID);

/**
* Gets the noise sigma for the indicated subdetector channel.
* @param channelID - The channel ID.
* @return Returns the value of the noise sigma as a
* <code>double</code>.
* @return Returns the value of the noise sigma in units of ADC for one
* 4-ns sample as a <code>double</code>.
*/
protected abstract double getNoiseConditions(long channelID);

Expand All @@ -866,7 +869,17 @@ private static final void addDaughtersToSet(MCParticle particle, Set<MCParticle>
* @return Returns the timestamp flag as an <code>int</code>.
*/
protected abstract int getTimestampFlag();


/**
* Generate photoelectron/amplification noise for a pulse's amplitude.
* @param hit - The hit for which to generate a fluctuation.
* @return Returns a fluctuation in units GeV.
*/
protected double getAmplitudeFluctuation(CalorimeterHit hit) {
double sigma = Math.sqrt(hit.getRawEnergy() * EcalUtils.MeV / pePerMeV);
return RandomGaussian.getGaussian(0, sigma);
}

@Override
protected Collection<TriggeredLCIOData<?>> getOnTriggerData(double triggerTime) {
// Create a list to store the extra collections.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class FADCEcalReadoutDriver extends EcalReadoutDriver<RawCalorimeterHit>
private double fixedGain = -1;
private boolean constantTriggerWindow = true;
private boolean addNoise = true;
private double pePerMeV = 32.8;
private double pePerMeV = EcalUtils.photoelectronsPerMeV;
private boolean use2014Gain = false;
private PulseShape pulseShape = PulseShape.ThreePole;

Expand Down
Loading

0 comments on commit 9743272

Please sign in to comment.