Belle II Software development
EventLevelTriggerTimeInfo.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <TObject.h>
11
12namespace Belle2 {
23 class EventLevelTriggerTimeInfo : public TObject {
24
25 public:
34 explicit EventLevelTriggerTimeInfo(bool isValid = false, bool isHER = false, bool revo2 = false,
35 unsigned int timeSinceLastInjection = c_flagNoInjection,
36 unsigned int timeSincePrevTrigger = 0,
37 unsigned int bunchNumber = 0) :
38 m_isValid(isValid), m_isHER(isHER), m_revo2(revo2), m_timeSinceLastInjection(timeSinceLastInjection),
39 m_timeSincePrevTrigger(timeSincePrevTrigger), m_bunchNumber(bunchNumber) {}
42
43 // Simple Getters
45 bool isValid() const {return m_isValid;}
47 bool isHER() const {return m_isHER;}
49 bool isRevo2() const {return m_revo2;}
53 unsigned int getTimeSincePrevTrigger() const {return m_timeSincePrevTrigger;}
55 unsigned int getBunchNumber() const {return m_bunchNumber;}
58
59 // Simple Setters
61 void setValid() {m_isValid = true;}
63 void setInvalid() {m_isValid = false;}
65 void setIsHER(bool isHER) {m_isHER = isHER;}
67 void setRevo2(bool revo2) {m_revo2 = revo2;}
69 void setTimeSinceLastInjection(unsigned int timeSinceLastInjection) {m_timeSinceLastInjection = timeSinceLastInjection;}
71 void setTimeSincePrevTrigger(unsigned int timeSincePrevTrigger) {m_timeSincePrevTrigger = timeSincePrevTrigger;}
73 void setBunchNumber(unsigned int bunchNumber) {m_bunchNumber = bunchNumber;}
76
77 // Additional Functions (not inline)
83 int getTimeSinceInjectedBunch() const;
88
89 private:
97 bool m_isHER;
122 unsigned int m_bunchNumber;
123
125 static const unsigned int c_flagNoInjection = 0x7FFFFFFF;
126
127 ClassDef(EventLevelTriggerTimeInfo, 1)
128 };
130}
Storage element for information from the Trigger Timing Distribution (TTD)
void setInvalid()
set that stored information is valid
void setTimeSinceLastInjection(unsigned int timeSinceLastInjection)
set time since the last injection (i.e. the injection-pre-kick signal) in clock ticks (FTSW clock)
bool m_isHER
Injection is in HER/LER.
EventLevelTriggerTimeInfo(bool isValid=false, bool isHER=false, bool revo2=false, unsigned int timeSinceLastInjection=c_flagNoInjection, unsigned int timeSincePrevTrigger=0, unsigned int bunchNumber=0)
Constructor.
int getTriggeredBunchNumberGlobal() const
get the actual (=global) number of the triggered bunch
int getTimeSinceInjectedBunch() const
get time since the injected bunch passed the detector in clock ticks (FTSW clock)
unsigned int getBunchNumber() const
get number of triggered bunch as provided by TTD
static const unsigned int c_flagNoInjection
This number is defined by the FTSW to indicate no injection happened recently.
unsigned int m_timeSincePrevTrigger
Time since the previous trigger in clock ticks (127MHz=RF/4 clock)
unsigned int getTimeSincePrevTrigger() const
get time since the previous trigger in clock ticks (FTSW clock)
bool hasInjection() const
get if an injection happened recently (and the corresponding stored data is actually valid)
void setIsHER(bool isHER)
set if injection in HER/LER
bool isValid() const
get if stored information is valid
unsigned int m_bunchNumber
Number of triggered bunch, ranging from 0-1279 (in 127MHz clock ticks) Note: There are a maximum of 5...
unsigned int getTimeSinceLastInjection() const
get time since the last injection (i.e. the injection-pre-kick signal) in clock ticks (FTSW clock)
unsigned int m_timeSinceLastInjection
Time since the last injection in clock ticks (127MHz=RF/4 clock) Note: A value of 0x7FFFFFFF (see c_f...
double getTimeSincePrevTriggerInMicroSeconds() const
get time since the previous trigger in microseconds
bool m_revo2
Lowest bit of revolution counter (PXD needs ~2 revolutions to readout one frame)
void setRevo2(bool revo2)
set lowest bit of revolution counter
bool isRevo2() const
get lowest bit of revolution counter
void setBunchNumber(unsigned int bunchNumber)
set number of triggered bunch
void setValid()
set that stored information is valid
void setTimeSincePrevTrigger(unsigned int timeSincePrevTrigger)
set time since the previous trigger in clock ticks (FTSW clock)
bool isHER() const
get if last injection was in HER/LER
void setNoInjection()
set that no injection happened recently (and the corresponding stored data is actually invalid)
bool m_isValid
Data stored in this TTD info object is actually valid.
double getTimeSinceInjectedBunchInMicroSeconds() const
get time since the injected bunch passed the detector in microseconds
double getTimeSinceLastInjectionInMicroSeconds() const
get time since the last injection (i.e. the injection-pre-kick signal) in microseconds
Abstract base class for different kinds of events.