Belle II Software light-2406-ragdoll
TRGSummary Class Referencefinal

Trigger Summary Information input bits input bits from subdetectors ftdl (Final Trigger Decision Logic) bits output bits of trigger logic psnm (Prescale and Mask) bits prescaled ftdl bits timType types of trigger timing source defined in b2tt firmware. More...

#include <TRGSummary.h>

Inheritance diagram for TRGSummary:
Collaboration diagram for TRGSummary:

Public Types

enum  ETimingType {
  TTYP_ECL = 0 ,
  TTYP_PID1 = 4 ,
  TTYP_PID2 = 8 ,
  TTYP_PID3 = 12 ,
  TTYP_SELF = 2 ,
  TTYP_RSV1 = 6 ,
  TTYP_RSV2 = 10 ,
  TTYP_RSV3 = 14 ,
  TTYP_TOP = 1 ,
  TTYP_CDC = 3 ,
  TTYP_DPHY = 5 ,
  TTYP_RAND = 7 ,
  TTYP_TEST = 9 ,
  TTYP_RSV4 = 11 ,
  TTYP_POIS = 13 ,
  TTYP_NONE = 15
}
 types of trigger timing source defined in b2tt firmware More...
 
enum  ETimingQuality {
  TTYQ_NONE = 0 ,
  TTYQ_CORS = 1 ,
  TTYQ_FINE = 2 ,
  TTYQ_SFIN = 3
}
 trigger timing type quality More...
 

Public Member Functions

 TRGSummary ()=default
 default constructor: xxx
 
 TRGSummary (unsigned int inputBits[10], unsigned int ftdlBits[10], unsigned int psnmBits[10], ETimingType timType)
 constructor: xxx
 
bool test () const
 check whether any psnm bit is set
 
bool testInput (unsigned int bit) const
 check whether an input bit is set
 
bool testInput (const std::string &name) const
 check whether an input bit is set
 
bool testFtdl (unsigned int bit) const
 check whether a ftdl bit is set
 
bool testFtdl (const std::string &name) const
 check whether a ftdl bit is set
 
bool testPsnm (unsigned int bit) const
 check whether a psnm bit is set
 
bool testPsnm (const std::string &name) const
 check whether a psnm bit is set
 
bool isPoissonInInjectionVeto () const
 check whether poisson random trigger is within injection veto
 
void setPoissonInInjectionVeto ()
 set true if poisson random trigger is within injection veto
 
void setTRGSummary (int i, int word)
 set the Final Trigger Decision Logic bit
 
void setPreScale (int i, int bit, int pre)
 set the prescale factor of each bit
 
void setInputBits (int i, int word)
 set the input bits
 
void setFtdlBits (int i, int word)
 set the ftdl bits, the same as setTRGSummary(int i, int word)
 
void setPsnmBits (int i, int word)
 set the Prescaled ftdl bits
 
unsigned int getTRGSummary (int i) const
 get the trigger result, each word has 32 bits
 
unsigned int getPreScale (int i, int bit) const
 get the prescale factor which the bit is corresponding
 
void setTimType (ETimingType timType)
 set the timType
 
void setTimQuality (ETimingQuality timQuality)
 set the timQuality
 
unsigned int getInputBits (const unsigned i) const
 get input bits
 
unsigned int getFtdlBits (const unsigned i) const
 get ftdl bits (directly determined by the trigger conditions)
 
unsigned int getPsnmBits (const unsigned i) const
 get psnm bits (prescaled ftdl bits)
 
ETimingType getTimType () const
 get timing source information
 
ETimingQuality getTimQuality () const
 get timing source quality
 
std::string getInfoHTML () const override
 Return a short summary of this object's contents in HTML format.
 
unsigned int getInputBitNumber (const std::string &name) const
 get number of an input trigger bit
 
unsigned int getOutputBitNumber (const std::string &name) const
 get number of an output trigger bit
 
void addRelationTo (const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
 Add a relation from this object to another object (with caching).
 
void addRelationTo (const TObject *object, float weight=1.0, const std::string &namedRelation="") const
 Add a relation from this object to another object (no caching, can be quite slow).
 
void copyRelations (const RelationsInterface< BASE > *sourceObj)
 Copies all relations of sourceObj (pointing from or to sourceObj) to this object (including weights).
 
template<class TO >
RelationVector< TO > getRelationsTo (const std::string &name="", const std::string &namedRelation="") const
 Get the relations that point from this object to another store array.
 
template<class FROM >
RelationVector< FROM > getRelationsFrom (const std::string &name="", const std::string &namedRelation="") const
 Get the relations that point from another store array to this object.
 
template<class T >
RelationVector< T > getRelationsWith (const std::string &name="", const std::string &namedRelation="") const
 Get the relations between this object and another store array.
 
template<class TO >
TO * getRelatedTo (const std::string &name="", const std::string &namedRelation="") const
 Get the object to which this object has a relation.
 
template<class FROM >
FROM * getRelatedFrom (const std::string &name="", const std::string &namedRelation="") const
 Get the object from which this object has a relation.
 
template<class T >
T * getRelated (const std::string &name="", const std::string &namedRelation="") const
 Get the object to or from which this object has a relation.
 
template<class TO >
std::pair< TO *, float > getRelatedToWithWeight (const std::string &name="", const std::string &namedRelation="") const
 Get first related object & weight of relation pointing to an array.
 
template<class FROM >
std::pair< FROM *, float > getRelatedFromWithWeight (const std::string &name="", const std::string &namedRelation="") const
 Get first related object & weight of relation pointing from an array.
 
template<class T >
std::pair< T *, float > getRelatedWithWeight (const std::string &name="", const std::string &namedRelation="") const
 Get first related object & weight of relation pointing from/to an array.
 
virtual std::string getName () const
 Return a short name that describes this object, e.g.
 
std::string getInfo () const
 Return a short summary of this object's contents in raw text format.
 
std::string getArrayName () const
 Get name of array this object is stored in, or "" if not found.
 
int getArrayIndex () const
 Returns this object's array index (in StoreArray), or -1 if not found.
 

Static Public Attributes

static const unsigned int c_trgWordSize = 32
 size of a l1 trigger word
 
static const unsigned int c_ntrgWords = 10
 number of l1 trigger words
 

Protected Member Functions

TClonesArray * getArrayPointer () const
 Returns the pointer to the raw DataStore array holding this object (protected since these arrays are easy to misuse).
 

Private Member Functions

std::string outputBitWithColor (bool bit) const
 return the td part of an HTML table with green of the bit is > 0
 
 ClassDefOverride (TRGSummary, 7)
 Trigger Summary Information including bit (input, ftdl, psnm), timing and trigger source.
 
 ClassDef (RelationsInterface, 0)
 defines interface for accessing relations of objects in StoreArray.
 

Private Attributes

unsigned int m_inputBits [c_ntrgWords] = {0}
 input bits from subdetectors
 
unsigned int m_ftdlBits [c_ntrgWords] = {0}
 ftdl (Final Trigger Decision Logic) bits.
 
unsigned int m_psnmBits [c_ntrgWords] = {0}
 psnm (PreScale aNd Mask) bits.
 
ETimingType m_timType = TTYP_NONE
 types of trigger timing source defined in b2tt firmware
 
ETimingQuality m_timQuality = TTYQ_NONE
 trigger timing type quality
 
unsigned int m_prescaleBits [c_ntrgWords][c_trgWordSize] = {{0}}
 the prescale factor of each bit
 
bool m_isPoissonInInjectionVeto = false
 Poisson random trigger in injection veto or not.
 
DataStore::StoreEntrym_cacheDataStoreEntry
 Cache of the data store entry to which this object belongs.
 
int m_cacheArrayIndex
 Cache of the index in the TClonesArray to which this object belongs.
 

Static Private Attributes

static const int c_Version = 1
 version of this code
 

Detailed Description

Trigger Summary Information input bits input bits from subdetectors ftdl (Final Trigger Decision Logic) bits output bits of trigger logic psnm (Prescale and Mask) bits prescaled ftdl bits timType types of trigger timing source defined in b2tt firmware.

Definition at line 32 of file TRGSummary.h.

Member Enumeration Documentation

◆ ETimingQuality

trigger timing type quality

Definition at line 79 of file TRGSummary.h.

79 {
80 /* Non. Must not happen for TOP/ECL/CDC timing events */
81 TTYQ_NONE = 0,
82 /* Coarse */
83 TTYQ_CORS = 1,
84 /* Fine */
85 TTYQ_FINE = 2,
86 /* Super Fine */
87 TTYQ_SFIN = 3,
88 };

◆ ETimingType

types of trigger timing source defined in b2tt firmware

Enumerator
TTYP_ECL 

events triggered by ECL timing

TTYP_PID1 

reserved (not defined yet)

TTYP_PID2 

reserved (not defined yet)

TTYP_PID3 

reserved (not defined yet)

TTYP_SELF 

events triggered by self trigger

TTYP_RSV1 

reserved (not defined yet)

TTYP_RSV2 

reserved (not defined yet)

TTYP_RSV3 

reserved (not defined yet)

TTYP_TOP 

events triggered by TOP timing

TTYP_CDC 

events triggered by CDC timing

TTYP_DPHY 

delayed physics events for background

TTYP_RAND 

random trigger events

TTYP_TEST 

test pulse input

TTYP_RSV4 

reserved (not defined yet)

TTYP_POIS 

poisson random trigger

TTYP_NONE 

reserved (not defined yet)

Definition at line 43 of file TRGSummary.h.

43 {
45 TTYP_ECL = 0,
47 TTYP_PID1 = 4,
49 TTYP_PID2 = 8,
51 TTYP_PID3 = 12,
53 TTYP_SELF = 2,
55 TTYP_RSV1 = 6,
57 TTYP_RSV2 = 10,
59 TTYP_RSV3 = 14,
61 TTYP_TOP = 1,
63 TTYP_CDC = 3,
65 TTYP_DPHY = 5,
67 TTYP_RAND = 7,
69 TTYP_TEST = 9,
71 TTYP_RSV4 = 11,
73 TTYP_POIS = 13,
75 TTYP_NONE = 15
76 };
@ TTYP_RSV3
reserved (not defined yet)
Definition: TRGSummary.h:59
@ TTYP_DPHY
delayed physics events for background
Definition: TRGSummary.h:65
@ TTYP_PID3
reserved (not defined yet)
Definition: TRGSummary.h:51
@ TTYP_RSV4
reserved (not defined yet)
Definition: TRGSummary.h:71
@ TTYP_SELF
events triggered by self trigger
Definition: TRGSummary.h:53
@ TTYP_POIS
poisson random trigger
Definition: TRGSummary.h:73
@ TTYP_PID1
reserved (not defined yet)
Definition: TRGSummary.h:47
@ TTYP_NONE
reserved (not defined yet)
Definition: TRGSummary.h:75
@ TTYP_TOP
events triggered by TOP timing
Definition: TRGSummary.h:61
@ TTYP_RSV2
reserved (not defined yet)
Definition: TRGSummary.h:57
@ TTYP_PID2
reserved (not defined yet)
Definition: TRGSummary.h:49
@ TTYP_CDC
events triggered by CDC timing
Definition: TRGSummary.h:63
@ TTYP_TEST
test pulse input
Definition: TRGSummary.h:69
@ TTYP_RSV1
reserved (not defined yet)
Definition: TRGSummary.h:55
@ TTYP_ECL
events triggered by ECL timing
Definition: TRGSummary.h:45
@ TTYP_RAND
random trigger events
Definition: TRGSummary.h:67

Constructor & Destructor Documentation

◆ TRGSummary()

TRGSummary ( unsigned int  inputBits[10],
unsigned int  ftdlBits[10],
unsigned int  psnmBits[10],
ETimingType  timType 
)

constructor: xxx

Definition at line 23 of file TRGSummary.cc.

27{
28 for (int i = 0; i < 10; i++) {
29 m_inputBits[i] = inputBits[i];
30 m_ftdlBits[i] = ftdlBits[i];
31 m_psnmBits[i] = psnmBits[i];
32 }
33 m_timType = timType;
34}
unsigned int m_ftdlBits[c_ntrgWords]
ftdl (Final Trigger Decision Logic) bits.
Definition: TRGSummary.h:254
unsigned int m_inputBits[c_ntrgWords]
input bits from subdetectors
Definition: TRGSummary.h:251
unsigned int m_psnmBits[c_ntrgWords]
psnm (PreScale aNd Mask) bits.
Definition: TRGSummary.h:259
ETimingType m_timType
types of trigger timing source defined in b2tt firmware
Definition: TRGSummary.h:262

Member Function Documentation

◆ addRelationTo() [1/2]

void addRelationTo ( const RelationsInterface< BASE > *  object,
float  weight = 1.0,
const std::string &  namedRelation = "" 
) const
inlineinherited

Add a relation from this object to another object (with caching).

Parameters
objectThe object to which the relation should point.
weightThe weight of the relation.
namedRelationAdditional name for the relation, or "" for the default naming

Definition at line 142 of file RelationsObject.h.

143 {
144 if (object)
146 object, object->m_cacheDataStoreEntry, object->m_cacheArrayIndex, weight, namedRelation);
147 }
void addRelation(const TObject *fromObject, StoreEntry *&fromEntry, int &fromIndex, const TObject *toObject, StoreEntry *&toEntry, int &toIndex, float weight, const std::string &namedRelation)
Add a relation from an object in a store array to another object in a store array.
Definition: DataStore.cc:492
static DataStore & Instance()
Instance of singleton Store.
Definition: DataStore.cc:54
DataStore::StoreEntry * m_cacheDataStoreEntry
Cache of the data store entry to which this object belongs.
int m_cacheArrayIndex
Cache of the index in the TClonesArray to which this object belongs.

