Jpp
JFitK40.hh
Go to the documentation of this file.
1 #ifndef __JCALIBRATE_JFITK40__
2 #define __JCALIBRATE_JFITK40__
3 
4 #include "TMath.h"
5 #include "TString.h"
6 #include "TF2.h"
7 #include "TH2.h"
8 #include "TFitResult.h"
9 
11 #include "JROOT/JRootToolkit.hh"
12 #include "JDetector/JModule.hh"
13 #include "JMath/JMathToolkit.hh"
14 #include "JLang/JException.hh"
16 
17 
18 /**
19  * \author mdejong
20  */
21 
22 namespace JCALIBRATE {}
23 namespace JPP { using namespace JCALIBRATE; }
24 
25 namespace JCALIBRATE {
26 
30  using JDETECTOR::JModule;
31 
32 
33  static const double FITK40_QE_MIN = 0.0; //!< Minimal quantum efficiency [unit]
34  static const double FITK40_QE_MAX = 10.0; //!< Maximal quantum efficiency [unit]
35  static const double FITK40_TTS_MIN_NS = 0.0; //!< Minimal transition-time spread [ns]
36  static const double FITK40_TTS_MAX_NS = 3.5; //!< Maximal transition-time spread [ns]
37 
38 
39  /**
40  * Fit parameters for single PMT.
41  */
43  /**
44  * Default constructor.
45  */
47  QE (1.0),
48  TTS(2.0),
49  t0 (0.0)
50  {}
51 
52 
53  Double_t QE; //!< quantum efficiency [unit]
54  Double_t TTS; //!< transition-time spread [ns]
55  Double_t t0; //!< time offset [ns]
56  };
57 
58 
59  /**
60  * Fit parameters for two-fold coincidence rate due to K40.
61  */
63  /**
64  * Default constructor.
65  *
66  * The default parameter values are set to those obtained from a designated simulation
67  * of K40 decays (see http://wiki.km3net.de/index.php/OMGsim_simulations_for_K40_fit).\n
68  * If you change these values, you may also want to change the corresponding values in JK40DefaultSimulator.hh.
69  */
71  Rate_Hz(16.304), // [Hz]
72  p1 ( 2.85261),
73  p2 (-0.949097),
74  p3 ( 0.182419),
75  p4 ( 1.23075),
76  bg ( 1.0e-3),
77  cc ( 1.0e-3)
78  {}
79 
80 
81  /**
82  * Copy constructor.
83  *
84  * \param data data
85  */
86  JFitK40Parameters(const Double_t* data)
87  {
88  if (data != NULL) {
89  setModelParameters(data);
90  }
91  }
92 
93 
94  /**
95  * Get number of model parameters.
96  *
97  * \return number of parameters
98  */
100  {
101  return sizeof(JFitK40Parameters) / sizeof(Double_t);
102  }
103 
104 
105  /**
106  * Get model parameters.
107  *
108  * \return pointer to parameters
109  */
110  const Double_t* getModelParameters() const
111  {
112  return &Rate_Hz;
113  }
114 
115 
116  /**
117  * Get model parameters.
118  *
119  * \return pointer to parameters
120  */
121  Double_t* getModelParameters()
122  {
123  return &Rate_Hz;
124  }
125 
126 
127  /**
128  * Set model parameters.
129  *
130  * \param data pointer to parameters
131  */
132  void setModelParameters(const Double_t* data)
133  {
134  for (Int_t i = 0; i != getNumberOfModelParameters(); ++i) {
135  getModelParameters()[i] = data[i];
136  }
137  }
138 
139 
140  /**
141  * Get model parameter.
142  *
143  * \param i parameter index
144  * \return parameter value
145  */
146  Double_t getModelParameter(Int_t i) const
147  {
148  return getModelParameters()[i];
149  }
150 
151 
152  /**
153  * Get model parameter.
154  *
155  * \param p pointer to data member
156  * \return parameter index and value
157  */
159  {
160  const Int_t i = &(this->*p) - getModelParameters();
161 
162  return JFitParameter_t(i, getModelParameter(i));
163  }
164 
165 
166  /**
167  * Get model parameter.
168  *
169  * \param pmt PMT number
170  * \param p pointer to data member of PMT parameters
171  * \return parameter index and value
172  */
173  JFitParameter_t getModelParameter(Int_t pmt, Double_t JPMTParameters_t::*p) const
174  {
175  const Int_t i = &(parameters[pmt].*p) - getModelParameters();
176 
177  return JFitParameter_t(i, getModelParameter(i));
178  }
179 
180 
181  /**
182  * Get QE of given PMT.
183  *
184  * \param pmt pmt address
185  * \return QE
186  */
187  Double_t getQE(const int pmt) const
188  {
189  return parameters[pmt].QE;
190  }
191 
192 
193  /**
194  * Set QE of given PMT.
195  *
196  * \param pmt pmt address
197  * \param QE QE
198  */
199  void setQE(const int pmt, const Double_t QE)
200  {
201  parameters[pmt].QE = QE;
202  }
203 
204 
205  /**
206  * Get time resolution of given PMT.
207  *
208  * \param pmt pmt address
209  * \return TTS [ns]
210  */
211  Double_t getTTS(const int pmt) const
212  {
213  return parameters[pmt].TTS;
214  }
215 
216 
217  /**
218  * Set time resolution of given PMT.
219  *
220  * \param pmt pmt address
221  * \param TTS TTS [ns]
222  */
223  void setTTS(const int pmt, const Double_t TTS)
224  {
225  parameters[pmt].TTS = TTS;
226  }
227 
228 
229  /**
230  * Get time offset of given PMT.
231  * Note that the time offset of each PMT is corrected by
232  * the average time offset of all PMTs.
233  *
234  * \param pmt pmt address
235  * \return time offset [ns]
236  */
237  Double_t getT0(const int pmt) const
238  {
239  return parameters[pmt].t0;
240  }
241 
242 
243  /**
244  * Set time offset of given PMT.
245  *
246  * \param pmt pmt address
247  * \param t0 time offset [ns]
248  */
249  void setT0(const int pmt, const Double_t t0)
250  {
251  parameters[pmt].t0 = t0;
252  }
253 
254 
255  /**
256  * Get K40 coincidence rate as a function of cosine angle between PMT axes.
257  *
258  * \param ct cosine angle between PMT axes
259  * \return rate [Hz]
260  */
261  Double_t getValue(const Double_t ct) const
262  {
263  return Rate_Hz * TMath::Exp(-(p1+p2+p3+p4)) * TMath::Exp(ct*(p1+ct*(p2+ct*(p3+ct*p4))));
264  }
265 
266 
267  // fit parameters
268 
269  Double_t Rate_Hz; //!< maximal coincidence rate [Hz]
270  Double_t p1; //!< angle dependence coincidence rate
271  Double_t p2; //!< angle dependence coincidence rate
272  Double_t p3; //!< angle dependence coincidence rate
273  Double_t p4; //!< angle dependence coincidence rate
274  Double_t bg; //!< remaining constant background
275  Double_t cc; //!< fraction of signal correlated background
276 
278  };
279 
280 
281  /**
282  * Parametrisation of two-fold coincidence rate due to K40 and other radioactive decays.
283  *
284  * Note that for use in ROOT fit operations, the member method JFitK40::getRate is static.\n
285  */
286  struct JFitK40 :
287  public JFitK40Parameters,
288  public TF2,
289  public JModule,
290  public JCombinatorics
291  {
293 
294  /**
295  * Data structure for a pair of addresses.
296  */
298 
299 
300  /**
301  * Constructor.
302  *
303  * \param module detector module
304  * \param xmin minimal x
305  * \param xmax maximal x
306  * \param ymin minimal y
307  * \param ymax maximal y
308  * \param option true = fix average t0; false = free average t0
309  */
310  JFitK40(const JModule& module,
311  const Double_t xmin,
312  const Double_t xmax,
313  const Double_t ymin,
314  const Double_t ymax,
315  const bool option) :
316 
317  TF2("fitk40",
318  JFitK40::getRate,
319  xmin, xmax, ymin, ymax,
321 
322  sigmaK40_ns(0.54)
323  {
324  static_cast<JModule&>(*this) = module;
325 
326  this->configure(module.size());
327 
328  this->sort(JPairwiseComparator(module));
329 
330  index_of_average_t0 = (option ? 0 : -1);
331 
332  for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
333  disable[i] = false;
334  }
335  }
336 
337 
338  /**
339  * Get intrinsic K40 arrival time spread.
340  *
341  * \return sigma [ns]
342  */
343  Double_t getSigmaK40() const
344  {
345  return this->sigmaK40_ns;
346  }
347 
348 
349  /**
350  * Set intrinsic K40 arrival time spread.
351  *
352  * \param sigma sigma [ns]
353  */
354  void setSigmaK40(const Double_t sigma)
355  {
356  this->sigmaK40_ns = sigma;
357  }
358 
359 
360  /**
361  * Test PMT status.
362  *
363  * \param pmt pmt address
364  * \return true if given pmt is disabled; else false
365  */
366  bool is_disabled(int pmt) const
367  {
368  return disable[pmt];
369  }
370 
371 
372  /**
373  * Test PMT status.
374  *
375  * \param pmt pmt address
376  * \return true if given pmt is used for average t0; else false
377  */
378  bool is_average_t0(int pmt) const
379  {
380  return pmt == index_of_average_t0;
381  }
382 
383 
384  /**
385  * Get time offset of given PMT.
386  *
387  * Note that if the average time offset is constraint,
388  * the time offset of each PMT is corrected by the average time offset of all PMTs.
389  *
390  * \param pmt pmt address
391  * \return time offset [ns]
392  */
393  Double_t getT0(const int pmt) const
394  {
395  if (index_of_average_t0 == -1) {
396 
397  return JFitK40Parameters::getT0(pmt);
398 
399  } else {
400 
401  if (disable[pmt]) {
402 
403  return parameters[pmt].t0;
404 
405  } else {
406 
407  Int_t n0 = 0; // number of non-fixed t0's
408  Double_t t0 = 0.0; // average of non-fixed t0's
409 
410  for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
411  if (!disable[i] && i != index_of_average_t0) {
412  n0 += 1;
413  t0 += parameters[i].t0;
414  }
415  }
416 
417  t0 /= (n0 + 1);
418 
419  if (pmt != index_of_average_t0)
420  return parameters[pmt].t0 - t0;
421  else
422  return -t0;
423  }
424  }
425  }
426 
427 
428  /**
429  * Enable PMT.
430  *
431  * \param pmt pmt address
432  */
433  void enablePMT(const int pmt)
434  {
435  disable[pmt] = false;
436  }
437 
438 
439  /**
440  * Disable PMT.
441  *
442  * Note that if the average time offset is constraint to zero,
443  * the corresponding index may change.
444  *
445  * \param pmt pmt address
446  */
447  void disablePMT(const int pmt)
448  {
449  disable[pmt] = true;
450 
451  if (index_of_average_t0 == pmt) {
452 
455  break;
456  }
457  }
458 
460  THROW(JIndexOutOfRange, "JFitK40::disable PMT: No free index for average t0.");
461  }
462  }
463  }
464 
465 
466  /**
467  * Get cosine of space angle between PMT axes.
468  *
469  * \param pair pair of addresses
470  * \return cosine
471  */
472  double getDot(const pair_type& pair) const
473  {
474  return JMATH::getDot(this->getPMT(pair.first),
475  this->getPMT(pair.second));
476  }
477 
478 
479  /**
480  * Get time resolution of given PMT pair.
481  *
482  * \param pair pair of addresses
483  * \return sigma [ns]
484  */
485  Double_t getSigma(const pair_type& pair) const
486  {
487  return TMath::Sqrt(getTTS(pair.first) * getTTS(pair.first) +
488  getTTS(pair.second) * getTTS(pair.second) +
489  getSigmaK40() * getSigmaK40());
490  }
491 
492 
493  /**
494  * Get time offset of given PMT pair.
495  *
496  * \param pair pair of addresses
497  * \return time offset [ns]
498  */
499  Double_t getT0(const pair_type& pair) const
500  {
501  if (index_of_average_t0 == -1) {
502 
503  return parameters[pair.first].t0 - parameters[pair.second].t0;
504 
505  } else {
506 
507  if (pair.first == index_of_average_t0) {
508 
509  return -parameters[pair.second].t0;
510 
511  } else if (pair.second == index_of_average_t0) {
512 
513  return parameters[pair.first].t0;
514 
515  } else {
516 
517  return parameters[pair.first].t0 - parameters[pair.second].t0;
518  }
519  }
520  }
521 
522 
523  /**
524  * Get K40 coincidence rate.
525  *
526  * \param pair pair of addresses
527  * \return rate [Hz]
528  */
529  Double_t getValue(const pair_type& pair) const
530  {
531  const Double_t ct = getDot(pair);
532 
533  return (getValue(ct) *
534  getQE(pair.first) *
535  getQE(pair.second));
536  }
537 
538 
539  /**
540  * Get K40 coincidence rate.
541  *
542  * \param pair pair of addresses
543  * \param dt_ns time difference [ns]
544  * \return rate [Hz/ns]
545  */
546  Double_t getValue(const pair_type& pair, const Double_t dt_ns) const
547  {
548  const Double_t t0 = getT0 (pair);
549  const Double_t sigma = getSigma(pair);
550 
551  return getValue(pair) * TMath::Gaus(dt_ns, t0, sigma, kTRUE);
552  }
553 
554 
555  /**
556  * Fit histogram.
557  *
558  * Note that the PMT parameters which are part of the model are reset before the fit according the status of each PMT and
559  * the obtained fit parameters are copied back to the model parameters after the fit.
560  *
561  * \param h2 ROOT 2D-histogram
562  * \param option fit option
563  */
564  TFitResultPtr operator()(TH2& h2, const std::string& option)
565  {
566  for (int pmt = 0; pmt != NUMBER_OF_PMTS; ++pmt) {
567 
568  parameters[pmt] = JPMTParameters_t();
569 
570  if (disable[pmt]) {
571 
572  parameters[pmt].QE = 0.0;
573 
577 
578  } else {
579 
580  // Note that setting limits to a parameter will also release it
581 
582  if (!isParameterFixed(*this, this->getModelParameter(pmt, &JPMTParameters_t::QE))) {
584  }
585  if (!isParameterFixed(*this, this->getModelParameter(pmt, &JPMTParameters_t::TTS))) {
587  }
588  if (!isParameterFixed(*this, this->getModelParameter(pmt, &JPMTParameters_t::t0))) {
589  setParLimits(*this, this->getModelParameter(pmt, &JPMTParameters_t::t0), h2.GetYaxis()->GetXmin(), h2.GetYaxis()->GetXmax());
590  }
591  }
592  }
593 
594  if (index_of_average_t0 != -1) {
595 
596  this->setT0(index_of_average_t0, 0.0);
597 
599  }
600 
601  this->SetParameters(this->getModelParameters());
602 
603  getInstance() = *this;
604 
605  const TFitResultPtr result = h2.Fit(this, option.c_str());
606 
607  this->setModelParameters(this->GetParameters());
608 
609  return result;
610  }
611 
612 
613  /**
614  * Get K40 coincidence rate as a function of the fit parameters.
615  *
616  * To speed up the calculation, it is assumed that the parameter values do not
617  * change unless also the x[0] value changes (i.e. the index of the PMT pair).
618  *
619  * \param x pointer to data
620  * \param data pointer to parameter values
621  * \return rate [Hz/ns]
622  */
623  static Double_t getRate(const Double_t* x, const Double_t* data)
624  {
625  static int id = -1;
626  static Double_t t0;
627  static Double_t sigma;
628  static Double_t rate;
629 
630  const int ix = (int) x[0];
631  const Double_t dt_ns = x[1];
632 
633  if (ix != id) {
634 
636 
637  const pair_type& pair = getInstance().getPair(ix);
638 
639  t0 = getInstance().getT0 (pair);
640  sigma = getInstance().getSigma(pair);
641  rate = getInstance().getValue(pair);
642  id = ix;
643  }
644 
645  return getInstance().bg + rate * (getInstance().cc + TMath::Gaus(dt_ns, t0, sigma, kTRUE));
646  }
647 
648  private:
649 
650  Double_t sigmaK40_ns; //!< intrinsic K40 arrival time spread [ns]
651  int index_of_average_t0; //!< index of t0 used for average time offset
652  bool disable[NUMBER_OF_PMTS]; //!< disable PMT from fit
653 
654  /**
655  * Default constructor.
656  */
658  {}
659 
660 
661  /**
662  * Get unique instance of fit object.
663  *
664  * \return reference to fit object.
665  */
667  {
668  static JFitK40 object;
669 
670  return object;
671  }
672  };
673 }
674 
675 #endif
JException.hh
JModule.hh
JCALIBRATE::JPMTParameters_t::QE
Double_t QE
quantum efficiency [unit]
Definition: JFitK40.hh:53
JCALIBRATE::JFitK40::getDot
double getDot(const pair_type &pair) const
Get cosine of space angle between PMT axes.
Definition: JFitK40.hh:472
JDAQ.hh
JCALIBRATE::JFitK40Parameters::JFitK40Parameters
JFitK40Parameters(const Double_t *data)
Copy constructor.
Definition: JFitK40.hh:86
JLANG::JIndexOutOfRange
Exception for accessing an index in a collection that is outside of its range.
Definition: JException.hh:90
JCALIBRATE::JFitK40::JFitK40
JFitK40()
Default constructor.
Definition: JFitK40.hh:657
JCALIBRATE::JFitK40::getRate
static Double_t getRate(const Double_t *x, const Double_t *data)
Get K40 coincidence rate as a function of the fit parameters.
Definition: JFitK40.hh:623
JCALIBRATE::JFitK40Parameters::bg
Double_t bg
remaining constant background
Definition: JFitK40.hh:274
JROOT::isParameterFixed
bool isParameterFixed(TF1 &f1, const Int_t index)
Check if fit parameter is fixed.
Definition: JRootToolkit.hh:319
JCALIBRATE::JFitK40Parameters::p2
Double_t p2
angle dependence coincidence rate
Definition: JFitK40.hh:271
JCALIBRATE::JFitK40::disable
bool disable[NUMBER_OF_PMTS]
disable PMT from fit
Definition: JFitK40.hh:652
JCALIBRATE::JFitK40Parameters::getModelParameter
JFitParameter_t getModelParameter(Double_t JFitK40Parameters::*p) const
Get model parameter.
Definition: JFitK40.hh:158
JCALIBRATE::JFitK40Parameters::setT0
void setT0(const int pmt, const Double_t t0)
Set time offset of given PMT.
Definition: JFitK40.hh:249
JCALIBRATE::JFitK40::pair_type
JCombinatorics::pair_type pair_type
Data structure for a pair of addresses.
Definition: JFitK40.hh:297
JCALIBRATE::JFitK40::operator()
TFitResultPtr operator()(TH2 &h2, const std::string &option)
Fit histogram.
Definition: JFitK40.hh:564
JTOOLS::JCombinatorics::configure
void configure(const int numberOfIndices)
Configure.
Definition: JCombinatorics.hh:54
JCALIBRATE
Definition: JCalibrateK40.hh:15
JCALIBRATE::JFitK40::getSigma
Double_t getSigma(const pair_type &pair) const
Get time resolution of given PMT pair.
Definition: JFitK40.hh:485
JCALIBRATE::FITK40_QE_MAX
static const double FITK40_QE_MAX
Maximal quantum efficiency [unit].
Definition: JFitK40.hh:34
JCALIBRATE::JFitK40Parameters::setModelParameters
void setModelParameters(const Double_t *data)
Set model parameters.
Definition: JFitK40.hh:132
JCALIBRATE::JFitK40Parameters::getQE
Double_t getQE(const int pmt) const
Get QE of given PMT.
Definition: JFitK40.hh:187
KM3NETDAQ::NUMBER_OF_PMTS
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
Definition: JDAQ.hh:26
JCALIBRATE::JFitK40::getT0
Double_t getT0(const pair_type &pair) const
Get time offset of given PMT pair.
Definition: JFitK40.hh:499
JCALIBRATE::JPMTParameters_t::t0
Double_t t0
time offset [ns]
Definition: JFitK40.hh:55
JCALIBRATE::JFitK40::getValue
Double_t getValue(const pair_type &pair) const
Get K40 coincidence rate.
Definition: JFitK40.hh:529
JCALIBRATE::JFitK40Parameters::getModelParameter
Double_t getModelParameter(Int_t i) const
Get model parameter.
Definition: JFitK40.hh:146
JCALIBRATE::JFitK40Parameters::parameters
JPMTParameters_t parameters[NUMBER_OF_PMTS]
Definition: JFitK40.hh:277
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JCALIBRATE::JFitK40Parameters::p3
Double_t p3
angle dependence coincidence rate
Definition: JFitK40.hh:272
JMathToolkit.hh
JCALIBRATE::FITK40_TTS_MAX_NS
static const double FITK40_TTS_MAX_NS
Maximal transition-time spread [ns].
Definition: JFitK40.hh:36
JTOOLS::JCombinatorics::getPair
const pair_type & getPair(const int index) const
Get pair of indices for given index.
Definition: JCombinatorics.hh:120
JCALIBRATE::JFitK40Parameters::getValue
Double_t getValue(const Double_t ct) const
Get K40 coincidence rate as a function of cosine angle between PMT axes.
Definition: JFitK40.hh:261
JDETECTOR::JModule::getPMT
const JPMT & getPMT(const int index) const
Get PMT.
Definition: JModule.hh:173
JCALIBRATE::JPMTParameters_t::TTS
Double_t TTS
transition-time spread [ns]
Definition: JFitK40.hh:54
JCALIBRATE::JFitK40::setSigmaK40
void setSigmaK40(const Double_t sigma)
Set intrinsic K40 arrival time spread.
Definition: JFitK40.hh:354
JTOOLS::result
return result
Definition: JPolint.hh:695
JCALIBRATE::JFitK40Parameters::Rate_Hz
Double_t Rate_Hz
maximal coincidence rate [Hz]
Definition: JFitK40.hh:269
JCALIBRATE::JFitK40::getSigmaK40
Double_t getSigmaK40() const
Get intrinsic K40 arrival time spread.
Definition: JFitK40.hh:343
THROW
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
JRootToolkit.hh
JDETECTOR::JModule
Data structure for a composite optical module.
Definition: JModule.hh:49
JCALIBRATE::JFitK40Parameters::p1
Double_t p1
angle dependence coincidence rate
Definition: JFitK40.hh:270
JCALIBRATE::JFitK40::JFitK40
JFitK40(const JModule &module, const Double_t xmin, const Double_t xmax, const Double_t ymin, const Double_t ymax, const bool option)
Constructor.
Definition: JFitK40.hh:310
JCALIBRATE::JFitK40Parameters::getTTS
Double_t getTTS(const int pmt) const
Get time resolution of given PMT.
Definition: JFitK40.hh:211
JCALIBRATE::JFitK40Parameters::setTTS
void setTTS(const int pmt, const Double_t TTS)
Set time resolution of given PMT.
Definition: JFitK40.hh:223
JCALIBRATE::JFitK40Parameters::getNumberOfModelParameters
static Int_t getNumberOfModelParameters()
Get number of model parameters.
Definition: JFitK40.hh:99
JCALIBRATE::JFitK40::is_disabled
bool is_disabled(int pmt) const
Test PMT status.
Definition: JFitK40.hh:366
std::pair
Definition: JSTDTypes.hh:15
JCALIBRATE::JFitK40
Parametrisation of two-fold coincidence rate due to K40 and other radioactive decays.
Definition: JFitK40.hh:286
JCALIBRATE::JFitK40Parameters::getModelParameters
Double_t * getModelParameters()
Get model parameters.
Definition: JFitK40.hh:121
JCALIBRATE::JPMTParameters_t
Fit parameters for single PMT.
Definition: JFitK40.hh:42
JROOT::setParLimits
bool setParLimits(TF1 &f1, const Int_t index, Double_t xmin, Double_t xmax)
Set fit parameter limits.
Definition: JRootToolkit.hh:293
JTOOLS::JCombinatorics
Auxiliary class to convert pair of indices to unique index and back.
Definition: JCombinatorics.hh:22
JCALIBRATE::JFitK40Parameters
Fit parameters for two-fold coincidence rate due to K40.
Definition: JFitK40.hh:62
JCALIBRATE::JFitK40Parameters::p4
Double_t p4
angle dependence coincidence rate
Definition: JFitK40.hh:273
JCALIBRATE::JFitK40Parameters::getModelParameter
JFitParameter_t getModelParameter(Int_t pmt, Double_t JPMTParameters_t::*p) const
Get model parameter.
Definition: JFitK40.hh:173
JROOT::fixParameter
bool fixParameter(TF1 &f1, const JFitParameter_t &parameter)
Fix fit parameter.
Definition: JRootToolkit.hh:249
JCALIBRATE::JFitK40::getInstance
static JFitK40 & getInstance()
Get unique instance of fit object.
Definition: JFitK40.hh:666
JCALIBRATE::JFitK40Parameters::JFitK40Parameters
JFitK40Parameters()
Default constructor.
Definition: JFitK40.hh:70
JCALIBRATE::JFitK40::index_of_average_t0
int index_of_average_t0
index of t0 used for average time offset
Definition: JFitK40.hh:651
JCALIBRATE::JFitK40::enablePMT
void enablePMT(const int pmt)
Enable PMT.
Definition: JFitK40.hh:433
JCALIBRATE::JFitK40Parameters::getModelParameters
const Double_t * getModelParameters() const
Get model parameters.
Definition: JFitK40.hh:110
JCalibrateK40.hh
JROOT::JFitParameter_t
Auxiliary data structure for a parameter index and its value.
Definition: JRootToolkit.hh:182
JCALIBRATE::JFitK40::is_average_t0
bool is_average_t0(int pmt) const
Test PMT status.
Definition: JFitK40.hh:378
JCALIBRATE::JFitK40::sigmaK40_ns
Double_t sigmaK40_ns
intrinsic K40 arrival time spread [ns]
Definition: JFitK40.hh:650
JCALIBRATE::JPairwiseComparator
Auxiliary class to sort pairs of PMT addresses within optical module.
Definition: JCalibrateK40.hh:45
JCALIBRATE::JFitK40::disablePMT
void disablePMT(const int pmt)
Disable PMT.
Definition: JFitK40.hh:447
JCALIBRATE::JFitK40::getT0
Double_t getT0(const int pmt) const
Get time offset of given PMT.
Definition: JFitK40.hh:393
JCALIBRATE::JFitK40Parameters::setQE
void setQE(const int pmt, const Double_t QE)
Set QE of given PMT.
Definition: JFitK40.hh:199
JCALIBRATE::FITK40_QE_MIN
static const double FITK40_QE_MIN
Minimal quantum efficiency [unit].
Definition: JFitK40.hh:33
JMATH::getDot
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.
Definition: JMathToolkit.hh:131
JTOOLS::JCombinatorics::sort
void sort(JComparator_t comparator)
Sort address pairs.
Definition: JCombinatorics.hh:132
JCALIBRATE::FITK40_TTS_MIN_NS
static const double FITK40_TTS_MIN_NS
Minimal transition-time spread [ns].
Definition: JFitK40.hh:35
JCALIBRATE::JPMTParameters_t::JPMTParameters_t
JPMTParameters_t()
Default constructor.
Definition: JFitK40.hh:46
JCALIBRATE::JFitK40::getValue
Double_t getValue(const pair_type &pair, const Double_t dt_ns) const
Get K40 coincidence rate.
Definition: JFitK40.hh:546
JCALIBRATE::JFitK40Parameters::cc
Double_t cc
fraction of signal correlated background
Definition: JFitK40.hh:275
JCALIBRATE::JFitK40Parameters::getT0
Double_t getT0(const int pmt) const
Get time offset of given PMT.
Definition: JFitK40.hh:237