ATLAS Offline Software
Loading...
Searching...
No Matches
Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGCALOCLUSTER_H
6#define TRIGCALOCLUSTER_H
7
8
9/*******************************************************
10
11NAME: TrigCaloCluster.h
12PACKAGE: Trigger/TrigEvent/TrigCaloEvent
13AUTHORS: Denis O. Damazio, Carlos Osuna, Xin Wu
14
15PURPOSE: Keep the important output variables
16 from the Calorimeter LVL2 Trigger.
17 Optionally seed ID Trigger and EF.
18 Variables here should be RAW variables
19 not corrected.
20KNOWTOINHERIT: TrigEmCluster, TrigTauCluster,
21 TrigJetCluster
22DATE: October 17th, 2005
23
24******************************************************/
25
26// for printing out
27#include <iostream>
28#include "GaudiKernel/MsgStream.h"
29// t have quantities per sample
30#include "CaloGeoHelpers/CaloSampling.h"
31// CLID for persistency
34#include <algorithm>
35
36const int MAXSIZE = CaloSampling::CaloSample::Unknown;
37
40
41public:
43 TrigCaloCluster (float energy = 0.0, float eta = -10.0,
44 float phi = -10.0, long roi_word = 0);
48 TrigCaloCluster ( const TrigCaloCluster* trigcalocluster );
49
51 void print ( void ) const;
53 void print ( MsgStream& log) const;
54
55 // set methods
57 inline void setRawEnergy( float energy )
58 { m_rawEnergy = energy; };
59 template <class ITERATOR>
60 void setRawEnergies (ITERATOR beg, ITERATOR end)
61 {
62 auto out = CxxUtils::copy_bounded (beg, end,
63 std::begin(m_rawEnergyS),
64 std::end(m_rawEnergyS));
65 std::fill (out, std::end(m_rawEnergyS), 0);
66 }
67
68 inline void setRawEt( float et )
69 { m_rawEt = et; };
70
72 float energy )
73 { m_rawEnergyS[sample] = energy; };
74
75 inline void setRawEta ( float eta )
76 { m_rawEta = eta; };
77
78 inline void setRawPhi ( float phi )
79 { m_rawPhi = phi; };
80
81 inline void setRoIword ( long roiword )
82 { m_roiWord = roiword; };
83
84 inline void setNCells ( int ncells )
85 { m_numberUsedCells = ncells;};
86
87 inline void setquality ( unsigned int quality )
88 { m_quality = quality; };
89
90 // get methods
92 inline float rawEnergy( ) const
93 { return m_rawEnergy ;};
94 template <class ITERATOR>
95 void rawEnergies (ITERATOR beg, ITERATOR end) const
96 {
97 auto out = CxxUtils::copy_bounded (std::begin(m_rawEnergyS),
98 std::end(m_rawEnergyS),
99 beg, end);
100 std::fill (out, end, 0);
101 }
102
103 inline float rawEt ( ) const
104 { return m_rawEt ;};
105
106 inline float rawEnergy( CaloSampling::CaloSample sample ) const
107 { return m_rawEnergyS[sample]; };
108
109 inline float rawEta ( ) const
110 { return m_rawEta ;};
111
112 inline float rawPhi ( ) const
113 { return m_rawPhi ;};
114
115 inline long RoIword ( ) const
116 { return m_roiWord ;};
117
118 inline int nCells ( ) const
119 { return m_numberUsedCells ;};
120
121 inline unsigned int quality ( ) const
122 { return m_quality ;};
123
124 // internal variables must be protected to be
125 // modified in daughter classes like TrigEM/Tau Clusters.
126protected:
130 float m_rawEt;
134 float m_rawEta;
136 float m_rawPhi;
142 unsigned int m_quality;
143
144};
145
146// stream output
147std::string str( const TrigCaloCluster& d );
148MsgStream& operator<< ( MsgStream& m, const TrigCaloCluster& d );
149
150// comparison
151bool operator== (const TrigCaloCluster& a, const TrigCaloCluster& b);
152inline bool operator!= ( const TrigCaloCluster& a,
153 const TrigCaloCluster& b ) { return !(a==b); }
154
155void diff( const TrigCaloCluster& clus1, const TrigCaloCluster& clus2,
156 std::map< std::string, double >& varChange );
157
158CLASS_DEF ( TrigCaloCluster, 220079886, 1)
159
160#endif
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
static Double_t a
bool operator!=(const TrigCaloCluster &a, const TrigCaloCluster &b)
bool operator==(const TrigCaloCluster &a, const TrigCaloCluster &b)
void diff(const TrigCaloCluster &clus1, const TrigCaloCluster &clus2, std::map< std::string, double > &varChange)
MsgStream & operator<<(MsgStream &m, const TrigCaloCluster &d)
void setRawEta(float eta)
set Raw Eta (no calibration)
void setRawEnergy(CaloSampling::CaloSample sample, float energy)
set Raw Et (no calibration) per sampling layer
TrigCaloCluster(float energy=0.0, float eta=-10.0, float phi=-10.0, long roi_word=0)
Constructor, please note the default values.
unsigned int m_quality
quality of cluster built (to be defined)
float m_rawEnergyS[MAXSIZE]
Raw Energy per sample (upto 25 samples - no calibration)
void print(void) const
Prints out cluster variables to std::cout.
void setRawEnergy(float energy)
set Raw Energy (no calibration)
void setRawPhi(float phi)
set Raw Phi (no calibration)
void setquality(unsigned int quality)
set quality of cluster built (to be defined)
unsigned int quality() const
get quality of cluster built (to be defined)
float rawEnergy() const
get Raw Energy (no calibration)
~TrigCaloCluster()
Destructor.
void setNCells(int ncells)
set number of cells used from RoI
float rawEnergy(CaloSampling::CaloSample sample) const
get Raw Energy (no calibration) per sampling layer
void setRawEt(float et)
set Raw Et (no calibration)
int nCells() const
get number of cells used from RoI
Copy a range with bounds restriction.
OutputIterator copy_bounded(InputIterator begi, InputIterator endi, OutputIterator bego, OutputIterator endo)
Copy a range with bounds restriction.
Extra patterns decribing particle interation process.