ATLAS Offline Software
Trigger
TrigTools
TrigT2CaloCalibration
src
EgammaGapCalibration.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
6
// ********************************************************************
7
//
8
// NAME: EgammaGapCalibration.cxx
9
// PACKAGE: Trigger/TrigTools/EgammaGapCalibration.cxx
10
//
11
// AUTHOR: Denis Oliveira Damazio
12
//
13
// REFERENCES: Tool to provide Longitudinal Weight calibration
14
// Based on Scott's code for the offline
15
//
16
// ********************************************************************
17
18
#include "
EgammaGapCalibration.h
"
19
//#include "TrigCaloEvent/TrigEMCluster.h"
20
#include "
xAODTrigCalo/TrigEMCluster.h
"
21
#include "GaudiKernel/MsgStream.h"
22
#include "CaloGeoHelpers/CaloSampling.h"
23
24
using
CaloClusterCorr::interpolate
;
25
26
StatusCode
EgammaGapCalibration::initialize
(){
27
28
CHECK
(
base_class::initialize
());
29
30
ATH_MSG_DEBUG
(
"Initialize Tool : "
<<
name
() );
31
32
return
StatusCode::SUCCESS;
33
34
}
35
36
37
StatusCode
EgammaGapCalibration::finalize
(){
38
39
ATH_MSG_DEBUG
(
"Finalize Tool : "
<<
name
() );
40
41
return
StatusCode::SUCCESS;
42
43
}
44
45
void
EgammaGapCalibration::makeCorrection
(
xAOD::TrigEMCluster
* clus,
46
const
void
*
/*param*/
)
const
{
47
48
#ifndef NDEBUG
49
ATH_MSG_DEBUG
(
"makeCorrection for tool : "
<<
name
() );
50
ATH_MSG_DEBUG
(
"Cluster E input : "
<< clus->
energy
() );
51
#endif
52
float
the_aeta=(clus->
eta
());
53
if
(the_aeta<0) the_aeta=-the_aeta;
54
// If far from the crack, nothing to do
55
if
(the_aeta <
m_eta_start_crack
() || the_aeta >
m_eta_end_crack
())
return
;
56
57
CxxUtils::Array<2>
correction
=
m_correction
();
58
int
degree
=
m_degree
();
59
float
a
=
interpolate
(
correction
, the_aeta,
degree
,1);
60
float
alpha =
interpolate
(
correction
, the_aeta,
degree
,2);
61
float
offset
=
interpolate
(
correction
, the_aeta,
degree
,3);
62
float
eh_scint = clus->
energy
(
CaloSampling::TileGap3
);
63
float
ec = clus->
energy
();
64
clus->
setEnergy
(
a
*(ec+alpha*eh_scint +
offset
));
65
clus->
setEt
(clus->
energy
()/cosh(clus->
eta
()));
66
#ifndef NDEBUG
67
ATH_MSG_DEBUG
(
"Cluster E output : "
<< clus->
energy
() );
68
#endif
69
70
}
71
EgammaGapCalibration::initialize
virtual StatusCode initialize() override
Initialization of the tool.
Definition:
EgammaGapCalibration.cxx:26
xAOD::TrigEMCluster_v1::eta
float eta() const
get Eta (calibrated)
xAOD::TrigEMCluster_v1::setEnergy
void setEnergy(float energy)
set Energy (calibrated)
initialize
void initialize()
Definition:
run_EoverP.cxx:894
TrigEMCluster.h
EgammaGapCalibration::m_eta_end_crack
Constant< float > m_eta_end_crack
Definition:
EgammaGapCalibration.h:50
CaloCell_ID_FCS::TileGap3
@ TileGap3
Definition:
FastCaloSim_CaloCell_ID.h:36
tools.zlumi_mc_cf.correction
def correction(mu, runmode, campaign, run=None)
Definition:
zlumi_mc_cf.py:4
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition:
AthMsgStreamMacros.h:29
CxxUtils::Array< 2 >
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition:
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
name
std::string name
Definition:
Control/AthContainers/Root/debug.cxx:221
EgammaGapCalibration.h
a
TList * a
Definition:
liststreamerinfos.cxx:10
CaloClusterCorr::interpolate
float interpolate(const CaloRec::Array< 2 > &a, float x, unsigned int degree, unsigned int ycol=1, const CaloRec::Array< 1 > ®ions=CaloRec::Array< 1 >(), int n_points=-1, bool fixZero=false)
Polynomial interpolation in a table.
Definition:
interpolate.cxx:75
EgammaGapCalibration::m_degree
Constant< int > m_degree
Definition:
EgammaGapCalibration.h:51
convertTimingResiduals.offset
offset
Definition:
convertTimingResiduals.py:71
xAOD::TrigEMCluster_v1::setEt
void setEt(float)
set Et (calibrated)
EgammaGapCalibration::makeCorrection
virtual void makeCorrection(xAOD::TrigEMCluster *, const void *v=nullptr) const override
method to perform the correction.
Definition:
EgammaGapCalibration.cxx:45
EgammaGapCalibration::m_eta_start_crack
Constant< float > m_eta_start_crack
Definition:
EgammaGapCalibration.h:49
xAOD::TrigEMCluster_v1
Description of a trigger EM cluster.
Definition:
TrigEMCluster_v1.h:28
python.SystemOfUnits.degree
tuple degree
Definition:
SystemOfUnits.py:106
xAOD::TrigEMCluster_v1::energy
float energy() const
get Energy (calibrated)
EgammaGapCalibration::m_correction
Constant< CxxUtils::Array< 2 > > m_correction
Definition:
EgammaGapCalibration.h:48
EgammaGapCalibration::finalize
virtual StatusCode finalize() override
Finalization of the tool.
Definition:
EgammaGapCalibration.cxx:37
Generated on Thu Nov 7 2024 21:14:15 for ATLAS Offline Software by
1.8.18