Jpp - 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 715 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 724 of file JFitK40.hh.

724  :
725  JFitK40_t<>(f2),
726  TF1("f1",
728  f2.GetXmin(), f2.GetXmax(),
729  getNumberOfModelParameters())
730  {
731  this->SetParameters(f2.GetParameters());
732 
733  for (size_t i = 0; i != JFitK40_t<>::getNumberOfModelParameters() - NUMBER_OF_PMTS * sizeof(JPMTParameters_t) / sizeof(Double_t); ++i) {
734  fixParameter(*this, JFitParameter_t(i, this->getModelParameter(i)));
735  }
736 
737  for (int pmt = 0; pmt != NUMBER_OF_PMTS; ++pmt) {
738 
739  fixParameter(*this, this->getModelParameter(pmt, &JPMTParameters_t::QE));
740  fixParameter(*this, this->getModelParameter(pmt, &JPMTParameters_t::TTS));
741 
742  if (isParameterFixed(f2, f2.getModelParameter(pmt, &JPMTParameters_t::t0))) {
743  fixParameter(*this, f2.getModelParameter(pmt, &JPMTParameters_t::t0));
744  }
745  }
746  }
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 756 of file JFitK40.hh.

757  {
758  const int ix = (int) x[0];
759 
760  getInstance().setModelParameters(data);
761 
762  const pair_type& pair = getInstance().getPair(ix);
763 
764  return getInstance().getTimeOffset(pair);
765  }
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 774 of file JFitK40.hh.

775  {
776  for (int pmt = 0; pmt != NUMBER_OF_PMTS; ++pmt) {
777 
778  if (disable[pmt]) {
779  fixParameter(*this, this->getModelParameter(pmt, &JPMTParameters_t::t0));
780  }
781  }
782 
783  if (index_of_average_t0 != -1) {
784 
785  this->setT0(index_of_average_t0, 0.0);
786 
787  fixParameter(*this, this->getModelParameter(index_of_average_t0, &JPMTParameters_t::t0));
788  }
789 
790  this->SetParameters(this->getModelParameters());
791 
792  getInstance() = *this;
793 
794  const TFitResultPtr result = h1.Fit(this, option.c_str());
795 
796  this->setModelParameters(this->GetParameters());
797 
798  return result;
799  }
Double_t t0
time offset [ns]
Definition: JFitK40.hh:59
then for HISTOGRAM in h0 h1
Definition: JMatrixNZ.sh:69
T & getInstance(const T &object)
Get static instance from temporary object.
Definition: JObject.hh:75
return result
Definition: JPolint.hh:727
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: