Jpp  master_rocky-40-g5f0272dcd
the software that should make you happy
Public Member Functions | Public Attributes | Private Attributes | List of all members
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. More...
 
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. More...
 
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. More...
 

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

219  : TMax_ns(window), min_M(threshold) // , hitSelector(selector)
220  { };

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

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

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

◆ min_M

int JSUPERNOVA::JDataSN::min_M
private

Definition at line 207 of file JSupernova.hh.

◆ frameIndex

int JSUPERNOVA::JDataSN::frameIndex

Definition at line 211 of file JSupernova.hh.

◆ timeUTC

JDAQUTCExtended JSUPERNOVA::JDataSN::timeUTC

Definition at line 212 of file JSupernova.hh.


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