LDMX Software
ldmx::CaloTrigPrim Class Reference

Contains the trigger output for generic calo objects. More...

#include <CaloTrigPrim.h>

Public Member Functions

 CaloTrigPrim ()=default
 Default Constructor.
 
 CaloTrigPrim (uint32_t tid, uint32_t tp=0)
 Preferred Constructor.
 
virtual ~CaloTrigPrim ()=default
 Destructor.
 
bool operator< (const CaloTrigPrim &c)
 Sort the collection of CaloTPs by the raw ID.
 
uint32_t getId () const
 Get the id of the CaloTP.
 
void setPrimitive (uint32_t tp)
 Set the trigger primitive value for the given channel @params[in] tp the value of the trigger primitive.
 
uint32_t getPrimitive () const
 Get the trigger primitive value for the given channel.
 

Private Member Functions

 ClassDef (CaloTrigPrim, 2)
 ROOT Dictionary class definition macro.
 

Private Attributes

uint32_t tid_ {0}
 the raw ID for this trigger channel
 
uint32_t tp_ {0}
 the integer trigger primitive value for this channel
 

Friends

std::ostream & operator<< (std::ostream &s, const CaloTrigPrim &c)
 Stream the input CaloTP.
 
std::ostream & operator<< (std::ostream &s, const CaloTrigPrimCollection &c)
 Stream the input tp collection.
 

Detailed Description

Contains the trigger output for generic calo objects.

Definition at line 24 of file CaloTrigPrim.h.

Constructor & Destructor Documentation

◆ CaloTrigPrim() [1/2]

ldmx::CaloTrigPrim::CaloTrigPrim ( )
default

Default Constructor.

Needed for ROOT dictionary definition, suggested to not use this constructor.

◆ CaloTrigPrim() [2/2]

ldmx::CaloTrigPrim::CaloTrigPrim ( uint32_t tid,
uint32_t tp = 0 )

Preferred Constructor.

Defines the trigger group ID and the trigger primitive value.

Parameters
[in]tidraw trigger group ID
[in]tptrigger primitive value

Definition at line 8 of file CaloTrigPrim.cxx.

8: tid_(tid), tp_{tp} {}
uint32_t tp_
the integer trigger primitive value for this channel
uint32_t tid_
the raw ID for this trigger channel

◆ ~CaloTrigPrim()

virtual ldmx::CaloTrigPrim::~CaloTrigPrim ( )
virtualdefault

Destructor.

Needs to be defined for ROOT dictionary definition, does nothing right now.

Member Function Documentation

◆ getId()

uint32_t ldmx::CaloTrigPrim::getId ( ) const
inline

Get the id of the CaloTP.

Returns
raw trigger ID

Definition at line 67 of file CaloTrigPrim.h.

67{ return tid_; }

References tid_.

◆ getPrimitive()

uint32_t ldmx::CaloTrigPrim::getPrimitive ( ) const
inline

Get the trigger primitive value for the given channel.

Returns
the value of the trigger primitive

Definition at line 79 of file CaloTrigPrim.h.

79{ return tp_; }

References tp_.

◆ operator<()

bool ldmx::CaloTrigPrim::operator< ( const CaloTrigPrim & c)
inline

Sort the collection of CaloTPs by the raw ID.

Parameters
[in]canother CaloTP to compare against
Returns
true if this ID is less than the other ID

Definition at line 61 of file CaloTrigPrim.h.

61{ return tid_ < c.tid_; }

References tid_.

◆ setPrimitive()

void ldmx::CaloTrigPrim::setPrimitive ( uint32_t tp)
inline

Set the trigger primitive value for the given channel @params[in] tp the value of the trigger primitive.

Definition at line 73 of file CaloTrigPrim.h.

73{ tp_ = tp; }

References tp_.

Friends And Related Symbol Documentation

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream & s,
const CaloTrigPrim & c )
friend

Stream the input CaloTP.

In one line, prints out the ID (in hex), the primitive (in hex).

Parameters
[in]sostream to write to
[in]dtp to write out
Returns
modified ostream

Definition at line 10 of file CaloTrigPrim.cxx.

10 {
11 s << "CaloTrigPrim { " << "(id : 0x" << std::hex << c.getId() << std::dec
12 << ") ";
13 s << "0x" << std::hex << int(c.getPrimitive()) << " } ";
14 return s;
15}

◆ operator<< [2/2]

std::ostream & operator<< ( std::ostream & s,
const CaloTrigPrimCollection & c )
friend

Stream the input tp collection.

Prints out each tp member of the collection on a new line.

Parameters
[in]sostream to write to
[in]ccollection to write out
Returns
modified ostream

Definition at line 17 of file CaloTrigPrim.cxx.

18 {
19 s << "CaloTrigPrimCollection { " << std::endl;
20 for (auto c : cs) s << " " << c << std::endl;
21 s << "}";
22 return s;
23}

Member Data Documentation

◆ tid_

uint32_t ldmx::CaloTrigPrim::tid_ {0}
private

the raw ID for this trigger channel

Definition at line 108 of file CaloTrigPrim.h.

108{0};

Referenced by getId(), and operator<().

◆ tp_

uint32_t ldmx::CaloTrigPrim::tp_ {0}
private

the integer trigger primitive value for this channel

Definition at line 110 of file CaloTrigPrim.h.

110{0};

Referenced by getPrimitive(), and setPrimitive().


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