Jpp
Public Member Functions | List of all members
JTRIGGER::JTimesliceL1< JDAQTimeslice_t > Class Template Reference

Auxiliary class to build JDAQTimeslice for L1 timeslice. More...

#include <JTimesliceL1.hh>

Inheritance diagram for JTRIGGER::JTimesliceL1< JDAQTimeslice_t >:

Public Member Functions

 JTimesliceL1 ()
 Default constructor. More...
 
template<class JHit_t >
 JTimesliceL1 (const JTimeslice< JHit_t > &timeslice, const JTimesliceRouter &timesliceRouter, const JModuleRouter &moduleRouter, const double TMaxLocal_ns)
 Constructor. More...
 

Detailed Description

template<class JDAQTimeslice_t>
class JTRIGGER::JTimesliceL1< JDAQTimeslice_t >

Auxiliary class to build JDAQTimeslice for L1 timeslice.

Definition at line 36 of file JTimesliceL1.hh.

Constructor & Destructor Documentation

◆ JTimesliceL1() [1/2]

template<class JDAQTimeslice_t>
JTRIGGER::JTimesliceL1< JDAQTimeslice_t >::JTimesliceL1 ( )
inline

Default constructor.

Definition at line 45 of file JTimesliceL1.hh.

45  :
46  JDAQTimeslice_t()
47  {}

◆ JTimesliceL1() [2/2]

template<class JDAQTimeslice_t>
template<class JHit_t >
JTRIGGER::JTimesliceL1< JDAQTimeslice_t >::JTimesliceL1 ( const JTimeslice< JHit_t > &  timeslice,
const JTimesliceRouter timesliceRouter,
const JModuleRouter moduleRouter,
const double  TMaxLocal_ns 
)
inline

Constructor.

The raw data referenced in the time slice router are sampled according the triggered time slice data and the given time window.
The status of each frame is taken from the raw data.

Parameters
timeslicetriggered timeslice (e.g. L1)
timesliceRoutertimeslice router
moduleRoutermodule router
TMaxLocal_nstime window [ns]

Definition at line 63 of file JTimesliceL1.hh.

66  :
67  JDAQTimeslice_t()
68  {
69  using namespace std;
70 
71  this->setDAQChronometer(timeslice.getDAQChronometer());
72 
73  vector<JDAQHit> buffer;
74 
75  for (typename JTimeslice<JHit_t>::const_iterator frame = timeslice.begin(); frame != timeslice.end(); ++frame) {
76 
77  const JModule& module = moduleRouter.getModule(frame->getModuleID());
78  const JTimeRange timeOffset = getTimeRange(JTimeRange(0,0), module);
79 
80  buffer.clear();
81 
82  for (typename JFrame<JHit_t>::const_iterator p = frame->begin(); p != frame->end(); ) {
83 
84  double Tmin = frame->getT(*p);
85  double Tmax = Tmin + TMaxLocal_ns;
86 
87  while (++p != frame->end() && frame->getT(*p) <= Tmax) {
88  Tmax = frame->getT(*p) + TMaxLocal_ns;
89  }
90 
91  const JDAQFrameSubset& subset = timesliceRouter.getFrameSubset(frame->getModuleID(), JTimeRange(Tmin, Tmax).add(timeOffset));
92 
93  for (JDAQFrameSubset::const_iterator i = subset.begin(); i != subset.end(); ++i) {
94 
95  const JCalibration& calibration = module.getPMT(i->getPMT()).getCalibration();
96  const double t1 = getTime(*i, calibration);
97 
98  if (t1 >= Tmin && t1 <= Tmax) {
99  buffer.push_back(*i);
100  }
101  }
102  }
103 
104  this->push_back(JDAQSuperFrame(timesliceRouter.getSuperFrame(frame->getModuleID()).getDAQSuperFrameHeader()));
105 
106  this->rbegin()->add(buffer.size(), buffer.data());
107  }
108  }

The documentation for this class was generated from the following file:
JTRIGGER::getTime
double getTime(const JDAQHit &hit, const JCalibration &cal)
Get calibrated time of DAQ hit.
Definition: JHitToolkit.hh:34
JDETECTOR::getCalibration
JCalibration getCalibration(const JCalibration &first, const JCalibration &second)
Get calibration to go from first to second calibration.
Definition: JDetectorToolkit.hh:846
JTRIGGER::JTimesliceRouter::getFrameSubset
JDAQFrameSubset getFrameSubset(const JDAQModuleIdentifier &module, const JTimeRange &timeRange) const
Get subset of frame given module identifier and range of hit times.
Definition: JTimesliceRouter.hh:270
KM3NETDAQ::JDAQFrameSubset::const_iterator
const typedef JDAQHit * const_iterator
Definition: JDAQFrame.hh:32
JTOOLS::JRange::add
range_type & add(argument_type x)
Add offset.
Definition: JRange.hh:437
std::vector
Definition: JSTDTypes.hh:12
JTRIGGER::JFrame::const_iterator
container_type::const_iterator const_iterator
Definition: JFrame.hh:45
JTOOLS::JTimeRange
JRange< double > JTimeRange
Type definition for time range.
Definition: JTools/JTimeRange.hh:19
JTRIGGER::getTimeRange
JTimeRange getTimeRange(const JEvent &event)
Get time range (i.e.
Definition: JEventToolkit.hh:26
JTRIGGER::JTimesliceRouter::getSuperFrame
const JDAQSuperFrame & getSuperFrame(const JDAQModuleIdentifier &module) const
Get super frame.
Definition: JTimesliceRouter.hh:254
JTRIGGER::JTimeslice::const_iterator
std::vector< value_type >::const_iterator const_iterator
Definition: JTimeslice.hh:34
KM3NETDAQ::JDAQChronometer::getDAQChronometer
const JDAQChronometer & getDAQChronometer() const
Get DAQ chronometer.
Definition: JDAQChronometer.hh:88
std
Definition: jaanetDictionary.h:36