Timeslice with random data.  
 More...
#include <JRandomTimeslice.hh>
Timeslice with random data. 
Definition at line 30 of file JRandomTimeslice.hh.
 
◆ JRandomTimeslice() [1/2]
  
  
      
        
          | KM3NETDAQ::JRandomTimeslice::JRandomTimeslice  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
 
◆ JRandomTimeslice() [2/2]
Constructor. 
- Parameters
 - 
  
    | chronometer | chronometer  | 
    | simbad | detector simulator  | 
  
   
Definition at line 46 of file JRandomTimeslice.hh.
   63         for (JDetector::const_iterator module = simbad->begin(); module != simbad->end(); ++module) {
 
   65           if (!module->empty()) {
 
   67             buffer.
reset(module->size());
 
   73             simbad(*module, buffer, *(this->rbegin()));
 
virtual void generateHits(const JModule &module, const JTimeRange &period, JModuleData &output) const override
Generate hits.
 
bool hasPMTSimulator() const
Check availability of PMT simulator.
 
bool hasK40Simulator() const
Check availability of K40 simulator.
 
bool hasCLBSimulator() const
Check availability of CLB simulator.
 
Data structure for PMT data corresponding to a detector module.
 
void reset(size_t size)
Reset buffers.
 
void setDAQChronometer(const JDAQChronometer &chronometer)
Set DAQ chronometer.
 
int getFrameIndex() const
Get frame index.
 
Data frame of one optical module.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 
double getFrameTime()
Get frame time duration.
 
double getTimeSinceRTS(const int frame_index)
Get time in ns since last RTS for a given frame index.
 
 
 
 
◆ recycle()
  
  
      
        
          | void KM3NETDAQ::JRandomTimeslice::recycle  | 
          ( | 
          const double  | 
          T_ns | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Recycle time slice by randomly shuffling time intervals of data. 
Hits within one time interval are swapped with hits within another -randomly selected- time interval.
Time intervals in which a high-rate veto occurred are excluded.
Note that the time interval should be:
- (much) larger than time differences of hits in L1 coincidence; and
 
- (much) smaller than time covered by data (as per KM3NETDAQ::getFrameTime()).
 
- Parameters
 - 
  
  
 
Definition at line 92 of file JRandomTimeslice.hh.
  102       if (N <   100) { N =   100; }                              
 
  103       if (N > 50000) { N = 50000; }                              
 
  107       random_indices_t    index (N);                             
 
  110       for (
iterator frame = this->begin(); frame != this->end(); ++frame) {
 
  112         if (!frame->empty()) {
 
  114           for (
size_t i = 0; i != N; ++i) {
 
  121                                numeric_limits<JTDC_t>::max());   
 
  125             T_max[hit->getPMT()] = hit->getT();
 
  127             const int i = hit->getT() / Ts;
 
  129             buffer[i].push_back(*hit);
 
  135             if (frame->testHighRateVeto(pmt)) {
 
  136               keep.insert(T_max[pmt] / Ts);
 
  140           index.random_shuffle(keep);                            
 
  146           for (
size_t in = 0; in != N; ++in) {
 
  148             const size_t  out   = index [in];
 
  151             const JTDC_t  T_in  = in  * Ts;
 
  152             const JTDC_t  T_out = out * Ts;
 
  154             for (buffer_type::iterator i = zbuf.begin(); i != zbuf.end(); ++i, ++hit) {
 
  155               *hit = 
JDAQHit(i->getPMT(), (i->getT() - T_out) + T_in, i->getToT());
 
unsigned int JTDC_t
leading edge [ns]
 
std::vector< JHitW0 > buffer_type
hits
 
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
 
Auxiliary class for TDC constraints.
 
 
 
 
◆ ClassDef() [1/6]
◆ ClassDef() [2/6]
◆ ClassDef() [3/6]
◆ ClassDef() [4/6]
◆ ClassDef() [5/6]
  
  
      
        
          | KM3NETDAQ::JDAQHeader::ClassDef  | 
          ( | 
          JDAQHeader  | 
          ,  | 
         
        
           | 
           | 
          2  | 
            | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inherited   | 
  
 
 
◆ ClassDef() [6/6]
◆ clear()
  
  
      
        
          | void KM3NETDAQ::JDAQTimeslice::clear  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
 
◆ add()
Add another timeslice. 
- Parameters
 - 
  
  
 
- Returns
 - this timeslice 
 
Definition at line 133 of file JDAQTimeslice.hh.
  139       for (const_iterator i = this->begin(); i != this->end(); ++i) {
 
  143       for (JDAQTimeslice::const_iterator i = timeslice.begin(); i != timeslice.end(); ++i) {
 
  147         if (p != buffer.end()) {
 
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
 
const_iterator end() const
 
const_iterator begin() const
 
JDAQSuperFrame & add(const JDAQSuperFrame &super_frame)
Add data from same optical module.
 
 
 
 
◆ print()
  
  
      
        
          | std::ostream& KM3NETDAQ::JDAQTimeslice::print  | 
          ( | 
          std::ostream &  | 
          out,  | 
         
        
           | 
           | 
          const bool  | 
          lpr = false  | 
         
        
           | 
          ) | 
           |  const | 
         
       
   | 
  
inlineinherited   | 
  
 
Print DAQ Timeslice. 
- Parameters
 - 
  
    | out | output stream  | 
    | lpr | long print  | 
  
   
- Returns
 - output stream 
 
Definition at line 172 of file JDAQTimeslice.hh.
  176       out << this->ClassName() << endl;
 
  177       out << dynamic_cast<const JDAQPreamble&>   (*
this) << endl;
 
  178       out << dynamic_cast<const JDAQChronometer&>(*
this) << endl;
 
  180       for (JDAQTimeslice::const_iterator frame = this->begin(); frame != this->end(); ++frame) {
 
  182         out << 
' ' << setw(10) << frame->getModuleID();
 
  183         out << 
' ' << setw(6)  << frame->getLength();
 
  184         out << 
' ' << setw(6)  << frame->getDataType();
 
  185         out << 
' ' << setw(6)  << frame->getTimesliceStart();
 
  186         out << 
' ' << setw(8)  << setfill(
'0') << hex << frame->getStatus()     << dec << setfill(
' ');
 
  187         out << 
'|' << setw(8)  << setfill(
'0') << hex << frame->getFIFOStatus() << dec << setfill(
' ');
 
  188         out << 
' ' << setw(2)  << frame->getUDPNumberOfReceivedPackets();
 
  189         out << 
'/' << setw(2)  << frame->getUDPMaximalSequenceNumber();
 
  190         out << 
' ' << setw(6)  << frame->size();
 
  194           if (!frame->empty()) {
 
  196             out << 
' ' << setw(10) << frame-> begin()->getT();
 
  198             out << 
' ' << setw(10) << frame->rbegin()->getT();
 
  210             out << setw(2) << (int) hit->getPMT() << 
' '  
  211                 << setw(8) << (int) hit->getT()   << 
' '  
  212                 << setw(3) << (int) hit->getToT() << (
n%10 == 0 ? 
'\n' : 
' ');
 
 
 
 
◆ getDAQPreamble()
template<class T > 
  
  
      
        
          | static JDAQPreamble KM3NETDAQ::JDAQPreamble::getDAQPreamble  | 
          ( | 
          const T &  | 
          object | ) | 
           | 
         
       
   | 
  
inlinestaticinherited   | 
  
 
Get DAQ preamble. 
This method should be used for binary I/O to get the actual data for the given object.
To this end, the following method should be overloaded for the corresponding data type. 
   size_t  getSizeof(const T&);
- Parameters
 - 
  
  
 
- Returns
 - preamble 
 
Definition at line 76 of file JDAQPreamble.hh.
   81       preamble.
type   = KM3NETDAQ::getDataType<T>();
 
friend size_t getSizeof()
Definition of method to get size of data type.
 
 
 
 
◆ getLength()
  
  
      
        
          | int KM3NETDAQ::JDAQAbstractPreamble::getLength  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
 
◆ getDataType()
  
  
      
        
          | int KM3NETDAQ::JDAQAbstractPreamble::getDataType  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
 
◆ ClassDefNV()
◆ getDAQTimesliceHeader()
◆ getDAQHeader()
  
  
      
        
          | const JDAQHeader& KM3NETDAQ::JDAQHeader::getDAQHeader  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
Get DAQ header. 
- Returns
 - DAQ header 
 
Definition at line 49 of file JDAQHeader.hh.
 
 
◆ setDAQHeader()
  
  
      
        
          | void KM3NETDAQ::JDAQHeader::setDAQHeader  | 
          ( | 
          const JDAQHeader &  | 
          header | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
 
◆ getDAQChronometer()
  
  
      
        
          | const JDAQChronometer& KM3NETDAQ::JDAQChronometer::getDAQChronometer  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
 
◆ setDAQChronometer()
  
  
      
        
          | void KM3NETDAQ::JDAQChronometer::setDAQChronometer  | 
          ( | 
          const JDAQChronometer &  | 
          chronometer | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Set DAQ chronometer. 
- Parameters
 - 
  
    | chronometer | DAQ chronometer  | 
  
   
Definition at line 99 of file JDAQChronometer.hh.
 
 
◆ getDetectorID()
  
  
      
        
          | int KM3NETDAQ::JDAQChronometer::getDetectorID  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
 
◆ getRunNumber()
  
  
      
        
          | int KM3NETDAQ::JDAQChronometer::getRunNumber  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
 
◆ getFrameIndex()
  
  
      
        
          | int KM3NETDAQ::JDAQChronometer::getFrameIndex  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
 
◆ getTimesliceStart()
Get start of timeslice. 
- Returns
 - timeslice start 
 
Definition at line 144 of file JDAQChronometer.hh.
JDAQUTCExtended timeslice_start
 
 
 
 
◆ setRunNumber()
  
  
      
        
          | void KM3NETDAQ::JDAQChronometer::setRunNumber  | 
          ( | 
          const int  | 
          run | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
 
◆ setFrameIndex()
  
  
      
        
          | void KM3NETDAQ::JDAQChronometer::setFrameIndex  | 
          ( | 
          const int  | 
          frame_index | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
 
◆ setTimesliceStart()
  
  
      
        
          | void KM3NETDAQ::JDAQChronometer::setTimesliceStart  | 
          ( | 
          const JDAQUTCExtended &  | 
          timeslice_start | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Set timeslice start time. 
- Parameters
 - 
  
    | timeslice_start | timeslice start time  | 
  
   
Definition at line 177 of file JDAQChronometer.hh.
 
 
◆ length
  
  
      
        
          | int KM3NETDAQ::JDAQAbstractPreamble::length | 
         
       
   | 
  
protectedinherited   | 
  
 
 
◆ type
  
  
      
        
          | int KM3NETDAQ::JDAQAbstractPreamble::type | 
         
       
   | 
  
protectedinherited   | 
  
 
 
◆ detector_id
  
  
      
        
          | int KM3NETDAQ::JDAQChronometer::detector_id | 
         
       
   | 
  
protectedinherited   | 
  
 
 
◆ run
  
  
      
        
          | int KM3NETDAQ::JDAQChronometer::run | 
         
       
   | 
  
protectedinherited   | 
  
 
 
◆ frame_index
  
  
      
        
          | int KM3NETDAQ::JDAQChronometer::frame_index | 
         
       
   | 
  
protectedinherited   | 
  
 
 
◆ timeslice_start
The documentation for this struct was generated from the following file: