musrfit 1.10.0
PSectorChisq Class Reference

#include <PFitter.h>

Public Member Functions

 PSectorChisq (UInt_t noOfRuns)
 
void SetRunFirstTime (Double_t first, UInt_t idx)
 
void SetSectorTime (Double_t last)
 
void SetChisq (Double_t chisq)
 
void SetChisq (Double_t chisq, UInt_t idx)
 
void SetExpectedChisq (Double_t expChisq)
 
void SetExpectedChisq (Double_t chisq, UInt_t idx)
 
void SetNDF (UInt_t ndf)
 
void SetNDF (UInt_t ndf, UInt_t idx)
 
Double_t GetTimeRangeFirst (UInt_t idx)
 
Double_t GetTimeRangeLast ()
 
Double_t GetChisq ()
 
Double_t GetChisq (UInt_t idx)
 
Double_t GetExpectedChisq ()
 
Double_t GetExpectedChisq (UInt_t idx)
 
UInt_t GetNDF ()
 
UInt_t GetNDF (UInt_t idx)
 
UInt_t GetNoRuns ()
 

Private Attributes

UInt_t fNoOfRuns
 number of runs presesent
 
Double_t fLast
 requested time stamp
 
Double_t fChisq
 chisq or maxLH for the sector
 
Double_t fExpectedChisq
 keep the expected chisq or maxLH for the sector
 
UInt_t fNDF
 NDF for the sector.
 
PDoubleVector fFirst
 time stamp for fgb for a given run
 
PDoubleVector fChisqRun
 chisq or maxLH for the sector and run
 
PDoubleVector fExpectedChisqRun
 expected chisq or maxLH for the sector and run
 
PUIntVector fNDFRun
 NDF for the sector and run.
 

Detailed Description

Container for sector χ² (or max likelihood) analysis results.

The SECTOR command analyzes how χ² changes as the fit range is extended from the first good bin (fgb) to progressively later times. This helps identify:

  • Optimal fitting windows
  • Time regions with systematic deviations
  • Data quality issues
  • Relaxation component contributions

A "sector" is a time window [fgb, fLast] where fLast < lgb. The class stores χ²/maxLH and NDF for each sector, both for the total fit and for individual runs.

Use case: If early-time data shows poor χ², the sector analysis reveals whether to adjust t0, fgb, or background estimation.

Definition at line 123 of file PFitter.h.

Constructor & Destructor Documentation

◆ PSectorChisq()

PSectorChisq::PSectorChisq ( UInt_t noOfRuns)

Constructor.

Parameters
noOfRunsNumber of runs in the fit (allocates storage for per-run statistics)

Constructor.

Definition at line 81 of file PFitter.cpp.

References fChisq, fChisqRun, fExpectedChisq, fExpectedChisqRun, fFirst, fLast, fNDF, fNDFRun, and fNoOfRuns.

Member Function Documentation

◆ GetChisq() [1/2]

Double_t PSectorChisq::GetChisq ( )
inline

Returns the total χ² for this sector

Returns
Chi-squared or max likelihood value

Definition at line 180 of file PFitter.h.

References fChisq.

◆ GetChisq() [2/2]

Double_t PSectorChisq::GetChisq ( UInt_t idx)

Returns the χ² for a specific run

Parameters
idxRun index
Returns
Chi-squared value

Get chisq/maxLH of the run with index idx

Parameters
idxindex of the run

return: chisq/maxLH of the requested run or -1.0 if the idx is out-of-range.

Definition at line 213 of file PFitter.cpp.

References fChisqRun, and fNoOfRuns.

◆ GetExpectedChisq() [1/2]

Double_t PSectorChisq::GetExpectedChisq ( )
inline

Returns the expected total χ²

Returns
Expected chi-squared value

Definition at line 189 of file PFitter.h.

References fExpectedChisq.

◆ GetExpectedChisq() [2/2]

Double_t PSectorChisq::GetExpectedChisq ( UInt_t idx)

Returns the expected χ² for a specific run

Parameters
idxRun index
Returns
Expected chi-squared value

Get expected chisq/maxLH of the run with index idx

Parameters
idxindex of the run

return: chisq/maxLH of the requested run or -1.0 if the idx is out-of-range.

Definition at line 231 of file PFitter.cpp.

References fExpectedChisqRun, and fNoOfRuns.

◆ GetNDF() [1/2]

UInt_t PSectorChisq::GetNDF ( )
inline

Returns the total NDF for this sector

Returns
Degrees of freedom

Definition at line 198 of file PFitter.h.

References fNDF.

◆ GetNDF() [2/2]

UInt_t PSectorChisq::GetNDF ( UInt_t idx)

Returns the NDF for a specific run

Parameters
idxRun index
Returns
Degrees of freedom

Get NDF of the run with index idx

Parameters
idxindex of the run

return: NDF of the requested run or 0.0 if the idx is out-of-range.

Definition at line 249 of file PFitter.cpp.

References fNDFRun, and fNoOfRuns.

◆ GetNoRuns()

UInt_t PSectorChisq::GetNoRuns ( )
inline

Returns the number of runs

Returns
Number of runs in the analysis

Definition at line 207 of file PFitter.h.

References fNoOfRuns.

◆ GetTimeRangeFirst()

Double_t PSectorChisq::GetTimeRangeFirst ( UInt_t idx)

Gets the first good bin time for a specific run

Parameters
idxRun index
Returns
First good bin time in microseconds

Get the fgb time of RUN with index idx. If idx is out-of-range PMUSR_UNDEFINED is returned.

Parameters
idxindex of the RUN

return: return the fgb time of RUN with index idx.

Definition at line 195 of file PFitter.cpp.

References fFirst, fNoOfRuns, and PMUSR_UNDEFINED.

◆ GetTimeRangeLast()

Double_t PSectorChisq::GetTimeRangeLast ( )
inline

Returns the sector end time

Returns
Last bin time in microseconds

Definition at line 176 of file PFitter.h.

References fLast.

◆ SetChisq() [1/2]

void PSectorChisq::SetChisq ( Double_t chisq)
inline

Sets the total χ² (or max likelihood) for this sector

Parameters
chisqChi-squared or maximum likelihood value

Definition at line 144 of file PFitter.h.

References fChisq.

◆ SetChisq() [2/2]

void PSectorChisq::SetChisq ( Double_t chisq,
UInt_t idx )

Sets the χ² for a specific run in this sector

Parameters
chisqChi-squared value for run
idxRun index

Set the chisq/maxLH for a given detector with index idx.

Parameters
chisqchisq/maxLH to be set
idxindex of the run to be set

Definition at line 130 of file PFitter.cpp.

References fChisqRun, and fNoOfRuns.

◆ SetExpectedChisq() [1/2]

void PSectorChisq::SetExpectedChisq ( Double_t chisq,
UInt_t idx )

Sets the expected χ² for a specific run

Parameters
chisqExpected chi-squared value
idxRun index

Set the expected chisq/maxLH for a given detector with index idx.

Parameters
chisqexpected chisq/maxLH to be set
idxindex of the run to be set

Definition at line 151 of file PFitter.cpp.

References fExpectedChisqRun, and fNoOfRuns.

◆ SetExpectedChisq() [2/2]

void PSectorChisq::SetExpectedChisq ( Double_t expChisq)
inline

Sets the expected total χ² for this sector

Parameters
expChisqExpected chi-squared value

Definition at line 153 of file PFitter.h.

References fExpectedChisq.

◆ SetNDF() [1/2]

void PSectorChisq::SetNDF ( UInt_t ndf)
inline

Sets the total number of degrees of freedom for this sector

Parameters
ndfDegrees of freedom

Definition at line 162 of file PFitter.h.

References fNDF.

◆ SetNDF() [2/2]

void PSectorChisq::SetNDF ( UInt_t ndf,
UInt_t idx )

Sets the NDF for a specific run

Parameters
ndfDegrees of freedom for run
idxRun index

Set the NDF for a given detector with index idx.

Parameters
ndfto be set
idxindex of the run to be set

Definition at line 172 of file PFitter.cpp.

References fNDFRun, and fNoOfRuns.

◆ SetRunFirstTime()

void PSectorChisq::SetRunFirstTime ( Double_t first,
UInt_t idx )

Sets the first good bin time for a specific run

Parameters
firstFirst good bin time in microseconds
idxRun index

Set the time of the fgb of a given RUN

Parameters
firsttime stamp of the fgb
idxindex of the RUN

Definition at line 109 of file PFitter.cpp.

References fFirst, and fNoOfRuns.

Referenced by PFitter::CheckCommands().

◆ SetSectorTime()

void PSectorChisq::SetSectorTime ( Double_t last)
inline

Sets the sector end time (last bin included in this sector)

Parameters
lastSector end time in microseconds

Definition at line 140 of file PFitter.h.

References fLast.

Referenced by PFitter::CheckCommands().

Member Data Documentation

◆ fChisq

Double_t PSectorChisq::fChisq
private

chisq or maxLH for the sector

Definition at line 212 of file PFitter.h.

Referenced by GetChisq(), PSectorChisq(), and SetChisq().

◆ fChisqRun

PDoubleVector PSectorChisq::fChisqRun
private

chisq or maxLH for the sector and run

Definition at line 216 of file PFitter.h.

Referenced by GetChisq(), PSectorChisq(), and SetChisq().

◆ fExpectedChisq

Double_t PSectorChisq::fExpectedChisq
private

keep the expected chisq or maxLH for the sector

Definition at line 213 of file PFitter.h.

Referenced by GetExpectedChisq(), PSectorChisq(), and SetExpectedChisq().

◆ fExpectedChisqRun

PDoubleVector PSectorChisq::fExpectedChisqRun
private

expected chisq or maxLH for the sector and run

Definition at line 217 of file PFitter.h.

Referenced by GetExpectedChisq(), PSectorChisq(), and SetExpectedChisq().

◆ fFirst

PDoubleVector PSectorChisq::fFirst
private

time stamp for fgb for a given run

Definition at line 215 of file PFitter.h.

Referenced by GetTimeRangeFirst(), PSectorChisq(), and SetRunFirstTime().

◆ fLast

Double_t PSectorChisq::fLast
private

requested time stamp

Definition at line 211 of file PFitter.h.

Referenced by GetTimeRangeLast(), PSectorChisq(), and SetSectorTime().

◆ fNDF

UInt_t PSectorChisq::fNDF
private

NDF for the sector.

Definition at line 214 of file PFitter.h.

Referenced by GetNDF(), PSectorChisq(), and SetNDF().

◆ fNDFRun

PUIntVector PSectorChisq::fNDFRun
private

NDF for the sector and run.

Definition at line 218 of file PFitter.h.

Referenced by GetNDF(), PSectorChisq(), and SetNDF().

◆ fNoOfRuns

UInt_t PSectorChisq::fNoOfRuns
private

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