ATLAS Offline Software
TrigEMCluster.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 /*******************************************************
7 
8 NAME: TrigEMCluster.cxx
9 PACKAGE: Trigger/TrigEvent/TrigCaloEvent
10 AUTHORS: Denis O. Damazio, Carlos Osuna, Xin Wu
11 
12 PURPOSE: 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.
17 INHERITFROM: TrigCaloCluster
18 DATE: October 17th, 2005
19 
20 ******************************************************/
21 
23 #include <cmath>
24 // Constructor
26  float phi, long roi_word) :
27  TrigCaloCluster ( ) , m_Energy ( energy ),
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
40 {}
41 
42 // Copy constructor (Note that also the base class is copied)
44  TrigCaloCluster ( (TrigCaloCluster*) temc ),
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 }
58  TrigCaloCluster ( (TrigCaloCluster&) temc ),
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
73 void
74 TrigEMCluster::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
97 void
98 TrigEMCluster::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++ )
117  log << endmsg;
118 }
119 
121  return m_rings.isValid();
122 }
123 
124 void 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 
136 {
137  m_rings = ringsLink;
138 }
139 
141  if (m_rings.isValid()) {
142  return *m_rings;
143  }
144  return 0;
145 }
146 
148 {
149  return m_rings;
150 }
151 
152 // stream output
153 std::string str( const TrigEMCluster& d ) {
154  std::stringstream log;
155  log << str( (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 
176 MsgStream& operator<< ( MsgStream& m, const TrigEMCluster& d ) {
177  m << str(d);
178  return m;
179 }
180 
181 // comparison
182 bool operator== (const TrigEMCluster& a, const TrigEMCluster& b) {
183  double ep=0.001; // arbitrary , but seems to be reasonable
184  if ( (const TrigCaloCluster&) a != (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
xAOD::EgammaParameters::ehad1
@ ehad1
E leakage into 1st sampling of had calo (CaloSampling::HEC0 + CaloSampling::TileBar0 + CaloSampling::...
Definition: EgammaEnums.h:48
xAOD::EgammaParameters::e233
@ e233
uncalibrated energy (sum of cells) of the middle sampling in a rectangle of size 3x3 (in cell units e...
Definition: EgammaEnums.h:68
et
Extra patterns decribing particle interation process.
TrigEMCluster::m_Phi
float m_Phi
Phi (calibrated)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:157
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
TrigEMCluster::~TrigEMCluster
~TrigEMCluster()
Destructor
Definition: TrigEMCluster.cxx:39
TrigEMCluster::m_Eta
float m_Eta
Eta (calibrated)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:155
TrigEMCluster::m_e237
float m_e237
Energy in a 3x7 cluster (no calibration) around hottest cell.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:159
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
hist_file_dump.d
d
Definition: hist_file_dump.py:137
TrigEMCluster::print
void print(void) const
Prints out cluster variables to std::cout
Definition: TrigEMCluster.cxx:74
TrigEMCluster::m_e233
float m_e233
Energy in a 3x3 cluster (no calibration) around hottest cell.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:176
TrigEMCluster::TrigEMCluster
TrigEMCluster(float energy=0.0, float eta=-10.0, float phi=-10.0, long roi_word=0)
Constructor, please note the default values
Definition: TrigEMCluster.cxx:25
TrigEMCluster
Class with calibrated variables for egamma clustering.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:31
TrigEMCluster::m_wstot
float m_wstot
width in first layer
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:178
TrigEMCluster::m_emaxs1
float m_emaxs1
maximum energy in sampling 1 (strip layer)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:172
xAOD::wstot
setEt setPhi setE277 setWeta2 setEta1 setE2tsts1 wstot
Definition: TrigEMCluster_v1.cxx:49
operator<<
MsgStream & operator<<(MsgStream &m, const TrigEMCluster &d)
Definition: TrigEMCluster.cxx:176
TrigEMCluster::m_fracs1
float m_fracs1
Energy in a 7 strips (around hottest strip) minus energy in 3 strips divided by energy in 3 strips.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:164
TrigCaloCluster::setRoIword
void setRoIword(long roiword)
set RoI Word
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:81
TrigEMCluster::m_e2tsts1
float m_e2tsts1
get second maximum energy in sampling 1 (strip layer)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:174
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
MAXSIZE
const int MAXSIZE
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:36
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
TrigEMCluster::isValid
bool isValid() const
Definition: TrigEMCluster.cxx:120
TrigCaloCluster
Base Cluster Class.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloCluster.h:39
TrigEMCluster.h
TrigEMCluster::m_rings
ElementLink< RingerRingsContainer > m_rings
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:180
TrigCaloCluster::print
void print(void) const
Prints out cluster variables to std::cout
Definition: TrigCaloCluster.cxx:57
TrigEMCluster::m_Eta1
float m_Eta1
Eta sampling 1 (strip layer)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:170
TrigEMCluster::m_e277
float m_e277
Energy in a 7x7 cluster (no calibration) around hottest cell.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:161
str
std::string str(const TrigEMCluster &d)
Definition: TrigEMCluster.cxx:153
TrigEMCluster::setEnergy
void setEnergy(float energy)
set Energy (calibrated)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:67
TrigEMCluster::energy
float energy() const
get Energy (calibrated)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:102
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
RingerRings
This class carries the generated Rings.
Definition: RingerRings.h:18
TrigEMCluster::rings
const RingerRings * rings() const
Definition: TrigEMCluster.cxx:140
a
TList * a
Definition: liststreamerinfos.cxx:10
TrigEMCluster::ringsLink
const ElementLink< RingerRingsContainer > & ringsLink() const
Definition: TrigEMCluster.cxx:147
RingerRingsContainer
Definition: RingerRingsContainer.h:13
DEBUG
#define DEBUG
Definition: page_access.h:11
TrigEMCluster::m_ehad1
float m_ehad1
hadronic Energy (first hadronic layer)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:168
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
xAOD::EgammaParameters::e277
@ e277
uncalibrated energy (sum of cells) of the middle sampling in a rectangle of size 7x7
Definition: EgammaEnums.h:80
TrigEMCluster::m_weta2
float m_weta2
cluster width (based on a 3x5 cluster - 2nd layer)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:166
TrigEMCluster::m_Energy
float m_Energy
Energy (calibrated)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:149
xAOD::EgammaParameters::e237
@ e237
uncalibrated energy (sum of cells) of the middle sampling in a rectangle of size 3x7
Definition: EgammaEnums.h:77
xAOD::EgammaParameters::e2tsts1
@ e2tsts1
energy of the cell corresponding to second energy maximum in the first sampling
Definition: EgammaEnums.h:108
TrigEMCluster::m_Et
float m_Et
Energy (calibrated)
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:151
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
xAOD::EgammaParameters::emaxs1
@ emaxs1
energy of strip with maximal energy deposit
Definition: EgammaEnums.h:145
xAOD::EgammaParameters::fracs1
@ fracs1
shower shape in the shower core : [E(+/-3)-E(+/-1)]/E(+/-1), where E(+/-n) is the energy in ± n strip...
Definition: EgammaEnums.h:111
operator==
bool operator==(const TrigEMCluster &a, const TrigEMCluster &b)
Definition: TrigEMCluster.cxx:182
xAOD::EgammaParameters::weta2
@ weta2
the lateral width is calculated with a window of 3x5 cells using the energy weighted sum over all cel...
Definition: EgammaEnums.h:103
TrigEMCluster::setRings
void setRings(const RingerRingsContainer &ring_con, unsigned int ring_idx)
Definition: TrigEMCluster.cxx:124