Example program to check background calculation.
More...
#include <string>
#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
#include "TRandom3.h"
#include "TMath.h"
#include "JDetector/JK40Rates.hh"
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Example program to check background calculation.
- Author
- mdejong
Definition in file JK40Rates.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 24 of file JK40Rates.cc.
38 JParser<> zap(
"Example program to check background calculation.");
49 catch(
const exception &error) {
50 FATAL(error.what() << endl);
53 gRandom->SetSeed(seed);
55 NOTICE(
"K40 rates (original) " << rates_Hz << endl);
57 JK40Rates corrected_rates_Hz = rates_Hz;
59 corrected_rates_Hz.correct(QE);
61 NOTICE(
"K40 rates (corrected) " << corrected_rates_Hz << endl);
63 if (livetime_s > 0.0) {
67 buffer.resize(corrected_rates_Hz.getUpperL1Multiplicity() + 1);
69 const double W = 1.0 / livetime_s;
71 for (
size_t M = corrected_rates_Hz.getLowerL1Multiplicity();
M <= corrected_rates_Hz.getUpperL1Multiplicity(); ++
M) {
73 const int numberOfEvents = (int) (livetime_s * corrected_rates_Hz.getMultiplesRate(
M));
75 for (
int number_of_events = 0; number_of_events != numberOfEvents; ++number_of_events) {
79 for (
size_t i = 0; i !=
M; ++i) {
80 if (gRandom->Rndm() <= QE) {
89 NOTICE(
"simulated" << endl);
91 for (
size_t M = corrected_rates_Hz.getLowerL1Multiplicity();
M <= corrected_rates_Hz.getUpperL1Multiplicity(); ++
M) {
92 NOTICE(setw(2) <<
M <<
' ' <<
FIXED(8,4) << buffer[
M] << endl);
97 for (
size_t M = rates_Hz.getLowerL1Multiplicity();
M <= rates_Hz.getUpperL1Multiplicity(); ++
M) {
98 if (fabs(buffer[
M] - rates_Hz.getMultiplesRate(
M)) > precision * rates_Hz.getMultiplesRate(
M)) {
99 FATAL(
"R[" << setw(2) <<
M <<
"] [Hz] " <<
FIXED(8,4) << buffer[
M] <<
" != " << rates_Hz.getMultiplesRate(
M) << endl);
Utility class to parse command line options.
Auxiliary data structure for floating point format specification.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
alias put_queue eval echo n