From 99ba8c2e6006c4285ea823fc7631cc745608a7cc Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Wed, 16 Oct 2024 21:47:10 -0500 Subject: [PATCH 1/5] added option to deal with older CrvDigis --- CRVReco/fcl/prolog_v11.fcl | 1 + CRVReco/src/CrvRecoPulsesFinder_module.cc | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CRVReco/fcl/prolog_v11.fcl b/CRVReco/fcl/prolog_v11.fcl index abef6f13d..de3e1551a 100644 --- a/CRVReco/fcl/prolog_v11.fcl +++ b/CRVReco/fcl/prolog_v11.fcl @@ -51,6 +51,7 @@ BEGIN_PROLOG //note: if measured time offsets are used, the cutoffs should be set to the maximum values useTimeOffsetDB : true //applies time offsets from the DB ignoreChannels : true //ignore channels that have status bit 1 ("ignore channels") in CRVstatus DB + oldDigis : false //older digis used a different reference time, which is off by 200ns } CrvCoincidenceClusterFinder: diff --git a/CRVReco/src/CrvRecoPulsesFinder_module.cc b/CRVReco/src/CrvRecoPulsesFinder_module.cc index 9c5815d6a..024e82a41 100644 --- a/CRVReco/src/CrvRecoPulsesFinder_module.cc +++ b/CRVReco/src/CrvRecoPulsesFinder_module.cc @@ -69,6 +69,7 @@ namespace mu2e fhicl::Atom timeOffsetCutoffHigh{Name("timeOffsetCutoffHigh"), Comment("upper cutoff of time offsets (for random values - otherwise set to maximum value)")}; //+3.0ns fhicl::Atom useTimeOffsetDB{Name("useTimeOffsetDB"), Comment("apply time offsets from the DB")}; //true fhicl::Atom ignoreChannels{Name("ignoreChannels"), Comment("ignore channels that have status 2 (bit 1) in CRVstatus DB")}; //true + fhicl::Atom oldDigis{Name("oldDigis"), Comment("older digis, that used a different time reference")}; //false }; typedef art::EDProducer::Table Parameters; @@ -92,6 +93,7 @@ namespace mu2e bool _useTimeOffsetDB; bool _ignoreChannels; + bool _oldDigis; ProditionsHandle _calib; ProditionsHandle _sipmStatus; @@ -107,7 +109,8 @@ namespace mu2e _timeOffsetCutoffLow(conf().timeOffsetCutoffLow()), _timeOffsetCutoffHigh(conf().timeOffsetCutoffHigh()), _useTimeOffsetDB(conf().useTimeOffsetDB()), - _ignoreChannels(conf().ignoreChannels()) + _ignoreChannels(conf().ignoreChannels()), + _oldDigis(conf().oldDigis()) { produces(); _makeCrvRecoPulses=boost::shared_ptr(new mu2eCrv::MakeCrvRecoPulses(conf().minADCdifference(), @@ -153,6 +156,9 @@ namespace mu2e ProditionsHandle eventTimingHandle; const EventTiming &eventTiming = eventTimingHandle.get(event.id()); TDC0time = -protonBunchTime->pbtime_ - eventTiming.timeFromProtonsToDRMarker(); //0ns...25ns (only for onspill) + + if(_oldDigis) TDC0time+=eventTiming.timeFromProtonsToDRMarker(); //old digis were produced relative to -protonBunchTime + //new digis are produced relative to -protonBunchTime-eventTiming.timeFromProtonsToDRMarker } } From a5320c818d162993b6644b56a45f290cc217e041 Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Thu, 17 Oct 2024 13:55:22 -0500 Subject: [PATCH 2/5] increased time before start of Crv digitization to account for photon travel time and electronics response time --- CRVResponse/fcl/prolog_v11.fcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRVResponse/fcl/prolog_v11.fcl b/CRVResponse/fcl/prolog_v11.fcl index a42dcd826..fe35d872a 100644 --- a/CRVResponse/fcl/prolog_v11.fcl +++ b/CRVResponse/fcl/prolog_v11.fcl @@ -87,14 +87,14 @@ BEGIN_PROLOG photonYieldVariationCutoffHigh : 0.2 //the photon yield variation is cut off at 20% above the mean //note: if measured deviations are used, the cutoffs should be set to the maximum values digitizationStart : @local::DigitizationStart - digitizationStartMargin : 50.0 //ns start recording earlier to account for photon travel times and electronics response times + digitizationStartMargin : 100.0 //ns start recording earlier to account for photon travel times and electronics response times } CrvSiPMCharges: { module_type : CrvSiPMChargeGenerator crvPhotonsModuleLabel : "CrvPhotons" digitizationStart : @local::DigitizationStart - digitizationStartMargin : 50.0 //ns start recording earlier to account for electronics response times + digitizationStartMargin : 100.0 //ns start recording earlier to account for electronics response times nPixelsX : 40 nPixelsY : 40 From 76934be592eebece1d6a2786f06013ae8380f304 Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Thu, 17 Oct 2024 18:04:20 -0500 Subject: [PATCH 3/5] old digi option not needed anymore --- CRVReco/fcl/prolog_v11.fcl | 1 - CRVReco/src/CrvRecoPulsesFinder_module.cc | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/CRVReco/fcl/prolog_v11.fcl b/CRVReco/fcl/prolog_v11.fcl index de3e1551a..abef6f13d 100644 --- a/CRVReco/fcl/prolog_v11.fcl +++ b/CRVReco/fcl/prolog_v11.fcl @@ -51,7 +51,6 @@ BEGIN_PROLOG //note: if measured time offsets are used, the cutoffs should be set to the maximum values useTimeOffsetDB : true //applies time offsets from the DB ignoreChannels : true //ignore channels that have status bit 1 ("ignore channels") in CRVstatus DB - oldDigis : false //older digis used a different reference time, which is off by 200ns } CrvCoincidenceClusterFinder: diff --git a/CRVReco/src/CrvRecoPulsesFinder_module.cc b/CRVReco/src/CrvRecoPulsesFinder_module.cc index 024e82a41..9c5815d6a 100644 --- a/CRVReco/src/CrvRecoPulsesFinder_module.cc +++ b/CRVReco/src/CrvRecoPulsesFinder_module.cc @@ -69,7 +69,6 @@ namespace mu2e fhicl::Atom timeOffsetCutoffHigh{Name("timeOffsetCutoffHigh"), Comment("upper cutoff of time offsets (for random values - otherwise set to maximum value)")}; //+3.0ns fhicl::Atom useTimeOffsetDB{Name("useTimeOffsetDB"), Comment("apply time offsets from the DB")}; //true fhicl::Atom ignoreChannels{Name("ignoreChannels"), Comment("ignore channels that have status 2 (bit 1) in CRVstatus DB")}; //true - fhicl::Atom oldDigis{Name("oldDigis"), Comment("older digis, that used a different time reference")}; //false }; typedef art::EDProducer::Table Parameters; @@ -93,7 +92,6 @@ namespace mu2e bool _useTimeOffsetDB; bool _ignoreChannels; - bool _oldDigis; ProditionsHandle _calib; ProditionsHandle _sipmStatus; @@ -109,8 +107,7 @@ namespace mu2e _timeOffsetCutoffLow(conf().timeOffsetCutoffLow()), _timeOffsetCutoffHigh(conf().timeOffsetCutoffHigh()), _useTimeOffsetDB(conf().useTimeOffsetDB()), - _ignoreChannels(conf().ignoreChannels()), - _oldDigis(conf().oldDigis()) + _ignoreChannels(conf().ignoreChannels()) { produces(); _makeCrvRecoPulses=boost::shared_ptr(new mu2eCrv::MakeCrvRecoPulses(conf().minADCdifference(), @@ -156,9 +153,6 @@ namespace mu2e ProditionsHandle eventTimingHandle; const EventTiming &eventTiming = eventTimingHandle.get(event.id()); TDC0time = -protonBunchTime->pbtime_ - eventTiming.timeFromProtonsToDRMarker(); //0ns...25ns (only for onspill) - - if(_oldDigis) TDC0time+=eventTiming.timeFromProtonsToDRMarker(); //old digis were produced relative to -protonBunchTime - //new digis are produced relative to -protonBunchTime-eventTiming.timeFromProtonsToDRMarker } } From ca050271af03606e917a77aa3c80fab2c0c5cc35 Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Thu, 17 Oct 2024 22:39:23 -0500 Subject: [PATCH 4/5] moved the CRV event start time forward to line up with the tracker event start time --- CRVReco/src/CrvRecoPulsesFinder_module.cc | 4 +-- CRVResponse/fcl/prolog_v11.fcl | 6 +++- CRVResponse/src/CrvPhotonGenerator_module.cc | 32 ++++++++++--------- .../src/CrvSiPMChargeGenerator_module.cc | 16 ++++++---- .../src/CrvWaveformsGenerator_module.cc | 11 ++++--- 5 files changed, 38 insertions(+), 31 deletions(-) diff --git a/CRVReco/src/CrvRecoPulsesFinder_module.cc b/CRVReco/src/CrvRecoPulsesFinder_module.cc index 9c5815d6a..ddf013a14 100644 --- a/CRVReco/src/CrvRecoPulsesFinder_module.cc +++ b/CRVReco/src/CrvRecoPulsesFinder_module.cc @@ -150,9 +150,7 @@ namespace mu2e event.getByLabel(_protonBunchTimeTag, protonBunchTime); if(protonBunchTime.isValid()) { - ProditionsHandle eventTimingHandle; - const EventTiming &eventTiming = eventTimingHandle.get(event.id()); - TDC0time = -protonBunchTime->pbtime_ - eventTiming.timeFromProtonsToDRMarker(); //0ns...25ns (only for onspill) + TDC0time = -protonBunchTime->pbtime_; //200ns...225ns (only for onspill) } } diff --git a/CRVResponse/fcl/prolog_v11.fcl b/CRVResponse/fcl/prolog_v11.fcl index fe35d872a..15397e42f 100644 --- a/CRVResponse/fcl/prolog_v11.fcl +++ b/CRVResponse/fcl/prolog_v11.fcl @@ -9,7 +9,9 @@ #include "Offline/CommonMC/fcl/prolog.fcl" BEGIN_PROLOG - DigitizationStart: 400.0 //ns after event window start (i.e. 400ns after first clock tick after POT) --> 400ns...425ns after POT + DigitizationStart : 200.0 //ns after event window start (400ns...425ns after POT) + DigitizationEnd : 1500.0 //ns after event window start (1700ns...1725ns after POT) + //event window starts 200ns after first clock tick after POT (200ns...225ns after POT) CrvSteps: { module_type : CrvStepsFromStepPointMCs @@ -87,6 +89,7 @@ BEGIN_PROLOG photonYieldVariationCutoffHigh : 0.2 //the photon yield variation is cut off at 20% above the mean //note: if measured deviations are used, the cutoffs should be set to the maximum values digitizationStart : @local::DigitizationStart + digitizationEnd : @local::DigitizationEnd digitizationStartMargin : 100.0 //ns start recording earlier to account for photon travel times and electronics response times } CrvSiPMCharges: @@ -94,6 +97,7 @@ BEGIN_PROLOG module_type : CrvSiPMChargeGenerator crvPhotonsModuleLabel : "CrvPhotons" digitizationStart : @local::DigitizationStart + digitizationEnd : @local::DigitizationEnd digitizationStartMargin : 100.0 //ns start recording earlier to account for electronics response times nPixelsX : 40 diff --git a/CRVResponse/src/CrvPhotonGenerator_module.cc b/CRVResponse/src/CrvPhotonGenerator_module.cc index 97891bef6..b8de63a5f 100644 --- a/CRVResponse/src/CrvPhotonGenerator_module.cc +++ b/CRVResponse/src/CrvPhotonGenerator_module.cc @@ -70,6 +70,7 @@ namespace mu2e fhicl::Atom photonYieldVariationCutoffLow{ Name("photonYieldVariationCutoffLow"),Comment("lower cutoff at photon yield variation")}; fhicl::Atom photonYieldVariationCutoffHigh{ Name("photonYieldVariationCutoffHigh"),Comment("upper cutoff at photon yield variation")}; fhicl::Atom digitizationStart{ Name("digitizationStart"), Comment("start of digitization after DAQ event window start")}; + fhicl::Atom digitizationEnd{ Name("digitizationEnd"), Comment("end of digitization after DAQ event window start")}; fhicl::Atom digitizationStartMargin{ Name("digitizationStartMargin"), Comment("time window before digitization starts to account for photon travel time and electronics response.")}; fhicl::Atom eventWindowMarkerTag{ Name("eventWindowMarkerTag"), Comment("EventWindowMarker producer"),"EWMProducer" }; @@ -104,16 +105,17 @@ namespace mu2e //-Digitization window //---first DAQ clock tick after POT occurs between 0ns and 25ns after protons. // 25ns jitter is due to the microbunch period not being an integer multiple of the DAQ clock period. - //---these first DAQ clock ticks define the event window. - // due to the above variations, the event window length varies between 1675ns and 1700ns. - //---digitization start: 400ns after event window start (--> 400ns...425ns after POT) - //---digitization end: at the end of the event window (i.e. first DAQ clock after the next POT), - // which is 1675ns or 1700ns after the event window start + //---event window starts 200ns after these first DAQ clock ticks (--> 200ns...225ns after POT). + //---due to the above variations, the event window length varies between 1675ns and 1700ns. + //---digitization start: 200ns after event window start (--> 400ns...425ns after POT) + //---digitization end: 1500ns after event window start (--> 1700ns...1725ns after POT), + // which is 1300ns after digitization start //-CrvSteps - //---start recording CrvSteps 50ns before digitzation window (=350ns after event window start) - // to account for photon travel time and electroncs response time. + //---start recording CrvSteps 100ns before digitzation window + // (--> 100ns after event window start, 300ns...325ns after POT) + // to account for photon travel time and electronics response time. //---stop recording CrvSteps at end of digitization window. - //---CrvSteps before 50ns before the digitization window are removed (dead time). + //---CrvSteps before 100ns before the digitization window are removed (dead time). //---CrvSteps after the end of the event window belong to the next event(s). // for simplicity, no time wrapping and removal of CrvSteps that occur in the dead time will be done. //-CrvPhotons @@ -130,8 +132,9 @@ namespace mu2e //-CrvPhotons //---no time wrapping - double _digitizationStart; //400ns after event window start (400ns...425ns after POT) - double _digitizationStartMargin; //50ns (used to account for photon travel time and electronics response time) + double _digitizationStart; //200ns after event window start (400ns...425ns after POT) + double _digitizationEnd; //1500ns after event window start (1700ns...1725ns after POT) + double _digitizationStartMargin; //100ns (used to account for photon travel time and electronics response time) art::InputTag _eventWindowMarkerTag; art::InputTag _protonBunchTimeMCTag; double _microBunchPeriod; @@ -156,6 +159,7 @@ namespace mu2e _photonYieldVariationCutoffLow(conf().photonYieldVariationCutoffLow()), _photonYieldVariationCutoffHigh(conf().photonYieldVariationCutoffHigh()), _digitizationStart(conf().digitizationStart()), + _digitizationEnd(conf().digitizationEnd()), _digitizationStartMargin(conf().digitizationStartMargin()), _eventWindowMarkerTag(conf().eventWindowMarkerTag()), _protonBunchTimeMCTag(conf().protonBunchTimeMCTag()), @@ -263,12 +267,10 @@ namespace mu2e { art::Handle protonBunchTimeMC; event.getByLabel(_protonBunchTimeMCTag, protonBunchTimeMC); - ProditionsHandle eventTimingHandle; - const EventTiming &eventTiming = eventTimingHandle.get(event.id()); - eventWindowStart = -protonBunchTimeMC->pbtime_ - eventTiming.timeFromProtonsToDRMarker(); //0ns...25ns (only for onspill) + eventWindowStart = -protonBunchTimeMC->pbtime_; //200ns...225ns - startTime=eventWindowStart+_digitizationStart-_digitizationStartMargin; //350ns...375ns - endTime=eventWindowStart+eventWindowLength; //up to ~1720ns + startTime=eventWindowStart+_digitizationStart-_digitizationStartMargin; //300ns...325ns + endTime=eventWindowStart+_digitizationEnd; //1700ns...1725ns } for(size_t j=0; j<_selectors.size(); ++j) diff --git a/CRVResponse/src/CrvSiPMChargeGenerator_module.cc b/CRVResponse/src/CrvSiPMChargeGenerator_module.cc index 1a1718b7f..3cd5cd023 100644 --- a/CRVResponse/src/CrvSiPMChargeGenerator_module.cc +++ b/CRVResponse/src/CrvSiPMChargeGenerator_module.cc @@ -53,7 +53,10 @@ namespace mu2e fhicl::Atom capacitance{Name("capacitance")}; //8.84e-14F (per pixel) fhicl::Atom digitizationStart{Name("digitizationStart"), Comment("start of digitization after DAQ event window start")}; - //400ns (400ns...425ns after POT) + //200ns (400ns...425ns after POT) + fhicl::Atom digitizationEnd{Name("digitizationEnd"), + Comment("end of digitization after DAQ event window start")}; + //1500ns (700ns...1725ns after POT) fhicl::Atom digitizationStartMargin{Name("digitizationStartMargin"), Comment("time window before digitization starts to account for photon travel time and electronics response.")}; //50.0ns start recording earlier to account for electronics response times @@ -83,7 +86,7 @@ namespace mu2e double _overvoltage; double _timeConstant; double _capacitance; - double _digitizationStart, _digitizationStartMargin; + double _digitizationStart, _digitizationEnd, _digitizationStartMargin; art::InputTag _eventWindowMarkerTag; art::InputTag _protonBunchTimeMCTag; @@ -112,6 +115,7 @@ namespace mu2e _timeConstant(conf().timeConstant()), _capacitance(conf().capacitance()), _digitizationStart(conf().digitizationStart()), + _digitizationEnd(conf().digitizationEnd()), _digitizationStartMargin(conf().digitizationStartMargin()), _eventWindowMarkerTag(conf().eventWindowMarkerTag()), _protonBunchTimeMCTag(conf().protonBunchTimeMCTag()), @@ -168,12 +172,10 @@ namespace mu2e { art::Handle protonBunchTimeMC; event.getByLabel(_protonBunchTimeMCTag, protonBunchTimeMC); - ProditionsHandle eventTimingHandle; - const EventTiming &eventTiming = eventTimingHandle.get(event.id()); - eventWindowStart = -protonBunchTimeMC->pbtime_ - eventTiming.timeFromProtonsToDRMarker(); //0ns...25ns (only for onspill) + eventWindowStart = -protonBunchTimeMC->pbtime_; //200ns...225ns - startTime=eventWindowStart+_digitizationStart-_digitizationStartMargin; //350ns...375ns - endTime=eventWindowStart+eventWindowLength; //up to ~1720ns + startTime=eventWindowStart+_digitizationStart-_digitizationStartMargin; //300ns...325ns + endTime=eventWindowStart+_digitizationEnd; //1700ns...1725ns } auto const& sipmStatus = _sipmStatus.get(event.id()); diff --git a/CRVResponse/src/CrvWaveformsGenerator_module.cc b/CRVResponse/src/CrvWaveformsGenerator_module.cc index a6a3e56e3..616d2c204 100644 --- a/CRVResponse/src/CrvWaveformsGenerator_module.cc +++ b/CRVResponse/src/CrvWaveformsGenerator_module.cc @@ -49,7 +49,8 @@ namespace mu2e { fhicl::Atom crvSiPMChargesModuleLabel{Name("crvSiPMChargesModuleLabel")}; fhicl::Atom singlePEWaveformFileName{Name("singlePEWaveformFileName")}; - fhicl::Atom digitizationStart{Name("digitizationStart"), Comment("start of digitization after DAQ event window start")}; //400ns (400ns...425ns after POT) + fhicl::Atom digitizationStart{Name("digitizationStart"), Comment("start of digitization after DAQ event window start")}; //200ns (400ns...425ns after POT) + fhicl::Atom digitizationEnd{Name("digitizationEnd"), Comment("end of digitization after DAQ event window start")}; //1500ns (1700ns...1725ns after POT) fhicl::Atom eventWindowMarkerTag{Name("eventWindowMarkerTag"), Comment("EventWindowMarker producer"),"EWMProducer" }; fhicl::Atom protonBunchTimeMCTag{Name("protonBunchTimeMCTag"), Comment("ProtonBunchTimeMC producer"),"EWMProducer" }; fhicl::Atom minVoltage{Name("minVoltage")}; //0.022V (corresponds to 3.5PE) @@ -79,6 +80,7 @@ namespace mu2e boost::shared_ptr _makeCrvWaveforms; double _digitizationStart; + double _digitizationEnd; double _minVoltage; double _noise; double _timeOffsetScale; @@ -114,6 +116,7 @@ namespace mu2e _eventWindowMarkerTag(conf().eventWindowMarkerTag()), _protonBunchTimeMCTag(conf().protonBunchTimeMCTag()), _digitizationStart(conf().digitizationStart()), + _digitizationEnd(conf().digitizationEnd()), _minVoltage(conf().minVoltage()), _noise(conf().noise()), _timeOffsetScale(conf().timeOffsetScale()), @@ -157,12 +160,10 @@ namespace mu2e { art::Handle protonBunchTimeMC; event.getByLabel(_protonBunchTimeMCTag, protonBunchTimeMC); - ProditionsHandle eventTimingHandle; - const EventTiming &eventTiming = eventTimingHandle.get(event.id()); - eventWindowStart = -protonBunchTimeMC->pbtime_ - eventTiming.timeFromProtonsToDRMarker(); //0ns...25ns (only for onspill) + eventWindowStart = -protonBunchTimeMC->pbtime_; //200ns...225ns digitizationStart=eventWindowStart+_digitizationStart; //400ns...425ns - digitizationEnd=eventWindowStart+eventWindowLength; //up to ~1720ns + digitizationEnd=eventWindowStart+_digitizationEnd; //1700ns...1725ns } auto const& calib = _calib.get(event.id()); From 06fa225dc5e808c092f2765564ea7769240291de Mon Sep 17 00:00:00 2001 From: ehrlich-uva Date: Fri, 18 Oct 2024 15:20:33 -0500 Subject: [PATCH 5/5] forgot digitizationEnd in CRV waveform generator --- CRVResponse/fcl/prolog_v11.fcl | 1 + 1 file changed, 1 insertion(+) diff --git a/CRVResponse/fcl/prolog_v11.fcl b/CRVResponse/fcl/prolog_v11.fcl index 15397e42f..3fc616369 100644 --- a/CRVResponse/fcl/prolog_v11.fcl +++ b/CRVResponse/fcl/prolog_v11.fcl @@ -130,6 +130,7 @@ BEGIN_PROLOG module_type : CrvWaveformsGenerator crvSiPMChargesModuleLabel : "CrvSiPMCharges" digitizationStart : @local::DigitizationStart + digitizationEnd : @local::DigitizationEnd singlePEWaveformFileName : "Offline/CRVResponse/data/singlePEWaveform_v3.txt" singlePEWaveformPrecision : 0.5 //0.5 ns singlePEWaveformStretchFactor: 1.047 //1.047 for singlePEWaveform_v3.txt //from comparison with testbeam data