◆ addRelationTo() [2/2]

void addRelationTo ( const TObject *  object,
float  weight = 1.0,
const std::string &  namedRelation = "" 
) const
inlineinherited

Add a relation from this object to another object (no caching, can be quite slow).

Parameters
objectThe object to which the relation should point.
weightThe weight of the relation.
namedRelationAdditional name for the relation, or "" for the default naming

Definition at line 155 of file RelationsObject.h.

156 {
157 StoreEntry* toEntry = nullptr;
158 int toIndex = -1;
159 DataStore::Instance().addRelation(this, m_cacheDataStoreEntry, m_cacheArrayIndex, object, toEntry, toIndex, weight, namedRelation);
160 }

◆ copyRelations()

void copyRelations ( const RelationsInterface< BASE > *  sourceObj)
inlineinherited

Copies all relations of sourceObj (pointing from or to sourceObj) to this object (including weights).

Useful if you want to make a complete copy of a StoreArray object to make modifications to it, but retain all information on linked objects.

Note: this only works if sourceObj inherits from the same base (e.g. RelationsObject), and only for related objects that also inherit from the same base.

Definition at line 170 of file RelationsObject.h.

171 {
172 if (!sourceObj)
173 return;
174 auto fromRels = sourceObj->getRelationsFrom<RelationsInterface<BASE>>("ALL");
175 for (unsigned int iRel = 0; iRel < fromRels.size(); iRel++) {
176 fromRels.object(iRel)->addRelationTo(this, fromRels.weight(iRel));
177 }
178
179 auto toRels = sourceObj->getRelationsTo<RelationsInterface<BASE>>("ALL");
180 for (unsigned int iRel = 0; iRel < toRels.size(); iRel++) {
181 this->addRelationTo(toRels.object(iRel), toRels.weight(iRel));
182 }
183 }
void addRelationTo(const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
Add a relation from this object to another object (with caching).

◆ getArrayIndex()

int getArrayIndex ( ) const
inlineinherited

Returns this object's array index (in StoreArray), or -1 if not found.

Definition at line 385 of file RelationsObject.h.

386 {
388 return m_cacheArrayIndex;
389 }
bool findStoreEntry(const TObject *object, StoreEntry *&entry, int &index)
Find an object in an array in the data store.
Definition: DataStore.cc:398

◆ getArrayName()

std::string getArrayName ( ) const
inlineinherited

Get name of array this object is stored in, or "" if not found.

Definition at line 377 of file RelationsObject.h.

◆ getArrayPointer()

TClonesArray * getArrayPointer ( ) const
inlineprotectedinherited

Returns the pointer to the raw DataStore array holding this object (protected since these arrays are easy to misuse).

Definition at line 418 of file RelationsObject.h.

419 {
422 return nullptr;
424 }
TClonesArray * getPtrAsArray() const
Return ptr cast to TClonesArray.
Definition: StoreEntry.cc:83

◆ getFtdlBits()

unsigned int getFtdlBits ( const unsigned  i) const
inline

get ftdl bits (directly determined by the trigger conditions)

Parameters
iindex: 0, 1, 2 for bit 0-31, 32-63, 64-95, respectively.
Returns
ftdl bits

Definition at line 195 of file TRGSummary.h.

196 {
197 return m_ftdlBits[i];
198 }

◆ getInfo()

std::string getInfo ( ) const
inlineinherited

Return a short summary of this object's contents in raw text format.

Returns the contents of getInfoHTML() while translating line-breaks etc.

Note
: You don't need to implement this function (it's not virtual), getInfoHTML() is enough.

Definition at line 370 of file RelationsObject.h.

371 {
373 }
virtual std::string getInfoHTML() const
Return a short summary of this object's contents in HTML format.
std::string htmlToPlainText(const std::string &html)
See RelationsObject::getInfo()

◆ getInfoHTML()

std::string getInfoHTML ( ) const
overridevirtual

Return a short summary of this object's contents in HTML format.

Reimplemented from RelationsInterface< BASE >.

Definition at line 124 of file TRGSummary.cc.

125{
126 std::stringstream htmlOutput;
127
128 htmlOutput << "<table>";
129 htmlOutput
130 << "<tr><td></td><td bgcolor='#cccccc'>GDL Input</td><td bgcolor='#cccccc' colspan='2'>GDL Output</td></tr>";
131 htmlOutput
132 << "<tr><td>Bit</td><td>Input Bits</td><td>Final Trg DL</td><td>Prescaled Trg and Mask</td></tr>";
133
134 for (unsigned int currentBit = 0;
135 currentBit < (c_ntrgWords * c_trgWordSize); currentBit++) {
136 htmlOutput << "<tr>";
137
138 const auto currentWord = currentBit / c_trgWordSize;
139 const auto currentBitInWord = currentBit % c_trgWordSize;
140
141 const auto ftdlBit =
142 (getFtdlBits(currentWord) & ((unsigned int)1 << currentBitInWord)) > 0;
143 const auto psnmBit =
144 (getPsnmBits(currentWord) & ((unsigned int)1 << currentBitInWord)) > 0;
145 const auto inputBit = (getInputBits(currentWord)
146 & ((unsigned int)1 << currentBitInWord)) > 0;
147
148 htmlOutput << "<td>" << currentBit << "(word " << currentWord << " bit "
149 << currentBitInWord << ")</td>";
150 htmlOutput << outputBitWithColor(inputBit);
151 htmlOutput << outputBitWithColor(ftdlBit);
152 htmlOutput << outputBitWithColor(psnmBit);
153 htmlOutput << "</tr>";
154 }
155 htmlOutput << "</table>";
156
157 return htmlOutput.str();
158}
static const unsigned int c_trgWordSize
size of a l1 trigger word
Definition: TRGSummary.h:37
std::string outputBitWithColor(bool bit) const
return the td part of an HTML table with green of the bit is > 0
Definition: TRGSummary.cc:162
unsigned int getFtdlBits(const unsigned i) const
get ftdl bits (directly determined by the trigger conditions)
Definition: TRGSummary.h:195
unsigned int getInputBits(const unsigned i) const
get input bits
Definition: TRGSummary.h:186
static const unsigned int c_ntrgWords
number of l1 trigger words
Definition: TRGSummary.h:40
unsigned int getPsnmBits(const unsigned i) const
get psnm bits (prescaled ftdl bits)
Definition: TRGSummary.h:204

