Jpp  15.0.0-rc.2
the software that should make you happy
 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, const JDAQHitSelector &selector=JDAQHitDefaultSelector())
 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 134 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 150 of file JSupernova.hh.

151  : TMax_ns(window), min_M(threshold) // , hitSelector(selector)
152  { };

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

159  {
160 
161  if (in.size() > 1) {
162 
163  for (vector<JHitR0>::const_iterator p = in.begin(); p != in.end(); ) {
164 
166 
167  while (++q != in.end() && q->getT() - p->getT() <= TMax_ns ) {}
168 
169  int M = distance(p, q);
170 
171  if (M >= min_M) {
172  this->push_back(JCoincidenceSN(p->getT(), M, moduleID));
173  }
174 
175  p = q;
176 
177  }
178  }
179  }
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,
const JDAQHitSelector selector = JDAQHitDefaultSelector() 
)
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

Definition at line 190 of file JSupernova.hh.

190  {
191 
192  frameIndex = timeslice->getFrameIndex();
193  timeUTC = timeslice->getTimesliceStart();
194 
195  typedef JHitR0 hit_t;
196 
197  typedef JSuperFrame2D<hit_t> JSuperFrame2D_t;
198 
199  typedef JSuperFrame1D<hit_t> JSuperFrame1D_t;
200 
201  const JMatchL0<hit_t> match(TMax_ns);
202 
203  for (JDAQTimeslice::const_iterator frame = timeslice->begin(); frame != timeslice->end(); ++frame) {
204 
205  int moduleID = frame->getModuleID();
206 
207  JSuperFrame2D_t& buffer = JSuperFrame2D_t::demultiplex(*frame,
208  moduleRouter.getModule(moduleID),
209  selector);
210 
211  buffer.preprocess(JPreprocessor::join_t, match);
212 
213  JSuperFrame1D_t& data = JSuperFrame1D_t::multiplex(buffer);
214 
215  (*this)(data, moduleID);
216 
217  }
218 
219  sort(this->begin(), this->end());
220 
221  }
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:144
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:24
2-dimensional frame with time calibrated data from one optical module.

Member Data Documentation

int JSUPERNOVA::JDataSN::TMax_ns
private

Definition at line 138 of file JSupernova.hh.

int JSUPERNOVA::JDataSN::min_M
private

Definition at line 139 of file JSupernova.hh.

int JSUPERNOVA::JDataSN::frameIndex

Definition at line 143 of file JSupernova.hh.

JDAQUTCExtended JSUPERNOVA::JDataSN::timeUTC

Definition at line 144 of file JSupernova.hh.


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