MUSIC unknown
Analysis for the MUSIC active-target ionization chamber
Loading...
Searching...
No Matches

Builds the strip-sum scatters, tags reactions, and draws the results. More...

#include <StripSumScatter.hpp>

Public Member Functions

 StripSumScatter ()
 Construct with empty scatters and no cache loaded.
 ~StripSumScatter ()
 Frees the scatters and the reservoir.
void Run ()
 Build or load the scatters, tag reactions, and draw everything.
Bool_t Prepare ()
 Measure the beam, then load the scatter cache or build it.
void SimTagReport ()
 Run the data selection over every simulated population: the event-level cuts (all but the beam gate, which is fitted on data) and the tag at every reaction strip with the one-tag rule, against the measured beam spread.
void DrawAllTaggedTraces (const TString &subdir)
 Region-trace overlays of every tagged event, one figure per reaction strip, against the beam band.

Static Public Member Functions

static TString CacheName ()
 Filename of the scatter cache for this configuration.
static void PlaneXY (const Double_t *total, Int_t reac, Double_t &x, Double_t &y)
 Where an event sits in the scatter plane for a given reaction strip.
static Int_t YLoOf (Int_t reac)
 First strip of the post-trigger window summed onto y.
static Int_t YHiOf (Int_t reac)
 Last strip of the post-trigger window, inclusive.
static Int_t ResolveTag (const EnergyView &ev, const std::vector< Bool_t > &pass)
 The one strip an event is tagged at, among those whose tag passed (pass[ReacIndex]), per TAG_RESOLVE; -1 when none.
static Bool_t Condition (TagCut c, const EnergyView &ev, Int_t reac, const TagThresholds &T)
 One tag condition on its own: whether c passes for reac under T, true where it does not apply at that strip.
static Bool_t ConditionActive (TagCut c, const TagThresholds &T)
 Whether the configuration has condition c in force.
static TagCut RejectReason (const EnergyView &ev, Int_t reac)
 Which condition of the tag an event fails first at a strip.
static TagCut RejectReason (const EnergyView &ev, Int_t reac, const TagThresholds &T)
 RejectReason under an explicit threshold set.
static TagCut TailReason (const EnergyView &ev, Int_t reac, const TagThresholds &T)
 The tail-shape part of RejectReason: kTAG_PASS or the first failing tail condition, under an explicit threshold set.
static Bool_t IsPileup (const EnergyView &ev)
 The event-level pileup and noise cuts (PILEUP_* / NOISE_*), in sigma of the measured beam spread.
static Bool_t IsNoise (const EnergyView &ev)
static Bool_t IsPileup (const EnergyView &ev, Double_t nsigma)
static Bool_t IsNoise (const EnergyView &ev, Double_t nsigma)
static Double_t MaxStepNSigma (const EnergyView &ev)
 The largest strip-to-strip step of the trace, |E(s) - E(s-1)| over strips 2 to the last in sigma of strip s's measured spread, with the single largest rise left out (the reaction jump); strips without a measured spread are skipped.
static Bool_t IsSmooth (const EnergyView &ev, Double_t nsigma)
 The event-level smoothness cut: MaxStepNSigma() at or under nsigma, or the cut is off (nsigma <= 0).
static TagThresholds NominalThresholds ()
 The thresholds the configuration sets.
static std::vector< std::pair< TString, TagThresholds > > ThresholdVariants ()
 The cut-variation set: each active threshold shifted up and down by its configured step (CUT_VARIATION_*), one at a time, named <threshold>+ and <threshold>-.
static std::vector< SelectionStep > DescribeSelection ()
 The whole selection as the configuration sets it, in order.
Measured beam noise

Measured once from the data and stamped into the cache.

Set before any tagging begins and read-only afterwards, which is what makes them safe to share across the worker threads without synchronisation.

static Double_t StripSigma (Int_t strip)
 Width of the beam's deposit on a strip, from the gated beam sample of the first run (MeasureBeamNoise).
static Double_t StripMean (Int_t strip)
 Mean of the beam's deposit on a strip over the same sample; the level every cut measures from.
