ATLAS Offline Software
Loading...
Searching...
No Matches
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
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
18 const std::string& name,
19 const IInterface* parent)
20 : CaloCellCorrection(type, name, parent),
22 m_EMEC_eta1(2.5),m_EMEC_eta2(2.8),m_EMEC_eta3(3.2),
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);
42 declareProperty("MiddleEta",m_EMEC_eta2);
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
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 {
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 = "
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
90
91// MakeCorrection: This is called with a pointer to the Cell Object.
92
93void
95 const EventContext& /*ctx*/) const
96{
97 MsgStream log(msgSvc(), name());
98
99 const CaloDetDescrElement* elt = theCell->caloDDE();
100
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/
108 }
109 else if (eta > m_EMEC_eta2 && eta < m_EMEC_eta3) {
110 e *= m_EMEC_beta2/
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
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
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}
Scalar eta() const
pseudorapidity method
#define endmsg
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
CaloSampling::CaloSample CaloSample
Definition CaloCell_ID.h:53
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
double energy() const
get energy (data member)
Definition CaloCell.h:327
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition CaloCell.h:321
virtual double eta() const override final
get eta (through CaloDetDescrElement)
Definition CaloCell.h:382
virtual void setEnergy(float energy)
set energy
Definition CaloCell.h:472
This class groups all DetDescr information related to a CaloCell.
CaloCell_ID::CaloSample getSampling() const
cell sampling
bool is_lar_em_endcap() const
cell belongs to EM end cap
bool is_lar_fcal() const
cell belongs to FCAL
virtual void MakeCorrection(CaloCell *theCell, const EventContext &ctx) const override
virtual StatusCode initialize() override
TBEMECCellEtaCorrection(const std::string &type, const std::string &name, const IInterface *parent)