Jpp  18.5.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 137 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 148 of file JSirene.hh.

149  {
150  using namespace std;
151 
152  if (!this->empty()) {
153 
154  sort(this->begin(), this->end());
155 
156  iterator in = this->begin();
157  iterator out = this->begin();
158 
159  out->id = 1; // set first hit identifier
160 
161  while (++in != this->end()) {
162 
163  if (out->pmt_id == in->pmt_id && in->t - out->t <= Tmax_ns) {
164 
165  out->npe += in->npe; // accumulate number of photo-electrons
166 
167  } else {
168 
169  int id = out->id;
170 
171  ++out; // increment desitination address
172 
173  *out = *in; // copy first new hit
174 
175  out->id = ++id; // set hit identifier
176  }
177  }
178 
179  this->erase(++out, this->end()); // remove hits
180  }
181  }
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:48

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