Jpp in_tag_pdf_generation
the software that should make you happy
Loading...
Searching...
No Matches
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
 
void setLiveTime (const double lt)
 
string toString ()
 put statistics into printable form outputs trigger level - rate - error
 
string toSummaryFile ()
 put statistics into printable form outputs trigger level - rate - error
 

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 620 of file JSupernova.hh.

Constructor & Destructor Documentation

◆ JTriggerSNStats()

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

default constructor

Parameters
nModulesnumber of modules of the detector

Definition at line 631 of file JSupernova.hh.

631: vector<double>(nModules) {}

Member Function Documentation

◆ setLiveTime()

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

Definition at line 633 of file JSupernova.hh.

633 {
634 livetime = lt;
635 }
Normalisation of MUPAGE events.
Definition JHead.hh:835

◆ toString()

string JSUPERNOVA::JTriggerSNStats::toString ( )
inline

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

Definition at line 641 of file JSupernova.hh.

641 {
642
643 ostringstream os;
644
645 os << "=== SUPERNOVA TRIGGER STATISTICS ==" << endl;
646 os << "=> livetime [s] = " << livetime << endl;
647 os << "Level" << '\t' << "Rate (error)" << endl;
648
649 if (livetime > 0) {
650 for (unsigned i = 0; i < this->size(); i++) {
651
652 double count = (*this)[i];
653 double rate = count / livetime;
654 double error = 100 * (sqrt(count) / count);
655
656 if (rate > 0) {
657 os << i << '\t';
658 os << scientific << setprecision(2) << rate << "Hz ";
659 os << fixed << setprecision(0) << "(" << setw(2) << error << "%)";
660 os << endl;
661 }
662 }
663 }
664
665 return os.str();
666
667 }

◆ toSummaryFile()

string JSUPERNOVA::JTriggerSNStats::toSummaryFile ( )
inline

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

Definition at line 674 of file JSupernova.hh.

674 {
675
676 ostringstream os;
677
678 if (livetime > 0) {
679
680 os << livetime << endl;
681
682 for (unsigned i = 0; i < this->size(); i++) {
683
684 double count = (*this)[i];
685 double rate = count / livetime;
686 double error = (sqrt(count) / count);
687
688 if (rate > 0) {
689 os << i << ",";
690 os << scientific;
691 os << setprecision(2);
692 os << rate << ",";
693 os << error;
694 os << endl;
695 }
696 }
697 }
698
699
700 return os.str();
701
702 }

Member Data Documentation

◆ livetime

double JSUPERNOVA::JTriggerSNStats::livetime
private

Definition at line 623 of file JSupernova.hh.


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