ATLAS Offline Software
Loading...
Searching...
No Matches
TrigEMCluster.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6/*******************************************************
7
8NAME: TrigEMCluster.cxx
9PACKAGE: Trigger/TrigEvent/TrigCaloEvent
10AUTHORS: Denis O. Damazio, Carlos Osuna, Xin Wu
11
12PURPOSE: Keep the important output variables
13 from the Calorimeter LVL2 egamma Trigger.
14 Optionally seed ID Trigger and EF.
15 Variables here should be RAW variables
16 not corrected.
17INHERITFROM: TrigCaloCluster
18DATE: October 17th, 2005
19
20******************************************************/
21
23#include <cmath>
24// Constructor
26 float phi, long roi_word) :
28 m_Et ( 0. ), m_Eta ( eta ), m_Phi ( phi ),
29 m_e237( 0. ), m_e277 ( 999. ),
30 m_fracs1 ( 0. ), m_weta2 ( 0. ),
31 m_ehad1 ( 0. ), m_Eta1 ( 0. ),
32 m_emaxs1 ( 999. ), m_e2tsts1 ( 0. ),
33 m_e233( 0. ), m_wstot( 0. )
34{ setRoIword ( roi_word );
35 m_rings.reset();
36}
37
38// Destructor
41
42// Copy constructor (Note that also the base class is copied)
45 m_Energy ( temc->energy() ), m_Et ( temc->et() ),
46 m_Eta ( temc->eta() ), m_Phi ( temc->phi() ),
47 m_e237 ( temc->e237() ), m_e277 ( temc->e277() ),
48 m_fracs1 ( temc->fracs1() ), m_weta2 ( temc->weta2() ),
49 m_ehad1 ( temc->ehad1() ), m_Eta1 ( temc->Eta1() ),
50 m_emaxs1 ( temc->emaxs1() ), m_e2tsts1( temc->e2tsts1() ),
51 m_e233 ( temc->e233() ), m_wstot ( temc->wstot() )
52{ for ( int i = 0 ; i < MAXSIZE ; i++ )
55 m_rings.reset();
56}
59 m_Energy ( temc.energy() ) , m_Et ( temc.et() ),
60 m_Eta ( temc.eta() ) , m_Phi ( temc.phi() ),
61 m_e237 ( temc.e237() ) , m_e277 ( temc.e277() ),
62 m_fracs1 ( temc.fracs1() ) , m_weta2 ( temc.weta2() ),
63 m_ehad1 ( temc.ehad1() ) , m_Eta1 ( temc.Eta1() ),
64 m_emaxs1 ( temc.emaxs1() ) , m_e2tsts1( temc.e2tsts1() ),
65 m_e233 ( temc.e233() ) , m_wstot ( temc.wstot() )
66{ for ( int i = 0 ; i < MAXSIZE ; i++ )
69 m_rings.reset();
70}
71
72// Simple debug method
73void
74TrigEMCluster::print ( void ) const {
76 std::cout << "m_Energy : " << m_Energy << "; ";
77 std::cout << "m_Et : " << m_Et << "; ";
78 std::cout << "m_Eta : " << m_Eta << "; ";
79 std::cout << "m_Phi : " << m_Phi << "; ";
80 std::cout << "m_e237 : " << m_e237 << "; ";
81 std::cout << "m_e277 : " << m_e277 << "; ";
82 std::cout << "m_fracs1 : " << m_fracs1 << "; ";
83 std::cout << "m_weta2 : " << m_weta2 << "; ";
84 std::cout << "m_ehad1 : " << m_ehad1 << "; ";
85 std::cout << "m_Eta1 : " << m_Eta1 << "; ";
86 std::cout << "m_emaxs1 : " << m_emaxs1 << "; ";
87 std::cout << "m_e2tsts1 : " << m_e2tsts1 << "; ";
88 std::cout << "m_e233 : " << m_e233 << "; ";
89 std::cout << "m_wstot : " << m_wstot << "; ";
90 std::cout << "m_EnergyS : ";
91 for ( int i = 0 ; i < MAXSIZE ; i++ )
92 std::cout << energy((CaloSampling::CaloSample)i) << "; ";
93 std::cout << std::endl;
94}
95
96// Simple debug method using MsgStream
97void
98TrigEMCluster::print ( MsgStream& log ) const {
100 log <<MSG::DEBUG<< "m_Energy : " << m_Energy << "; ";
101 log <<MSG::DEBUG<< "m_Et : " << m_Et << "; ";
102 log <<MSG::DEBUG<< "m_Eta : " << m_Eta << "; ";
103 log <<MSG::DEBUG<< "m_Phi : " << m_Phi << "; ";
104 log <<MSG::DEBUG<< "m_e237 : " << m_e237 << "; ";
105 log <<MSG::DEBUG<< "m_e277 : " << m_e277 << "; ";
106 log <<MSG::DEBUG<< "m_fracs1 : " << m_fracs1 << "; ";
107 log <<MSG::DEBUG<< "m_weta2 : " << m_weta2 << "; ";
108 log <<MSG::DEBUG<< "m_ehad1 : " << m_ehad1 << "; ";
109 log <<MSG::DEBUG<< "m_Eta1 : " << m_Eta1 << "; ";
110 log <<MSG::DEBUG<< "m_emaxs1 : " << m_emaxs1 << "; ";
111 log <<MSG::DEBUG<< "m_e2tsts1 : " << m_e2tsts1 << "; ";
112 log <<MSG::DEBUG<< "m_e233 : " << m_e233 << "; ";
113 log <<MSG::DEBUG<< "m_wstot : " << m_wstot << "; ";
114 log <<MSG::DEBUG<< "m_EnergyS : ";
115 for ( int i = 0 ; i < MAXSIZE ; i++ )
116 log <<MSG::DEBUG<< energy((CaloSampling::CaloSample)i) << "; ";
117 log << endmsg;
118}
119
121 return m_rings.isValid();
122}
123
124void TrigEMCluster::setRings(const RingerRingsContainer &ring_con, unsigned int ring_idx) {
125 if (ring_idx < ring_con.size()) {
126 m_rings.toIndexedElement(ring_con, ring_idx);
127 if (!m_rings.isValid()) {
128 m_rings.reset();
129 }
130 } else {
131 m_rings.reset();
132 }
133}
134
139
141 if (m_rings.isValid()) {
142 return *m_rings;
143 }
144 return 0;
145}
146
151
152// stream output
153std::string str( const TrigEMCluster& d ) {
154 std::stringstream log;
155 log << str( static_cast<const TrigCaloCluster&>( d )) ;
156 log << "m_Energy : " << d.energy() << "; ";
157 log << "m_Et : " << d.et() << "; ";
158 log << "m_Eta : " << d.eta() << "; ";
159 log << "m_Phi : " << d.phi() << "; ";
160 log << "m_e237 : " << d.e237() << "; ";
161 log << "m_e277 : " << d.e277() << "; ";
162 log << "m_fracs1 : " << d.fracs1() << "; ";
163 log << "m_weta2 : " << d.weta2() << "; ";
164 log << "m_ehad1 : " << d.ehad1() << "; ";
165 log << "m_Eta1 : " << d.Eta1() << "; ";
166 log << "m_emaxs1 : " << d.emaxs1() << "; ";
167 log << "m_e2tsts1 : " << d.e2tsts1() << "; ";
168 log << "m_e233 : " << d.e233() << "; ";
169 log << "m_wstot : " << d.wstot() << "; ";
170 log << "m_EnergyS : ";
171 for ( int i = 0 ; i < MAXSIZE ; i++ )
172 log << d.energy((CaloSampling::CaloSample)i) << "; ";
173 return log.str();
174}
175
176MsgStream& operator<< ( MsgStream& m, const TrigEMCluster& d ) {
177 m << str(d);
178 return m;
179}
180
181// comparison
182bool operator== (const TrigEMCluster& a, const TrigEMCluster& b) {
183 double ep=0.001; // arbitrary , but seems to be reasonable
184 if ( static_cast<const TrigCaloCluster&>(a) != static_cast<const TrigCaloCluster&>(b) )
185 return false;
186 if ( std::fabs(a.eta() - b.eta() )>ep ) return false;
187 if ( std::fabs(a.phi() - b.phi() )>ep ) return false;
188 if ( std::fabs(a.energy() - b.energy() )>ep ) return false;
189 return true;
190}
191
192// End of file TrigEMCluster.cxx
#define endmsg
static Double_t a
bool operator==(const TrigEMCluster &a, const TrigEMCluster &b)
MsgStream & operator<<(MsgStream &m, const TrigEMCluster &d)
size_type size() const noexcept
Returns the number of elements in the collection.
This class carries the generated Rings.
Definition RingerRings.h:18
TrigCaloCluster(float energy=0.0, float eta=-10.0, float phi=-10.0, long roi_word=0)
Constructor, please note the default values.
void print(void) const
Prints out cluster variables to std::cout.
Class with calibrated variables for egamma clustering.
float ehad1() const
get hadronic Energy (first hadronic layer)
float m_e237
Energy in a 3x7 cluster (no calibration) around hottest cell.
float m_e233
Energy in a 3x3 cluster (no calibration) around hottest cell.
float emaxs1() const
get maximum energy in sampling 1 (strip layer)
bool isValid() const
const ElementLink< RingerRingsContainer > & ringsLink() const
float e2tsts1() const
get second maximum energy in sampling 1 (strip layer)
float e233() const
get Energy in a 3x3 cluster (no calibration) around hottest cell
const RingerRings * rings() const
float m_e277
Energy in a 7x7 cluster (no calibration) around hottest cell.
TrigEMCluster(float energy=0.0, float eta=-10.0, float phi=-10.0, long roi_word=0)
Constructor, please note the default values.
float m_emaxs1
maximum energy in sampling 1 (strip layer)
float weta2() const
get cluster width (based on a 3x5 cluster - 2nd layer)
float m_e2tsts1
get second maximum energy in sampling 1 (strip layer)
void print(void) const
Prints out cluster variables to std::cout.
float e277() const
get Energy in a 7x7 cluster (no calibration) around hottest cell
float m_ehad1
hadronic Energy (first hadronic layer)
void setRings(const RingerRingsContainer &ring_con, unsigned int ring_idx)
float m_weta2
cluster width (based on a 3x5 cluster - 2nd layer)
~TrigEMCluster()
Destructor.
void setEnergy(float energy)
set Energy (calibrated)
float fracs1() const
get Energy in a 7 strips (around hottest strip) minus energy in 3 strips divided by energy in 3 strip...
float m_fracs1
Energy in a 7 strips (around hottest strip) minus energy in 3 strips divided by energy in 3 strips.
float Eta1() const
get Eta sampling 1 (strip layer)
float e237() const
get Energy in a 3x7 cluster (no calibration) around hottest cell