static void SetStripNoise (const Double_t *mean, const Double_t *sigma)
 Install the per-strip beam means and sigmas.
static Double_t JumpMin (Int_t reac)
 Minimum jump for a tag: REAC_JUMP_NSIGMA * StripSigma(reac).

Detailed Description

Builds the strip-sum scatters, tags reactions, and draws the results.

The entry point behind the strip-sum-scatter binary. Fills per-strip scatters from the events files, caches them alongside a reservoir of tagged events, and draws the regions and trace overlays.

Note
The cache carries a fingerprint of every configuration knob that changes its contents — filters, gates, strip spans — so editing any of them rebuilds it automatically on the next run. There is no cache-clearing step to remember.

Definition at line 332 of file StripSumScatter.hpp.

Constructor & Destructor Documentation

◆ StripSumScatter()

StripSumScatter::StripSumScatter ( )

Construct with empty scatters and no cache loaded.

Definition at line 50 of file StripSumScatter.cpp.

◆ ~StripSumScatter()

StripSumScatter::~StripSumScatter ( )

Frees the scatters and the reservoir.

Definition at line 69 of file StripSumScatter.cpp.

Member Function Documentation

◆ CacheName()

TString StripSumScatter::CacheName ( )
static

Filename of the scatter cache for this configuration.

Note
compute-regions reads the same file, so the name is defined here and nowhere else.

Definition at line 807 of file StripSumScatter.cpp.

Referenced by main(), and Prepare().

◆ Condition()

Bool_t StripSumScatter::Condition ( TagCut c,
const EnergyView & ev,
Int_t reac,
const TagThresholds & T )
static

One tag condition on its own: whether c passes for reac under T, true where it does not apply at that strip.

Each condition on its own.

The tail-shape ones follow the published 87Rb per-strip macros (TracesVisu2.C at A9-A11), each in sigma of the measured noise; all are numerator-only: they describe the residue, not the beam. A strip whose noise was not measured is skipped. A condition that does not apply at this strip (a window past the last strip, the cliff with no strip between the reaction and the end) passes.

Definition at line 247 of file StripSumScatter.cpp.

Referenced by RejectReason(), and TailReason().

◆ ConditionActive()

Bool_t StripSumScatter::ConditionActive ( TagCut c,
const TagThresholds & T )
static

Whether the configuration has condition c in force.

Definition at line 218 of file StripSumScatter.cpp.

Referenced by RejectReason(), and TailReason().

◆ DescribeSelection()

std::vector< SelectionStep > StripSumScatter::DescribeSelection ( )
static

The whole selection as the configuration sets it, in order.

Input and beam reference, the event-level cuts, the tag conditions per reaction strip and what becomes of a tag, each with its configured numbers and whether it is on. Read by WriteCutReport() for the on/off columns and by SelectionDiagram for the block diagram, so it is kept beside RejectReason and must follow its order.

Returns
The steps, SelectionStep::kINPUT first.

Definition at line 406 of file StripSumScatter.cpp.

Referenced by Prepare().

◆ DrawAllTaggedTraces()

void StripSumScatter::DrawAllTaggedTraces ( const TString & subdir)

Region-trace overlays of every tagged event, one figure per reaction strip, against the beam band.

The all-tagged mode's counterpart of the interactive overlay: no region cut, and every event tagged at the strip is drawn with no cap (the TRACES_PER_CLASS cap applies to the beam sample only), in calibrated units, in raw ADC when PLOT_ADC_TRACES, and as mean traces when PLOT_REGION_MEAN_TRACES. Needs the reservoir, so call after Prepare().

Parameters
subdirPlot subdirectory the figures go to.

Definition at line 3397 of file StripSumScatter.cpp.

Referenced by main().

◆ IsNoise() [1/2]

Bool_t StripSumScatter::IsNoise ( const EnergyView & ev)
static

Definition at line 741 of file StripSumScatter.cpp.

Referenced by IsNoise(), and SimTagReport().

◆ IsNoise() [2/2]

Bool_t StripSumScatter::IsNoise ( const EnergyView & ev,
Double_t nsigma )
static

Definition at line 745 of file StripSumScatter.cpp.

◆ IsPileup() [1/2]

Bool_t StripSumScatter::IsPileup ( const EnergyView & ev)
static

The event-level pileup and noise cuts (PILEUP_* / NOISE_*), in sigma of the measured beam spread.

Definition at line 721 of file StripSumScatter.cpp.

Referenced by IsPileup(), and SimTagReport().

◆ IsPileup() [2/2]

Bool_t StripSumScatter::IsPileup ( const EnergyView & ev,
Double_t nsigma )
static

Definition at line 725 of file StripSumScatter.cpp.

◆ IsSmooth()

Bool_t StripSumScatter::IsSmooth ( const EnergyView & ev,
Double_t nsigma )
static

The event-level smoothness cut: MaxStepNSigma() at or under nsigma, or the cut is off (nsigma <= 0).

Definition at line 782 of file StripSumScatter.cpp.

Referenced by SimTagReport().

◆ JumpMin()

Double_t StripSumScatter::JumpMin ( Int_t reac)
static

Minimum jump for a tag: REAC_JUMP_NSIGMA * StripSigma(reac).

Parameters
reacReaction strip index.

Definition at line 198 of file StripSumScatter.cpp.

Referenced by Prepare().

◆ MaxStepNSigma()

Double_t StripSumScatter::MaxStepNSigma ( const EnergyView & ev)
static

The largest strip-to-strip step of the trace, |E(s) - E(s-1)| over strips 2 to the last in sigma of strip s's measured spread, with the single largest rise left out (the reaction jump); strips without a measured spread are skipped.

Definition at line 760 of file StripSumScatter.cpp.

Referenced by IsSmooth().

◆ NominalThresholds()

TagThresholds StripSumScatter::NominalThresholds ( )
static

The thresholds the configuration sets.

Definition at line 112 of file StripSumScatter.cpp.

Referenced by RejectReason(), and ThresholdVariants().

◆ PlaneXY()

void StripSumScatter::PlaneXY ( const Double_t * total,
Int_t reac,
Double_t & x,
Double_t & y )
static

Where an event sits in the scatter plane for a given reaction strip.

x is the sum over X_LO..X_HI; y is the sum over the post-trigger window.

Parameters
totalCalibrated per-strip totals for the event.
reacReaction strip index.
[out]xPlane x coordinate.
[out]yPlane y coordinate.
Note
Every consumer of a region cut goes through this, which is what stops the fill, the overlay and the cross section from ever disagreeing about where an event sits.

Definition at line 793 of file StripSumScatter.cpp.

◆ Prepare()

Bool_t StripSumScatter::Prepare ( )

Measure the beam, then load the scatter cache or build it.

Everything Run() does before any overlay: the first run's beam mean and width per strip, the cache fingerprint, a load of a matching cache or a fill and write of a fresh one, and the batch scatter figures. Leaves the scatters and the trace reservoir in memory. compute-regions calls this in the all-tagged mode so strip-sum-scatter itself never has to be run. Writes the selection diagram (SelectionDiagram::Write) first, before any data are read.

Returns
kFALSE when there are no runs or the beam cannot be measured.

Definition at line 3295 of file StripSumScatter.cpp.

Referenced by main(), and Run().

◆ RejectReason() [1/2]

TagCut StripSumScatter::RejectReason ( const EnergyView & ev,
Int_t reac )
static

Which condition of the tag an event fails first at a strip.

The per-strip conditions only: the event-level cuts (PreCut, every strip fired among them) are applied once per event by the fill, before any strip is asked about, and are assumed here.

Parameters
evDecoded event.
reacReaction strip index.
Returns
kTAG_PASS if tagged, else the first failing TagCut.

Definition at line 350 of file StripSumScatter.cpp.

Referenced by RejectReason(), and SimTagReport().

◆ RejectReason() [2/2]

TagCut StripSumScatter::RejectReason ( const EnergyView & ev,
Int_t reac,
const TagThresholds & T )
static

RejectReason under an explicit threshold set.

