Jpp - the software that should make you happy
 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 540 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 551 of file JSupernova.hh.

Member Function Documentation

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

Definition at line 553 of file JSupernova.hh.

553  {
554  livetime = lt;
555  }
Normalisation of MUPAGE events.
Definition: JHead.hh:768
string JSUPERNOVA::JTriggerSNStats::toString ( )
inline

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

Definition at line 561 of file JSupernova.hh.

561  {
562 
563  ostringstream os;
564 
565  os << "=== SUPERNOVA TRIGGER STATISTICS ==" << endl;
566  os << "=> livetime [s] = " << livetime << endl;
567  os << "Level" << '\t' << "Rate (error)" << endl;
568 
569  if (livetime > 0) {
570  for (unsigned i = 0; i < this->size(); i++) {
571 
572  double count = (*this)[i];
573  double rate = count / livetime;
574  double error = 100 * (sqrt(count) / count);
575 
576  if (rate > 0) {
577  os << i << '\t';
578  os << scientific << setprecision(2) << rate << "Hz ";
579  os << fixed << setprecision(0) << "(" << setw(2) << error << "%)";
580  os << endl;
581  }
582  }
583  }
584 
585  return os.str();
586 
587  }
then set_variable singlesRate set_variable doublesRate set_variable numberOfSlices echo Generating random background echo Singles rate
Normalisation of MUPAGE events.
Definition: JHead.hh:768
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 594 of file JSupernova.hh.

594  {
595 
596  ostringstream os;
597 
598  if (livetime > 0) {
599 
600  os << livetime << endl;
601 
602  for (unsigned i = 0; i < this->size(); i++) {
603 
604  double count = (*this)[i];
605  double rate = count / livetime;
606  double error = (sqrt(count) / count);
607 
608  if (rate > 0) {
609  os << i << ",";
610  os << scientific;
611  os << setprecision(2);
612  os << rate << ",";
613  os << error;
614  os << endl;
615  }
616  }
617  }
618 
619 
620  return os.str();
621 
622  }
then set_variable singlesRate set_variable doublesRate set_variable numberOfSlices echo Generating random background echo Singles rate
Normalisation of MUPAGE events.
Definition: JHead.hh:768
std::vector< int > count
Definition: JAlgorithm.hh:184

Member Data Documentation

double JSUPERNOVA::JTriggerSNStats::livetime
private

Definition at line 543 of file JSupernova.hh.


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