Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reintroduce 200ns delay for CRV event window start #1363

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions CRVReco/src/CrvRecoPulsesFinder_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@ namespace mu2e
event.getByLabel(_protonBunchTimeTag, protonBunchTime);
if(protonBunchTime.isValid())
{
ProditionsHandle<EventTiming> 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)
}
}

Expand Down
10 changes: 7 additions & 3 deletions CRVResponse/fcl/prolog_v11.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
brownd1978 marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the tracker we define digitizationStart/end in fcl as the effective time you want referenced to nominal proton arrival time, and then subtract the timeFromProtonsToDRMarker to get the actual value used by the digi making / hardware. Might make it easier to keep in sync if timeFromProtonsToDRMarker changes

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
Expand Down Expand Up @@ -87,14 +89,16 @@ 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
digitizationEnd : @local::DigitizationEnd
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
digitizationEnd : @local::DigitizationEnd
digitizationStartMargin : 100.0 //ns start recording earlier to account for electronics response times

nPixelsX : 40
nPixelsY : 40
Expand Down
32 changes: 17 additions & 15 deletions CRVResponse/src/CrvPhotonGenerator_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ namespace mu2e
fhicl::Atom<double> photonYieldVariationCutoffLow{ Name("photonYieldVariationCutoffLow"),Comment("lower cutoff at photon yield variation")};
fhicl::Atom<double> photonYieldVariationCutoffHigh{ Name("photonYieldVariationCutoffHigh"),Comment("upper cutoff at photon yield variation")};
fhicl::Atom<double> digitizationStart{ Name("digitizationStart"), Comment("start of digitization after DAQ event window start")};
fhicl::Atom<double> digitizationEnd{ Name("digitizationEnd"), Comment("end of digitization after DAQ event window start")};
fhicl::Atom<double> digitizationStartMargin{ Name("digitizationStartMargin"),
Comment("time window before digitization starts to account for photon travel time and electronics response.")};
fhicl::Atom<art::InputTag> eventWindowMarkerTag{ Name("eventWindowMarkerTag"), Comment("EventWindowMarker producer"),"EWMProducer" };
Expand Down Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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()),
Expand Down Expand Up @@ -263,12 +267,10 @@ namespace mu2e
{
art::Handle<ProtonBunchTimeMC> protonBunchTimeMC;
event.getByLabel(_protonBunchTimeMCTag, protonBunchTimeMC);
ProditionsHandle<EventTiming> 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)
Expand Down
16 changes: 9 additions & 7 deletions CRVResponse/src/CrvSiPMChargeGenerator_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ namespace mu2e
fhicl::Atom<double> capacitance{Name("capacitance")}; //8.84e-14F (per pixel)
fhicl::Atom<double> digitizationStart{Name("digitizationStart"),
Comment("start of digitization after DAQ event window start")};
//400ns (400ns...425ns after POT)
//200ns (400ns...425ns after POT)
fhicl::Atom<double> digitizationEnd{Name("digitizationEnd"),
Comment("end of digitization after DAQ event window start")};
//1500ns (700ns...1725ns after POT)
fhicl::Atom<double> 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
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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()),
Expand Down Expand Up @@ -168,12 +172,10 @@ namespace mu2e
{
art::Handle<ProtonBunchTimeMC> protonBunchTimeMC;
event.getByLabel(_protonBunchTimeMCTag, protonBunchTimeMC);
ProditionsHandle<EventTiming> 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());
Expand Down
11 changes: 6 additions & 5 deletions CRVResponse/src/CrvWaveformsGenerator_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ namespace mu2e
{
fhicl::Atom<std::string> crvSiPMChargesModuleLabel{Name("crvSiPMChargesModuleLabel")};
fhicl::Atom<std::string> singlePEWaveformFileName{Name("singlePEWaveformFileName")};
fhicl::Atom<double> digitizationStart{Name("digitizationStart"), Comment("start of digitization after DAQ event window start")}; //400ns (400ns...425ns after POT)
fhicl::Atom<double> digitizationStart{Name("digitizationStart"), Comment("start of digitization after DAQ event window start")}; //200ns (400ns...425ns after POT)
fhicl::Atom<double> digitizationEnd{Name("digitizationEnd"), Comment("end of digitization after DAQ event window start")}; //1500ns (1700ns...1725ns after POT)
fhicl::Atom<art::InputTag> eventWindowMarkerTag{Name("eventWindowMarkerTag"), Comment("EventWindowMarker producer"),"EWMProducer" };
fhicl::Atom<art::InputTag> protonBunchTimeMCTag{Name("protonBunchTimeMCTag"), Comment("ProtonBunchTimeMC producer"),"EWMProducer" };
fhicl::Atom<double> minVoltage{Name("minVoltage")}; //0.022V (corresponds to 3.5PE)
Expand Down Expand Up @@ -79,6 +80,7 @@ namespace mu2e
boost::shared_ptr<mu2eCrv::MakeCrvWaveforms> _makeCrvWaveforms;

double _digitizationStart;
double _digitizationEnd;
double _minVoltage;
double _noise;
double _timeOffsetScale;
Expand Down Expand Up @@ -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()),
Expand Down Expand Up @@ -157,12 +160,10 @@ namespace mu2e
{
art::Handle<ProtonBunchTimeMC> protonBunchTimeMC;
event.getByLabel(_protonBunchTimeMCTag, protonBunchTimeMC);
ProditionsHandle<EventTiming> 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());
Expand Down