ATLAS Offline Software
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)
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 
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 
89 { }
90 
91 // MakeCorrection: This is called with a pointer to the Cell Object.
92 
93 void
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/
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
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 }
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
TBEMECCellEtaCorrection::m_EMEC_beta1
double m_EMEC_beta1
Definition: TBEMECCellEtaCorrection.h:50
TBEMECCellEtaCorrection::m_FCAL_1_scale
double m_FCAL_1_scale
Definition: TBEMECCellEtaCorrection.h:68
TBEMECCellEtaCorrection::m_HEC_1_scale
double m_HEC_1_scale
Definition: TBEMECCellEtaCorrection.h:65
TBEMECCellEtaCorrection::m_EMEC_beta2
double m_EMEC_beta2
Definition: TBEMECCellEtaCorrection.h:52
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TBEMECCellEtaCorrection::m_EMEC_rescale
double m_EMEC_rescale
Definition: TBEMECCellEtaCorrection.h:59
TBEMECCellEtaCorrection::initialize
virtual StatusCode initialize() override
Definition: TBEMECCellEtaCorrection.cxx:57
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloCellCorrection
Definition: CaloCellCorrection.h:51
CaloCell_ID_FCS::FCAL1
@ FCAL1
Definition: FastCaloSim_CaloCell_ID.h:41
TBEMECCellEtaCorrection::m_EMEC_1_scale
double m_EMEC_1_scale
Definition: TBEMECCellEtaCorrection.h:62
CaloCell.h
TBEMECCellEtaCorrection::m_HEC_0_scale
double m_HEC_0_scale
Definition: TBEMECCellEtaCorrection.h:64
TBEMECCellEtaCorrection::m_HEC_2_scale
double m_HEC_2_scale
Definition: TBEMECCellEtaCorrection.h:66
TBEMECCellEtaCorrection.h
CaloCell_ID_FCS::HEC2
@ HEC2
Definition: FastCaloSim_CaloCell_ID.h:29
CaloDetDescrElement::is_lar_em_endcap
bool is_lar_em_endcap() const
cell belongs to EM end cap
Definition: CaloDetDescrElement.cxx:106
TBEMECCellEtaCorrection::m_ramp_corr
double m_ramp_corr
Definition: TBEMECCellEtaCorrection.h:55
CaloCell::setEnergy
virtual void setEnergy(float energy)
set energy
Definition: CaloCell.cxx:136
TBEMECCellEtaCorrection::m_ramp_corr_eta1
double m_ramp_corr_eta1
Definition: TBEMECCellEtaCorrection.h:56
CaloCell::energy
double energy() const
get energy (data member)
Definition: CaloCell.h:311
CaloCell_ID_FCS::HEC1
@ HEC1
Definition: FastCaloSim_CaloCell_ID.h:28
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CaloCell::caloDDE
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition: CaloCell.h:305
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TBEMECCellEtaCorrection::m_EMEC_eta0_2
double m_EMEC_eta0_2
Definition: TBEMECCellEtaCorrection.h:49
TBEMECCellEtaCorrection::m_EMEC_eta3
double m_EMEC_eta3
Definition: TBEMECCellEtaCorrection.h:47
TBEMECCellEtaCorrection::MakeCorrection
virtual void MakeCorrection(CaloCell *theCell, const EventContext &ctx) const override
Definition: TBEMECCellEtaCorrection.cxx:94
CaloDetDescrElement::is_lar_fcal
bool is_lar_fcal() const
cell belongs to FCAL
Definition: CaloDetDescrElement.cxx:138
TBEMECCellEtaCorrection::m_EMEC_response_eta_correction
bool m_EMEC_response_eta_correction
Definition: TBEMECCellEtaCorrection.h:44
TBEMECCellEtaCorrection::m_EMEC_2_scale
double m_EMEC_2_scale
Definition: TBEMECCellEtaCorrection.h:63
TBEMECCellEtaCorrection::m_ramp_corr_eta2
double m_ramp_corr_eta2
Definition: TBEMECCellEtaCorrection.h:57
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
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
CaloCell_ID_FCS::HEC0
@ HEC0
Definition: FastCaloSim_CaloCell_ID.h:27
TBEMECCellEtaCorrection::m_EMEC_eta1
double m_EMEC_eta1
Definition: TBEMECCellEtaCorrection.h:45
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloDetDescrElement::getSampling
CaloCell_ID::CaloSample getSampling() const
cell sampling
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:395
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TBEMECCellEtaCorrection::m_EMEC_eta2
double m_EMEC_eta2
Definition: TBEMECCellEtaCorrection.h:46
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TBEMECCellEtaCorrection::m_EMEC_alpha2
double m_EMEC_alpha2
Definition: TBEMECCellEtaCorrection.h:53
TBEMECCellEtaCorrection::m_FCAL_rescale
double m_FCAL_rescale
Definition: TBEMECCellEtaCorrection.h:60
CaloCell_ID_FCS::FCAL2
@ FCAL2
Definition: FastCaloSim_CaloCell_ID.h:42
TBEMECCellEtaCorrection::~TBEMECCellEtaCorrection
virtual ~TBEMECCellEtaCorrection()
Definition: TBEMECCellEtaCorrection.cxx:88
python.CaloScaleNoiseConfig.default
default
Definition: CaloScaleNoiseConfig.py:79
CaloCell_ID_FCS::FCAL0
@ FCAL0
Definition: FastCaloSim_CaloCell_ID.h:40
TBEMECCellEtaCorrection::m_EMEC_alpha1
double m_EMEC_alpha1
Definition: TBEMECCellEtaCorrection.h:51
TBEMECCellEtaCorrection::TBEMECCellEtaCorrection
TBEMECCellEtaCorrection(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TBEMECCellEtaCorrection.cxx:17
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
CaloCell::eta
virtual double eta() const override final
get eta (through CaloDetDescrElement)
Definition: CaloCell.h:366