Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JRECONSTRUCTION::JStart Struct Reference

Auxiliary class for start or end point evaluation. More...

#include <JStart.hh>

Public Member Functions

 JStart ()
 Default constructor.
 
 JStart (const double Pmin1, const double Pmin2, const int Nmax2)
 Constructor.
 
bool is_valid () const
 Check validity of start or end point conditions.
 
template<class T >
find (T __begin, T __end) const
 Get start point of muon trajectory.
 

Public Attributes

double Pmin1
 minimal probability single observation
 
double Pmin2
 minimal probability for twofold observations
 
int Nmax2
 maximal number for twofold observations
 

Friends

std::istream & operator>> (std::istream &in, JStart &parameters)
 Read parameters from input.
 
std::ostream & operator<< (std::ostream &out, const JStart &parameters)
 Write parameters to output.
 

Detailed Description

Auxiliary class for start or end point evaluation.

Definition at line 21 of file JStart.hh.

Constructor & Destructor Documentation

◆ JStart() [1/2]

JRECONSTRUCTION::JStart::JStart ( )
inline

Default constructor.

Definition at line 25 of file JStart.hh.

25 :
26 Pmin1(0.0),
27 Pmin2(0.0),
28 Nmax2(0)
29 {}
int Nmax2
maximal number for twofold observations
Definition JStart.hh:130
double Pmin2
minimal probability for twofold observations
Definition JStart.hh:129
double Pmin1
minimal probability single observation
Definition JStart.hh:128

◆ JStart() [2/2]

JRECONSTRUCTION::JStart::JStart ( const double Pmin1,
const double Pmin2,
const int Nmax2 )
inline

Constructor.

Parameters
Pmin1minimal probability single observation
Pmin2minimal probability for twofold observations
Nmax2maximal number for twofold observations

Definition at line 39 of file JStart.hh.

41 :
42 Pmin1(Pmin1),
43 Pmin2(Pmin2),
45 {}

Member Function Documentation

◆ is_valid()

bool JRECONSTRUCTION::JStart::is_valid ( ) const
inline

Check validity of start or end point conditions.

Returns
true if valid; else false

Definition at line 53 of file JStart.hh.

54 {
55 return (Pmin1 >= 0.0 && Pmin1 <= 1.0 &&
56 Pmin2 >= 0.0 && Pmin2 <= 1.0);
57 }

◆ find()

template<class T >
T JRECONSTRUCTION::JStart::find ( T __begin,
T __end ) const
inline

Get start point of muon trajectory.

The template parameter should correspond to a data type which has the member method:

    double getP() const;    // return probability

The input data should have been sorted along the muon path beforehand.
A start point is triggered when an observed probability is less than Pmin1 or when there are two probabilities less than Pmin2 within Nmax2 consecutive observations.
The start or end point can found by providing the data in ascending or descending order, respectively.

Parameters
__beginbegin of data
__endend of data
Returns
start point

Definition at line 77 of file JStart.hh.

78 {
79 for (T p = __begin; p != __end; ++p) {
80
81 if (p->getP() < this->Pmin1) {
82 return p;
83 }
84
85 if (p->getP() < this->Pmin2) {
86 for (T q = p; ++q != __end && distance(p,q) < Nmax2; ) {
87 if (q->getP() < this->Pmin2) {
88 return p;
89 }
90 }
91 }
92 }
93
94 return __end;
95 }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.

Friends And Related Symbol Documentation

◆ operator>>

std::istream & operator>> ( std::istream & in,
JStart & parameters )
friend

Read parameters from input.

Parameters
ininput stream
parametersparameters
Returns
input stream

Definition at line 105 of file JStart.hh.

106 {
107 in >> parameters.Pmin1 >> parameters.Pmin2 >> parameters.Nmax2;
108
109 return in;
110 }

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const JStart & parameters )
friend

Write parameters to output.

Parameters
outoutput stream
parametersparameters
Returns
output stream

Definition at line 120 of file JStart.hh.

121 {
122 out << parameters.Pmin1 << ' ' << parameters.Pmin2 << ' ' << parameters.Nmax2;
123
124 return out;
125 }

Member Data Documentation

◆ Pmin1

double JRECONSTRUCTION::JStart::Pmin1

minimal probability single observation

Definition at line 128 of file JStart.hh.

◆ Pmin2

double JRECONSTRUCTION::JStart::Pmin2

minimal probability for twofold observations

Definition at line 129 of file JStart.hh.

◆ Nmax2

int JRECONSTRUCTION::JStart::Nmax2

maximal number for twofold observations

Definition at line 130 of file JStart.hh.


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