From f8e335686455506ee10e537cb5c5b8b1d15bf677 Mon Sep 17 00:00:00 2001 From: kkauder Date: Tue, 7 Nov 2023 03:04:59 +0100 Subject: [PATCH] Consolidated BEMC thresholds and ADC parameters (#1094) ### 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. --- src/detectors/BEMC/BEMC.cc | 56 +++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/src/detectors/BEMC/BEMC.cc b/src/detectors/BEMC/BEMC.cc index 44f63c3324..c3f9b51a6e 100644 --- a/src/detectors/BEMC/BEMC.cc +++ b/src/detectors/BEMC/BEMC.cc @@ -8,7 +8,7 @@ #include #include -#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" @@ -27,6 +27,13 @@ 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( "EcalBarrelScFiRawHits", {"EcalBarrelScFiHits"}, @@ -34,11 +41,12 @@ extern "C" { { .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"}, @@ -48,10 +56,12 @@ extern "C" { app->Add(new JChainMultifactoryGeneratorT( "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", @@ -95,6 +105,12 @@ 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( "EcalBarrelImagingRawHits", {"EcalBarrelImagingHits"}, @@ -102,11 +118,11 @@ extern "C" { { .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 @@ -114,10 +130,12 @@ extern "C" { app->Add(new JChainMultifactoryGeneratorT( "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",