Jpp  18.0.1-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
JCALIBRATE::JFitK40_t< TF1 > Struct Template Reference

Template specialisation of two-fold coincidence rate due to K40 and other radioactive decays. More...

#include <JFitK40.hh>

Inheritance diagram for JCALIBRATE::JFitK40_t< TF1 >:
JCALIBRATE::JFitK40_t<>

Public Member Functions

 JFitK40_t (const JFitK40_t< TF2 > &f2)
 Constructor. More...
 
TFitResultPtr operator() (TH1 &h1, const std::string &option)
 Fit 1D-histogram. More...
 

Static Public Member Functions

static Double_t getTimeOffset (const Double_t *x, const Double_t *data)
 Get time offset as a function of the fit parameters. More...
 

Detailed Description

template<>
struct JCALIBRATE::JFitK40_t< TF1 >

Template specialisation of two-fold coincidence rate due to K40 and other radioactive decays.

Note that for use in ROOT fit operations, the member method JFitK40_t::getTimeOffset is static.

Definition at line 716 of file JFitK40.hh.

Constructor & Destructor Documentation

JCALIBRATE::JFitK40_t< TF1 >::JFitK40_t ( const JFitK40_t< TF2 > &  f2)
inline

Constructor.

Parameters
f22D-fit function

Definition at line 725 of file JFitK40.hh.

725  :
726  JFitK40_t<>(f2),
727  TF1("f1",
729  f2.GetXmin(), f2.GetXmax(),
730  getNumberOfModelParameters())
731  {
732  this->SetParameters(f2.GetParameters());
733 
734  for (size_t i = 0; i != JFitK40_t<>::getNumberOfModelParameters() - NUMBER_OF_PMTS * sizeof(JPMTParameters_t) / sizeof(Double_t); ++i) {
735  fixParameter(*this, JFitParameter_t(i, this->getModelParameter(i)));
736  }
737 
738  for (int pmt = 0; pmt != NUMBER_OF_PMTS; ++pmt) {
739 
740  fixParameter(*this, this->getModelParameter(pmt, &JPMTParameters_t::QE));
741  fixParameter(*this, this->getModelParameter(pmt, &JPMTParameters_t::TTS));
742 
743  if (isParameterFixed(f2, f2.getModelParameter(pmt, &JPMTParameters_t::t0))) {
744  fixParameter(*this, f2.getModelParameter(pmt, &JPMTParameters_t::t0));
745  }
746  }
747  }
Double_t TTS
transition-time spread [ns]
Definition: JFitK40.hh:58
Double_t t0
time offset [ns]
Definition: JFitK40.hh:59
Double_t QE
quantum efficiency [unit]
Definition: JFitK40.hh:57
bool isParameterFixed(const TF1 &f1, const Int_t index)
Check if fit parameter is fixed.
Fit parameters for single PMT.
Definition: JFitK40.hh:46
bool fixParameter(TF1 &f1, const JFitParameter_t &parameter)
Fix fit parameter.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
Definition: JDAQ.hh:26

Member Function Documentation

static Double_t JCALIBRATE::JFitK40_t< TF1 >::getTimeOffset ( const Double_t *  x,
const Double_t *  data 
)
inlinestatic

Get time offset as a function of the fit parameters.

Parameters
xpointer to data
datapointer to parameter values
Returns
time offset [ns]

Definition at line 757 of file JFitK40.hh.

758  {
759  const int ix = (int) x[0];
760 
761  getInstance().setModelParameters(data);
762 
763  const pair_type& pair = getInstance().getPair(ix);
764 
765  return getInstance().getTimeOffset(pair);
766  }
T & getInstance(const T &object)
Get static instance from temporary object.
Definition: JObject.hh:75
TFitResultPtr JCALIBRATE::JFitK40_t< TF1 >::operator() ( TH1 &  h1,
const std::string option 
)
inline

Fit 1D-histogram.

Parameters
h1ROOT histogram
optionfit option

Definition at line 775 of file JFitK40.hh.

776  {
777  for (int pmt = 0; pmt != NUMBER_OF_PMTS; ++pmt) {
778 
779  if (disable[pmt]) {
780  fixParameter(*this, this->getModelParameter(pmt, &JPMTParameters_t::t0));
781  }
782  }
783 
784  if (index_of_average_t0 != -1) {
785 
786  this->setT0(index_of_average_t0, 0.0);
787 
788  fixParameter(*this, this->getModelParameter(index_of_average_t0, &JPMTParameters_t::t0));
789  }
790 
791  this->SetParameters(this->getModelParameters());
792 
793  getInstance() = *this;
794 
795  const TFitResultPtr result = h1.Fit(this, option.c_str());
796 
797  this->setModelParameters(this->GetParameters());
798 
799  return result;
800  }
Double_t t0
time offset [ns]
Definition: JFitK40.hh:59
T & getInstance(const T &object)
Get static instance from temporary object.
Definition: JObject.hh:75
bool fixParameter(TF1 &f1, const JFitParameter_t &parameter)
Fix fit parameter.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
Definition: JDAQ.hh:26

The documentation for this struct was generated from the following file: