Timeslice with random data.
More...
#include <JRandomTimeslice.hh>
Timeslice with random data.
Definition at line 29 of file JRandomTimeslice.hh.
KM3NETDAQ::JRandomTimeslice::JRandomTimeslice |
( |
| ) |
|
|
inline |
Constructor.
- Parameters
-
chronometer | chronometer |
simbad | detector simulator |
Definition at line 45 of file JRandomTimeslice.hh.
62 for (JDetector::const_iterator module = simbad->begin(); module != simbad->end(); ++module) {
64 if (!module->empty()) {
66 buffer.
reset(module->size());
72 simbad(*module, buffer, *(this->rbegin()));
void reset(size_t size)
Reset buffers.
Data structure for PMT data corresponding to a detector module.
int getFrameIndex() const
Get frame index.
virtual void generateHits(const JModule &module, const JTimeRange &period, JModuleData &output) const
Generate hits.
bool hasPMTSimulator() const
Check availability of PMT simulator.
double getFrameTime()
Get frame time duration.
void setDAQChronometer(const JDAQChronometer &chronometer)
Set DAQ chronometer.
bool hasK40Simulator() const
Check availability of K40 simulator.
bool hasCLBSimulator() const
Check availability of CLB simulator.
double getTimeSinceRTS(const int frame_index)
Get time in ns since last RTS for a given frame index.
Data frame of one optical module.
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.
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 90 of file JRandomTimeslice.hh.
115 for (
iterator frame = this->begin(); frame != this->end(); ++frame) {
117 if (!frame->empty()) {
120 for (
size_t i = 0; i !=
N; ++i) {
130 T_max[hit->getPMT()] = hit->getT();
135 const size_t N_i = (T_max[i] + T_step) / T_step;
137 if (N_i < N_max[i]) {
142 sort(N_max.begin(), N_max.end());
144 for (
size_t i = 0, L = 0; i != N_max.size(); ++i) {
149 for (
size_t i = M - L - 1; i != 0; --i) {
150 std::swap(index[L + i], index[L + gRandom->Integer(i+1)]);
164 for (
size_t in = 0;
in !=
M; ++
in) {
166 const size_t out = index[
in];
167 buffer_type& zbuf = buffer[out];
170 const JTDC_t T_out = out * T_step;
172 for ( ; hit != frame->end() && hit->
getT() < T_in + T_step; ++hit) {
180 for (
size_t i = 0, number_of_hits = 0; i !=
M; ++i) {
182 memcpy(frame->data() + number_of_hits, buffer[i].data(), buffer[i].size() *
sizeof(
JDAQHit));
184 number_of_hits += buffer[i].size();
Auxiliary class for TDC constraints.
JTDC_t getT() const
Get time.
JPMT_t getPMT() const
Get PMT.
unsigned int JTDC_t
leading edge [ns]
JTOT_t getToT() const
Get time-over-threshold.
double getFrameTime()
Get frame time duration.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
then usage $script[input file[working directory[option]]] nWhere option can be N
KM3NETDAQ::JDAQHeader::ClassDef |
( |
JDAQHeader |
, |
|
|
2 |
|
|
) |
| |
|
inherited |
void KM3NETDAQ::JDAQTimeslice::clear |
( |
| ) |
|
|
inlineinherited |
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) {
140 buffer[i->getModuleIdentifier()] =
distance(static_cast<const JDAQTimeslice&>(*this).begin(),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 begin() const
Data frame of one optical module.
JDAQSuperFrame & add(const JDAQSuperFrame &super_frame)
Add data from same optical module.
const_iterator end() const
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(6) << frame->size();
192 if (!frame->empty()) {
194 out <<
' ' << setw(10) << frame-> begin()->getT();
196 out <<
' ' << setw(10) << frame->rbegin()->getT();
208 out << setw(2) << (int) hit->getPMT() <<
' ' << setw(8) << hit->getT() << (n%10 == 0 ?
'\n' :
' ');
alias put_queue eval echo n
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.
int KM3NETDAQ::JDAQAbstractPreamble::getLength |
( |
| ) |
const |
|
inlineinherited |
int KM3NETDAQ::JDAQAbstractPreamble::getDataType |
( |
| ) |
const |
|
inlineinherited |
const JDAQHeader& KM3NETDAQ::JDAQHeader::getDAQHeader |
( |
| ) |
const |
|
inlineinherited |
Get DAQ header.
- Returns
- DAQ header
Definition at line 49 of file JDAQHeader.hh.
void KM3NETDAQ::JDAQHeader::setDAQHeader |
( |
const JDAQHeader & |
header | ) |
|
|
inlineinherited |
const JDAQChronometer& KM3NETDAQ::JDAQChronometer::getDAQChronometer |
( |
| ) |
const |
|
inlineinherited |
void KM3NETDAQ::JDAQChronometer::setDAQChronometer |
( |
const JDAQChronometer & |
chronometer | ) |
|
|
inlineinherited |
Set DAQ chronometer.
- Parameters
-
chronometer | DAQ chronometer |
Definition at line 99 of file JDAQChronometer.hh.
int KM3NETDAQ::JDAQChronometer::getDetectorID |
( |
| ) |
const |
|
inlineinherited |
int KM3NETDAQ::JDAQChronometer::getRunNumber |
( |
| ) |
const |
|
inlineinherited |
int KM3NETDAQ::JDAQChronometer::getFrameIndex |
( |
| ) |
const |
|
inlineinherited |
Get start of timeslice.
- Returns
- timeslice start
Definition at line 144 of file JDAQChronometer.hh.
JDAQUTCExtended timeslice_start
void KM3NETDAQ::JDAQChronometer::setRunNumber |
( |
const int |
run | ) |
|
|
inlineinherited |
void KM3NETDAQ::JDAQChronometer::setFrameIndex |
( |
const int |
frame_index | ) |
|
|
inlineinherited |
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.
JDAQUTCExtended timeslice_start
int KM3NETDAQ::JDAQAbstractPreamble::length |
|
protectedinherited |
int KM3NETDAQ::JDAQAbstractPreamble::type |
|
protectedinherited |
int KM3NETDAQ::JDAQChronometer::detector_id |
|
protectedinherited |
int KM3NETDAQ::JDAQChronometer::run |
|
protectedinherited |
int KM3NETDAQ::JDAQChronometer::frame_index |
|
protectedinherited |
The documentation for this struct was generated from the following file: