Jpp 20.0.0-rc.9-29-gccc23c492-D
the software that should make you happy
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Friends | List of all members
JACOUSTICS::event_type Struct Reference

Event with vertex. More...

Inheritance diagram for JACOUSTICS::event_type:
JACOUSTICS::JEvent JACOUSTICS::JCounter

Public Member Functions

 event_type ()
 Default constructor.
 
 event_type (const JEvent &event)
 Copy constructor.
 
 event_type (const JVertex3D &vertex, const JEvent &event)
 Constructor.
 
double getQ () const
 Get average quality.
 
const int getDetectorID () const
 Get detector identifier.
 
int getOverlays () const
 Get number of overlayed events.
 
int getID () const
 Get emitter identifier.
 
void merge (const JEvent &event)
 Merge event.
 
virtual JReader & read (JReader &in) override
 Read from input.
 
virtual JWriter & write (JWriter &out) const override
 Write to output.
 
 ClassDefOverride (JEvent, 4)
 
int getCounter () const
 Get counter.
 
 ClassDefNV (JCounter, 1)
 

Static Public Member Functions

template<class T >
static void overlap (T p, T q, const double Tmax_s)
 Empty overlapping events.
 

Static Public Attributes

static double TOA_s = std::numeric_limits<double>::max()
 start time of data
 

Protected Attributes

int detid
 
int overlays
 
int id
 
int counter
 

Friends

std::ostream & operator<< (std::ostream &out, const event_type &object)
 Write event to output stream.
 

Detailed Description

Event with vertex.

Definition at line 140 of file JAcousticsTriggerProcessor.cc.

Constructor & Destructor Documentation

◆ event_type() [1/3]

JACOUSTICS::event_type::event_type ( )
inline

Default constructor.

Definition at line 147 of file JAcousticsTriggerProcessor.cc.

147 :
148 JVertex3D(),
149 JEvent()
150 {}
JEvent()
Default constructor.
Definition JEvent.hh:78

◆ event_type() [2/3]

JACOUSTICS::event_type::event_type ( const JEvent & event)
inline

Copy constructor.

Parameters
eventevent

Definition at line 158 of file JAcousticsTriggerProcessor.cc.

158 :
159 JVertex3D(),
160 JEvent(event)
161 {}

◆ event_type() [3/3]

JACOUSTICS::event_type::event_type ( const JVertex3D & vertex,
const JEvent & event )
inline

Constructor.

Parameters
vertexvertex
eventevent

Definition at line 170 of file JAcousticsTriggerProcessor.cc.

171 :
172 JVertex3D(vertex),
173 JEvent(event)
174 {}

Member Function Documentation

◆ getQ()

double JACOUSTICS::event_type::getQ ( ) const
inline

Get average quality.

Returns
quality

Definition at line 182 of file JAcousticsTriggerProcessor.cc.

183 {
184 double Q = 0.0;
185
186 if (!this->empty()) {
187
188 for (const_iterator i = this->begin(); i != this->end(); ++i) {
189 Q += i->getQ();
190 }
191
192 Q /= this->size();
193 }
194
195 return Q;
196 }

◆ getDetectorID()

const int JACOUSTICS::JEvent::getDetectorID ( ) const
inlineinherited

Get detector identifier.

Returns
detector identifier.

Definition at line 129 of file JEvent.hh.

130 {
131 return detid;
132 }

◆ getOverlays()

int JACOUSTICS::JEvent::getOverlays ( ) const
inlineinherited

Get number of overlayed events.

Returns
overlays

Definition at line 140 of file JEvent.hh.

141 {
142 return overlays;
143 }

◆ getID()

int JACOUSTICS::JEvent::getID ( ) const
inlineinherited

Get emitter identifier.

Returns
identifier

Definition at line 151 of file JEvent.hh.

152 {
153 return id;
154 }

◆ merge()

void JACOUSTICS::JEvent::merge ( const JEvent & event)
inlineinherited

Merge event.

It is assumed that the transmissions in both events are ordered according the default less-than operator.

Parameters
eventevent

Definition at line 165 of file JEvent.hh.

166 {
167 using namespace std;
168
169 vector<JTransmission> buffer;
170
171 const_iterator __hit1 = this ->begin();
172 const_iterator __end1 = this ->end();
173
174 const_iterator __hit2 = event.begin();
175 const_iterator __end2 = event.end();
176
177 buffer.resize(this->size() + event.size());
178
179 iterator out = buffer.begin();
180
181 while (__hit1 != __end1 && __hit2 != __end2) {
182
183 if (*__hit1 < *__hit2) {
184
185 *out = *__hit1;
186 ++__hit1;
187
188 } else if (*__hit2 < *__hit1) {
189
190 *out = *__hit2;
191 ++__hit2;
192
193 } else {
194
195 *out = *__hit1;
196
197 ++__hit1;
198 ++__hit2;
199 }
200
201 ++out;
202 }
203
204 // append remaining hits from either set
205
206 out = copy(__hit1, __end1, out);
207 out = copy(__hit2, __end2, out);
208
209 buffer.resize(distance(buffer.begin(), out));
210
211 this->swap(buffer);
212
213 ++overlays;
214 }
friend void swap(JEvent &first, JEvent &second)
Swap events.
Definition JEvent.hh:223

◆ overlap()

template<class T >
static void JACOUSTICS::JEvent::overlap ( T p,
T q,
const double Tmax_s )
inlinestaticinherited

Empty overlapping events.

The events should be time sorted on input.
The time window applies to the difference between the first transmission of an event and the last transmission of the previous event.

Parameters
pbegin of events
qend of events
Tmax_stime window [s]

Definition at line 247 of file JEvent.hh.

248 {
249 for (T __q = p, __p = __q++; __p != q && __q != q; __p = __q++) {
250
251 if (!__p->empty() &&
252 !__q->empty() &&
253 __q->begin()->getToE() < __p->rbegin()->getToE() + Tmax_s) {
254
255 __p->clear(); // clear first
256
257 for (__p = __q++; __p != q && __q != q; __p = __q++) {
258
259 if (__q->begin()->getToE() < __p->rbegin()->getToE() + Tmax_s)
260 __p->clear(); // clear intermediate
261 else
262 break;
263 }
264
265 __p->clear(); // clear last
266 }
267 }
268 }

◆ read()

virtual JReader & JACOUSTICS::JEvent::read ( JReader & in)
inlineoverridevirtualinherited

Read from input.

Parameters
inreader
Returns
reader

Definition at line 326 of file JEvent.hh.

327 {
328 in >> static_cast<JCounter&>(*this);
329 in >> this->detid;
330 in >> this->overlays;
331 in >> this->id;
332 in >> static_cast<std::vector<JTransmission>&>(*this);
333
334 return in;
335 }
JCounter()
Default constructor.
Definition JCounter.hh:30

◆ write()

virtual JWriter & JACOUSTICS::JEvent::write ( JWriter & out) const
inlineoverridevirtualinherited

Write to output.

Parameters
outwriter
Returns
writer

Definition at line 344 of file JEvent.hh.

345 {
346 out << static_cast<const JCounter&>(*this);
347 out << this->detid;
348 out << this->overlays;
349 out << this->id;
350 out << static_cast<const std::vector<JTransmission>&>(*this);
351
352 return out;
353 }

◆ ClassDefOverride()

JACOUSTICS::JEvent::ClassDefOverride ( JEvent ,
4  )
inherited

◆ getCounter()

int JACOUSTICS::JCounter::getCounter ( ) const
inlineinherited

Get counter.

Returns
counter

Definition at line 50 of file JCounter.hh.

51 {
52 return counter;
53 }

◆ ClassDefNV()

JACOUSTICS::JCounter::ClassDefNV ( JCounter ,
1  )
inherited

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const event_type & object )
friend

Write event to output stream.

Parameters
outoutput stream
Returns
object event
output stream

Definition at line 206 of file JAcousticsTriggerProcessor.cc.

207 {
208 using namespace std;
209
210 return out << setw(3) << object.getID() << ' '
211 << FIXED(9,3) << object.getT() - TOA_s << " [s]" << ' '
212 << setw(4) << object.size() << ' '
213 << FIXED(9,2) << object.getQ() << ' '
214 << object.getPosition();
215 }
static double TOA_s
start time of data

Member Data Documentation

◆ TOA_s

double JACOUSTICS::event_type::TOA_s = std::numeric_limits<double>::max()
static

start time of data

Set start time of data.

Definition at line 217 of file JAcousticsTriggerProcessor.cc.

◆ detid

int JACOUSTICS::JEvent::detid
protectedinherited

Definition at line 358 of file JEvent.hh.

◆ overlays

int JACOUSTICS::JEvent::overlays
protectedinherited

Definition at line 359 of file JEvent.hh.

◆ id

int JACOUSTICS::JEvent::id
protectedinherited

Definition at line 360 of file JEvent.hh.

◆ counter

int JACOUSTICS::JCounter::counter
protectedinherited

Definition at line 88 of file JCounter.hh.


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