Jpp  pmt_effective_area_update_2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Typedefs | Functions | Variables
JTRIGGER Namespace Reference

Auxiliary classes and method for triggering. More...

Classes

class  JBinder2nd
 Auxiliary class to convert binary JMatch operator and given hit to unary match operator. More...
 
struct  JBuild
 Auxiliary base class for hit building. More...
 
struct  JBuildHelper
 Auxiliary class to extend hit building functionality to all DAQ data types. More...
 
class  JBuildL0
 Template L0 hit builder. More...
 
class  JBuildL0< JHitL0 >
 Template specialisation of L0 builder for JHitL0 data type. More...
 
class  JBuildL0< JHitR0 >
 Template specialisation of L0 builder for JHitR0 data type. More...
 
class  JBuildL0< JHitR1 >
 Template specialisation of L0 builder for JHitR1 data type. More...
 
struct  JBuildL1Parameters
 Auxiliary data structure for L1 build parameters. More...
 
class  JBuildL1
 Template L1 hit builder. More...
 
class  JBuildL1< JHitL1 >
 Template specialisation of L1 builder for JHitL1 data type. More...
 
class  JBuildL1< JHitR1 >
 Template specialisation of L1 builder for JHitR1 data type. More...
 
class  JBuildL2
 Template L2 builder. More...
 
class  JBuildL2< JHitL2 >
 Template specialisation of L2 builder for JHitL2 data type. More...
 
class  JBuildL2< JHitR2 >
 Template specialisation of L2 builder for JHitR2 data type. More...
 
struct  JChecksum
 Auxiliary class to perform check-sum on raw data. More...
 
class  JCLBRunByRunSimulator
 CLB simulation based on run-by-run information. More...
 
class  JClone
 Clone of a container. More...
 
struct  JDAQHitSelector
 Auxiliary class to select DAQ hits. More...
 
struct  JDAQHitDefaultSelector
 Default class to select DAQ hits. More...
 
struct  JDAQHitToTSelector
 Auxiliary class to select DAQ hits based on time-over-treshold value. More...
 
class  JDOMToPMTMaskMap
 
class  JEvent
 Triggered event. More...
 
class  JEventOverlap
 Match of two events considering overlap in time. More...
 
class  JFrame
 Data frame for calibrated hits of one PMT. More...
 
class  JFrameClone
 Clone of JFrame. More...
 
struct  JGetRiseTime
 Auxiliary class for rise time evaluation. More...
 
class  JHit
 Hit data structure. More...
 
class  JHitL0
 Data structure for L0 hit. More...
 
class  JHitL1
 Data structure for L1 hit. More...
 
class  JHitR0
 Reduced data structure for L0 hit. More...
 
class  JHitR1
 Reduced data structure for L1 hit. More...
 
struct  JHitToolkit
 Template definition of hit toolkit. More...
 
struct  JHitToolkit< JHit, false >
 Template specialisation of hit toolkit for JHit class. More...
 
struct  JHitToolkit< JDAQHit, false >
 Template specialisation of hit toolkit for JDAQHit class. More...
 
struct  JHitToolkit< JHitR0, false >
 Template specialisation of hit toolkit for JHitR0 class. More...
 
struct  JHitToolkit< JHit_t, true >
 Template specialisation of hit toolkit for any primitive data type. More...
 
class  JK40RunByRunSimulator
 K40 simulation based on run-by-run information. More...
 
class  JMatch
 Function object interface for hit matching. More...
 
class  JMatchHelper
 Auxiliary class to handle pointer to match function. More...
 
class  JMatch1D
 1D match criterion. More...
 
class  JMatch3B
 3D match criterion with road width. More...
 
class  JMatch3D
 3D match criterion. More...
 
class  JMatch3G
 3G match criterion. More...
 
class  JMatchL0
 L0 match criterion. More...
 
struct  JModuleCounter
 Auxiliary class for counting unique modules. More...
 
struct  JModuleHeader
 Header for Module. More...
 
struct  JParametersHelper
 Wrapper class to share parameters. More...
 
struct  JPMTHeader
 Header for PMT. More...
 
class  JPMTIdentifier_t
 
class  JPMTMask
 Auxiliary class for pmt mask. More...
 
class  JPMTRunByRunSimulator
 PMT simulation based on run-by-run information. More...
 
struct  JPMTSelector
 Auxiliary data structure for set of PMT identifiers. More...
 
struct  JPreprocessor
 Auxiliary class for specifying the way of pre-processing of hits. More...
 
class  JPrescaler
 Auxiliary class for prescaling. More...
 
class  JSummaryRouter
 Router for fast addressing of summary data in JDAQSummaryslice data structure as a function of the optical module identifier. More...
 
class  JSuperFrame1D
 1-dimensional frame with time calibrated data from one optical module. More...
 
class  JSuperFrame2D
 2-dimensional frame with time calibrated data from one optical module. More...
 
class  JSuperFrameClone1D
 Clone of JSuperFrame1D. More...
 
