Jpp 19.3.0-rc.4
the software that should make you happy
Loading...
Searching...
No Matches
JSUPERNOVA::JDataSN Class Reference

Auxiliary class to build the supernova trigger dataset. More...

#include <JSupernova.hh>

Inheritance diagram for JSUPERNOVA::JDataSN:
std::vector< JCoincidenceSN >

Public Member Functions

 JDataSN (double window, int threshold=4)
 Default constructor Configures the trigger with a time window and the pretrigger threshold.
 
void operator() (const vector< JHitR0 > &in, const int &moduleID, const JDetector &det=JDetector())
 Builds coincidences from calibrated hit data and loads them in the internal vector.
 
void operator() (const JDAQTimeslice *timeslice, const JModuleRouter &moduleRouter, const JDAQHitSelector &selector=JDAQHitDefaultSelector(), const JDetector &det=JDetector())
 Builds coincidences from a timeslice and loads them into the internal vector.
 

Public Attributes

int frameIndex
 
JDAQUTCExtended timeUTC
 

Private Attributes

int TMax_ns
 
int min_M
 

Detailed Description

Auxiliary class to build the supernova trigger dataset.

Definition at line 204 of file JSupernova.hh.

Constructor & Destructor Documentation

◆ JDataSN()

JSUPERNOVA::JDataSN::JDataSN ( double window,
int threshold = 4 )
inline

Default constructor Configures the trigger with a time window and the pretrigger threshold.

Definition at line 220 of file JSupernova.hh.

221 : TMax_ns(window), min_M(threshold) // , hitSelector(selector)
222 { };

Member Function Documentation

◆ operator()() [1/2]

void JSUPERNOVA::JDataSN::operator() ( const vector< JHitR0 > & in,
const int & moduleID,
const JDetector & det = JDetector() )
inline

Builds coincidences from calibrated hit data and loads them in the internal vector.

Parameters
inhit data
moduleIDoptical module ID for the hit data
detsingle-DOM detx file used to simulate CCSN neutrinos (default: empty detector)

Definition at line 230 of file JSupernova.hh.

230 {
231
232 if (in.size() > 1) {
233
234 for (vector<JHitR0>::const_iterator p = in.begin(); p != in.end(); ) {
235
236 vector<JHitR0>::const_iterator q = p;
237
238 while (++q != in.end() && q->getT() - p->getT() <= TMax_ns ) {}
239
240 int M = distance(p, q);
241
242 if (M >= min_M) {
243 JCoincidenceSN coincidence(p->getT(), M, moduleID);
244 if (det.size() > 0) {
245 vector<JHitR0> coincidence_hits;
246 coincidence_hits.assign(p,q);
247 coincidence(coincidence_hits, det);
248 }
249 this->push_back(coincidence);
250 }
251
252 p = q;
253
254 }
255 }
256 }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.

◆ operator()() [2/2]

void JSUPERNOVA::JDataSN::operator() ( const JDAQTimeslice * timeslice,
const JModuleRouter & moduleRouter,
const JDAQHitSelector & selector = JDAQHitDefaultSelector(),
const JDetector & det = JDetector() )
inline

Builds coincidences from a timeslice and loads them into the internal vector.

Double pulses are merged according to the coincidence time window.

Parameters
timesliceinput timeslice
moduleRouterdetector module router
selectorhit selector
detsingle-DOM detx file used to simulate signal events

Definition at line 268 of file JSupernova.hh.

268 {
269
270 frameIndex = timeslice->getFrameIndex();
271 timeUTC = timeslice->getTimesliceStart();
272
273 typedef JHitR0 hit_t;
274
275 typedef JSuperFrame2D<hit_t> JSuperFrame2D_t;
276
277 typedef JSuperFrame1D<hit_t> JSuperFrame1D_t;
278
279 const JMatchL0<hit_t> match(TMax_ns);
280
281 for (JDAQTimeslice::const_iterator frame = timeslice->begin(); frame != timeslice->end(); ++frame) {
282
283 int moduleID = frame->getModuleID();
284
285 JSuperFrame2D_t& buffer = JSuperFrame2D_t::demultiplex(*frame,
286 moduleRouter.getModule(moduleID),
287 selector);
288
289 buffer.preprocess(JPreprocessor::join_t, match);
290
291 JSuperFrame1D_t& data = JSuperFrame1D_t::multiplex(buffer);
292
293 if (det.size() < 0)(*this)(data, moduleID);
294 else (*this)(data, moduleID, det);
295
296 }
297
298 sort(this->begin(), this->end());
299
300 }
const JModule & getModule(const JObjectID &id) const
Get module parameters.
JDAQUTCExtended timeUTC
Reduced data structure for L0 hit.
Definition JHitR0.hh:27
L0 match criterion.
Definition JMatchL0.hh:29
1-dimensional frame with time calibrated data from one optical module.
2-dimensional frame with time calibrated data from one optical module.
JDAQUTCExtended getTimesliceStart() const
Get start of timeslice.
int getFrameIndex() const
Get frame index.
const char *const hit_t
Definition io_ascii.hh:24
@ join_t
join consecutive hits according match criterion

Member Data Documentation

◆ TMax_ns

int JSUPERNOVA::JDataSN::TMax_ns
private

Definition at line 208 of file JSupernova.hh.

◆ min_M

int JSUPERNOVA::JDataSN::min_M
private

Definition at line 209 of file JSupernova.hh.

◆ frameIndex

int JSUPERNOVA::JDataSN::frameIndex

Definition at line 213 of file JSupernova.hh.

◆ timeUTC

JDAQUTCExtended JSUPERNOVA::JDataSN::timeUTC

Definition at line 214 of file JSupernova.hh.


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