Jpp  17.2.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
JSIRENE::JHits_t Struct Reference

Auxiliary data structure for list of hits with hit merging capability. More...

#include <JSirene.hh>

Inheritance diagram for JSIRENE::JHits_t:
std::vector< JHit_t >

Public Member Functions

void merge (const double Tmax_ns)
 Merge hits on same PMT that are within given time window. More...
 

Detailed Description

Auxiliary data structure for list of hits with hit merging capability.

Definition at line 135 of file JSirene.hh.

Member Function Documentation

void JSIRENE::JHits_t::merge ( const double  Tmax_ns)
inline

Merge hits on same PMT that are within given time window.

The earliest hit has the sum of the number of photo-electrons of all following hits within given time window.
The hit identifiers are subsequently set in ascending order, starting at one.

Parameters
Tmax_nsmaximal time difference [ns]

Definition at line 146 of file JSirene.hh.

147  {
148  using namespace std;
149 
150  if (!this->empty()) {
151 
152  sort(this->begin(), this->end());
153 
154  iterator in = this->begin();
155  iterator out = this->begin();
156 
157  out->id = 1; // set first hit identifier
158 
159  while (++in != this->end()) {
160 
161  if (out->pmt_id == in->pmt_id && in->t - out->t <= Tmax_ns) {
162 
163  out->npe += in->npe; // accumulate number of photo-electrons
164 
165  } else {
166 
167  int id = out->id;
168 
169  ++out; // increment desitination address
170 
171  *out = *in; // copy first new hit
172 
173  out->id = ++id; // set hit identifier
174  }
175  }
176 
177  this->erase(++out, this->end()); // remove hits
178  }
179  }
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46

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