Jpp
 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 107 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 118 of file JHit_t.hh.

119  {
120  using namespace std;
121 
122  if (!this->empty()) {
123 
124  sort(this->begin(), this->end());
125 
126  iterator in = this->begin();
127  iterator out = this->begin();
128 
129  out->id = 1; // set first hit identifier
130 
131  while (++in != this->end()) {
132 
133  if (out->pmt_id == in->pmt_id && in->t - out->t <= Tmax_ns) {
134 
135  out->npe += in->npe; // accumulate number of photo-electrons
136 
137  } else {
138 
139  int id = out->id;
140 
141  ++out; // increment desitination address
142 
143  *out = *in; // copy first new hit
144 
145  out->id = ++id; // set hit identifier
146  }
147  }
148 
149  this->erase(++out, this->end()); // remove hits
150  }
151  }
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45

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