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 min_M
 

Detailed Description

Auxiliary class to build the supernova trigger dataset.

Definition at line 158 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 173 of file JSupernova.hh.

174  : TMax_ns(window), min_M(threshold)
175  { };

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

182  {
183 
184  if (in.size() > 1) {
185 
186  for (vector<JHitR0>::const_iterator p = in.begin(); p != in.end(); ) {
187 
189 
190  while (++q != in.end() && q->getT() - p->getT() <= TMax_ns ) {}
191 
192  int M = distance(p, q);
193 
194  if (M >= min_M) {
195  this->push_back(JCoincidenceSN(p->getT(), M, moduleID));
196  }
197 
198  p = q;
199 
200  }
201  }
202  }
do $JPP JMEstimator M
Definition: JMEstimator.sh:37
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
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 212 of file JSupernova.hh.

212  {
213 
214  frameIndex = timeslice->getFrameIndex();
215  timeUTC = timeslice->getTimesliceStart();
216 
217  typedef JHitR0 hit_t;
218 
219  typedef JSuperFrame2D<hit_t> JSuperFrame2D_t;
220 
221  typedef JSuperFrame1D<hit_t> JSuperFrame1D_t;
222 
223  const JMatchL0<hit_t> match(TMax_ns);
224 
225  for (JDAQTimeslice::const_iterator frame = timeslice->begin(); frame != timeslice->end(); ++frame) {
226 
227  int moduleID = frame->getModuleID();
228 
229  JSuperFrame2D_t& buffer = JSuperFrame2D_t::demultiplex(*frame, moduleRouter.getModule(moduleID));
230 
231  buffer.preprocess(JPreprocessor::join_t, match);
232 
233  JSuperFrame1D_t& data = JSuperFrame1D_t::multiplex(buffer); data.pop_back();
234 
235  (*this)(data, moduleID);
236 
237  }
238 
239  sort(this->begin(), this->end());
240 
241  }
JDAQUTCExtended getTimesliceStart() const
Get start of timeslice.
const JModule & getModule(const JObjectID &id) const
Get module parameters.
L0 match criterion.
Definition: JMatchL0.hh:27
int getFrameIndex() const
Get frame index.
1-dimensional frame with time calibrated data from one optical module.
JDAQUTCExtended timeUTC
Definition: JSupernova.hh:167
join consecutive hits according match criterion
Reduced data structure for L0 hit.
Definition: JHitR0.hh:25
const char *const hit_t
Definition: io_ascii.hh:23
2-dimensional frame with time calibrated data from one optical module.

Member Data Documentation

int JSUPERNOVA::JDataSN::TMax_ns
private

Definition at line 162 of file JSupernova.hh.

int JSUPERNOVA::JDataSN::min_M
private

Definition at line 163 of file JSupernova.hh.

int JSUPERNOVA::JDataSN::frameIndex

Definition at line 166 of file JSupernova.hh.

JDAQUTCExtended JSUPERNOVA::JDataSN::timeUTC

Definition at line 167 of file JSupernova.hh.


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