Jpp  18.0.0
the software that should make you happy
 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  * Get intrinsic K40 arrival time spread.
313  *
314  * \return sigma [ns]
315  */
316  Double_t getSigmaK40() const
317  {
318  return this->sigmaK40_ns;
319  }
320 
321 
322  /**
323  * Set intrinsic K40 arrival time spread.
324  *
325  * \param sigma sigma [ns]
326  */
327  void setSigmaK40(const Double_t sigma)
328  {
329  this->sigmaK40_ns = sigma;
330  }
331 
332 
333  /**
334  * Test PMT status.
335  *
336  * \param pmt pmt address
337  * \return true if given pmt is disabled; else false
338  */
339  bool is_disabled(int pmt) const
340  {
341  return disable[pmt];
342  }
343 
344 
345  /**
346  * Test PMT status.
347  *
348  * \param pmt pmt address
349  * \return true if given pmt is used for average t0; else false
350  */
351  bool is_average_t0(int pmt) const
352  {
353  return pmt == index_of_average_t0;
354  }
355 
356 
357  /**
358  * Get time offset of given PMT.
359  *
360  * Note that if the average time offset is constraint,
361  * the time offset of each PMT is corrected by the average time offset of all PMTs.
362  *
363  * \param pmt pmt address
364  * \return time offset [ns]
365  */
366  Double_t getT0(const int pmt) const
367  {
368  if (index_of_average_t0 == -1) {
369 
370  return JFitK40Parameters::getT0(pmt);
371 
372  } else {
373 
374  if (disable[pmt]) {
375 
376  return parameters[pmt].t0;
377 
378  } else {
379 
380  Int_t n0 = 0; // number of non-fixed t0's
381  Double_t t0 = 0.0; // average of non-fixed t0's
382 
383  for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
384  if (!disable[i] && i != index_of_average_t0) {
385  n0 += 1;
386  t0 += parameters[i].t0;
387  }
388  }
389 
390  t0 /= (n0 + 1);
391 
392  if (pmt != index_of_average_t0)
393  return parameters[pmt].t0 - t0;
394  else
395  return -t0;
396  }
397  }
398  }
399 
400 
401  /**
402  * Enable PMT.
403  *
404  * \param pmt pmt address
405  */
406  void enablePMT(const int pmt)
407  {
408  disable[pmt] = false;
409  }
410 
411 
412  /**
413  * Disable PMT.
414  *
415  * Note that if the average time offset is constraint to zero,
416  * the corresponding index may change.
417  *
418  * \param pmt pmt address
419  */
420  void disablePMT(const int pmt)
421  {
422  disable[pmt] = true;
423 
424  if (index_of_average_t0 == pmt) {
425 
426  for (index_of_average_t0 = 0; index_of_average_t0 != NUMBER_OF_PMTS; ++index_of_average_t0) {
427  if (!disable[index_of_average_t0]) {
428  break;
429  }
430  }
431 
432  if (index_of_average_t0 == NUMBER_OF_PMTS) {
433  THROW(JIndexOutOfRange, "JFitK40_t::disable PMT: No free index for average t0.");
434  }
435  }
436  }
437 
438 
439  /**
440  * Get cosine of space angle between PMT axes.
441  *
442  * \param pair pair of addresses
443  * \return cosine
444  */
445  double getDot(const pair_type& pair) const
446  {
447  return JMATH::getDot(this->getPMT(pair.first),
448  this->getPMT(pair.second));
449  }
450 
451 
452  /**
453  * Get time resolution of given PMT pair.
454  *
455  * \param pair pair of addresses
456  * \return sigma [ns]
457  */
458  Double_t getSigma(const pair_type& pair) const
459  {
460  return TMath::Sqrt(getTTS(pair.first) * getTTS(pair.first) +
461  getTTS(pair.second) * getTTS(pair.second) +
462  getSigmaK40() * getSigmaK40());
463  }
464 
465 
466  /**
467  * Get time offset of given PMT pair.
468  *
469  * \param pair pair of addresses
470  * \return time offset [ns]
471  */
472  Double_t getTimeOffset(const pair_type& pair) const
473  {
474  if (index_of_average_t0 == -1) {
475 
476  return parameters[pair.first].t0 - parameters[pair.second].t0;
477 
478  } else {
479 
480  if (pair.first == index_of_average_t0) {
481 
482  return -parameters[pair.second].t0;
483 
484  } else if (pair.second == index_of_average_t0) {
485 
486  return parameters[pair.first].t0;
487 
488  } else {
489 
490  return parameters[pair.first].t0 - parameters[pair.second].t0;
491  }
492  }
493  }
494 
495 
496  /**
497  * Get K40 coincidence rate.
498  *
499  * \param pair pair of addresses
500  * \return rate [Hz]
501  */
502  Double_t getValue(const pair_type& pair) const
503  {
504  const Double_t ct = getDot(pair);
505 
506  return (getValue(ct) *
507  getQE(pair.first) *
508  getQE(pair.second));
509  }
510 
511 
512  /**
513  * Get K40 coincidence rate.
514  *
515  * \param pair pair of addresses
516  * \param dt_ns time difference [ns]
517  * \return rate [Hz/ns]
518  */
519  Double_t getValue(const pair_type& pair, const Double_t dt_ns) const
520  {
521  const Double_t t0 = getTimeOffset(pair);
522  const Double_t sigma = getSigma (pair);
523 
524  return getValue(pair) * TMath::Gaus(dt_ns, t0, sigma, kTRUE);
525  }
526 
527 
528  protected:
529 
530  Double_t sigmaK40_ns; //!< intrinsic K40 arrival time spread [ns]
531  int index_of_average_t0; //!< index of t0 used for average time offset
532  bool disable[NUMBER_OF_PMTS]; //!< disable PMT from fit
533 
534 
535  /**
536  * Constructor.
537  *
538  * \param module detector module
539  * \param option true = fix average t0; false = free average t0
540  */
541  JFitK40_t(const JModule& module,
542  const bool option) :
543  sigmaK40_ns(0.54)
544  {
545  static_cast<JModule&>(*this) = module;
546 
547  this->configure(module.size());
548 
549  this->sort(JPairwiseComparator(module));
550 
551  index_of_average_t0 = (option ? 0 : -1);
552 
553  for (int i = 0; i != NUMBER_OF_PMTS; ++i) {
554  disable[i] = false;
555  }
556  }
557 
558 
559  /**
560  * Default constructor.
561  */
563  {}
564 
565 
566  /**
567  * Get unique instance of fit object.
568  *
569  * \return reference to fit object.
570  */
572  {
573  static JFitK40_t object;
574 
575  return object;
576  }
577  };
578 
579 
580  /**
581  * Template specialisation of two-fold coincidence rate due to K40 and other radioactive decays.
582  *
583  * Note that for use in ROOT fit operations, the member method JFitK40_t::getRate is static.
584  */
585  template<>
586  struct JFitK40_t<TF2> :
587  public JFitK40_t<>,
588  public TF2
589  {
590  /**
591  * Constructor.
592  *
593  * \param module detector module
594  * \param xmin minimal x
595  * \param xmax maximal x
596  * \param ymin minimal y
597  * \param ymax maximal y
598  * \param option true = fix average t0; false = free average t0
599  */
600  JFitK40_t(const JModule& module,
601  const Double_t xmin,
602  const Double_t xmax,
603  const Double_t ymin,
604  const Double_t ymax,
605  const bool option) :
606  JFitK40_t<>(module, option),
607  TF2("f2",
608  JFitK40_t<TF2>::getRate,
609  xmin, xmax, ymin, ymax,
610  getNumberOfModelParameters())
611  {}
612 
613 
614  /**
615  * Get K40 coincidence rate as a function of the fit parameters.
616  *
617  * To speed up the calculation, it is assumed that the parameter values do not
618  * change unless also the x[0] value changes (i.e.\ the index of the PMT pair).
619  *
620  * \param x pointer to data
621  * \param data pointer to parameter values
622  * \return rate [Hz/ns]
623  */
624  static Double_t getRate(const Double_t* x, const Double_t* data)
625  {
626  static int id = -1;
627  static Double_t t0;
628  static Double_t sigma;
629  static Double_t rate;
630 
631  const int ix = (int) x[0];
632  const Double_t dt_ns = x[1];
633 
634  if (ix != id) {
635 
636  getInstance().setModelParameters(data);
637 
638  const pair_type& pair = getInstance().getPair(ix);
639 
640  t0 = getInstance().getTimeOffset(pair);
641  sigma = getInstance().getSigma (pair);
642  rate = getInstance().getValue (pair);
643  id = ix;
644  }
645 
646  return getInstance().bg + rate * (getInstance().cc + TMath::Gaus(dt_ns, t0, sigma, kTRUE));
647  }
648 
649 
650  /**
651  * Fit 2D-histogram.
652  *
653  * Note that the PMT parameters are partially reset before the fit according the status of each PMT and
654  * the obtained fit parameters are copied back to the model parameters after the fit.
655  *
656  * \param h2 ROOT histogram
657  * \param option fit option
658  */
659  TFitResultPtr operator()(TH2& h2, const std::string& option)
660  {
661  for (int pmt = 0; pmt != NUMBER_OF_PMTS; ++pmt) {
662 
663  parameters[pmt].QE = JPMTParameters_t().QE;
664  parameters[pmt].TTS = JPMTParameters_t().TTS;
665 
666  if (disable[pmt]) {
667 
668  parameters[pmt].QE = 0.0;
669 
670  fixParameter(*this, this->getModelParameter(pmt, &JPMTParameters_t::QE));
671  fixParameter(*this, this->getModelParameter(pmt, &JPMTParameters_t::TTS));
672  fixParameter(*this, this->getModelParameter(pmt, &JPMTParameters_t::t0));
673 
674  } else {
675 
676  // Note that setting limits to a parameter will also release it
677 
678  if (!isParameterFixed(*this, this->getModelParameter(pmt, &JPMTParameters_t::QE))) {
679  setParLimits(*this, this->getModelParameter(pmt, &JPMTParameters_t::QE), FITK40_QE_MIN, FITK40_QE_MAX);
680  }
681  if (!isParameterFixed(*this, this->getModelParameter(pmt, &JPMTParameters_t::TTS))) {
682  setParLimits(*this, this->getModelParameter(pmt, &JPMTParameters_t::TTS), FITK40_TTS_MIN_NS, FITK40_TTS_MAX_NS);
683  }
684  if (!isParameterFixed(*this, this->getModelParameter(pmt, &JPMTParameters_t::t0))) {
685  setParLimits(*this, this->getModelParameter(pmt, &JPMTParameters_t::t0), h2.GetYaxis()->GetXmin(), h2.GetYaxis()->GetXmax());
686  }
687  }
688  }
689 
690  if (index_of_average_t0 != -1) {
691 
692  this->setT0(index_of_average_t0, 0.0);
693 
694  fixParameter(*this, this->getModelParameter(index_of_average_t0, &JPMTParameters_t::t0));
695  }
696 
697  this->SetParameters(this->getModelParameters());
698 
699  getInstance() = *this;
700 
701  const TFitResultPtr result = h2.Fit(this, option.c_str());
702 
703  this->setModelParameters(this->GetParameters());
704 
705  return result;
706  }
707  };
708 
709 
710  /**
711  * Template specialisation of two-fold coincidence rate due to K40 and other radioactive decays.
712  *
713  * Note that for use in ROOT fit operations, the member method JFitK40_t::getTimeOffset is static.
714  */
715  template<>
716  struct JFitK40_t<TF1> :
717  public JFitK40_t<>,
718  public TF1
719  {
720  /**
721  * Constructor.
722  *
723  * \param f2 2D-fit function
724  */
726  JFitK40_t<>(f2),
727  TF1("f1",
728  JFitK40_t<TF1>::getTimeOffset,
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  }
748 
749 
750  /**
751  * Get time offset as a function of the fit parameters.
752  *
753  * \param x pointer to data
754  * \param data pointer to parameter values
755  * \return time offset [ns]
756  */
757  static Double_t getTimeOffset(const Double_t* x, const Double_t* data)
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  }
767 
768 
769  /**
770  * Fit 1D-histogram.
771  *
772  * \param h1 ROOT histogram
773  * \param option fit option
774  */
775  TFitResultPtr operator()(TH1& h1, const std::string& option)
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  }
801  };
802 
803 
804  /**
805  * Type definition for backward compatibility.
806  */
808 }
809 
810 #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:600
TFitResultPtr operator()(TH1 &h1, const std::string &option)
Fit 1D-histogram.
Definition: JFitK40.hh:775
const double xmax
Definition: JQuadrature.cc:24
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:571
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:351
Double_t sigmaK40_ns
intrinsic K40 arrival time spread [ns]
Definition: JFitK40.hh:530
Auxiliary methods for geometrical methods.
Data structure for a composite optical module.
Definition: JModule.hh:68
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:445
JFitK40_t< TF2 > JFitK40
Type definition for backward compatibility.
Definition: JFitK40.hh:807
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:757
bool is_disabled(int pmt) const
Test PMT status.
Definition: JFitK40.hh:339
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:696
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:519
Template specialisation of two-fold coincidence rate due to K40 and other radioactive decays...
Definition: JFitK40.hh:586
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 usage $script< detector file >< detectorfile > nIf the range of floors is the first detector file is aligned to the second before the comparison nIn this
JFitK40_t(const JModule &module, const bool option)
Constructor.
Definition: JFitK40.hh:541
void enablePMT(const int pmt)
Enable PMT.
Definition: JFitK40.hh:406
Double_t p3
angle dependence coincidence rate
Definition: JFitK40.hh:274
JPMTParameters_t()
Default constructor.
Definition: JFitK40.hh:50
const double sigma[]
Definition: JQuadrature.cc:74
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:458
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:502
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:725
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:531
Auxiliary class for no type definition.
Definition: JNullType.hh:19
JPMTParameters_t parameters[NUMBER_OF_PMTS]
Definition: JFitK40.hh:279
then awk string
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:316
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:327
static const double FITK40_QE_MIN
Minimal quantum efficiency [unit].
Definition: JFitK40.hh:37
const double xmin
Definition: JQuadrature.cc:23
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:562
Double_t getTimeOffset(const pair_type &pair) const
Get time offset of given PMT pair.
Definition: JFitK40.hh:472
void disablePMT(const int pmt)
Disable PMT.
Definition: JFitK40.hh:420
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:624
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:366
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:659
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 optical module.