class  JSuperFrameClone2D
 Clone of JSuperFrame2D. More...
 
class  JTimeslice
 Time slice with calibrated data. More...
 
class  JTimesliceClone
 Clone of JTimeslice. More...
 
class  JTimesliceL1
 Auxiliary class to build JDAQTimeslice for L1 timeslice. More...
 
struct  JTimesliceRouter_t
 Auxiliary base class for JTimesliceRouter. More...
 
struct  JTimesliceRouter
 Router for fast addressing of hits in KM3NETDAQ::JDAQTimeslice data structure as a function of the optical module identifier and time. More...
 
class  JTrigger3D
 General purpose majority trigger. More...
 
class  JTrigger3DMuon
 Muon trigger. More...
 
struct  JTrigger3DMuon_t
 Muon trigger parameters. More...
 
class  JTrigger3DShower
 Shower trigger. More...
 
struct  JTrigger3DShower_t
 Shower trigger parameters. More...
 
class  JTrigger3N
 General purpose muon trigger. More...
 
class  JTriggeredEvent
 Auxiliary class to build JDAQEvent for a triggered event. More...
 
class  JTriggeredHit
 Data structure for triggered hit. More...
 
class  JTriggerException
 General exception. More...
 
class  JTriggerInput
 Data structure for input to trigger algorithm. More...
 
class  JTriggerInterface
 Trigger interface. More...
 
struct  JTriggerBit
 This class is used to map trigger class to trigger bit. More...
 
struct  JAssertBit
 This class will generate a compiler error if trigger bit is out of range. More...
 
struct  JAssertBit< N, true >
 Implementation of a valid trigger bit. More...
 
struct  JAttributes
 Module attributes. More...
 
class  JTriggerMXShower
 Shower trigger. More...
 
struct  JTriggerMXShower_t
 Shower trigger parameters. More...
 
class  JTriggerNB
 Nano-beacon trigger. More...
 
struct  JTriggerNB_t
 Nano-beacon trigger parameters. More...
 
class  JTriggerOutput
 Set of triggered events. More...
 
struct  JL2Parameters
 Data structure for L2 parameters. More...
 
class  JTriggerParameters
 Data structure for all trigger parameters. More...
 

Typedefs

typedef JHitL1 JHitL2
 Type definition of L2 hit. More...
 
typedef JHitR1 JHitR2
 Type definition of R2 hit. More...
 
typedef unsigned int JPMTMask_t
 Type definition of pmt mask. More...
 
typedef unsigned int JTriggerbit_t
 Type definition of trigger bit. More...
 

Functions

template<class JHit_t >
bool weightSorter (const JHit_t &first, const JHit_t &second)
 Compare two hits by weight. More...
 
template<class JHit_t >
bool timeSorter (const JHit_t &first, const JHit_t &second)
 Compare two hits by weight. More...
 
template<class JHit_t >
JBinder2nd< JHit_t > JBind2nd (const JMatch< JHit_t > &match, const JHit_t &second)
 Auxiliary method to create JBinder2nd object. More...
 
bool operator< (const JEvent &first, const JEvent &second)
 Less than operator for events. More...
 
JTimeRange getTimeRange (const JEvent &event)
 Get time range (i.e. earlist and latest hit time) of triggered event. More...
 
bool operator< (const JHit &first, const JHit &second)
 Less than operator for hits. More...
 
bool operator< (const JHit &hit, const double t1)
 Less than operator for hits. More...
 
bool operator== (const JHit &first, const JHit &second)
 Equal operator for hits. More...
 
template<class T >
int getCount (const T &hit)
 Get hit count. More...
 
template<class T >
int getCount (T __begin, T __end)
 Get hit count. More...
 
double getTime (const JDAQHit &hit, const JCalibration &cal)
 Get calibrated time of DAQ hit. More...
 
double getToT (const JDAQHit &hit, const JCalibration &cal)
 Get calibrated time-over-threshold of DAQ hit. More...
 
template<class JHit_t >
JMatchHelper< JHit_t > make_match (bool(*match)(const JHit_t &, const JHit_t &))
 Auxiliary method to make JMatch object based on pointer to match function. More...
 
bool operator== (const JPMTIdentifier_t &first, const JPMTIdentifier_t &second)
 Equal operator for PMT identifiers. More...
 
bool operator< (const JPMTIdentifier_t &first, const JPMTIdentifier_t &second)
 Less than operator for PMT identifiers. More...
 
JPMTMask_t getPMTMask (const unsigned int bit)
 Convert pmt bit to pmt mask. More...
 
 setTriggerBit (JTrigger3DShower, JTRIGGER3DSHOWER)
 
 setTriggerBit (JTriggerMXShower, JTRIGGERMXSHOWER)
 
 setTriggerBit (JTrigger3DMuon, JTRIGGER3DMUON)
 
 setTriggerBit (JTriggerNB, JTRIGGERNB)
 
