LDMX Software
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
trigger::TrigEnergySum Class Reference

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

#include <TrigEnergySum.h>

Public Member Functions

 TrigEnergySum ()=default
 Default Constructor.
 
 TrigEnergySum (int layer, int hwEnergy=0)
 Preferred Constructor.
 
 TrigEnergySum (int layer, int module, float energy)
 
virtual ~TrigEnergySum ()=default
 Destructor.
 
bool operator< (const TrigEnergySum &sum)
 Sort the collection to trig digis by the raw ID.
 
void Clear ()
 
void setLayer (int layer)
 
int layer () const
 
void setModule (int module)
 
int module () const
 
void setEnergy (float energy)
 
float energy () const
 
void setHwEnergy (int hwEnergy)
 
int hwEnergy () const
 
void Print () const
 Print a description of this object.
 

Private Member Functions

 ClassDef (TrigEnergySum, 1)
 ROOT Dictionary class definition macro.
 

Private Attributes

int layer_ {0}
 the raw ID for this trigger channel
 
int module_ {0}
 
int hwEnergy_ {0}
 
float energy_ {0}
 

Friends

std::ostream & operator<< (std::ostream &o, const TrigEnergySum &d)
 Stream the input digi.
 
std::ostream & operator<< (std::ostream &o, const TrigEnergySumCollection &c)
 Stream the input digi collection.
 

Detailed Description

Contains the trigger output for generic calo objects.

Definition at line 24 of file TrigEnergySum.h.

Constructor & Destructor Documentation

◆ TrigEnergySum() [1/3]

trigger::TrigEnergySum::TrigEnergySum ( )
default

Default Constructor.

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

◆ TrigEnergySum() [2/3]

trigger::TrigEnergySum::TrigEnergySum ( int  layer,
int  hwEnergy = 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 TrigEnergySum.cxx.

9 : layer_{layer}, module_{0}, hwEnergy_{hwEnergy}, energy_{0} {}
int layer_
the raw ID for this trigger channel

◆ TrigEnergySum() [3/3]

trigger::TrigEnergySum::TrigEnergySum ( int  layer,
int  module,
float  energy 
)

Definition at line 10 of file TrigEnergySum.cxx.

11 : layer_{layer}, module_{module}, hwEnergy_{0}, energy_{energy} {}

◆ ~TrigEnergySum()

virtual trigger::TrigEnergySum::~TrigEnergySum ( )
virtualdefault

Destructor.

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

Member Function Documentation

◆ Clear()

void trigger::TrigEnergySum::Clear ( )
inline

Definition at line 64 of file TrigEnergySum.h.

64 {
65 energy_ = 0;
66 hwEnergy_ = 0;
67 layer_ = 0;
68 module_ = 0;
69 }

◆ energy()

float trigger::TrigEnergySum::energy ( ) const
inline

Definition at line 78 of file TrigEnergySum.h.

78{ return energy_; }

◆ hwEnergy()

int trigger::TrigEnergySum::hwEnergy ( ) const
inline

Definition at line 81 of file TrigEnergySum.h.

81{ return hwEnergy_; }

◆ layer()

int trigger::TrigEnergySum::layer ( ) const
inline

Definition at line 72 of file TrigEnergySum.h.

72{ return layer_; }

◆ module()

int trigger::TrigEnergySum::module ( ) const
inline

Definition at line 75 of file TrigEnergySum.h.

75{ return module_; }

◆ operator<()

bool trigger::TrigEnergySum::operator< ( const TrigEnergySum sum)
inline

Sort the collection to trig digis by the raw ID.

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

Definition at line 62 of file TrigEnergySum.h.

62{ return hwEnergy_ < sum.hwEnergy_; }

◆ Print()

void trigger::TrigEnergySum::Print ( ) const

Print a description of this object.

Definition at line 13 of file TrigEnergySum.cxx.

13{ std::cout << *this << std::endl; }

◆ setEnergy()

void trigger::TrigEnergySum::setEnergy ( float  energy)
inline

Definition at line 77 of file TrigEnergySum.h.

77{ energy_ = energy; }

◆ setHwEnergy()

void trigger::TrigEnergySum::setHwEnergy ( int  hwEnergy)
inline

Definition at line 80 of file TrigEnergySum.h.

80{ hwEnergy_ = hwEnergy; }

◆ setLayer()

void trigger::TrigEnergySum::setLayer ( int  layer)
inline

Definition at line 71 of file TrigEnergySum.h.

71{ layer_ = layer; }

◆ setModule()

void trigger::TrigEnergySum::setModule ( int  module)
inline

Definition at line 74 of file TrigEnergySum.h.

74{ module_ = module; }

Friends And Related Symbol Documentation

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream &  o,
const TrigEnergySum d 
)
friend

Stream the input digi.

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

Parameters
[in]oostream to write to
[in]ddigi to write out
Returns
modified ostream

Definition at line 15 of file TrigEnergySum.cxx.

15 {
16 s << "TrigEnergySum { "
17 << "(layer " << sum.layer() << ", hwEnergy " << sum.hwEnergy() << " } ";
18 return s;
19}

◆ operator<< [2/2]

std::ostream & operator<< ( std::ostream &  o,
const TrigEnergySumCollection &  c 
)
friend

Stream the input digi collection.

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

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

Definition at line 21 of file TrigEnergySum.cxx.

22 {
23 s << "TrigEnergySumCollection { " << std::endl;
24 for (auto sum : sums) s << " " << sum << std::endl;
25 s << "}";
26 return s;
27}

Member Data Documentation

◆ energy_

float trigger::TrigEnergySum::energy_ {0}
private

Definition at line 122 of file TrigEnergySum.h.

122{0};

◆ hwEnergy_

int trigger::TrigEnergySum::hwEnergy_ {0}
private

Definition at line 121 of file TrigEnergySum.h.

121{0};

◆ layer_

int trigger::TrigEnergySum::layer_ {0}
private

the raw ID for this trigger channel

Definition at line 119 of file TrigEnergySum.h.

119{0};

◆ module_

int trigger::TrigEnergySum::module_ {0}
private

Definition at line 120 of file TrigEnergySum.h.

120{0};

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