Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
JSUPERNOVA::JTriggerSNStats Class Reference

SN trigger statistics, the information is stored in the form of a count as a function of the trigger level. More...

#include <JSupernova.hh>

Inheritance diagram for JSUPERNOVA::JTriggerSNStats:
std::vector< double >

Public Member Functions

 JTriggerSNStats (const int nModules)
 default constructor More...
 
void setLiveTime (const double lt)
 
string toString ()
 put statistics into printable form outputs trigger level - rate - error More...
 
string toSummaryFile ()
 put statistics into printable form outputs trigger level - rate - error More...
 

Private Attributes

double livetime
 

Detailed Description

SN trigger statistics, the information is stored in the form of a count as a function of the trigger level.

the livetime needs to be set manually to compute the rates for the printing.

Definition at line 560 of file JSupernova.hh.

Constructor & Destructor Documentation

JSUPERNOVA::JTriggerSNStats::JTriggerSNStats ( const int  nModules)
inline

default constructor

Parameters
nModulesnumber of modules of the detector

Definition at line 571 of file JSupernova.hh.

Member Function Documentation

void JSUPERNOVA::JTriggerSNStats::setLiveTime ( const double  lt)
inline

Definition at line 573 of file JSupernova.hh.

573  {
574  livetime = lt;
575  }
Normalisation of MUPAGE events.
Definition: JHead.hh:604
string JSUPERNOVA::JTriggerSNStats::toString ( )
inline

put statistics into printable form outputs trigger level - rate - error

Definition at line 581 of file JSupernova.hh.

581  {
582 
583  ostringstream os;
584 
585  os << "=== SUPERNOVA TRIGGER STATISTICS ==" << endl;
586  os << "=> livetime [s] = " << livetime << endl;
587  os << "Level" << '\t' << "Rate (error)" << endl;
588 
589  if (livetime > 0) {
590  for (unsigned i = 0; i < this->size(); i++) {
591 
592  double count = (*this)[i];
593  double rate = count / livetime;
594  double error = 100 * (sqrt(count) / count);
595 
596  if (rate > 0) {
597  os << i << '\t';
598  os << scientific << setprecision(2) << rate << "Hz ";
599  os << fixed << setprecision(0) << "(" << setw(2) << error << "%)";
600  os << endl;
601  }
602  }
603  }
604 
605  return os.str();
606 
607  }
then set_variable singlesRate set_variable doublesRate set_variable numberOfSlices echo Generating random background echo Singles rate
Normalisation of MUPAGE events.
Definition: JHead.hh:604
std::vector< int > count
Definition: JAlgorithm.hh:184
string JSUPERNOVA::JTriggerSNStats::toSummaryFile ( )
inline

put statistics into printable form outputs trigger level - rate - error

Definition at line 614 of file JSupernova.hh.

614  {
615 
616  ostringstream os;
617 
618  if (livetime > 0) {
619 
620  os << livetime << endl;
621 
622  for (unsigned i = 0; i < this->size(); i++) {
623 
624  double count = (*this)[i];
625  double rate = count / livetime;
626  double error = (sqrt(count) / count);
627 
628  if (rate > 0) {
629  os << i << ",";
630  os << scientific;
631  os << setprecision(2);
632  os << rate << ",";
633  os << error;
634  os << endl;
635  }
636  }
637  }
638 
639 
640  return os.str();
641 
642  }
then set_variable singlesRate set_variable doublesRate set_variable numberOfSlices echo Generating random background echo Singles rate
Normalisation of MUPAGE events.
Definition: JHead.hh:604
std::vector< int > count
Definition: JAlgorithm.hh:184

Member Data Documentation

double JSUPERNOVA::JTriggerSNStats::livetime
private

Definition at line 563 of file JSupernova.hh.


The documentation for this class was generated from the following file: