Example program to check background calculation.  
More...
#include <string>
#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
#include "TRandom3.h"
#include "JPhysics/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 23 of file JK40Rates.cc.
   37     JParser<> zap(
"Example program to check background calculation.");
 
   48   catch(
const exception &error) {
 
   49     FATAL(error.what() << endl);
 
   52   gRandom->SetSeed(seed);
 
   54   NOTICE(
"K40 rates (original)  " << rates_Hz << endl);
 
   56   JK40Rates corrected_rates_Hz = rates_Hz;
 
   58   corrected_rates_Hz.correct(QE);
 
   60   NOTICE(
"K40 rates (corrected) " << corrected_rates_Hz << endl);
 
   66     buffer.resize(corrected_rates_Hz.getUpperL1Multiplicity() + 1);
 
   70     for (
size_t M = corrected_rates_Hz.getLowerL1Multiplicity(); M <= corrected_rates_Hz.getUpperL1Multiplicity(); ++M) {
 
   72       const int numberOfEvents = (int) (
livetime_s * corrected_rates_Hz.getMultiplesRate(M)); 
 
   74       for (
int number_of_events = 0; number_of_events != numberOfEvents; ++number_of_events) {
 
   78         for (
size_t i = 0; i != M; ++i) {
 
   79           if (gRandom->Rndm() <= QE) {
 
   88     NOTICE(
"simulated" << endl);
 
   90     for (
size_t M = corrected_rates_Hz.getLowerL1Multiplicity(); M <= corrected_rates_Hz.getUpperL1Multiplicity(); ++M) {
 
   91       NOTICE(setw(2) << M << 
' ' << 
FIXED(8,4) << buffer[M] << endl);
 
   96     for (
size_t M = rates_Hz.getLowerL1Multiplicity(); M <= rates_Hz.getUpperL1Multiplicity(); ++M) {
 
   97       if (fabs(buffer[M] - rates_Hz.getMultiplesRate(M)) > precision * rates_Hz.getMultiplesRate(M)) {
 
   98         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. 
 
then JCookie sh JDataQuality D $DETECTOR_ID R $RUNS[*] o $QUALITY_TXT d $DEBUG!fi fi JDataQuality f $QUALITY_TXT Q livetime_s
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object