Jpp
Public Types | Public Member Functions | Protected Attributes | List of all members
JFIT::JK40Hit Struct Reference

Auxiliary class for simultaneously handling light yields and response of module. More...

#include <JK40Hit.hh>

Inheritance diagram for JFIT::JK40Hit:
JLANG::JObjectID JFIT::JK40 JLANG::JComparable< JObjectID > JLANG::JComparable< JObjectID, int >

Public Types

typedef std::vector< double > JL1_t
 Type definition of expectation values of number of multiple hits. More...
 

Public Member Functions

 JK40Hit ()
 Default constructor. More...
 
 JK40Hit (const JModuleIdentifier &id, const JK40 &k40, const size_t n)
 Constructor. More...
 
size_t getN () const
 Get number of hits. More...
 
double getP () const
 Get probability. More...
 
double getP (size_t M) const
 Get probability to observe a hit with given multiplicity. More...
 
int getID () const
 Get identifier. More...
 
void setID (const int id)
 Set identifier. More...
 
bool less (const JObjectID &object) const
 Less than method. More...
 
bool less (const int id) const
 Less than method. More...
 
bool more (const int id) const
 More than method. More...
 
double getY0 () const
 Get expectation value for number of single hits. More...
 
double getY1 (const size_t M) const
 Get expectation value for number of multiple hits. More...
 
double getP (size_t M) const
 Get probability to observe a hit with given multiplicity. More...
 

Protected Attributes

size_t __n
 
int __id
 
double __y0
 expectation value of number of single hits More...
 
JL1_t __y1
 expectation values of number of multiple hits More...
 

Detailed Description

Auxiliary class for simultaneously handling light yields and response of module.

Definition at line 23 of file JK40Hit.hh.

Member Typedef Documentation

◆ JL1_t

typedef std::vector<double> JFIT::JK40::JL1_t
inherited

Type definition of expectation values of number of multiple hits.

Definition at line 34 of file JK40.hh.

Constructor & Destructor Documentation

◆ JK40Hit() [1/2]

JFIT::JK40Hit::JK40Hit ( )
inline

Default constructor.

Definition at line 32 of file JK40Hit.hh.

32  :
34  JK40(),
35  __n (0)
36  {}

◆ JK40Hit() [2/2]

JFIT::JK40Hit::JK40Hit ( const JModuleIdentifier id,
const JK40 k40,
const size_t  n 
)
inline

Constructor.

Parameters
idmodule identifier
k40k40
nnumber of hits

Definition at line 46 of file JK40Hit.hh.

48  :
50  JK40(k40),
51  __n (n)
52  {}

Member Function Documentation

◆ getN()

size_t JFIT::JK40Hit::getN ( ) const
inline

Get number of hits.

Returns
number of hits

Definition at line 60 of file JK40Hit.hh.

61  {
62  return __n;
63  }

◆ getP() [1/3]

double JFIT::JK40Hit::getP ( ) const
inline

Get probability.

Returns
probability

Definition at line 71 of file JK40Hit.hh.

72  {
73  return this->getP(this->getN());
74  }

◆ getP() [2/3]

double JFIT::JK40::getP
inline

Get probability to observe a hit with given multiplicity.

Note that if M = 0, the probability corresponds to observing no hits.

Parameters
Mmultiplicity (M >= 0)
Returns
probability

Definition at line 129 of file JK40.hh.

130  {
131  double expval = 0.0;
132 
133  if (M < 2)
134  expval = getY0();
135  else
136  expval = getY1(M);
137 
138  return JFIT::getP(expval, M != 0);
139  }

◆ getID()

int JLANG::JObjectID::getID ( ) const
inlineinherited

Get identifier.

Returns
identifier

Definition at line 55 of file JObjectID.hh.

56  {
57  return __id;
58  }

◆ setID()

void JLANG::JObjectID::setID ( const int  id)
inlineinherited

Set identifier.

Parameters
ididentifier

Definition at line 66 of file JObjectID.hh.

67  {
68  this->__id = id;
69  }

◆ less() [1/2]

bool JLANG::JObjectID::less ( const JObjectID object) const
inlineinherited

Less than method.

Parameters
objectobject identifier
Returns
true if this identifier less than given identifier; else false

Definition at line 78 of file JObjectID.hh.

79  {
80  return this->getID() < object.getID();
81  }

◆ less() [2/2]

bool JLANG::JObjectID::less ( const int  id) const
inlineinherited

Less than method.

Parameters
ididentifier
Returns
true if this identifier less than given identifier; else false

Definition at line 90 of file JObjectID.hh.

91  {
92  return this->getID() < id;
93  }

◆ more()

bool JLANG::JObjectID::more ( const int  id) const
inlineinherited

More than method.

Parameters
ididentifier
Returns
true if this identifier greater than given identifier; else false

Definition at line 102 of file JObjectID.hh.

103  {
104  return this->getID() > id;
105  }

◆ getY0()

double JFIT::JK40::getY0 ( ) const
inlineinherited

Get expectation value for number of single hits.

Returns
expectation value

Definition at line 101 of file JK40.hh.

102  {
103  return __y0;
104  }

◆ getY1()

double JFIT::JK40::getY1 ( const size_t  M) const
inlineinherited

Get expectation value for number of multiple hits.

Parameters
Mmultiplicity (M >= 2)
Returns
expectation value

Definition at line 113 of file JK40.hh.

114  {
115  if (M >= 2 && M - 2 < __y1.size())
116  return __y1[M-2];
117  else
118  return 0.0;
119  }

◆ getP() [3/3]

double JFIT::JK40::getP ( size_t  M) const
inlineinherited

Get probability to observe a hit with given multiplicity.

Note that if M = 0, the probability corresponds to observing no hits.

Parameters
Mmultiplicity (M >= 0)
Returns
probability

Definition at line 129 of file JK40.hh.

130  {
131  double expval = 0.0;
132 
133  if (M < 2)
134  expval = getY0();
135  else
136  expval = getY1(M);
137 
138  return JFIT::getP(expval, M != 0);
139  }

Member Data Documentation

◆ __n

size_t JFIT::JK40Hit::__n
protected

Definition at line 77 of file JK40Hit.hh.

◆ __id

int JLANG::JObjectID::__id
protectedinherited

Definition at line 160 of file JObjectID.hh.

◆ __y0

double JFIT::JK40::__y0
protectedinherited

expectation value of number of single hits

Definition at line 142 of file JK40.hh.

◆ __y1

JL1_t JFIT::JK40::__y1
protectedinherited

expectation values of number of multiple hits

Definition at line 143 of file JK40.hh.


The documentation for this struct was generated from the following file:
JDETECTOR::JModuleIdentifier
JLANG::JObjectID JModuleIdentifier
Definition: JModuleIdentifier.hh:16
JFIT::JK40Hit::getN
size_t getN() const
Get number of hits.
Definition: JK40Hit.hh:60
JTOOLS::n
const int n
Definition: JPolint.hh:628
JFIT::JK40::__y0
double __y0
expectation value of number of single hits
Definition: JK40.hh:142
JFIT::JK40::getY0
double getY0() const
Get expectation value for number of single hits.
Definition: JK40.hh:101
JLANG::JObjectID::getID
int getID() const
Get identifier.
Definition: JObjectID.hh:55
JFIT::JK40Hit::getP
double getP() const
Get probability.
Definition: JK40Hit.hh:71
JFIT::JK40Hit::__n
size_t __n
Definition: JK40Hit.hh:77
JLANG::JObjectID::__id
int __id
Definition: JObjectID.hh:160
JFIT::getP
double getP(const double expval, bool hit)
Get Poisson probability to observe a hit or not for given expectation value for the number of hits.
Definition: JFitToolkit.hh:37
JFIT::JK40::JK40
JK40()
Default constructor.
Definition: JK40.hh:40
JFIT::JK40::getY1
double getY1(const size_t M) const
Get expectation value for number of multiple hits.
Definition: JK40.hh:113
JFIT::JK40::__y1
JL1_t __y1
expectation values of number of multiple hits
Definition: JK40.hh:143