ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TestBeam
TBRec
src
TBEMECCellEtaCorrection.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
#include "
TBEMECCellEtaCorrection.h
"
6
7
// INCLUDE LAr header files:
8
9
#include "CaloDetDescr/CaloDetDescrElement.h"
10
#include "
CaloEvent/CaloCell.h
"
11
12
// INCLUDE Gaudi hearder files
13
#include "GaudiKernel/MsgStream.h"
14
15
// Constructor:
16
17
TBEMECCellEtaCorrection::TBEMECCellEtaCorrection
(
const
std::string&
type
,
18
const
std::string& name,
19
const
IInterface* parent)
20
:
CaloCellCorrection
(
type
, name, parent),
21
m_EMEC_response_eta_correction
(false),
22
m_EMEC_eta1
(2.5),
m_EMEC_eta2
(2.8),
m_EMEC_eta3
(3.2),
23
m_EMEC_eta0_1
(0),
24
m_EMEC_eta0_2
(0),
25
m_EMEC_beta1
(1.),
m_EMEC_alpha1
(0.),
m_EMEC_beta2
(1.),
m_EMEC_alpha2
(0.),
26
m_ramp_corr
(1.045),
m_ramp_corr_eta1
(2.8),
m_ramp_corr_eta2
(2.9),
27
m_EMEC_rescale
(1.),
m_FCAL_rescale
(0.9818),
28
m_EMEC_1_scale
(1.),
m_EMEC_2_scale
(1.),
29
m_HEC_0_scale
(1.),
m_HEC_1_scale
(1.),
m_HEC_2_scale
(1.),
30
m_FCAL_0_scale
(1.),
m_FCAL_1_scale
(1.)
31
{
32
declareInterface<CaloCellCorrection>(
this
);
33
// Cell level correction of EMEC eta-dependent response
34
declareProperty
(
"EMEC_beta1"
,
m_EMEC_beta1
);
35
declareProperty
(
"EMEC_beta2"
,
m_EMEC_beta2
);
36
declareProperty
(
"EMEC_alpha1"
,
m_EMEC_alpha1
);
37
declareProperty
(
"EMEC_alpha2"
,
m_EMEC_alpha2
);
38
declareProperty
(
"ramp_corr"
,
m_ramp_corr
);
39
declareProperty
(
"EMEC_rescale"
,
m_EMEC_rescale
);
40
declareProperty
(
"FCAL_rescale"
,
m_FCAL_rescale
);
41
declareProperty
(
"LowEta"
,
m_EMEC_eta1
);
42
declareProperty
(
"MiddleEta"
,
m_EMEC_eta2
);
43
declareProperty
(
"HighEta"
,
m_EMEC_eta3
);
44
45
declareProperty
(
"EMEC1_scale"
,
m_EMEC_1_scale
);
46
declareProperty
(
"EMEC2_scale"
,
m_EMEC_2_scale
);
47
48
declareProperty
(
"HEC0_scale"
,
m_HEC_0_scale
);
49
declareProperty
(
"HEC1_scale"
,
m_HEC_1_scale
);
50
declareProperty
(
"HEC2_scale"
,
m_HEC_2_scale
);
51
52
declareProperty
(
"FCAL0_scale"
,
m_FCAL_0_scale
);
53
declareProperty
(
"FCAL1_scale"
,
m_FCAL_1_scale
);
54
}
55
56
57
StatusCode
TBEMECCellEtaCorrection::initialize
()
58
{
59
MsgStream log(msgSvc(), name());
60
61
log << MSG::INFO <<
" TBEMECCellEtaCorrection initialization "
<<
endmsg
;
62
63
// Initialize variables for correction of EMEC response eta-dependance
64
if
(
m_EMEC_alpha1
== 0 &&
m_EMEC_alpha2
== 0 &&
m_EMEC_beta1
== 0 &&
m_EMEC_beta2
== 0) {
65
log << MSG::INFO <<
"No correction of EMEC response eta-dependance"
66
<<
endmsg
;
67
}
68
else
{
69
m_EMEC_response_eta_correction
=
true
;
70
m_EMEC_eta0_1
= 0.5*(
m_EMEC_eta1
+
m_EMEC_eta2
);
71
m_EMEC_eta0_2
= 0.5*(
m_EMEC_eta2
+
m_EMEC_eta3
);
72
log << MSG::INFO <<
"Correction of EMEC response eta-dependance is ON;"
73
<<
endmsg
;
74
log << MSG::INFO <<
"EMEC_eta0_1, EMEC_alpha1, EMEC_beta1 = "
<<
75
m_EMEC_eta0_1
<<
" "
<<
m_EMEC_alpha1
<<
" "
<<
m_EMEC_beta1
<<
endmsg
;
76
log << MSG::INFO <<
"EMEC_eta0_2, EMEC_alpha2, EMEC_beta2 = "
<<
77
m_EMEC_eta0_2
<<
" "
<<
m_EMEC_alpha2
<<
" "
<<
m_EMEC_beta2
<<
endmsg
;
78
}
79
log << MSG::INFO <<
"ramp_corr, ramp_corr_eta1, ramp_corr_eta2 = "
80
<<
m_ramp_corr
<<
" "
<<
m_ramp_corr_eta1
<<
" "
<<
m_ramp_corr_eta2
<<
endmsg
;
81
log << MSG::INFO <<
"EMEC_rescale = "
<<
m_EMEC_rescale
<<
endmsg
;
82
log << MSG::INFO <<
"FCAL_rescale = "
<<
m_FCAL_rescale
<<
endmsg
;
83
return
StatusCode::SUCCESS;
84
}
85
86
// Desctructor
87
88
TBEMECCellEtaCorrection::~TBEMECCellEtaCorrection
()
89
{ }
90
91
// MakeCorrection: This is called with a pointer to the Cell Object.
92
93
void
94
TBEMECCellEtaCorrection::MakeCorrection
(
CaloCell
* theCell,
95
const
EventContext&
/*ctx*/
)
const
96
{
97
MsgStream log(msgSvc(), name());
98
99
const
CaloDetDescrElement
* elt = theCell->
caloDDE
();
100
101
if
(
m_EMEC_response_eta_correction
&& elt->
is_lar_em_endcap
()) {
102
double
e = theCell->
energy
();
103
double
eta
= theCell->
eta
();
104
// Cell level correction of EMEC eta-dependent response
105
if
(
eta
>
m_EMEC_eta1
&&
eta
<
m_EMEC_eta2
) {
106
e *=
m_EMEC_beta1
/
107
(1 +
m_EMEC_alpha1
*(
eta
-
m_EMEC_eta0_1
));
108
}
109
else
if
(
eta
>
m_EMEC_eta2
&&
eta
<
m_EMEC_eta3
) {
110
e *=
m_EMEC_beta2
/
111
(1 +
m_EMEC_alpha2
*(
eta
-
m_EMEC_eta0_2
));
112
}
113
theCell->
setEnergy
(e);
114
}
115
116
if
(elt->
is_lar_em_endcap
()) {
117
double
e = theCell->
energy
();
118
double
eta
= theCell->
eta
();
119
// Temporary ramp correction for EMEC cells with eta=2.85
120
if
(
eta
>
m_ramp_corr_eta1
&&
eta
<
m_ramp_corr_eta2
) {
121
e /=
m_ramp_corr
;
122
// theCell->setEnergy(e);
123
}
124
// Temporary correction of EMEC mkA->MeV constant
125
e /=
m_EMEC_rescale
;
126
theCell->
setEnergy
(e);
127
}
128
129
if
(elt->
is_lar_fcal
()) {
130
double
e = theCell->
energy
();
131
// Temporary correction of EMEC mkA->MeV constant
132
e /=
m_FCAL_rescale
;
133
theCell->
setEnergy
(e);
134
}
135
136
CaloCell_ID::CaloSample
iSamp=elt->
getSampling
();
137
switch
( iSamp ) {
138
case
CaloCell_ID::EME2 : {
139
theCell->
setEnergy
(theCell->
energy
() *
m_EMEC_1_scale
);
140
break
;
141
}
142
case
CaloCell_ID::EME3 : {
143
theCell->
setEnergy
(theCell->
energy
() *
m_EMEC_2_scale
);
144
break
;
145
}
146
case
CaloCell_ID::HEC0 : {
147
theCell->
setEnergy
(theCell->
energy
() *
m_HEC_0_scale
);
148
break
;
149
}
150
case
CaloCell_ID::HEC1 : {
151
theCell->
setEnergy
(theCell->
energy
() *
m_HEC_1_scale
);
152
break
;
153
}
154
case
CaloCell_ID::HEC2 : {
155
theCell->
setEnergy
(theCell->
energy
() *
m_HEC_2_scale
);
156
break
;
157
}
158
case
CaloCell_ID::FCAL0 : {
159
theCell->
setEnergy
(theCell->
energy
() *
m_FCAL_0_scale
);
160
break
;
161
}
162
case
CaloCell_ID::FCAL1 : {
163
theCell->
setEnergy
(theCell->
energy
() *
m_FCAL_1_scale
);
164
break
;
165
}
166
case
CaloCell_ID::FCAL2 : {
167
break
;
168
}
169
default : {
170
log << MSG::ERROR <<
"Unknown sampling: "
<<iSamp<<
endmsg
;
171
}
172
}
173
174
}
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
CaloCell.h
TBEMECCellEtaCorrection.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
CaloCellCorrection
Definition
CaloCellCorrection.h:46
CaloCell_ID::CaloSample
CaloSampling::CaloSample CaloSample
Definition
CaloCell_ID.h:53
CaloCell
Data object for each calorimeter readout cell.
Definition
CaloCell.h:57
CaloCell::energy
double energy() const
get energy (data member)
Definition
CaloCell.h:327
CaloCell::caloDDE
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition
CaloCell.h:321
CaloCell::eta
virtual double eta() const override final
get eta (through CaloDetDescrElement)
Definition
CaloCell.h:382
CaloCell::setEnergy
virtual void setEnergy(float energy)
set energy
Definition
CaloCell.h:472
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell.
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloDetDescrElement::getSampling
CaloCell_ID::CaloSample getSampling() const
cell sampling
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:395
CaloDetDescrElement::is_lar_em_endcap
bool is_lar_em_endcap() const
cell belongs to EM end cap
Definition
CaloDetDescrElement.cxx:105
CaloDetDescrElement::is_lar_fcal
bool is_lar_fcal() const
cell belongs to FCAL
Definition
CaloDetDescrElement.cxx:137
TBEMECCellEtaCorrection::m_ramp_corr_eta2
double m_ramp_corr_eta2
Definition
TBEMECCellEtaCorrection.h:57
TBEMECCellEtaCorrection::m_EMEC_beta2
double m_EMEC_beta2
Definition
TBEMECCellEtaCorrection.h:52
TBEMECCellEtaCorrection::m_HEC_1_scale
double m_HEC_1_scale
Definition
TBEMECCellEtaCorrection.h:65
TBEMECCellEtaCorrection::MakeCorrection
virtual void MakeCorrection(CaloCell *theCell, const EventContext &ctx) const override
Definition
TBEMECCellEtaCorrection.cxx:94
TBEMECCellEtaCorrection::m_EMEC_beta1
double m_EMEC_beta1
Definition
TBEMECCellEtaCorrection.h:50
TBEMECCellEtaCorrection::m_EMEC_alpha1
double m_EMEC_alpha1
Definition
TBEMECCellEtaCorrection.h:51
TBEMECCellEtaCorrection::m_EMEC_eta1
double m_EMEC_eta1
Definition
TBEMECCellEtaCorrection.h:45
TBEMECCellEtaCorrection::m_EMEC_rescale
double m_EMEC_rescale
Definition
TBEMECCellEtaCorrection.h:59
TBEMECCellEtaCorrection::m_HEC_0_scale
double m_HEC_0_scale
Definition
TBEMECCellEtaCorrection.h:64
TBEMECCellEtaCorrection::m_EMEC_eta0_2
double m_EMEC_eta0_2
Definition
TBEMECCellEtaCorrection.h:49
TBEMECCellEtaCorrection::~TBEMECCellEtaCorrection
virtual ~TBEMECCellEtaCorrection()
Definition
TBEMECCellEtaCorrection.cxx:88
TBEMECCellEtaCorrection::m_FCAL_rescale
double m_FCAL_rescale
Definition
TBEMECCellEtaCorrection.h:60
TBEMECCellEtaCorrection::m_EMEC_eta2
double m_EMEC_eta2
Definition
TBEMECCellEtaCorrection.h:46
TBEMECCellEtaCorrection::m_EMEC_1_scale
double m_EMEC_1_scale
Definition
TBEMECCellEtaCorrection.h:62
TBEMECCellEtaCorrection::m_FCAL_1_scale
double m_FCAL_1_scale
Definition
TBEMECCellEtaCorrection.h:68
TBEMECCellEtaCorrection::m_ramp_corr
double m_ramp_corr
Definition
TBEMECCellEtaCorrection.h:55
TBEMECCellEtaCorrection::m_EMEC_eta3
double m_EMEC_eta3
Definition
TBEMECCellEtaCorrection.h:47
TBEMECCellEtaCorrection::m_EMEC_2_scale
double m_EMEC_2_scale
Definition
TBEMECCellEtaCorrection.h:63
TBEMECCellEtaCorrection::m_HEC_2_scale
double m_HEC_2_scale
Definition
TBEMECCellEtaCorrection.h:66
TBEMECCellEtaCorrection::m_EMEC_alpha2
double m_EMEC_alpha2
Definition
TBEMECCellEtaCorrection.h:53
TBEMECCellEtaCorrection::m_EMEC_response_eta_correction
bool m_EMEC_response_eta_correction
Definition
TBEMECCellEtaCorrection.h:44
TBEMECCellEtaCorrection::m_ramp_corr_eta1
double m_ramp_corr_eta1
Definition
TBEMECCellEtaCorrection.h:56
TBEMECCellEtaCorrection::initialize
virtual StatusCode initialize() override
Definition
TBEMECCellEtaCorrection.cxx:57
TBEMECCellEtaCorrection::TBEMECCellEtaCorrection
TBEMECCellEtaCorrection(const std::string &type, const std::string &name, const IInterface *parent)
Definition
TBEMECCellEtaCorrection.cxx:17
TBEMECCellEtaCorrection::m_EMEC_eta0_1
double m_EMEC_eta0_1
Definition
TBEMECCellEtaCorrection.h:48
TBEMECCellEtaCorrection::m_FCAL_0_scale
double m_FCAL_0_scale
Definition
TBEMECCellEtaCorrection.h:67
type
Generated on
for ATLAS Offline Software by
1.17.0