|
MUSIC unknown
Analysis for the MUSIC active-target ionization chamber
|
Classes | |
| struct | Kernel |
| One fitted correction: a channel's own, or a group's. More... | |
| struct | Result |
| Everything one subfile's pulse-history pass produced. More... | |
Enumerations | |
| enum | ChannelGroup { kNONE = 0 , kLONG_LEFT = 1 , kLONG_RIGHT = 2 , kSHORT_LEFT = 3 , kSHORT_RIGHT = 4 , kSTRIP0 = 5 , kSTRIP17 = 6 , kGRID = 7 , kNGROUPS = 8 } |
| Channel groups, one kernel each. More... | |
Functions | |
| const char * | GroupName (Int_t g) |
| Human-readable name of a Group. | |
| const char * | GroupTag (Int_t g) |
| Short tag for filenames: L, R, Ls, Rs, S0, S17. | |
| Int_t | ChainOf (Int_t g) |
| Which readout chain a group belongs to. | |
| Bool_t | IsLongGroup (Int_t g) |
| Whether a group is a long end rather than a short end or an unsegmented strip. | |
| Bool_t | GroupEnabled (Int_t g) |
| Whether the groups in force (Constants::ActivePulseHistoryGroups()) have this group corrected. | |
| Bool_t | GroupWantsForm (Int_t g) |
| Whether the configuration asks for the pole-zero form on this group rather than the binned kernel. | |
| Double_t | GroupTauUs (Int_t g) |
| The preamp decay time the configuration gives for this group, in microseconds; 0 when it is to be profiled. | |
| Int_t | BinOf (Double_t dt_s) |
| Kernel bin for a time since the previous pulse. | |
| Double_t | BinCentreUs (Int_t b) |
| Centre of a kernel bin, in microseconds, for reports. | |
| Int_t | AmpBinOf (Double_t e_prev, Double_t mode, Int_t n_amp) |
| Amplitude band of a previous pulse. | |
| std::vector< Int_t > | BuildGroupMap () |
| Group lookup for every (board, channel) under the active map. | |
| Bool_t | Measure (std::vector< RawHit > &hits, const std::vector< Int_t > &group_of, Result &res, const TString &file_label) |
| Measure the kernels on this subfile's beam-like events. | |
| void | Apply (std::vector< RawHit > &hits, const std::vector< Int_t > &group_of, Result &res) |
| Apply the measured kernels to the hit stream, in place. | |
| TString | Report (const Result &res, const TString &file_label, Bool_t detail=kTRUE) |
| Format the pass as a human-readable report. | |
| void | SavePlots (Result &res, const TString &file_label) |
| Draw and save the diagnostics, then free them. | |
| void | WriteToEventsFile (const TString &events_subpath, const Result &res) |
| Record the kernels and counters alongside a subfile's events. | |
| void | FitTauDecay (const std::vector< Double_t > &dt_us, const std::vector< Double_t > &dev, Kernel::TauFit &out) |
| p0 + p1 exp(-dt / p2) + p3 dt through (dt us, deviation ADC) pairs, the form the pole-zero residual plus the slow baseline lift takes. | |
| TString | BandLabel (Int_t a, Int_t n_amp, Bool_t latex) |
Variables | |
| const UInt_t | kFlagClamped = 0x2000 |
| Flag set on a hit whose correction was clamped rather than applied in full. | |
| const Int_t | kNBins = 30 |
| Bins in the kernel, spanning kLogLo to kLogHi in log10 of dt: twelve per decade, 0.083 dex each. | |
| const Double_t | kLogLo = -6.0 |
| Lowest dt bin edge: log10 of 1 us in seconds. | |
| const Double_t | kLogHi |
| Highest dt bin edge: log10 of 316 us in seconds. | |
| const Int_t | kMAX_AMP_BINS = 6 |
| Maximum amplitude bands a kernel may split the previous pulse into. | |
| const Long64_t | kMinPairsPerChannel = 2000 |
| Fewest (event, channel) pairs a channel needs for a kernel of its own; below it the channel is corrected with its group's kernel. | |
Pole-zero kernel analytic form | |
The preamp decay time of the analytic form (see kANALYTIC) is not linear in the fit, so it is profiled: the linear coefficients are solved for every tau of a logarithmic grid from kTauGridLoUs to kTauGridHiUs and the tau with the smallest residual is kept. The grid step is the resolution of the profiled tau, about 15 percent at kNTauGrid = 21. A tau given in the configuration is solved for as well, at its exact value. The grid is the main cost of the fit scan: two features per tau, band and past pulse, so halving it roughly halves the pulse-history time when the form is on. | |
| const Int_t | kNTauGrid = 21 |
| const Double_t | kTauGridLoUs = 4.0 |
| const Double_t | kTauGridHiUs = 64.0 |
Decay-time fit | |
Every fitted kernel's group additionally summarises the pre-correction deviation-against-dt profile with p0 + p1 exp(-dt / p2) + p3 dt over this window in microseconds. p2 is the preamp decay time the pole-zero setting failed to cancel. The window starts after the trapezoid freeze (holdoff plus margin, where the deviation follows the residual itself) and ends inside the kernel reach, where the profile still carries the tail and the linear term has not drowned it. | |
| const Double_t | kTauFitLoUs = 8.0 |
| const Double_t | kTauFitHiUs = 130.0 |
| const Int_t | kTauFitMinEntries = 100 |
| Below this many (event, channel) pairs in the window the fit is skipped. | |
Channel groups, one kernel each.
The long and short end of the segmented strips on either chain, plus the two unsegmented strips 0 and 17.
Definition at line 84 of file PulseHistory.hpp.
| Int_t PulseHistory::AmpBinOf | ( | Double_t | e_prev, |
| Double_t | mode, | ||
| Int_t | n_amp ) |
Amplitude band of a previous pulse.
| e_prev | Previous pulse energy, in ADC. |
| mode | That channel's beam peak, in ADC. |
| n_amp | Bands in use for this kernel. |
Definition at line 250 of file PulseHistory.cpp.
| void PulseHistory::Apply | ( | std::vector< RawHit > & | hits, |
| const std::vector< Int_t > & | group_of, | ||
| Result & | res ) |
Apply the measured kernels to the hit stream, in place.
| [in,out] | hits | Hits to correct. |
| group_of | Group per channel, from BuildGroupMap(). | |
| [in,out] | res | Kernels to apply, each channel's own from Result::kernel_ch; its clamp and shift counters are updated as it goes. |
Definition at line 1320 of file PulseHistory.cpp.
Referenced by RunFusedPipelineForFile().
| TString PulseHistory::BandLabel | ( | Int_t | a, |
| Int_t | n_amp, | ||
| Bool_t | latex ) |
Definition at line 260 of file PulseHistory.cpp.
Referenced by Report(), and SavePlots().
| Double_t PulseHistory::BinCentreUs | ( | Int_t | b | ) |
Centre of a kernel bin, in microseconds, for reports.
| b | Bin index. |
Definition at line 201 of file PulseHistory.cpp.
Referenced by Report().
| Int_t PulseHistory::BinOf | ( | Double_t | dt_s | ) |
Kernel bin for a time since the previous pulse.
| dt_s | Time difference, in seconds. |
Definition at line 192 of file PulseHistory.cpp.
Referenced by PulseHistory::Kernel::FormAt(), Measure(), and Report().
| std::vector< Int_t > PulseHistory::BuildGroupMap | ( | ) |
Group lookup for every (board, channel) under the active map.
Definition at line 271 of file PulseHistory.cpp.
Referenced by RunFusedPipelineForFile().
| Int_t PulseHistory::ChainOf | ( | Int_t | g | ) |
Which readout chain a group belongs to.
Definition at line 73 of file PulseHistory.cpp.
| void PulseHistory::FitTauDecay | ( | const std::vector< Double_t > & | dt_us, |
| const std::vector< Double_t > & | dev, | ||
| Kernel::TauFit & | out ) |
p0 + p1 exp(-dt / p2) + p3 dt through (dt us, deviation ADC) pairs, the form the pole-zero residual plus the slow baseline lift takes.
A p1 within 2 sigma of zero, or a p2 pinned at a limit, means the profile has no decay to measure: the group's pole-zero is matched, and a decay time off such a fit is noise.
Definition at line 211 of file PulseHistory.cpp.
Referenced by Measure().
| Bool_t PulseHistory::GroupEnabled | ( | Int_t | g | ) |
Whether the groups in force (Constants::ActivePulseHistoryGroups()) have this group corrected.
A disabled group gets no kernel and no correction but still takes part in the beam-like selection.
Definition at line 111 of file PulseHistory.cpp.
Referenced by Measure().
| const char * PulseHistory::GroupName | ( | Int_t | g | ) |
Human-readable name of a Group.
Definition at line 33 of file PulseHistory.cpp.
| const char * PulseHistory::GroupTag | ( | Int_t | g | ) |
Short tag for filenames: L, R, Ls, Rs, S0, S17.
Definition at line 53 of file PulseHistory.cpp.
Referenced by Measure(), and SavePlots().
| Double_t PulseHistory::GroupTauUs | ( | Int_t | g | ) |
The preamp decay time the configuration gives for this group, in microseconds; 0 when it is to be profiled.
Definition at line 121 of file PulseHistory.cpp.
Referenced by Measure().
| Bool_t PulseHistory::GroupWantsForm | ( | Int_t | g | ) |
Whether the configuration asks for the pole-zero form on this group rather than the binned kernel.
Definition at line 116 of file PulseHistory.cpp.
Referenced by Measure().
| Bool_t PulseHistory::IsLongGroup | ( | Int_t | g | ) |
Whether a group is a long end rather than a short end or an unsegmented strip.
Definition at line 85 of file PulseHistory.cpp.
Referenced by Measure().
| Bool_t PulseHistory::Measure | ( | std::vector< RawHit > & | hits, |
| const std::vector< Int_t > & | group_of, | ||
| Result & | res, | ||
| const TString & | file_label ) |
Measure the kernels on this subfile's beam-like events.
| [in,out] | hits | Raw hits for the subfile. Sorted in place if not already time-ordered, which the event builder needs anyway. |
| group_of | Group per channel, from BuildGroupMap(). | |
| [out] | res | Fitted kernels and diagnostics. |
| file_label | Label from FileSet::FileLabel(), used in plots and logs. |
Definition at line 971 of file PulseHistory.cpp.
Referenced by RunFusedPipelineForFile().
| TString PulseHistory::Report | ( | const Result & | res, |
| const TString & | file_label, | ||
| Bool_t | detail = kTRUE ) |
Format the pass as a human-readable report.
| res | Result to summarise. |
| file_label | Subfile label. |
| detail | Full report (form lines, kernel rows, tau fit, one line per channel) or, when false, the header and one line per group with its R^2 and rms before and after; the pipeline passes Constants::FileInSample(). |
Definition at line 1409 of file PulseHistory.cpp.
Referenced by RunFusedPipelineForFile().
| void PulseHistory::SavePlots | ( | Result & | res, |
| const TString & | file_label ) |
Draw and save the diagnostics, then free them.
| [in,out] | res | Result whose histograms are drawn and then deleted. |
| file_label | Subfile label, used in the plot names. |
Definition at line 1674 of file PulseHistory.cpp.
Referenced by RunFusedPipelineForFile().
| void PulseHistory::WriteToEventsFile | ( | const TString & | events_subpath, |
| const Result & | res ) |
Record the kernels and counters alongside a subfile's events.
| events_subpath | Events file to write into. |
| res | Result to record. |
Definition at line 1843 of file PulseHistory.cpp.
Referenced by RunFusedPipelineForFile().
| const UInt_t PulseHistory::kFlagClamped = 0x2000 |
Flag set on a hit whose correction was clamped rather than applied in full.
Definition at line 33 of file PulseHistory.hpp.
Referenced by Apply().
| const Double_t PulseHistory::kLogHi |
Highest dt bin edge: log10 of 316 us in seconds.
Definition at line 38 of file PulseHistory.hpp.
Referenced by BinCentreUs(), BinOf(), Measure(), Report(), and SavePlots().
| const Double_t PulseHistory::kLogLo = -6.0 |
Lowest dt bin edge: log10 of 1 us in seconds.
Definition at line 37 of file PulseHistory.hpp.
Referenced by BinCentreUs(), BinOf(), Measure(), Report(), and SavePlots().
| const Int_t PulseHistory::kMAX_AMP_BINS = 6 |
Maximum amplitude bands a kernel may split the previous pulse into.
Definition at line 41 of file PulseHistory.hpp.
Referenced by PulseHistory::Kernel::EffectiveWindowUs(), PulseHistory::Kernel::FormAt(), PulseHistory::Kernel::Kernel(), Measure(), and WriteToEventsFile().
| const Long64_t PulseHistory::kMinPairsPerChannel = 2000 |
Fewest (event, channel) pairs a channel needs for a kernel of its own; below it the channel is corrected with its group's kernel.
Definition at line 44 of file PulseHistory.hpp.
Referenced by Measure().
| const Int_t PulseHistory::kNBins = 30 |
Bins in the kernel, spanning kLogLo to kLogHi in log10 of dt: twelve per decade, 0.083 dex each.
Definition at line 36 of file PulseHistory.hpp.
Referenced by BinCentreUs(), BinOf(), PulseHistory::Kernel::Kernel(), Measure(), Report(), SavePlots(), and WriteToEventsFile().
| const Int_t PulseHistory::kNTauGrid = 21 |
Definition at line 55 of file PulseHistory.hpp.
Referenced by Measure().
| const Double_t PulseHistory::kTauFitHiUs = 130.0 |
Definition at line 69 of file PulseHistory.hpp.
Referenced by FitTauDecay().
| const Double_t PulseHistory::kTauFitLoUs = 8.0 |
Definition at line 68 of file PulseHistory.hpp.
Referenced by FitTauDecay().
| const Int_t PulseHistory::kTauFitMinEntries = 100 |
Below this many (event, channel) pairs in the window the fit is skipped.
Definition at line 71 of file PulseHistory.hpp.
Referenced by FitTauDecay().
| const Double_t PulseHistory::kTauGridHiUs = 64.0 |
Definition at line 57 of file PulseHistory.hpp.
Referenced by Measure().
| const Double_t PulseHistory::kTauGridLoUs = 4.0 |
Definition at line 56 of file PulseHistory.hpp.
Referenced by Measure().