Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 "TF1.h"
7 #include "TF2.h"
8 #include "TH1.h"
9 #include "TH2.h"
10 #include "TFitResult.h"
11 
13 #include "JROOT/JRootToolkit.hh"
14 #include "JDetector/JModule.hh"
15 #include "JMath/JMathToolkit.hh"
16 #include "JLang/JException.hh"
17 #include "JLang/JNullType.hh"
19 
20 
21 /**
22  * \author mdejong
23  */
24 
25 namespace JCALIBRATE {}
26 namespace JPP { using namespace JCALIBRATE; }
27 
28 namespace JCALIBRATE {
29 
31  using JLANG::JNullType;
34  using JDETECTOR::JModule;
35 
36 
37  static const double FITK40_QE_MIN = 0.0; //!< Minimal quantum efficiency [unit]
38  static const double FITK40_QE_MAX = 10.0; //!< Maximal quantum efficiency [unit]
39  static const double FITK40_TTS_MIN_NS = 0.0; //!< Minimal transition-time spread [ns]
40  static const double FITK40_TTS_MAX_NS = 3.5; //!< Maximal transition-time spread [ns]
41 
42 
43  /**
44  * Fit parameters for single PMT.
45  */
47  /**
48  * Default constructor.
49  */
51  QE (1.0),
52  TTS(2.0),
53  t0 (0.0)
54  {}
55 
56 
57  Double_t QE; //!< quantum efficiency [unit]
58  Double_t TTS; //!< transition-time spread [ns]
59  Double_t t0; //!< time offset [ns]
60  };
61 
62 
63  /**
64  * Fit parameters for two-fold coincidence rate due to K40.
65  */
67  /**
68  * Default constructor.
69  *
70  * The default parameter values are set to those obtained from a designated simulation
71  * of K40 decays (see http://wiki.km3net.de/index.php/OMGsim_simulations_for_K40_fit).\n
72  * If you change these values, you may also want to change the corresponding values in JK40DefaultSimulator.hh.
73  */
75  Rate_Hz(18.460546),
76  p1 ( 3.0767),
77  p2 (-1.2078),
78  p3 ( 0.9905),
79  p4 ( 0.9379),
80  bg ( 1.0e-3),
81  cc ( 1.0e-3)
82  {}
83 
84 
85  /**
86  * Copy constructor.
87  *
88  * \param data data
89  */
90  JFitK40Parameters(const Double_t* data)
91  {
92  if (data != NULL) {
93  setModelParameters(data);
94  }
95  }
96 
97 
98  /**
99  * Get number of model parameters.
100  *
101  * \return number of parameters
102  */
104  {
105  return sizeof(JFitK40Parameters) / sizeof(Double_t);
106  }
107 
108 
109  /**
110  * Get model parameters.
111  *
112  * \return pointer to parameters
113  */
114  const Double_t* getModelParameters() const
115  {
116  return &Rate_Hz;
117  }
118 
119 
120  /**
121  * Get model parameters.
122  *
123  * \return pointer to parameters
124  */
125  Double_t* getModelParameters()
126  {
127  return &Rate_Hz;
128  }
129 
130 
131  /**
132  * Set model parameters.
133  *
134  * \param data pointer to parameters
135  */
136  void setModelParameters(const Double_t* data)
137  {
138  for (Int_t i = 0; i != getNumberOfModelParameters(); ++i) {
139  getModelParameters()[i] = data[i];
140  }
141  }
142 
143 
144  /**
145  * Get model parameter.
146  *
147  * \param i parameter index
148  * \return parameter value
149  */
150  Double_t getModelParameter(Int_t i) const
151  {
152  return getModelParameters()[i];
153  }
154 
155 
156  /**
157  * Get model parameter.
158  *
159  * \param p pointer to data member
160  * \return parameter index and value
161  */
163  {
164  const Int_t i = &(this->*p) - getModelParameters();
165 
166  return JFitParameter_t(i, getModelParameter(i));
167  }
168 
169 
170  /**
171  * Get model parameter.
172  *
173  * \param pmt PMT number
174  * \param p pointer to data member of PMT parameters
175  * \return parameter index and value
176  */
177  JFitParameter_t getModelParameter(Int_t pmt, Double_t JPMTParameters_t::*p) const
178  {
179  const Int_t i = &(parameters[pmt].*p) - getModelParameters();
180 
181  return JFitParameter_t(i, getModelParameter(i));
182  }
183 
184 
185  /**
186  * Get QE of given PMT.
187  *
188  * \param pmt pmt address
189  * \return QE
190  */
191  Double_t getQE(const int pmt) const
192  {
193  return parameters[pmt].QE;
194  }
195 
196 
197  /**
198  * Set QE of given PMT.
199  *
200  * \param pmt pmt address
201  * \param QE QE
202  */
203  void setQE(const int pmt, const Double_t QE)
204  {
205  parameters[pmt].QE = QE;
206  }
207 
208 
209  /**
210  * Get time resolution of given PMT.
211  *
212  * \param pmt pmt address
213  * \return TTS [ns]
214  */
215  Double_t getTTS(const int pmt) const
216  {
217  return parameters[pmt].TTS;
218  }
219 
220 
221  /**
222  * Set time resolution of given PMT.
223  *
224  * \param pmt pmt address
225  * \param TTS TTS [ns]
226  */
227  void setTTS(const int pmt, const Double_t TTS)
228  {
229  parameters[pmt].TTS = TTS;
230  }
231 
232 
233  /**
234  * Get time offset of given PMT.
235  *
236  * \param pmt pmt address
237  * \return time offset [ns]
238  */
239  Double_t getT0(const int pmt) const
240  {
241  return parameters[pmt].t0;
242  }
243 
244 
245  /**
246  * Set time offset of given PMT.
247  *
248  * \param pmt pmt address
249  * \param t0 time offset [ns]
250  */
251  void setT0(const int pmt, const Double_t t0)
252  {
253  parameters[pmt].t0 = t0;
254  }
255 
256 
257  /**
258  * Get K40 coincidence rate as a function of cosine angle between PMT axes.
259  *
260  * \param ct cosine angle between PMT axes
261  * \return rate [Hz]
262  */
263  Double_t getValue(const Double_t ct) const
264  {
265  return Rate_Hz * TMath::Exp(-(p1+p2+p3+p4)) * TMath::Exp(ct*(p1+ct*(p2+ct*(p3+ct*p4))));
266  }
267 
268 
269  // fit parameters
270 
271  Double_t Rate_Hz; //!< maximal coincidence rate [Hz]
272  Double_t p1; //!< angle dependence coincidence rate
273  Double_t p2; //!< angle dependence coincidence rate
274  Double_t p3; //!< angle dependence coincidence rate
275  Double_t p4; //!< angle dependence coincidence rate
276  Double_t bg; //!< remaining constant background
277  Double_t cc; //!< fraction of signal correlated background
278 
280  };
281 
282 
283  /**
284  * Template definition of two-fold coincidence rate due to K40 and other radioactive decays.
285  */
286  template<class JFunction_t = JNullType>
287  struct JFitK40_t;
288 
289 
290  /**
291  * Template specialisation of two-fold coincidence rate due to K40 and other radioactive decays.
292  *
293  * This class serves as a base class for the ROOT fit classes.
294  */
295  template<>
297  public JFitK40Parameters,
298  public JModule,
299  public JCombinatorics
300  {
304 
305  /**
306  * Data structure for a pair of addresses.
307  */
309 
310 
311  /**
312  * Constructor.
313  *
314  * \param module detector module
315  * \param option true = fix average t0; false = free average t0
316  */
317  JFitK40_t(const JModule& module,
318  const bool option) :
319  sigmaK40_ns(0.54)
320  {
321  static_cast<JModule&>(*this) = module;
322 
323  this->configure(module.size());
324 
325  this->sort(JPairwiseComparator(module));
326 
327  index_of_average_t0 = (option ? 0 : -1);
328 
329  for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
330  disable[i] = false;
331  }
332  }
333 
334 
335  /**
336  * Get intrinsic K40 arrival time spread.
337  *
338  * \return sigma [ns]
339  */
340  Double_t getSigmaK40() const
341  {
342  return this->sigmaK40_ns;
343  }
344 
345 
346  /**
347  * Set intrinsic K40 arrival time spread.
348  *
349  * \param sigma sigma [ns]
350  */
351  void setSigmaK40(const Double_t sigma)
352  {
353  this->sigmaK40_ns = sigma;
354  }
355 
356 
357  /**
358  * Test PMT status.
359  *
360  * \param pmt pmt address
361  * \return true if given pmt is disabled; else false
362  */
363  bool is_disabled(int pmt) const
364  {
365  return disable[pmt];
366  }
367 
368 
369  /**
370  * Test PMT status.
371  *
372  * \param pmt pmt address
373  * \return true if given pmt is used for average t0; else false
374  */
375  bool is_average_t0(int pmt) const
376  {
377  return pmt == index_of_average_t0;
378  }
379 
380 
381  /**
382  * Get time offset of given PMT.
383  *
384  * Note that if the average time offset is constraint,
385  * the time offset of each PMT is corrected by the average time offset of all PMTs.
386  *
387  * \param pmt pmt address
388  * \return time offset [ns]
389  */
390  Double_t getT0(const int pmt) const
391  {
392  if (index_of_average_t0 == -1) {
393 
394  return JFitK40Parameters::getT0(pmt);
395 
396  } else {
397 
398  if (disable[pmt]) {
399 
400  return parameters[pmt].t0;
401 
402  } else {
403 
404  Int_t n0 = 0; // number of non-fixed t0's
405  Double_t t0 = 0.0; // average of non-fixed t0's
406 
407  for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
408  if (!disable[i] && i != index_of_average_t0) {
409  n0 += 1;
410  t0 += parameters[i].t0;
411  }
412  }
413 
414  t0 /= (n0 + 1);
415 
416  if (pmt != index_of_average_t0)
417  return parameters[pmt].t0 - t0;
418  else
419  return -t0;
420  }
421  }
422  }
423 
424 
425  /**
426  * Enable PMT.
427  *
428  * \param pmt pmt address
429  */
430  void enablePMT(const int pmt)
431  {
432  disable[pmt] = false;
433  }
434 
435 
436  /**
437  * Disable PMT.
438  *
439  * Note that if the average time offset is constraint to zero,
440  * the corresponding index may change.
441  *
442  * \param pmt pmt address
443  */
444  void disablePMT(const int pmt)
445  {
446  disable[pmt] = true;
447 
448  if (index_of_average_t0 == pmt) {
449 
450  for (index_of_average_t0 = 0; index_of_average_t0 != NUMBER_OF_PMTS; ++index_of_average_t0) {
451  if (!disable[index_of_average_t0]) {
452  break;
453  }
454  }
455 
456  if (index_of_average_t0 == NUMBER_OF_PMTS) {
457  THROW(JIndexOutOfRange, "JFitK40_t::disable PMT: No free index for average t0.");
458  }
459  }
460  }
461 
462 
463  /**
464  * Get cosine of space angle between PMT axes.
465  *
466  * \param pair pair of addresses
467  * \return cosine
468  */
469  double getDot(const pair_type& pair) const
470  {
471  return JMATH::getDot(this->getPMT(pair.first),
472  this->getPMT(pair.second));
473  }
474 
475 
476  /**
477  * Get time resolution of given PMT pair.
478  *
479  * \param pair pair of addresses
480  * \return sigma [ns]
481  */
482  Double_t getSigma(const pair_type& pair) const
483  {
484  return TMath::Sqrt(getTTS(pair.first) * getTTS(pair.first) +
485  getTTS(pair.second) * getTTS(pair.second) +
486  getSigmaK40() * getSigmaK40());
487  }
488 
489 
490  /**
491  * Get time offset of given PMT pair.
492  *
493  * \param pair pair of addresses
494  * \return time offset [ns]
495  */
496  Double_t getTimeOffset(const pair_type& pair) const
497  {
498  if (index_of_average_t0 == -1) {
499 
500  return parameters[pair.first].t0 - parameters[pair.second].t0;
501 
502  } else {
503 
504  if (pair.first == index_of_average_t0) {
505 
506  return -parameters[pair.second].t0;
507 
508  } else if (pair.second == index_of_average_t0) {
509 
510  return parameters[pair.first].t0;
511 
512  } else {
513 
514  return parameters[pair.first].t0 - parameters[pair.second].t0;
515  }
516  }
517  }
518 
519 
520  /**
521  * Get K40 coincidence rate.
522  *
523  * \param pair pair of addresses
524  * \return rate [Hz]
525  */
526  Double_t getValue(const pair_type& pair) const
527  {
528  const Double_t ct = getDot(pair);
529 
530  return (getValue(ct) *
531  getQE(pair.first) *
532  getQE(pair.second));
533  }
534 
535 
536  /**
537  * Get K40 coincidence rate.
538  *
539  * \param pair pair of addresses
540  * \param dt_ns time difference [ns]
541  * \return rate [Hz/ns]
542  */
543  Double_t getValue(const pair_type& pair, const Double_t dt_ns) const
544  {
545  const Double_t t0 = getTimeOffset(pair);
546  const Double_t sigma = getSigma (pair);
547 
548  return getValue(pair) * TMath::Gaus(dt_ns, t0, sigma, kTRUE);
549  }
550 
551 
552  protected:
553 
554  Double_t sigmaK40_ns; //!< intrinsic K40 arrival time spread [ns]
555  int index_of_average_t0; //!< index of t0 used for average time offset
556  bool disable[NUMBER_OF_PMTS]; //!< disable PMT from fit
557 
558  /**
559  * Default constructor.
560  */
562  {}
563 
564 
565  /**
566  * Get unique instance of fit object.
567  *
568  * \return reference to fit object.
569  */
571  {
572  static JFitK40_t object;
573 
574  return object;
575  }
576  };
577 
578 
579  /**
580  * Template specialisation of two-fold coincidence rate due to K40 and other radioactive decays.
581  *
582  * Note that for use in ROOT fit operations, the member method JFitK40_t::getRate is static.
583  */
584  template<>
585  struct JFitK40_t<TF2> :
586  public JFitK40_t<>,
587  public TF2
588  {
589  /**
590  * Constructor.
591  *
592  * \param module detector module
593  * \param xmin minimal x
594  * \param xmax maximal x
595  * \param ymin minimal y
596  * \param ymax maximal y
597  * \param option true = fix average t0; false = free average t0
598  */
599  JFitK40_t(const JModule& module,
600  const Double_t xmin,
601  const Double_t xmax,
602  const Double_t ymin,
603  const Double_t ymax,
604  const bool option) :
605  JFitK40_t<>(module, option),
606  TF2("f2",
607  JFitK40_t<TF2>::getRate,
608  xmin, xmax, ymin, ymax,
609  getNumberOfModelParameters())
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 
635  getInstance().setModelParameters(data);
636 
637  const pair_type& pair = getInstance().getPair(ix);
638 
639  t0 = getInstance().getTimeOffset(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 
649  /**
650  * Fit 2D-histogram.
651  *
652  * Note that the PMT parameters are partially reset before the fit according the status of each PMT and
653  * the obtained fit parameters are copied back to the model parameters after the fit.
654  *
655  * \param h2 ROOT histogram
656  * \param option fit option
657  */
658  TFitResultPtr operator()(TH2& h2, const std::string& option)
659  {
660  for (int pmt = 0; pmt != NUMBER_OF_PMTS; ++pmt) {
661 
662  parameters[pmt].QE = JPMTParameters_t().QE;
663  parameters[pmt].TTS = JPMTParameters_t().TTS;
664 
665  if (disable[pmt]) {
666 
667  parameters[pmt].QE = 0.0;
668 
669  fixParameter(*this, this->getModelParameter(pmt, &JPMTParameters_t::QE));
670  fixParameter(*this, this->getModelParameter(pmt, &JPMTParameters_t::TTS));
671  fixParameter(*this, this->getModelParameter(pmt, &JPMTParameters_t::t0));
672 
673  } else {
674 
675  // Note that setting limits to a parameter will also release it
676 
677  if (!isParameterFixed(*this, this->getModelParameter(pmt, &JPMTParameters_t::QE))) {
678  setParLimits(*this, this->getModelParameter(pmt, &JPMTParameters_t::QE), FITK40_QE_MIN, FITK40_QE_MAX);
679  }
680  if (!isParameterFixed(*this, this->getModelParameter(pmt, &JPMTParameters_t::TTS))) {
681  setParLimits(*this, this->getModelParameter(pmt, &JPMTParameters_t::TTS), FITK40_TTS_MIN_NS, FITK40_TTS_MAX_NS);
682  }
683  if (!isParameterFixed(*this, this->getModelParameter(pmt, &JPMTParameters_t::t0))) {
684  setParLimits(*this, this->getModelParameter(pmt, &JPMTParameters_t::t0), h2.GetYaxis()->GetXmin(), h2.GetYaxis()->GetXmax());
685  }
686  }
687  }
688 
689  if (index_of_average_t0 != -1) {
690 
691  this->setT0(index_of_average_t0, 0.0);
692 
693  fixParameter(*this, this->getModelParameter(index_of_average_t0, &JPMTParameters_t::t0));
694  }
695 
696  this->SetParameters(this->getModelParameters());
697 
698  getInstance() = *this;
699 
700  const TFitResultPtr result = h2.Fit(this, option.c_str());
701 
702  this->setModelParameters(this->GetParameters());
703 
704  return result;
705  }
706  };
707 
708 
709  /**
710  * Template specialisation of two-fold coincidence rate due to K40 and other radioactive decays.
711  *
712  * Note that for use in ROOT fit operations, the member method JFitK40_t::getTimeOffset is static.\n
713  */
714  template<>
715  struct JFitK40_t<TF1> :
716  public JFitK40_t<>,
717  public TF1
718  {
719  /**
720  * Constructor.
721  *
722  * \param f2 2D-fit function
723  */
725  JFitK40_t<>(f2),
726  TF1("f1",
727  JFitK40_t<TF1>::getTimeOffset,
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  }
747 
748 
749  /**
750  * Get time offset as a function of the fit parameters.
751  *
752  * \param x pointer to data
753  * \param data pointer to parameter values
754  * \return time offset [ns]
755  */
756  static Double_t getTimeOffset(const Double_t* x, const Double_t* data)
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  }
766 
767 
768  /**
769  * Fit 1D-histogram.
770  *
771  * \param h1 ROOT histogram
772  * \param option fit option
773  */
774  TFitResultPtr operator()(TH1& h1, const std::string& option)
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  }
800  };
801 
802 
803  /**
804  * Type definition for backward compatibility.
805  */
807 }
808 
809 #endif
Double_t bg
remaining constant background
Definition: JFitK40.hh:276
JFitK40_t(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:599
TFitResultPtr operator()(TH1 &h1, const std::string &option)
Fit 1D-histogram.
Definition: JFitK40.hh:774
Double_t TTS
transition-time spread [ns]
Definition: JFitK40.hh:58
JFitParameter_t getModelParameter(Double_t JFitK40Parameters::*p) const
Get model parameter.
Definition: JFitK40.hh:162
Double_t getQE(const int pmt) const
Get QE of given PMT.
Definition: JFitK40.hh:191
static JFitK40_t & getInstance()
Get unique instance of fit object.
Definition: JFitK40.hh:570
Exceptions.
void setT0(const int pmt, const Double_t t0)
Set time offset of given PMT.
Definition: JFitK40.hh:251
Auxiliary class to convert pair of indices to unique index and back.
double getValue(const JScale_t scale)
Get numerical value corresponding to scale.
Definition: JScale.hh:47
bool is_average_t0(int pmt) const
Test PMT status.
Definition: JFitK40.hh:375
Double_t sigmaK40_ns
intrinsic K40 arrival time spread [ns]
Definition: JFitK40.hh:554
Auxiliary methods for geometrical methods.
Data structure for a composite optical module.
Definition: JModule.hh:57
Double_t t0
time offset [ns]
Definition: JFitK40.hh:59
Double_t QE
quantum efficiency [unit]
Definition: JFitK40.hh:57
double getDot(const pair_type &pair) const
Get cosine of space angle between PMT axes.
Definition: JFitK40.hh:469
JFitK40_t< TF2 > JFitK40
Type definition for backward compatibility.
Definition: JFitK40.hh:806
double getDot(const JNeutrinoDirection &first, const JNeutrinoDirection &second)
Dot product.
Definition: JAstronomy.hh:409
static Double_t getTimeOffset(const Double_t *x, const Double_t *data)
Get time offset as a function of the fit parameters.
Definition: JFitK40.hh:756
bool is_disabled(int pmt) const
Test PMT status.
Definition: JFitK40.hh:363
double getSigma(vector< double > &v)
get standard deviation of vector content
JFitK40Parameters(const Double_t *data)
Copy constructor.
Definition: JFitK40.hh:90
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
then set_variable singlesRate set_variable doublesRate set_variable numberOfSlices echo Generating random background echo Singles rate
Double_t getValue(const pair_type &pair, const Double_t dt_ns) const
Get K40 coincidence rate.
Definition: JFitK40.hh:543
Template specialisation of two-fold coincidence rate due to K40 and other radioactive decays...
Definition: JFitK40.hh:585
Double_t getTTS(const int pmt) const
Get time resolution of given PMT.
Definition: JFitK40.hh:215
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
static const double FITK40_QE_MAX
Maximal quantum efficiency [unit].
Definition: JFitK40.hh:38
then for HISTOGRAM in h0 h1
Definition: JMatrixNZ.sh:69
JFitK40_t(const JModule &module, const bool option)
Constructor.
Definition: JFitK40.hh:317
void enablePMT(const int pmt)
Enable PMT.
Definition: JFitK40.hh:430
Double_t p3
angle dependence coincidence rate
Definition: JFitK40.hh:274
JPMTParameters_t()
Default constructor.
Definition: JFitK40.hh:50
const Double_t * getModelParameters() const
Get model parameters.
Definition: JFitK40.hh:114
bool isParameterFixed(const TF1 &f1, const Int_t index)
Check if fit parameter is fixed.
Double_t getT0(const int pmt) const
Get time offset of given PMT.
Definition: JFitK40.hh:239
Double_t getSigma(const pair_type &pair) const
Get time resolution of given PMT pair.
Definition: JFitK40.hh:482
Auxiliary data structure for a parameter index and its value.
Double_t getValue(const Double_t ct) const
Get K40 coincidence rate as a function of cosine angle between PMT axes.
Definition: JFitK40.hh:263
Auxiliary class to sort pairs of PMT addresses within optical module.
void setModelParameters(const Double_t *data)
Set model parameters.
Definition: JFitK40.hh:136
double getRate(const JDAQSummaryFrame &frame, const int pmt, const double factor=1.0)
Get corrected rate of PMT.
T & getInstance(const T &object)
Get static instance from temporary object.
Definition: JObject.hh:75
Template definition of two-fold coincidence rate due to K40 and other radioactive decays...
Definition: JFitK40.hh:287
Double_t getValue(const pair_type &pair) const
Get K40 coincidence rate.
Definition: JFitK40.hh:526
double getQE(const double R, const double mu)
Get QE for given ratio of hit probabilities and expectation value of the number of photo-electrons...
JFitK40_t(const JFitK40_t< TF2 > &f2)
Constructor.
Definition: JFitK40.hh:724
return result
Definition: JPolint.hh:727
Double_t getModelParameter(Int_t i) const
Get model parameter.
Definition: JFitK40.hh:150
int index_of_average_t0
index of t0 used for average time offset
Definition: JFitK40.hh:555
Auxiliary class for no type definition.
Definition: JNullType.hh:19
JPMTParameters_t parameters[NUMBER_OF_PMTS]
Definition: JFitK40.hh:279
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.
static Int_t getNumberOfModelParameters()
Get number of model parameters.
Definition: JFitK40.hh:103
JFitParameter_t getModelParameter(Int_t pmt, Double_t JPMTParameters_t::*p) const
Get model parameter.
Definition: JFitK40.hh:177
Double_t p4
angle dependence coincidence rate
Definition: JFitK40.hh:275
Double_t getSigmaK40() const
Get intrinsic K40 arrival time spread.
Definition: JFitK40.hh:340
bool setParLimits(TF1 &f1, const Int_t index, Double_t xmin, Double_t xmax)
Set fit parameter limits.
Fit parameters for single PMT.
Definition: JFitK40.hh:46
void setSigmaK40(const Double_t sigma)
Set intrinsic K40 arrival time spread.
Definition: JFitK40.hh:351
static const double FITK40_QE_MIN
Minimal quantum efficiency [unit].
Definition: JFitK40.hh:37
JCombinatorics::pair_type pair_type
Data structure for a pair of addresses.
Definition: JFitK40.hh:308
void configure(const T &value, const JAbstractCollection< JAbscissa_t > &bounds, JBool< false > option)
Configuration of value.
static const double FITK40_TTS_MIN_NS
Minimal transition-time spread [ns].
Definition: JFitK40.hh:39
JFitK40_t()
Default constructor.
Definition: JFitK40.hh:561
Double_t getTimeOffset(const pair_type &pair) const
Get time offset of given PMT pair.
Definition: JFitK40.hh:496
void disablePMT(const int pmt)
Disable PMT.
Definition: JFitK40.hh:444
void setQE(const int pmt, const Double_t QE)
Set QE of given PMT.
Definition: JFitK40.hh:203
Double_t Rate_Hz
maximal coincidence rate [Hz]
Definition: JFitK40.hh:271
bool fixParameter(TF1 &f1, const JFitParameter_t &parameter)
Fix fit parameter.
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
void setTTS(const int pmt, const Double_t TTS)
Set time resolution of given PMT.
Definition: JFitK40.hh:227
static const double FITK40_TTS_MAX_NS
Maximal transition-time spread [ns].
Definition: JFitK40.hh:40
Double_t p1
angle dependence coincidence rate
Definition: JFitK40.hh:272
Double_t p2
angle dependence coincidence rate
Definition: JFitK40.hh:273
Exception for accessing an index in a collection that is outside of its range.
Definition: JException.hh:90
KM3NeT DAQ constants, bit handling, etc.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
Definition: JDAQ.hh:26
Double_t getT0(const int pmt) const
Get time offset of given PMT.
Definition: JFitK40.hh:390
Fit parameters for two-fold coincidence rate due to K40.
Definition: JFitK40.hh:66
TFitResultPtr operator()(TH2 &h2, const std::string &option)
Fit 2D-histogram.
Definition: JFitK40.hh:658
Double_t * getModelParameters()
Get model parameters.
Definition: JFitK40.hh:125
Double_t cc
fraction of signal correlated background
Definition: JFitK40.hh:277
JFitK40Parameters()
Default constructor.
Definition: JFitK40.hh:74
Data structure for a composite optical module.