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

On-disk home of the per-strip (a,n) and (a,a') region cuts. More...

Functions

TString Dir ()
 Directory holding the region cut files.
TString Path (const char *name, Int_t reac)
 Path to one cut's file.
void Save (Int_t reac, TCutG *cut_an, TCutG *cut_aa, Double_t n_an_assigned=-1.0)
 Write a strip's two region cuts.
TCutG * Load (const char *name, Int_t reac)
 Load a cut, from either storage generation.
TCutG * LoadDrawn (const char *name, Int_t reac)
 Load only a hand-drawn cut, never a fitted one.
Double_t LoadAssigned (const char *name, Int_t reac)
 The attributed count stored with a cut.
void SaveFit (Int_t reac, const RegionFit &fit)
 Store the fitted components beside the (a,n) cut.
Bool_t LoadFit (Int_t reac, RegionFit &fit)
 Read back a stored fit.

Detailed Description

On-disk home of the per-strip (a,n) and (a,a') region cuts.

Shared by strip-sum-scatter, which draws or loads them, and compute-regions, which fits them — so the two tools can never disagree about where a cut lives.

One cut per file, written RECREATE. Saving one strip's region therefore cannot touch another's, and never touches the scatter cache: cuts are applied at read time, so a new cut is picked up on the next read with no cache rebuild.

Function Documentation

◆ Dir()

TString RegionCutStore::Dir ( )

Directory holding the region cut files.

Definition at line 25 of file RegionCuts.cpp.

Referenced by Path(), and Save().

◆ Load()

TCutG * RegionCutStore::Load ( const char * name,
Int_t reac )

Load a cut, from either storage generation.

Tries the per-cut file first, then the pre-split combined RegionCuts.root, so cuts drawn before the split keep working until they are next replaced.

Parameters
nameCut name.
reacReaction strip index.
Returns
The cut, or null if neither file holds one. The caller owns it.

Definition at line 158 of file RegionCuts.cpp.

◆ LoadAssigned()

Double_t RegionCutStore::LoadAssigned ( const char * name,
Int_t reac )

The attributed count stored with a cut.

Parameters
nameCut name.
reacReaction strip index.
Returns
The count, or -1 when the cut carries none.

Definition at line 127 of file RegionCuts.cpp.

◆ LoadDrawn()

TCutG * RegionCutStore::LoadDrawn ( const char * name,
Int_t reac )

Load only a hand-drawn cut, never a fitted one.

Sources are interactive strip-sum-scatter and the pre-split RegionCuts.root. Used where a measurement must rest on a human's judgement rather than on the mixture fit — the tag efficiency bootstrap, for instance.

Parameters
nameCut name.
reacReaction strip index.
Returns
The cut, or null. The caller owns it.

Definition at line 168 of file RegionCuts.cpp.

◆ LoadFit()

Bool_t RegionCutStore::LoadFit ( Int_t reac,
RegionFit & fit )

Read back a stored fit.

Parameters
reacReaction strip index.
[out]fitSet on success; untouched otherwise.
Returns
kFALSE when the store holds no fit for that strip.

Definition at line 97 of file RegionCuts.cpp.

◆ Path()

TString RegionCutStore::Path ( const char * name,
Int_t reac )

Path to one cut's file.

Parameters
nameCut name, e.g. the (a,n) or (a,a') label.
reacReaction strip index.

Definition at line 27 of file RegionCuts.cpp.

Referenced by Load(), LoadAssigned(), LoadDrawn(), LoadFit(), and SaveFit().

◆ Save()

void RegionCutStore::Save ( Int_t reac,
TCutG * cut_an,
TCutG * cut_aa,
Double_t n_an_assigned = -1.0 )

Write a strip's two region cuts.

Parameters
reacReaction strip index.
cut_anThe (a,n) region.
cut_aaThe (a,a') region.
n_an_assignedEvents the fit attributed to the reaction component. When >= 0 this is stored beside the (a,n) cut, for the cross section to prefer over a geometric count of the region. Hand-drawn cuts have none, hence the -1 default.

Definition at line 55 of file RegionCuts.cpp.

Referenced by main().

◆ SaveFit()

void RegionCutStore::SaveFit ( Int_t reac,
const RegionFit & fit )

Store the fitted components beside the (a,n) cut.

Kept so a later step can weight events by the mixture's own posterior rather than by a geometric cut.

Parameters
reacReaction strip index.
fitFit to store.

Definition at line 80 of file RegionCuts.cpp.

Referenced by main().