◆ getInputBitNumber()

unsigned int getInputBitNumber ( const std::string &  name) const

get number of an input trigger bit

Parameters
nameinput trigger bit name
Returns
input trigger bit number

Definition at line 77 of file TRGSummary.cc.

78{
79 // Instead of returning a magic number, let's throw an exception:
80 // this will help us to distinguish "trigger not fired" cases
81 // from "trigger not found" at analysis level.
82 static DBObjPtr<TRGGDLDBInputBits> inputBits;
83
84 if (not inputBits) {
85 B2WARNING("The mapping of input trigger names does not exist in the given globaltags");
86 throw std::runtime_error("No input trigger map in the given globaltags");
87 }
88
89 for (unsigned int bit = 0; bit < c_trgWordSize * c_ntrgWords; bit++) {
90 if (std::string(inputBits->getinbitname((int)bit)) == name) {
91 return bit;
92 }
93 }
94
95 B2WARNING("The requested input trigger name does not exist" << LogVar("name", name));
96 throw std::invalid_argument("The requested input trigger name does not exist: " + name);
97}
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
Class to store variables with their name which were sent to the logging service.

◆ getInputBits()

unsigned int getInputBits ( const unsigned  i) const
inline

get input bits

Parameters
iindex: 0, 1, 2 for bit 0-31, 32-63, 64-95, respectively.
Returns
input bits

Definition at line 186 of file TRGSummary.h.

187 {
188 return m_inputBits[i];
189 }

◆ getName()

virtual std::string getName ( ) const
inlinevirtualinherited

Return a short name that describes this object, e.g.

pi+ for an MCParticle.

Reimplemented in Particle, and MCParticle.

Definition at line 344 of file RelationsObject.h.

344{ return ""; }

◆ getOutputBitNumber()

unsigned int getOutputBitNumber ( const std::string &  name) const

get number of an output trigger bit

Parameters
nameoutput trigger bit name
Returns
output trigger bit number

Definition at line 99 of file TRGSummary.cc.

100{
101 // Instead of returning a magic number, let's throw an exception:
102 // this will help us to distinguish "trigger not fired" cases
103 // from "trigger not found" at analysis level.
104 static DBObjPtr<TRGGDLDBFTDLBits> ftdlBits;
105
106 if (not ftdlBits) {
107 B2WARNING("The mapping of output trigger names does not exist in the given globaltags");
108 throw std::runtime_error("No input trigger map in the given globaltags");
109 }
110
111 for (unsigned int bit = 0; bit < c_trgWordSize * c_ntrgWords; bit++) {
112 if (std::string(ftdlBits->getoutbitname((int)bit)) == name) {
113 return bit;
114 }
115 }
116
117 B2WARNING("The requested output trigger name does not exist" << LogVar("name", name));
118 // Instead of returning a magic number, let's throw an exception:
119 // this will help us to distinguish "trigger not fired" cases
120 // from "trigger not found" at analysis level.
121 throw std::invalid_argument("The requested input trigger name does not exist: " + name);
122}

◆ getPreScale()

unsigned int getPreScale ( int  i,
int  bit 
) const
inline

get the prescale factor which the bit is corresponding

Definition at line 174 of file TRGSummary.h.

174{return m_prescaleBits[i][bit];}
unsigned int m_prescaleBits[c_ntrgWords][c_trgWordSize]
the prescale factor of each bit
Definition: TRGSummary.h:268

◆ getPsnmBits()

unsigned int getPsnmBits ( const unsigned  i) const
inline

get psnm bits (prescaled ftdl bits)

Parameters
iindex: 0, 1, 2 for bit 0-31, 32-63, 64-95, respectively.
Returns
psnm bits

Definition at line 204 of file TRGSummary.h.

205 {
206 return m_psnmBits[i];
207 }

◆ getRelated()

T * getRelated ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the object to or from which this object has a relation.

Template Parameters
TThe class of objects to or from which the relation points.
Parameters
nameThe name of the store array to or from which the relation points. If empty the default store array name for class T will be used. If the special name "ALL" is given all store arrays containing objects of type T are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
The first related object or a null pointer.

Definition at line 278 of file RelationsObject.h.

279 {
281 T::Class(), name, namedRelation).object);
282 }
@ c_BothSides
Combination of c_FromSide and c_ToSide.
Definition: DataStore.h:79
Belle2::RelationEntry getRelationWith(ESearchSide searchSide, const TObject *object, StoreEntry *&entry, int &index, const TClass *withClass, const std::string &withName, const std::string &namedRelation)
Get the first relation between an object and another object in a store array.
Definition: DataStore.cc:597
TObject * object
Pointer to the object.
Definition: RelationEntry.h:32