bool operator< (const JTriggeredHit &first, const JTriggeredHit &second)
 Less than operator for triggered hits. More...
 
bool operator== (const JTriggeredHit &first, const JTriggeredHit &second)
 Equal operator for triggered hits. More...
 
template<class JTrigger_t >
JTriggerbit_t getTriggerBit ()
 Get the trigger bit. More...
 
template<class JTrigger_t >
JTriggerbit_t getTriggerBit (const JTrigger_t &event)
 Get the trigger bit. More...
 
const char * getTriggerName (JTriggerbit_t bit)
 Get trigger name. More...
 
void setAttributes (const JModule &first, const JModule &second, JAttributes &attributes)
 Set module attributes. More...
 
void randomize (JTrigger3DMuon_t::JParameters *p)
 Randomize trigger parameters. More...
 
void randomize (JTrigger3DShower_t::JParameters *p)
 Randomize trigger parameters. More...
 
void randomize (JTriggerMXShower_t::JParameters *p)
 Randomize trigger parameters. More...
 
void randomize (JTriggerNB_t::JParameters *p)
 Randomize trigger parameters. More...
 
void randomize (JTriggerParameters *p)
 Randomize trigger parameters. More...
 
JTimeRange getTimeRange (const JTriggerParameters &parameters)
 Get time range of snapshot. More...
 
JTimeRange getTimeRange (const JTriggerNB_t::JParameters &parameters)
 Get time range of snapshot. More...
 
bool getDAQStatus (const JDAQFrameStatus &frame, const JStatus &status)
 Test status of DAQ. More...
 
bool getDAQStatus (const JDAQFrameStatus &frame, const JModule &module, const int pmt)
 Test status of DAQ. More...
 
bool getPMTStatus (const JStatus &status)
 Test status of PMT. More...
 
bool getPMTStatus (const JDAQFrameStatus &frame, const JStatus &status, const int pmt)
 Test status of PMT. More...
 
bool getPMTStatus (const JDAQFrameStatus &frame, const JModule &module, const int pmt)
 Test status of PMT. More...
 
double getRate (const JDAQSummaryFrame &frame, const int pmt, const double factor=1.0)
 Get corrected rate of PMT. More...
 

Variables

struct {
   std::vector< int >   JTRIGGER::count
 
clusterize
 Anonymous structure for clustering of hits. More...
 
struct {
   std::vector< int >   JTRIGGER::count
 
reverse_clusterize
 Anonymous structure for reverse clustering of hits. More...
 
struct {
   std::vector< double >   JTRIGGER::weight
 
clusterizeWeight
 Anonymous struct for weighed clustering of hits. More...
 
static int MAXIMAL_FRAME_SIZE = std::numeric_limits<int>::max()
 Maximal frame size. More...
 
static const JChecksum checksum
 Function object to perform check-sum of raw data. More...
 
static const JGetRiseTime getRiseTime
 Function object for rise time evaluation. More...
 
static const JModuleCounter getNumberOfModules
 Function object to count unique modules. More...
 
static const unsigned int NUMBER_OF_PMT_BITS = 31
 Number of pmt bits. More...
 

Detailed Description

Auxiliary classes and method for triggering.

Trigger algorithms, support classes and auxiliary methods.

Author
mdejong
rbruijn
rgruiz

Typedef Documentation

Type definition of L2 hit.

Definition at line 20 of file JHitL2.hh.

Type definition of R2 hit.

Definition at line 20 of file JHitR2.hh.

typedef unsigned int JTRIGGER::JPMTMask_t

Type definition of pmt mask.

Definition at line 30 of file JPMTMask.hh.

typedef unsigned int JTRIGGER::JTriggerbit_t

Type definition of trigger bit.

Definition at line 29 of file JTriggerInterface.hh.

Function Documentation

template<class JHit_t >
bool JTRIGGER::weightSorter ( const JHit_t &  first,
const JHit_t &  second 
)
inline

Compare two hits by weight.

The template argument JHit_t refers to a data structure which should have the following member method:

  • double getW(); // [a.u.]
Parameters
firstfirst hit
secondsecond hit
Returns
true if first hit has larger weight than second; else false

Definition at line 433 of file JAlgorithm.hh.

434  {
435  return first.getW() > second.getW();
436  }
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
template<class JHit_t >
bool JTRIGGER::timeSorter ( const JHit_t &  first,
const JHit_t &  second 
)
inline

Compare two hits by weight.

The template argument JHit_t refers to a data structure which should have the following member methods:

  • double getT(); // [a.u.]
Parameters
firstfirst hit
secondsecond hit
Returns
true if first hit earlier than second; else false

Definition at line 450 of file JAlgorithm.hh.

451  {
452  return first.getT() < second.getT();
453  }
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
template<class JHit_t >
JBinder2nd<JHit_t> JTRIGGER::JBind2nd ( const JMatch< JHit_t > &  match,
const JHit_t &  second 
)
inline

Auxiliary method to create JBinder2nd object.

Parameters
matchmatch operator
secondsecond hit
Returns
JBinder2nd

Definition at line 70 of file JBind2nd.hh.

71  {
72  return JBinder2nd<JHit_t>(match, second);
73  }
Auxiliary class to convert binary JMatch operator and given hit to unary match operator.
Definition: JBind2nd.hh:26
bool JTRIGGER::operator< ( const JEvent first,
const JEvent second 
)
inline

Less than operator for events.

The less than operator is applied to the first hit in the events.

Parameters
firstfirst event
secondsecond event
Returns
true if first event earliear than second; else false

Definition at line 215 of file JTrigger/JEvent.hh.

216  {
217  if (first.empty() || second.empty()) {
218  throw JTriggerException("Comparison with empty event(s).");
219  }
220 
221  return first.begin()->getT() < second.begin()->getT();
222  }
JTimeRange JTRIGGER::getTimeRange ( const JEvent event)
inline

Get time range (i.e. earlist and latest hit time) of triggered event.

Parameters
eventevent
Returns
time range

Definition at line 26 of file JEventToolkit.hh.

27  {
28  if (!event.empty())
29  return JTimeRange(event.begin()->getT(), event.rbegin()->getT());
30  else
31  return JTimeRange::DEFAULT_RANGE;
32  }
JTOOLS::JRange< double > JTimeRange
Type definition for time range (unit [ns]).
bool JTRIGGER::operator< ( const JHit first,
const JHit second 
)
inline

Less than operator for hits.

The less than operator is applied to the time of the hits.

Parameters
firstfirst hit
secondsecond hit
Returns
true if first hit earlier; else false

Definition at line 231 of file JTrigger/JHit.hh.

232  {
233  return first.getT() < second.getT();
234  }
double getT() const
Get calibrated time of hit.
bool JTRIGGER::operator< ( const JHit hit,
const double  t1 
)
inline

Less than operator for hits.

The less than operator is applied to the time of the hits.

Parameters
hithit
t1time [ns]
Returns
true if hit earlier than t; else false

Definition at line 246 of file JTrigger/JHit.hh.

247  {
248  return hit.getT() < t1;
249  }
double getT() const
Get calibrated time of hit.
bool JTRIGGER::operator== ( const JHit first,
const JHit second 
)
inline

Equal operator for hits.

The equal operator is applied to the time of the hits.

Parameters
firsthit
secondhit
Returns
true if first hit time equal to second hit time; else false

Definition at line 261 of file JTrigger/JHit.hh.

262  {
263  return first.getT() == second.getT();
264  }
double getT() const
Get calibrated time of hit.
template<class T >
int JTRIGGER::getCount ( const T hit)
inline

Get hit count.

The hit refers to a data structure which should have the following member method:

  • int getN();
Parameters
hithit
Returns
count

Definition at line 277 of file JTrigger/JHit.hh.

278  {
279  return hit.getN();
280  }
template<class T >
int JTRIGGER::getCount ( T  __begin,
T  __end 
)
inline

Get hit count.

The hit iterator refers to a data structure which should have the following member method:

  • int getN();
Parameters
__beginbegin of data
__endend of data
Returns
count

Definition at line 294 of file JTrigger/JHit.hh.

295  {
296  int count = 0;
297 
298  for (T hit = __begin; hit !=__end; ++hit) {
299  count += getCount(*hit);
300  }
301 
302  return count;
303  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T
std::vector< int > count
Definition: JAlgorithm.hh:180
int getCount(const T &hit)
Get hit count.
double JTRIGGER::getTime ( const JDAQHit hit,
const JCalibration cal 
)
inline

Get calibrated time of DAQ hit.

Parameters
hitDAQ hit
calcalibration
Returns
time [ns]

Definition at line 34 of file JHitToolkit.hh.

35  {
36  return getTime(hit.getT(), cal);
37  }
double getTime(const Hit &hit)
Get true time of hit.
JTDC_t getT() const
Get time.
Definition: JDAQHit.hh:86
double JTRIGGER::getToT ( const JDAQHit hit,
const JCalibration cal 
)
inline

Get calibrated time-over-threshold of DAQ hit.

Parameters
hitDAQ hit
calcalibration
Returns
time-over-threshold [ns]

Definition at line 47 of file JHitToolkit.hh.

48  {
49  return getToT(hit.getToT(), cal);
50  }
JTOT_t getToT() const
Get time-over-threshold.
Definition: JDAQHit.hh:97
double getToT(const T &tot, const JCalibration &cal)
Get calibrated time-over-threshold of hit.
template<class JHit_t >
JMatchHelper<JHit_t> JTRIGGER::make_match ( bool(*)(const JHit_t &, const JHit_t &)  match)

Auxiliary method to make JMatch object based on pointer to match function.

Parameters
matchpointer to match function
Returns
match object

Definition at line 115 of file JMatch.hh.

116  {
117  return JMatchHelper<JHit_t>(match);
118  }
Auxiliary class to handle pointer to match function.
Definition: JMatch.hh:74
bool JTRIGGER::operator== ( const JPMTIdentifier_t first,
const JPMTIdentifier_t second 
)
inline

Equal operator for PMT identifiers.

Parameters
firstPMT identifier
secondPMT identifier
Returns
true if first PMT equal second PMT; else false

Definition at line 169 of file JPMTIdentifier_t.hh.

170  {
171  return (first.getModuleID() == second.getModuleID() &&
172  first.getPMTAddress() == second.getPMTAddress());
173  }
int getPMTAddress() const
Get PMT address.
int getModuleID() const
Get module identifier.
bool JTRIGGER::operator< ( const JPMTIdentifier_t first,
const JPMTIdentifier_t second 
)
inline

Less than operator for PMT identifiers.

The less than operator is applied first to the module identifer and then to the PMT address.

Parameters
firstPMT identifier
secondPMT identifier
Returns
true if first PMT lower than second PMT; else false

Definition at line 185 of file JPMTIdentifier_t.hh.

186  {
187  if (first.getModuleID() == second.getModuleID())
188  return first.getPMTAddress() < second.getPMTAddress();
189  else
190  return first.getModuleID() < second.getModuleID();
191  }
int getPMTAddress() const
Get PMT address.
int getModuleID() const
Get module identifier.
JPMTMask_t JTRIGGER::getPMTMask ( const unsigned int  bit)
inline

Convert pmt bit to pmt mask.

Parameters
bitpmt bit
Returns
pmt mask

Definition at line 45 of file JPMTMask.hh.

46  {
47  if (bit < NUMBER_OF_PMT_BITS)
48  return JPMTMask_t(1) << bit;
49  else
50  return 0;
51  }
unsigned int JPMTMask_t
Type definition of pmt mask.
Definition: JPMTMask.hh:30
static const unsigned int NUMBER_OF_PMT_BITS
Number of pmt bits.
Definition: JPMTMask.hh:36
JTRIGGER::setTriggerBit ( JTrigger3DShower  ,
JTRIGGER3DSHOWER   
)
JTRIGGER::setTriggerBit ( JTriggerMXShower  ,
JTRIGGERMXSHOWER   
)
JTRIGGER::setTriggerBit ( JTrigger3DMuon  ,
JTRIGGER3DMUON   
)
JTRIGGER::setTriggerBit ( JTriggerNB  ,
JTRIGGERNB   
)
bool JTRIGGER::operator< ( const JTriggeredHit first,
const JTriggeredHit second 
)
inline

Less than operator for triggered hits.

The less than operator is applied first to JTRIGGER::JHit and then to the KM3NETDAQ::JDAQPMTIdentifier. Hence, the ordering by JTRIGGER::JHit is maintained. This allows for the use of STL sort() and set_union() algorithms.

Parameters
firstfirst hit
secondsecond hit
Returns
true if first hit earlier or lower PMT identifier if equal; else false

Definition at line 86 of file JTriggeredHit.hh.

87  {
88  if (std::equal_to<JHit>()(first,second))
89  return std::less<JDAQPMTIdentifier>()(first,second);
90  else
91  return std::less<JHit> ()(first,second);
92  }
bool JTRIGGER::operator== ( const JTriggeredHit first,
const JTriggeredHit second 
)
inline

Equal operator for triggered hits.

The equal operator is applied to JTRIGGER::JHit and to the KM3NETDAQ::JDAQPMTIdentifier.

Parameters
firstfirst hit
secondsecond hit
Returns
true if first hit equal second hit; else false

Definition at line 104 of file JTriggeredHit.hh.

105  {
106  return (std::equal_to<JDAQPMTIdentifier>()(first,second) &&
107  std::equal_to<JHit> ()(first,second));
108  }
template<class JTrigger_t >
JTriggerbit_t JTRIGGER::getTriggerBit ( )
inline

Get the trigger bit.

Returns
trigger bit

Definition at line 206 of file JTriggerInterface.hh.

207  {
209  }
This class is used to map trigger class to trigger bit.
template<class JTrigger_t >
JTriggerbit_t JTRIGGER::getTriggerBit ( const JTrigger_t &  event)
inline

Get the trigger bit.

Parameters
eventtriggered event
Returns
trigger bit

Definition at line 219 of file JTriggerInterface.hh.

220  {
222  }
This class is used to map trigger class to trigger bit.
const char* JTRIGGER::getTriggerName ( JTriggerbit_t  bit)
inline

Get trigger name.

param bit trigger bit

Returns
trigger name

Definition at line 231 of file JTriggerInterface.hh.

232  {
234  }
const char * getTriggerName(JTriggerbit_t bit)
Get trigger name.
void JTRIGGER::setAttributes ( const JModule first,
const JModule second,
JAttributes attributes 
)
inline

Set module attributes.

Parameters
firstfirst module
secondsecond module
attributesmodule attributes

Definition at line 46 of file JTriggerMXShower.hh.

49  {
50  using namespace JMATH;
51  using namespace JTOOLS;
52 
53  typedef JTriggerMXShower_t::JParameters JParameters_t;
54 
55  // get trigger parameters
56 
58 
59  const double d = getDistance(first.getPosition(), second.getPosition());
60 
61  double t1 = 0.0;
62 
63  if (d <= 0.5 * parameters.DMax_m)
64  t1 = d * getIndexOfRefraction() * getInverseSpeedOfLight() + parameters.TMaxExtra_ns;
65  else if (d <= parameters.DMax_m)
66  t1 = (parameters.DMax_m - d) * getIndexOfRefraction() * getInverseSpeedOfLight() + parameters.TMaxExtra_ns;
67 
68  attributes.Tmin_ns = -t1;
69  attributes.Tmax_ns = +t1;
70  }
double getIndexOfRefraction()
Get average index of refraction of water corresponding to group velocity.
Wrapper class to share parameters.
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
double Tmin_ns
minimal time difference [ns]
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
double Tmax_ns
maximal time difference [ns]
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:47
const double getInverseSpeedOfLight()
Get inverse speed of light.
void JTRIGGER::randomize ( JTrigger3DMuon_t::JParameters p)
inline

Randomize trigger parameters.

Parameters
ppointer to valid object

Definition at line 26 of file JTriggerTestkit.hh.

27  {
28  p->enabled = getRandom<bool>();
29  p->numberOfHits = getRandom<int>(1, 10);
30  p->numberOfModules = getRandom<int>(1, 10);
31  p->DMax_m = getRandom<double>( 0.0, 999.0, 1.0);
32  p->roadWidth_m = getRandom<double>(50.0, 250.0, 1.0);
33  p->gridAngle_deg = getRandom<double>( 1.0, 10.0, 1.0);
34  p->TMaxExtra_ns = getRandom<double>(10.0, 50.0, 1.0);
35  p->factoryLimit = getRandom<double>(100, 200);
36  }
double TMaxExtra_ns
maximal extra time [ns]
double roadWidth_m
maximal road width [m]
int factoryLimit
maximal number of hits to apply trigger logic (above this limit, always trigger)
double DMax_m
maximal distance between PMTs [m]
int numberOfHits
minimal number of hits to trigger event
int numberOfModules
minimal number of modules to trigger event
bool enabled
enabled status of trigger
void JTRIGGER::randomize ( JTrigger3DShower_t::JParameters p)
inline

Randomize trigger parameters.

Parameters
ppointer to valid object

Definition at line 44 of file JTriggerTestkit.hh.

45  {
46  p->enabled = getRandom<bool>();
47  p->numberOfHits = getRandom<int>(1, 10);
48  p->numberOfModules = getRandom<int>(1, 10);
49  p->DMax_m = getRandom<double>( 0.0, 999.0, 1.0);
50  p->TMaxExtra_ns = getRandom<double>(10.0, 50.0, 1.0);
51  p->factoryLimit = getRandom<double>(100, 200);
52  }
int numberOfHits
minimal number of hits to trigger event
int numberOfModules
minimal number of modules to trigger event
bool enabled
enabled status of trigger
double TMaxExtra_ns
maximal extra time [ns]
int factoryLimit
maximal number of hits to apply trigger logic (above this limit, always trigger
double DMax_m
maximal distance between PMTs [m]
void JTRIGGER::randomize ( JTriggerMXShower_t::JParameters p)
inline

Randomize trigger parameters.

Parameters
ppointer to valid object

Definition at line 60 of file JTriggerTestkit.hh.

61  {
62  p->enabled = getRandom<bool>();
63  p->numberOfHits = getRandom<int>(1, 10);
64  p->numberOfModules = getRandom<int>(1, 10);
65  p->DMax_m = getRandom<double>( 0.0, 999.0, 1.0);
66  p->TMaxExtra_ns = getRandom<double>(10.0, 50.0, 1.0);
67  p->factoryLimit = getRandom<double>(100, 200);
68  }
bool enabled
enabled status of trigger
int factoryLimit
maximal number of hits to apply trigger logic (above this limit, always trigger)
double TMaxExtra_ns
maximal extra time [ns]
int numberOfHits
minimal number of hits to trigger event
int numberOfModules
minimal number of modules to trigger event
double DMax_m
maximal distance between PMTs [m]
void JTRIGGER::randomize ( JTriggerNB_t::JParameters p)
inline

Randomize trigger parameters.

Parameters
ppointer to valid object

Definition at line 76 of file JTriggerTestkit.hh.

77  {
78  p->enabled = getRandom<bool>();
79 
80  p->pmts.clear();
81 
82  for (int i = getRandom<int>(1, 10); i != 0; --i) {
83  p->pmts.push_back(JPMTIdentifier_t(getRandom<int>(-1, 100),
84  getRandom<int>(-1, 30)));
85  }
86  }
bool enabled
enabled status of trigger
Definition: JTriggerNB_t.hh:84
JPMTSelector pmts
PMT selection.
Definition: JTriggerNB_t.hh:86
void JTRIGGER::randomize ( JTriggerParameters p)
inline

Randomize trigger parameters.

Parameters
ppointer to valid object

Definition at line 94 of file JTriggerTestkit.hh.

95  {
96  p->highRateVeto_Hz = getRandom<double>(1.0e3, 1.0e4, 1.0);
97  p->L2Min = getRandom<int>(2, 3);
98  p->ctMin = getRandom<double>( -1.0, +1.0, 0.1);
99  p->TMaxLocal_ns = getRandom<double>( 10.0, 20.0, 1.0);
100  p->TMaxEvent_ns = getRandom<double>(100.0, 999.0, 1.0);
101  p->numberOfBins = getRandom<int>(100, 1000);
102  p->combineL1 = getRandom<bool>();
103 
104  p->trigger3DMuon = getRandom<JTrigger3DMuon_t ::JParameters>();
105  p->trigger3DShower = getRandom<JTrigger3DShower_t::JParameters>();
106  p->triggerMXShower = getRandom<JTriggerMXShower_t::JParameters>();
107  p->triggerNB = getRandom<JTriggerNB_t ::JParameters>();
108 
109  p->writeSummary = getRandom<long long int>(0, 100);
110  p->writeL0 = getRandom<long long int>(0, 100);
111  p->writeL1 = getRandom<long long int>(0, 100);
112  p->writeL2 = getRandom<long long int>(0, 100);
113  p->writeSN = getRandom<long long int>(0, 100);
114  }
JTimeRange JTRIGGER::getTimeRange ( const JTriggerParameters parameters)
inline

Get time range of snapshot.

Parameters
parameterstrigger parameters
Returns
time range [ns]

Definition at line 39 of file JTriggerToolkit.hh.

40  {
41  return JTimeRange(-parameters.TMaxEvent_ns,
42  +parameters.TMaxEvent_ns);
43  }
JTOOLS::JRange< double > JTimeRange
Type definition for time range (unit [ns]).
JTimeRange JTRIGGER::getTimeRange ( const JTriggerNB_t::JParameters parameters)
inline

Get time range of snapshot.

Parameters
parameterstrigger parameters
Returns
time range [ns]

Definition at line 51 of file JTriggerToolkit.hh.

52  {
53  using namespace JPP;
54 
55  return JTimeRange(0.0, parameters.DMax_m * getIndexOfRefraction() * getInverseSpeedOfLight());
56  }
double DMax_m
maximal distance between PMTs [m]
Definition: JTriggerNB_t.hh:87
double getIndexOfRefraction()
Get average index of refraction of water corresponding to group velocity.
JTOOLS::JRange< double > JTimeRange
Type definition for time range (unit [ns]).
const double getInverseSpeedOfLight()
Get inverse speed of light.
bool JTRIGGER::getDAQStatus ( const JDAQFrameStatus frame,
const JStatus status 
)
inline

Test status of DAQ.

The DAQ test passes if the assembly of UDP packets is complete.
The test can be bypassed using the PMT control status.

Parameters
framedata frame status
statusPMT control status
Returns
true if test passes; else false

Definition at line 69 of file JTriggerToolkit.hh.

70  {
71  return ((status.has(UDP_COUNTER_DISABLE) || (frame.getUDPNumberOfReceivedPackets() == frame.getUDPMaximalSequenceNumber() + 1)) &&
72  (status.has(UDP_TRAILER_DISABLE) || (frame.hasUDPTrailer())));
73  }
bool hasUDPTrailer() const
Get UDP trailer status.
int getUDPNumberOfReceivedPackets() const
Get number of received UDP packets.
int getUDPMaximalSequenceNumber() const
Get maximal sequence number of UDP packet.
static const int UDP_TRAILER_DISABLE
Enable (disable) use of UDP packet trailer test if this status bit is 0 (1);.
Definition: pmt_status.hh:16
bool has(const int bit) const
Test PMT status.
Definition: JStatus.hh:112
static const int UDP_COUNTER_DISABLE
Enable (disable) use of UDP packet counter test if this status bit is 0 (1);.
Definition: pmt_status.hh:15
bool JTRIGGER::getDAQStatus ( const JDAQFrameStatus frame,
const JModule module,
const int  pmt 
)
inline

Test status of DAQ.

The DAQ test passes if the assembly of UDP packets is complete.
The test can be bypassed using the PMT control status.

Parameters
framedata frame status
modulemodule
pmtPMT number
Returns
true if test passes; else false

Definition at line 87 of file JTriggerToolkit.hh.

88  {
89  return getDAQStatus(frame, module.getPMT(pmt));
90  }
const JPMT & getPMT(const int index) const
Get PMT.
Definition: JModule.hh:163
bool getDAQStatus(const JDAQFrameStatus &frame, const JStatus &status)
Test status of DAQ.
bool JTRIGGER::getPMTStatus ( const JStatus status)
inline

Test status of PMT.

The PMT test passes if it is not disabled.

Parameters
statusPMT control status
Returns
true if test passes; else false

Definition at line 101 of file JTriggerToolkit.hh.

102  {
103  return !status.has(PMT_DISABLE);
104  }
static const int PMT_DISABLE
KM3NeT Data Definitions v2.0.0-15-g59d2e2b https://git.km3net.de/common/km3net-dataformat.
Definition: pmt_status.hh:12
bool has(const int bit) const
Test PMT status.
Definition: JStatus.hh:112
bool JTRIGGER::getPMTStatus ( const JDAQFrameStatus frame,
const JStatus status,
const int  pmt 
)
inline

Test status of PMT.

The PMT test passes if it is not disabled and no high-rate veto or FIFO (almost) full.
The test can be bypassed using the PMT control status.

Parameters
framedata frame
statusPMT control status
pmtPMT number
Returns
true if test passes; else false

Definition at line 118 of file JTriggerToolkit.hh.

119  {
120  return ((status.has(HIGH_RATE_VETO_DISABLE) || !frame.testHighRateVeto(pmt)) &&
121  (status.has(FIFO_FULL_DISABLE) || !frame.testFIFOStatus (pmt)) &&
122  (getPMTStatus(status)));
123  }
static const int HIGH_RATE_VETO_DISABLE
Enable (disable) use of high-rate veto test if this status bit is 0 (1);.
Definition: pmt_status.hh:13
static const int FIFO_FULL_DISABLE
Enable (disable) use of FIFO (almost) full test if this status bit is 0 (1);.
Definition: pmt_status.hh:14
bool testHighRateVeto() const
Test high-rate veto status.
bool has(const int bit) const
Test PMT status.
Definition: JStatus.hh:112
bool getPMTStatus(const JStatus &status)
Test status of PMT.
bool testFIFOStatus() const
Test FIFO status.
bool JTRIGGER::getPMTStatus ( const JDAQFrameStatus frame,
const JModule module,
const int  pmt 
)
inline

Test status of PMT.

The PMT test passes if it is not disabled and no high-rate veto or FIFO (almost) full.
The test can be bypassed using the PMT control status.

Parameters
framedata frame
modulemodule
pmtPMT number
Returns
true if test passes; else false

Definition at line 137 of file JTriggerToolkit.hh.

138  {
139  return getPMTStatus(frame, module.getPMT(pmt), pmt);
140  }
const JPMT & getPMT(const int index) const
Get PMT.
Definition: JModule.hh:163
bool getPMTStatus(const JStatus &status)
Test status of PMT.
double JTRIGGER::getRate ( const JDAQSummaryFrame frame,
const int  pmt,
const double  factor = 1.0 
)
inline

Get corrected rate of PMT.

The measured rate is corrected for the possible loss of UDP packets.

Parameters
framedata frame
pmtPMT number
factorscaling factor
Returns
rate x scaling factor [Hz]

Definition at line 153 of file JTriggerToolkit.hh.

154  {
155  double rate_Hz = frame.getRate(pmt, factor);
156 
157  // correct measured rate for UDP packet loss
158 
159  const int n1 = frame.getUDPNumberOfReceivedPackets();
160  const int n2 = frame.getUDPMaximalSequenceNumber ();
161 
162  if (n1 < n2 + 1) {
163  rate_Hz *= (double) (n2 + 1) / (double) n1;
164  }
165 
166  return rate_Hz;
167  }
double getRate(const int tdc, const double factor=1.0) const
Get count rate.
int getUDPNumberOfReceivedPackets() const
Get number of received UDP packets.
int getUDPMaximalSequenceNumber() const
Get maximal sequence number of UDP packet.

Variable Documentation

std::vector<int> JTRIGGER::count
mutable

Definition at line 180 of file JAlgorithm.hh.

struct { ... } JTRIGGER::clusterize

Anonymous structure for clustering of hits.

struct { ... } JTRIGGER::reverse_clusterize

Anonymous structure for reverse clustering of hits.

std::vector<double> JTRIGGER::weight
mutable

Definition at line 417 of file JAlgorithm.hh.

struct { ... } JTRIGGER::clusterizeWeight

Anonymous struct for weighed clustering of hits.

int JTRIGGER::MAXIMAL_FRAME_SIZE = std::numeric_limits<int>::max()
static

Maximal frame size.

Definition at line 32 of file JChecksum.hh.

const JChecksum JTRIGGER::checksum
static

Function object to perform check-sum of raw data.

Definition at line 176 of file JChecksum.hh.

const JGetRiseTime JTRIGGER::getRiseTime
static

Function object for rise time evaluation.

Definition at line 313 of file JGetRiseTime.hh.

const JModuleCounter JTRIGGER::getNumberOfModules
static

Function object to count unique modules.

Definition at line 67 of file JModuleCounter.hh.

const unsigned int JTRIGGER::NUMBER_OF_PMT_BITS = 31
static

Number of pmt bits.

Definition at line 36 of file JPMTMask.hh.