Jpp in_tag_pdf_generation
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 205 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 221 of file JSupernova.hh.

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

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 231 of file JSupernova.hh.

231 {
232
233 if (in.size() > 1) {
234
235 for (vector<JHitR0>::const_iterator p = in.begin(); p != in.end(); ) {
236
237 vector<JHitR0>::const_iterator q = p;
238
239 while (++q != in.end() && q->getT() - p->getT() <= TMax_ns ) {}
240
241 int M = distance(p, q);
242
243 if (M >= min_M) {
244 JCoincidenceSN coincidence(p->getT(), M, moduleID);
245 if (det.size() > 0) {
246 vector<JHitR0> coincidence_hits;
247 coincidence_hits.assign(p,q);
248 coincidence(coincidence_hits, det);
249 }
250 this->push_back(coincidence);
251 }
252
253 p = q;
254
255 }
256 }
257 }
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 269 of file JSupernova.hh.

269 {
270
271 frameIndex = timeslice->getFrameIndex();
272 timeUTC = timeslice->getTimesliceStart();
273
274 typedef JHitR0 hit_t;
275
276 typedef JSuperFrame2D<hit_t> JSuperFrame2D_t;
277
278 typedef JSuperFrame1D<hit_t> JSuperFrame1D_t;
279
280 const JMatchL0<hit_t> match(TMax_ns);
281
282 for (JDAQTimeslice::const_iterator frame = timeslice->begin(); frame != timeslice->end(); ++frame) {
283
284 int moduleID = frame->getModuleID();
285
286 JSuperFrame2D_t& buffer = JSuperFrame2D_t::demultiplex(*frame,
287 moduleRouter.getModule(moduleID),
288 selector);
289
290 buffer.preprocess(JPreprocessor::join_t, match);
291
292 JSuperFrame1D_t& data = JSuperFrame1D_t::multiplex(buffer);
293
294 if (det.size() < 0)(*this)(data, moduleID);
295 else (*this)(data, moduleID, det);
296
297 }
298
299 sort(this->begin(), this->end());
300
301 }
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 209 of file JSupernova.hh.

◆ min_M

int JSUPERNOVA::JDataSN::min_M
private

Definition at line 210 of file JSupernova.hh.

◆ frameIndex

int JSUPERNOVA::JDataSN::frameIndex

Definition at line 214 of file JSupernova.hh.

◆ timeUTC

JDAQUTCExtended JSUPERNOVA::JDataSN::timeUTC

Definition at line 215 of file JSupernova.hh.


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