Jpp
Public Member Functions | Public Attributes | List of all members
JTRIGGER::JPrescaler Class Reference

Auxiliary class for prescaling. More...

#include <JPrescaler.hh>

Inheritance diagram for JTRIGGER::JPrescaler:
TObject

Public Member Functions

 JPrescaler ()
 Default constructor. More...
 
 JPrescaler (const long long int value)
 Constructor. More...
 
virtual ~JPrescaler ()
 Virtual destructor. More...
 
bool equals (const JPrescaler &prescaler) const
 Equality. More...
 
bool operator() () const
 Test operator. More...
 
 operator bool () const
 Check status. More...
 
 ClassDef (JPrescaler, 2)
 

Public Attributes

long long int prescale
 
long long int counter
 

Detailed Description

Auxiliary class for prescaling.

Definition at line 23 of file JPrescaler.hh.

Constructor & Destructor Documentation

◆ JPrescaler() [1/2]

JTRIGGER::JPrescaler::JPrescaler ( )
inline

Default constructor.

Definition at line 30 of file JPrescaler.hh.

30  :
31  prescale(0),
32  counter (0)
33  {}

◆ JPrescaler() [2/2]

JTRIGGER::JPrescaler::JPrescaler ( const long long int  value)
inline

Constructor.

Parameters
valueprescale value (0 is off)

Definition at line 41 of file JPrescaler.hh.

41  :
42  prescale(value),
43  counter (0)
44  {}

◆ ~JPrescaler()

virtual JTRIGGER::JPrescaler::~JPrescaler ( )
inlinevirtual

Virtual destructor.

Definition at line 50 of file JPrescaler.hh.

51  {}

Member Function Documentation

◆ equals()

bool JTRIGGER::JPrescaler::equals ( const JPrescaler prescaler) const
inline

Equality.

Parameters
prescalerprescaler
Returns
true if equals; else false

Definition at line 60 of file JPrescaler.hh.

61  {
62  return prescale == prescaler.prescale;
63  }

◆ operator()()

bool JTRIGGER::JPrescaler::operator() ( ) const
inline

Test operator.

This operator increments the internal counter and checks whether this counter complies with the prescale value.

Returns
true if this turn not prescaled; else false

Definition at line 74 of file JPrescaler.hh.

75  {
76  ++counter;
77 
78  return prescale != 0 && counter%prescale == 0;
79  }

◆ operator bool()

JTRIGGER::JPrescaler::operator bool ( ) const
inline

Check status.

Returns
true if this turn not prescaled; else false

Definition at line 87 of file JPrescaler.hh.

88  {
89  return prescale != 0 && counter%prescale == 0;
90  }

◆ ClassDef()

JTRIGGER::JPrescaler::ClassDef ( JPrescaler  ,
 
)

Member Data Documentation

◆ prescale

long long int JTRIGGER::JPrescaler::prescale

Definition at line 96 of file JPrescaler.hh.

◆ counter

long long int JTRIGGER::JPrescaler::counter
mutable

Definition at line 97 of file JPrescaler.hh.


The documentation for this class was generated from the following file:
JTRIGGER::JPrescaler::prescale
long long int prescale
Definition: JPrescaler.hh:96
JTRIGGER::JPrescaler::counter
long long int counter
Definition: JPrescaler.hh:97