Skip to content

Commit

Permalink
Consolidated BEMC thresholds and ADC parameters (#1094)
Browse files Browse the repository at this point in the history
### Briefly, what does this PR introduce?
This PR should only unify the parameters between digi and reco, plus set
a few values explicitly to 0 for clarity. But please double-check that
all parameters are indeed correct.

Checked BEMC threshold and digitization parameters against the
[digitization table from
10/2](https://brookhavenlab.sharepoint.com/:x:/s/EICPublicSharingDocs/EeICxMJ9vGtPtyq5g4qzcSwBKCqkHDj06KDdSvYQ7pxqrQ?rtime=lD_5kMnT20g).



### What kind of change does this PR introduce?
- [ ] Bug fix (issue #__)
- [ ] New feature (issue #__)
- [ ] Documentation update
- [x] Other: Maintenance

### Please check if this PR fulfills the following:
- [ ] Tests for the changes have been added
- [ ] Documentation has been added / updated
- [x] Changes have been communicated to collaborators

### Does this PR introduce breaking changes? What changes might users
need to make to their code?
No.

### Does this PR change default behavior?
Yes.
  • Loading branch information
kkauder authored Nov 7, 2023
1 parent 04663d7 commit f8e3356
Showing 1 changed file with 37 additions and 19 deletions.
56 changes: 37 additions & 19 deletions src/detectors/BEMC/BEMC.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <math.h>
#include <string>

#include "algorithms/interfaces/WithPodConfig.h"
#include "algorithms/calorimetry/CalorimeterHitDigiConfig.h"
#include "extensions/jana/JChainMultifactoryGeneratorT.h"
#include "factories/calorimetry/CalorimeterClusterRecoCoG_factoryT.h"
#include "factories/calorimetry/CalorimeterHitDigi_factoryT.h"
Expand All @@ -27,18 +27,26 @@ extern "C" {

InitJANAPlugin(app);


// Make sure digi and reco use the same value
decltype(CalorimeterHitDigiConfig::capADC) EcalBarrelScFi_capADC = 16384; //16384, 14bit ADC
decltype(CalorimeterHitDigiConfig::dyRangeADC) EcalBarrelScFi_dyRangeADC = 1500 * dd4hep::MeV;
decltype(CalorimeterHitDigiConfig::pedMeanADC) EcalBarrelScFi_pedMeanADC = 100;
decltype(CalorimeterHitDigiConfig::pedSigmaADC) EcalBarrelScFi_pedSigmaADC = 1;
decltype(CalorimeterHitDigiConfig::resolutionTDC) EcalBarrelScFi_resolutionTDC = 10 * dd4hep::picosecond;
app->Add(new JChainMultifactoryGeneratorT<CalorimeterHitDigi_factoryT>(
"EcalBarrelScFiRawHits",
{"EcalBarrelScFiHits"},
{"EcalBarrelScFiRawHits"},
{
.eRes = {0.0 * sqrt(dd4hep::GeV), 0.0, 0.0 * dd4hep::GeV},
.tRes = 0.0 * dd4hep::ns,
.capADC = 16384, // 14bit ADC
.dyRangeADC = 1500 * dd4hep::MeV,
.pedMeanADC = 100,
.pedSigmaADC = 1,
.resolutionTDC = 10 * dd4hep::picosecond,
.threshold = 0.0*dd4hep::keV, // threshold is set in ADC in reco
.capADC = EcalBarrelScFi_capADC,
.dyRangeADC = EcalBarrelScFi_dyRangeADC,
.pedMeanADC = EcalBarrelScFi_pedMeanADC,
.pedSigmaADC = EcalBarrelScFi_pedSigmaADC,
.resolutionTDC = EcalBarrelScFi_resolutionTDC,
.corrMeanScale = 1.0,
.readout = "EcalBarrelScFiHits",
.fields = {"fiber", "z"},
Expand All @@ -48,10 +56,12 @@ extern "C" {
app->Add(new JChainMultifactoryGeneratorT<CalorimeterHitReco_factoryT>(
"EcalBarrelScFiRecHits", {"EcalBarrelScFiRawHits"}, {"EcalBarrelScFiRecHits"},
{
.capADC = 16384,
.dyRangeADC = 1500. * dd4hep::MeV,
.pedMeanADC = 100,
.resolutionTDC = 10 * dd4hep::picosecond,
.capADC = EcalBarrelScFi_capADC,
.dyRangeADC = EcalBarrelScFi_dyRangeADC,
.pedMeanADC = EcalBarrelScFi_pedMeanADC,
.pedSigmaADC = EcalBarrelScFi_pedSigmaADC, // not needed; use only thresholdValue
.resolutionTDC = EcalBarrelScFi_resolutionTDC,
.thresholdFactor = 0.0, // use only thresholdValue
.thresholdValue = 5.0, // 16384 ADC counts/1500 MeV * 0.5 MeV (desired threshold) = 5.46
.sampFrac = 0.10200085,
.readout = "EcalBarrelScFiHits",
Expand Down Expand Up @@ -95,29 +105,37 @@ extern "C" {
)
);

// Make sure digi and reco use the same value
decltype(CalorimeterHitDigiConfig::capADC) EcalBarrelImaging_capADC = 8192; //8192, 13bit ADC
decltype(CalorimeterHitDigiConfig::dyRangeADC) EcalBarrelImaging_dyRangeADC = 3 * dd4hep::MeV;
decltype(CalorimeterHitDigiConfig::pedMeanADC) EcalBarrelImaging_pedMeanADC = 14; // Noise floor at 5 keV: 8192 / 3 * 0.005
decltype(CalorimeterHitDigiConfig::pedSigmaADC) EcalBarrelImaging_pedSigmaADC = 5; // Upper limit for sigma for AstroPix
decltype(CalorimeterHitDigiConfig::resolutionTDC) EcalBarrelImaging_resolutionTDC = 3.25 * dd4hep::nanosecond;
app->Add(new JChainMultifactoryGeneratorT<CalorimeterHitDigi_factoryT>(
"EcalBarrelImagingRawHits",
{"EcalBarrelImagingHits"},
{"EcalBarrelImagingRawHits"},
{
.eRes = {0.0 * sqrt(dd4hep::GeV), 0.02, 0.0 * dd4hep::GeV},
.tRes = 0.0 * dd4hep::ns,
.capADC = 8192,
.dyRangeADC = 3 * dd4hep::MeV,
.pedMeanADC = 14, // Noise floor at 5 keV: 8192 / 3 * 0.005
.pedSigmaADC = 5, // Upper limit for sigma for AstroPix
.resolutionTDC = 3.25 * dd4hep::nanosecond,
.capADC = EcalBarrelImaging_capADC,
.dyRangeADC = EcalBarrelImaging_dyRangeADC,
.pedMeanADC = EcalBarrelImaging_pedMeanADC,
.pedSigmaADC = EcalBarrelImaging_pedSigmaADC,
.resolutionTDC = EcalBarrelImaging_resolutionTDC,
.corrMeanScale = 1.0,
},
app // TODO: Remove me once fixed
));
app->Add(new JChainMultifactoryGeneratorT<CalorimeterHitReco_factoryT>(
"EcalBarrelImagingRecHits", {"EcalBarrelImagingRawHits"}, {"EcalBarrelImagingRecHits"},
{
.capADC = 8192,
.dyRangeADC = 3 * dd4hep::MeV,
.pedMeanADC = 14,
.resolutionTDC = 3.25 * dd4hep::nanosecond,
.capADC = EcalBarrelImaging_capADC,
.dyRangeADC = EcalBarrelImaging_dyRangeADC,
.pedMeanADC = EcalBarrelImaging_pedMeanADC,
.pedSigmaADC = EcalBarrelImaging_pedSigmaADC, // not needed; use only thresholdValue
.resolutionTDC = EcalBarrelImaging_resolutionTDC,
.thresholdFactor = 0.0, // use only thresholdValue
.thresholdValue = 41, // 8192 ADC counts/3 MeV * 0.015 MeV (desired threshold) = 41
.sampFrac = 0.00619766,
.readout = "EcalBarrelImagingHits",
Expand Down

0 comments on commit f8e3356

Please sign in to comment.