◆ getRelatedFrom()

FROM * getRelatedFrom ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the object from which this object has a relation.

Template Parameters
FROMThe class of objects from which the relation points.
Parameters
nameThe name of the store array from which the relation points. If empty the default store array name for class FROM will be used. If the special name "ALL" is given all store arrays containing objects of type FROM are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
The first related object or a null pointer.

Definition at line 263 of file RelationsObject.h.

264 {
266 m_cacheArrayIndex, FROM::Class(), name, namedRelation).object);
267 }
@ c_FromSide
Return relations/objects pointed from (to a given object).
Definition: DataStore.h:77

◆ getRelatedFromWithWeight()

std::pair< FROM *, float > getRelatedFromWithWeight ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get first related object & weight of relation pointing from an array.

Template Parameters
FROMThe class of objects from which the relation points.
Parameters
nameThe name of the store array from which the relation points. If empty the default store array name for class FROM will be used. If the special name "ALL" is given all store arrays containing objects of type FROM are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
Pair of first related object and the relation weight, or (NULL, 1.0) if none found.

Definition at line 314 of file RelationsObject.h.

316 {
318 FROM::Class(), name, namedRelation);
319 return std::make_pair(static_cast<FROM*>(entry.object), entry.weight);
320 }

◆ getRelatedTo()

TO * getRelatedTo ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the object to which this object has a relation.

Template Parameters
TOThe class of objects to which the relation points.
Parameters
nameThe name of the store array to which the relation points. If empty the default store array name for class TO will be used. If the special name "ALL" is given all store arrays containing objects of type TO are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
The first related object or a null pointer.

Definition at line 248 of file RelationsObject.h.

249 {
251 TO::Class(), name, namedRelation).object);
252 }
@ c_ToSide
Return relations/objects pointed to (from a given object).
Definition: DataStore.h:78

◆ getRelatedToWithWeight()

std::pair< TO *, float > getRelatedToWithWeight ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get first related object & weight of relation pointing to an array.

Template Parameters
TOThe class of objects to which the relation points.
Parameters
nameThe name of the store array to which the relation points. If empty the default store array name for class TO will be used. If the special name "ALL" is given all store arrays containing objects of type TO are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
Pair of first related object and the relation weight, or (NULL, 1.0) if none found.

Definition at line 297 of file RelationsObject.h.

299 {
301 TO::Class(), name, namedRelation);
302 return std::make_pair(static_cast<TO*>(entry.object), entry.weight);
303 }

◆ getRelatedWithWeight()

std::pair< T *, float > getRelatedWithWeight ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get first related object & weight of relation pointing from/to an array.

Template Parameters
TThe class of objects to or from which the relation points.
Parameters
nameThe name of the store array to or from which the relation points. If empty the default store array name for class T will be used. If the special name "ALL" is given all store arrays containing objects of type T are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
Pair of first related object and the relation weight, or (NULL, 1.0) if none found.

Definition at line 331 of file RelationsObject.h.

333 {
335 T::Class(), name, namedRelation);
336 return std::make_pair(static_cast<T*>(entry.object), entry.weight);
337 }

◆ getRelationsFrom()

RelationVector< FROM > getRelationsFrom ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the relations that point from another store array to this object.

Template Parameters
FROMThe class of objects from which the relations point.
Parameters
nameThe name of the store array from which the relations point. If empty the default store array name for class FROM will be used. If the special name "ALL" is given all store arrays containing objects of type FROM are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
A vector of relations.

Definition at line 212 of file RelationsObject.h.

214 {
216 m_cacheArrayIndex, FROM::Class(), name, namedRelation));
217 }
RelationVector< T > getRelationsWith(const std::string &name="", const std::string &namedRelation="") const
Get the relations between this object and another store array.

◆ getRelationsTo()

RelationVector< TO > getRelationsTo ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the relations that point from this object to another store array.

Template Parameters
TOThe class of objects to which the relations point.
Parameters
nameThe name of the store array to which the relations point. If empty the default store array name for class TO will be used. If the special name "ALL" is given all store arrays containing objects of type TO are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
A vector of relations.

Definition at line 197 of file RelationsObject.h.

198 {
200 m_cacheArrayIndex, TO::Class(), name, namedRelation));
201 }

◆ getRelationsWith()

RelationVector< T > getRelationsWith ( const std::string &  name = "",
const std::string &  namedRelation = "" 
) const
inlineinherited

Get the relations between this object and another store array.

Relations in both directions are returned.

Template Parameters
TThe class of objects to or from which the relations point.
Parameters
nameThe name of the store array to or from which the relations point. If empty the default store array name for class T will be used. If the special name "ALL" is given all store arrays containing objects of type T are considered.
namedRelationAdditional name for the relation, or "" for the default naming
Returns
A vector of relations.