Definition at line 342 of file StripSumScatter.cpp.

◆ ResolveTag()

Int_t StripSumScatter::ResolveTag ( const EnergyView & ev,
const std::vector< Bool_t > & pass )
static

The one strip an event is tagged at, among those whose tag passed (pass[ReacIndex]), per TAG_RESOLVE; -1 when none.

Parameters
evDecoded event.
passPer-strip pass flags, indexed from REACTION_STRIP_MIN.

Definition at line 354 of file StripSumScatter.cpp.

Referenced by SimTagReport().

◆ Run()

void StripSumScatter::Run ( )

Build or load the scatters, tag reactions, and draw everything.

The entry point called from main_strip_sum_scatter.cpp: Prepare(), then the optional simulation overlays and the interactive region-trace overlay for the candidate strip.

Definition at line 3381 of file StripSumScatter.cpp.

Referenced by main().

◆ SetStripNoise()

void StripSumScatter::SetStripNoise ( const Double_t * mean,
const Double_t * sigma )
static

Install the per-strip beam means and sigmas.

Call before tagging starts.

Parameters
mean18 values, one per strip; null means 1.0 everywhere.
sigma18 values, one per strip.

Definition at line 104 of file StripSumScatter.cpp.

Referenced by main(), and Prepare().

◆ SimTagReport()

void StripSumScatter::SimTagReport ( )

Run the data selection over every simulated population: the event-level cuts (all but the beam gate, which is fitted on data) and the tag at every reaction strip with the one-tag rule, against the measured beam spread.

Per file: the event-level funnel, the first failing condition at the file's own strip, and where the event's one tag went. Printed and written to plots/strip_sum_scatter/sim_tag_report.txt. No correction is derived from it. Needs the strip noise set (Prepare, or SetStripNoise from the cache).

Definition at line 1656 of file StripSumScatter.cpp.

Referenced by main(), and Run().

◆ StripMean()

Double_t StripSumScatter::StripMean ( Int_t strip)
static

Mean of the beam's deposit on a strip over the same sample; the level every cut measures from.

1.0 when none was installed.

Parameters
stripStrip index.

Definition at line 100 of file StripSumScatter.cpp.

Referenced by Condition(), IsNoise(), and IsPileup().

◆ StripSigma()

Double_t StripSumScatter::StripSigma ( Int_t strip)
static

Width of the beam's deposit on a strip, from the gated beam sample of the first run (MeasureBeamNoise).

Parameters
stripStrip index.

Definition at line 96 of file StripSumScatter.cpp.

Referenced by Condition(), IsNoise(), IsPileup(), JumpMin(), MaxStepNSigma(), and ResolveTag().

◆ TailReason()

TagCut StripSumScatter::TailReason ( const EnergyView & ev,
Int_t reac,
const TagThresholds & T )
static

The tail-shape part of RejectReason: kTAG_PASS or the first failing tail condition, under an explicit threshold set.

Definition at line 332 of file StripSumScatter.cpp.

◆ ThresholdVariants()

std::vector< std::pair< TString, TagThresholds > > StripSumScatter::ThresholdVariants ( )
static

The cut-variation set: each active threshold shifted up and down by its configured step (CUT_VARIATION_*), one at a time, named <threshold>+ and <threshold>-.

Empty when CUT_VARIATION is off.

Definition at line 135 of file StripSumScatter.cpp.

◆ YHiOf()

Int_t StripSumScatter::YHiOf ( Int_t reac)
static

Last strip of the post-trigger window, inclusive.

Parameters
reacReaction strip index.

Definition at line 82 of file StripSumScatter.cpp.

Referenced by Condition(), and PlaneXY().

◆ YLoOf()

Int_t StripSumScatter::YLoOf ( Int_t reac)
static

First strip of the post-trigger window summed onto y.

Parameters
reacReaction strip index.
Returns
The strip index, inclusive, per the POST_TRIGGER_SUM_STRIPS / POST_WINDOW_LAST_STRIP rule.

Definition at line 80 of file StripSumScatter.cpp.

Referenced by PlaneXY().


The documentation for this class was generated from the following files: