Jpp
Public Member Functions | Public Attributes | Friends | List of all members
JAANET::JHit_t Struct Reference

Auxiliary class to set-up Hit. More...

#include <JHit_t.hh>

Public Member Functions

 JHit_t (const int id, const int pmt_id, const int type, const int origin, const double t, const int npe)
 Constructor. More...
 
 operator const Hit & () const
 Type conversion operator. More...
 

Public Attributes

int id
 
int pmt_id
 
int type
 
int origin
 
double t
 
int npe
 

Friends

bool operator< (const JHit_t &first, const JHit_t &second)
 Less than operator for hits. More...
 

Detailed Description

Auxiliary class to set-up Hit.

This class is primarily used to limit the size of a Monte Carlo hit and thereby the memory usage of applications in case of large numbers of hits.

Definition at line 25 of file JHit_t.hh.

Constructor & Destructor Documentation

◆ JHit_t()

JAANET::JHit_t::JHit_t ( const int  id,
const int  pmt_id,
const int  type,
const int  origin,
const double  t,
const int  npe 
)
inline

Constructor.

Parameters
ididentifier
pmt_idPMT identifier
typetype
originorigin
ttime [ns]
npenumber of photo-electrons

Definition at line 37 of file JHit_t.hh.

43  {
44  this->id = id;
45  this->pmt_id = pmt_id;
46  this->type = type;
47  this->origin = origin;
48  this->t = t;
49  this->npe = npe;
50  }

Member Function Documentation

◆ operator const Hit &()

JAANET::JHit_t::operator const Hit & ( ) const
inline

Type conversion operator.

Returns
hit

Definition at line 58 of file JHit_t.hh.

59  {
60  static Hit hit;
61 
62  hit.id = this->id;
63  hit.pmt_id = this->pmt_id;
64  hit.type = this->type;
65  hit.origin = this->origin;
66  hit.pure_t = this->t;
67  hit.pure_a = this->npe;
68  hit.t = this->t;
69  hit.a = this->npe;
70 
71  return hit;
72  }

Friends And Related Function Documentation

◆ operator<

bool operator< ( const JHit_t first,
const JHit_t second 
)
friend

Less than operator for hits.

First hit is defined as:

  1. smallest PMT identifier;
  2. earliest time if same PMT identifier;
Parameters
firstfirst hit
secondsecond hit
Returns
true if first hit earlier than second hit; else false

Definition at line 86 of file JHit_t.hh.

87  {
88  if (first.pmt_id == second.pmt_id)
89  return first.t < second.t;
90  else
91  return first.pmt_id < second.pmt_id;
92  }

Member Data Documentation

◆ id

int JAANET::JHit_t::id

Definition at line 95 of file JHit_t.hh.

◆ pmt_id

int JAANET::JHit_t::pmt_id

Definition at line 96 of file JHit_t.hh.

◆ type

int JAANET::JHit_t::type

Definition at line 97 of file JHit_t.hh.

◆ origin

int JAANET::JHit_t::origin

Definition at line 98 of file JHit_t.hh.

◆ t

double JAANET::JHit_t::t

Definition at line 99 of file JHit_t.hh.

◆ npe

int JAANET::JHit_t::npe

Definition at line 100 of file JHit_t.hh.


The documentation for this struct was generated from the following file:
JAANET::JHit_t::npe
int npe
Definition: JHit_t.hh:100
JAANET::JHit_t::t
double t
Definition: JHit_t.hh:99
JAANET::JHit_t::origin
int origin
Definition: JHit_t.hh:98
JAANET::JHit_t::type
int type
Definition: JHit_t.hh:97
JAANET::JHit_t::id
int id
Definition: JHit_t.hh:95
JAANET::JHit_t::pmt_id
int pmt_id
Definition: JHit_t.hh:96