Definition at line 230 of file RelationsObject.h.

231 {
233 m_cacheArrayIndex, T::Class(), name, namedRelation));
234 }

◆ getTimQuality()

ETimingQuality getTimQuality ( ) const
inline

get timing source quality

Returns
timing type quality

Definition at line 220 of file TRGSummary.h.

221 {
222 return m_timQuality;
223 }
ETimingQuality m_timQuality
trigger timing type quality
Definition: TRGSummary.h:265

◆ getTimType()

ETimingType getTimType ( ) const
inline

get timing source information

Returns
timing source type

Definition at line 212 of file TRGSummary.h.

213 {
214 return m_timType;
215 }

◆ getTRGSummary()

unsigned int getTRGSummary ( int  i) const
inline

get the trigger result, each word has 32 bits

Definition at line 171 of file TRGSummary.h.

171{return m_ftdlBits[i];}

◆ isPoissonInInjectionVeto()

bool isPoissonInInjectionVeto ( ) const
inline

check whether poisson random trigger is within injection veto

Returns
True if poisson random trigger is within injection veto

Definition at line 143 of file TRGSummary.h.

144 {
146 }
bool m_isPoissonInInjectionVeto
Poisson random trigger in injection veto or not.
Definition: TRGSummary.h:271

◆ outputBitWithColor()

std::string outputBitWithColor ( bool  bit) const
private

return the td part of an HTML table with green of the bit is > 0

Definition at line 162 of file TRGSummary.cc.

163{
164 const std::string colorNeutral = gROOT->GetColor(kWhite)->AsHexString();
165 const std::string colorAccept = gROOT->GetColor(kGreen)->AsHexString();
166
167 std::string color = bit > 0 ? colorAccept : colorNeutral;
168 std::stringstream outStream;
169 outStream << "<td bgcolor=\"" << color << "\">" << bit << "</td>";
170 return outStream.str();
171}

◆ setFtdlBits()

void setFtdlBits ( int  i,
int  word 
)
inline

set the ftdl bits, the same as setTRGSummary(int i, int word)

Definition at line 165 of file TRGSummary.h.

165{m_ftdlBits[i] = word;}

◆ setInputBits()

void setInputBits ( int  i,
int  word 
)
inline

set the input bits

Definition at line 162 of file TRGSummary.h.

162{m_inputBits[i] = word;}

◆ setPoissonInInjectionVeto()

void setPoissonInInjectionVeto ( )
inline

set true if poisson random trigger is within injection veto

Definition at line 150 of file TRGSummary.h.

151 {
153 }

◆ setPreScale()

void setPreScale ( int  i,
int  bit,
int  pre 
)
inline

set the prescale factor of each bit

Definition at line 159 of file TRGSummary.h.

159{m_prescaleBits[i][bit] = pre;}

◆ setPsnmBits()

void setPsnmBits ( int  i,
int  word 
)
inline

set the Prescaled ftdl bits

Definition at line 168 of file TRGSummary.h.

168{m_psnmBits[i] = word;}

◆ setTimQuality()

void setTimQuality ( ETimingQuality  timQuality)
inline

set the timQuality

Definition at line 180 of file TRGSummary.h.

180{m_timQuality = timQuality;}

◆ setTimType()

void setTimType ( ETimingType  timType)
inline

set the timType

Definition at line 177 of file TRGSummary.h.

177{m_timType = timType;}

◆ setTRGSummary()

void setTRGSummary ( int  i,
int  word 
)
inline

set the Final Trigger Decision Logic bit

Definition at line 156 of file TRGSummary.h.

156{ m_ftdlBits[i] = word;}

◆ test()

bool test ( ) const

check whether any psnm bit is set

Returns
True if triggered by L1

Definition at line 36 of file TRGSummary.cc.

37{
38 for (unsigned int word = 0; word < c_ntrgWords; word++) {
39 if (m_psnmBits[word] != 0) return true;
40 }
41 return false;
42}

◆ testFtdl() [1/2]

bool testFtdl ( const std::string &  name) const
inline

check whether a ftdl bit is set

Parameters
namename of ftdl bit.
Returns
True if the bit is set

Definition at line 126 of file TRGSummary.h.

126{return testFtdl(getOutputBitNumber(name));}
unsigned int getOutputBitNumber(const std::string &name) const
get number of an output trigger bit
Definition: TRGSummary.cc:99
bool testFtdl(unsigned int bit) const
check whether a ftdl bit is set
Definition: TRGSummary.cc:55

◆ testFtdl() [2/2]

bool testFtdl ( unsigned int  bit) const

check whether a ftdl bit is set

Parameters
bitindex of ftdl bit.
Returns
True if the bit is set

Definition at line 55 of file TRGSummary.cc.

