Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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() (vector< JHitR0 > in, int moduleID)
 Builds coincidences from calibrated hit data and loads them in the internal vector. More...
 
void operator() (const JDAQTimeslice *timeslice, const JModuleRouter &moduleRouter)
 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 multiplicityThreshold
 

Detailed Description

Auxiliary class to build the supernova trigger dataset.

Definition at line 121 of file JSupernova.hh.

Constructor & Destructor Documentation

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

137  : TMax_ns(window), multiplicityThreshold(threshold)
138  { };

Member Function Documentation

void JSUPERNOVA::JDataSN::operator() ( vector< JHitR0 in,
int  moduleID 
)
inline

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

Parameters
inhit data
moduleIDoptical module ID for the hit data

Definition at line 145 of file JSupernova.hh.

145  {
146 
147  if (in.size() > 1) {
148 
149  for (vector<JHitR0>::const_iterator p = in.begin(); p != in.end(); ) {
150 
152 
153  while (++q != in.end() && q->getT() - p->getT() <= TMax_ns ) {}
154 
155  int M = distance(p, q);
156 
157  if (M >= multiplicityThreshold)
158  { this->push_back(JCoincidenceSN(p->getT(), M, moduleID)); }
159 
160  p = q;
161 
162  }
163  }
164  }
void JSUPERNOVA::JDataSN::operator() ( const JDAQTimeslice timeslice,
const JModuleRouter moduleRouter 
)
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

Definition at line 174 of file JSupernova.hh.

174  {
175 
176  frameIndex = timeslice->getFrameIndex();
177  timeUTC = timeslice->getTimesliceStart();
178 
179  typedef JSuperFrame2D<JHitR0> JSuperFrame2D_t;
180 
181  typedef JSuperFrame1D<JHitR0> JSuperFrame1D_t;
182 
183  const JMatch_t match(TMax_ns);
184 
185  for (JDAQTimeslice::const_iterator frame = timeslice->begin(); frame != timeslice->end(); ++frame) {
186 
187  int moduleID = frame->getModuleID();
188 
189  JSuperFrame2D_t& buffer = JSuperFrame2D_t::demultiplex(*frame, moduleRouter.getModule(moduleID));
190 
191  for (JSuperFrame2D_t::iterator i = buffer.begin(); i != buffer.end(); ++i) { i->join(match); }
192 
193  JSuperFrame1D_t& data = JSuperFrame1D_t::multiplex(buffer); data.pop_back();
194 
195  (*this)(data, moduleID);
196 
197  }
198 
199  sort(this->begin(), this->end());
200 
201  }
const JDAQUTCExtended & getTimesliceStart() const
Get start of timeslice.
JSuperFrame2D< hit_type > JSuperFrame2D_t
Definition: JDataFilter.cc:93
int getFrameIndex() const
Get frame index.
JDAQUTCExtended timeUTC
Definition: JSupernova.hh:130
std::vector< frame_type >::iterator iterator
JSuperFrame1D< hit_type > JSuperFrame1D_t
Definition: JDataFilter.cc:92

Member Data Documentation

int JSUPERNOVA::JDataSN::TMax_ns
private

Definition at line 125 of file JSupernova.hh.

int JSUPERNOVA::JDataSN::multiplicityThreshold
private

Definition at line 126 of file JSupernova.hh.

int JSUPERNOVA::JDataSN::frameIndex

Definition at line 129 of file JSupernova.hh.

JDAQUTCExtended JSUPERNOVA::JDataSN::timeUTC

Definition at line 130 of file JSupernova.hh.


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