Jpp  15.0.1-rc.2-highQE
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
JAANET::JHits_t Struct Reference

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

#include <JHit_t.hh>

Inheritance diagram for JAANET::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 105 of file JHit_t.hh.

Member Function Documentation

void JAANET::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 116 of file JHit_t.hh.

117  {
118  using namespace std;
119 
120  if (!this->empty()) {
121 
122  sort(this->begin(), this->end());
123 
124  iterator in = this->begin();
125  iterator out = this->begin();
126 
127  out->id = 1; // set first hit identifier
128 
129  while (++in != this->end()) {
130 
131  if (out->pmt_id == in->pmt_id && in->t - out->t <= Tmax_ns) {
132 
133  out->npe += in->npe; // accumulate number of photo-electrons
134 
135  } else {
136 
137  int id = out->id;
138 
139  ++out; // increment desitination address
140 
141  *out = *in; // copy first new hit
142 
143  out->id = ++id; // set hit identifier
144  }
145  }
146 
147  this->erase(++out, this->end()); // remove hits
148  }
149  }
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 source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:41

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