56{
57 if (bit >= c_trgWordSize * c_ntrgWords) {
58 B2ERROR("Requested ftdl trigger bit number is out of range" << LogVar("bit", bit));
59 throw std::out_of_range("The requested FTDL trigger bit is out of range: " + std::to_string(bit));
60 }
61 int iWord = bit / c_trgWordSize;
62 int iBit = bit % c_trgWordSize;
63 return (m_ftdlBits[iWord] & (1u << iBit)) != 0;
64}

◆ testInput() [1/2]

bool testInput ( const std::string &  name) const
inline

check whether an input bit is set

Parameters
namename of input bit.
Returns
True if the bit is set

Definition at line 114 of file TRGSummary.h.

114{return testInput(getInputBitNumber(name));}
unsigned int getInputBitNumber(const std::string &name) const
get number of an input trigger bit
Definition: TRGSummary.cc:77
bool testInput(unsigned int bit) const
check whether an input bit is set
Definition: TRGSummary.cc:44

◆ testInput() [2/2]

bool testInput ( unsigned int  bit) const

check whether an input bit is set

Parameters
bitindex of input bit.
Returns
True if the bit is set

Definition at line 44 of file TRGSummary.cc.

45{
46 if (bit >= c_trgWordSize * c_ntrgWords) {
47 B2ERROR("Requested input trigger bit number is out of range" << LogVar("bit", bit));
48 throw std::out_of_range("The requested input trigger bit is out of range: " + std::to_string(bit));
49 }
50 int iWord = bit / c_trgWordSize;
51 int iBit = bit % c_trgWordSize;
52 return (m_inputBits[iWord] & (1u << iBit)) != 0;
53}

◆ testPsnm() [1/2]

bool testPsnm ( const std::string &  name) const
inline

check whether a psnm bit is set

Parameters
namename of psnm bit.
Returns
True if the bit is set

Definition at line 138 of file TRGSummary.h.

138{return testPsnm(getOutputBitNumber(name));}
bool testPsnm(unsigned int bit) const
check whether a psnm bit is set
Definition: TRGSummary.cc:66

◆ testPsnm() [2/2]

bool testPsnm ( unsigned int  bit) const

check whether a psnm bit is set

Parameters
bitindex of psnm bit.
Returns
True if the bit is set

Definition at line 66 of file TRGSummary.cc.

67{
68 if (bit >= c_trgWordSize * c_ntrgWords) {
69 B2ERROR("Requested psnm trigger bit number is out of range" << LogVar("bit", bit));
70 throw std::out_of_range("The requested PSNM trigger bit is out of range: " + std::to_string(bit));
71 }
72 int iWord = bit / c_trgWordSize;
73 int iBit = bit % c_trgWordSize;
74 return (m_psnmBits[iWord] & (1u << iBit)) != 0;
75}

Member Data Documentation

◆ c_ntrgWords

const unsigned int c_ntrgWords = 10
static

number of l1 trigger words

Definition at line 40 of file TRGSummary.h.

◆ c_trgWordSize

const unsigned int c_trgWordSize = 32
static

size of a l1 trigger word

Definition at line 37 of file TRGSummary.h.

◆ c_Version

const int c_Version = 1
staticprivate

version of this code

Definition at line 248 of file TRGSummary.h.

◆ m_cacheArrayIndex

int m_cacheArrayIndex
mutableprivateinherited

Cache of the index in the TClonesArray to which this object belongs.

Definition at line 432 of file RelationsObject.h.

◆ m_cacheDataStoreEntry

DataStore::StoreEntry* m_cacheDataStoreEntry
mutableprivateinherited

Cache of the data store entry to which this object belongs.

Definition at line 429 of file RelationsObject.h.

◆ m_ftdlBits

unsigned int m_ftdlBits[c_ntrgWords] = {0}
private

ftdl (Final Trigger Decision Logic) bits.

Outputs of trigger logic

Definition at line 254 of file TRGSummary.h.

◆ m_inputBits

unsigned int m_inputBits[c_ntrgWords] = {0}
private

input bits from subdetectors

Definition at line 251 of file TRGSummary.h.

◆ m_isPoissonInInjectionVeto

bool m_isPoissonInInjectionVeto = false
private

Poisson random trigger in injection veto or not.

Definition at line 271 of file TRGSummary.h.

◆ m_prescaleBits

unsigned int m_prescaleBits[c_ntrgWords][c_trgWordSize] = {{0}}
private

the prescale factor of each bit

Definition at line 268 of file TRGSummary.h.

◆ m_psnmBits

unsigned int m_psnmBits[c_ntrgWords] = {0}
private

psnm (PreScale aNd Mask) bits.

Prescaled ftdl bits For instance, if the prescale factor is 20 of a ftdl bit, only 1/20 of its psnm bit would be fired.

Definition at line 259 of file TRGSummary.h.

◆ m_timQuality

ETimingQuality m_timQuality = TTYQ_NONE
private

trigger timing type quality

Definition at line 265 of file TRGSummary.h.

◆ m_timType

ETimingType m_timType = TTYP_NONE
private

types of trigger timing source defined in b2tt firmware

Definition at line 262 of file TRGSummary.h.


The documentation for this class was generated from the following files: