ATLAS Offline Software
EgammaTransitionRegions.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 // NAME: EgammaTransitionRegions.cxx
8 // PACKAGE: Trigger/TrigTools/EgammaTransitionRegions.cxx
9 //
10 // AUTHOR: Denis Oliveira Damazio <Denis.Oliveira.Damazio@cern.ch>
11 //
12 // REFERENCES: Tool to provide Transition Regions Calobration to the HLT (BASED ON OFFLINE)
13 //
14 // Created : January 10, 2015
15 //
16 // ********************************************************************
17 
19 #include "EgammaHitsShowerDepth.h"
21 #include "GaudiKernel/MsgStream.h"
22 // Need Cosh
23 #include <math.h>
24 
25 
26 namespace {
27 
28 
29 const CaloSampling::CaloSample samps[2][4] =
38 };
39 
40 
41 } // anonymous namespace
42 
44 
46 
47  ATH_MSG_DEBUG( "Initialize Tool : " << name() );
48 
49 
50 
51 // unsigned int shape[] = {2};
52 
53  return StatusCode::SUCCESS;
54 }
55 
57  ATH_MSG_DEBUG( "Finalize Tool : " << name() );
58  return StatusCode::SUCCESS;
59 }
60 
62  const void * /*param*/) const{
63 
64  float the_aeta = (clus->eta());
65 
66  the_aeta = (the_aeta>0)?(the_aeta):(- the_aeta);
67 
68  //if (the_aeta >= m_etamax) return;
69 
70 #ifndef NDEBUG
71  ATH_MSG_DEBUG( "************************************************************************************************" );
72  ATH_MSG_DEBUG( " USING TRANSITION REGION " );
73  ATH_MSG_DEBUG( "************************************************************************************************" );
74 #endif
75 
77  CaloRec::Array<1> tr00 = correction[0];
78  CaloRec::Array<1> tr08 = correction[1];
79 
80 #ifndef NDEBUG
81  ATH_MSG_DEBUG( "************************************************************************************************" );
82  ATH_MSG_DEBUG( "the_aeta ::::: " << the_aeta );
83 #endif
84  double corr = 1.0;
85 
86  // -------------------------------------------------------------
87  // Compute correction for eta = 0
88  // -------------------------------------------------------------
89 
90  if (the_aeta < m_etamax_TR00() && the_aeta > m_etamin_TR00() ) {
91 #ifndef NDEBUG
92  ATH_MSG_DEBUG( "Applying correction for eta = 0 (loose) " );
93  ATH_MSG_DEBUG( tr00[0] << " " << tr00[1] << " " << tr00[2] );
94 #endif
95  corr = ( tr00[0] - tr00[1] / (exp( tr00[2] - the_aeta ) + exp( tr00[3]*( the_aeta - tr00[4]))+tr00[5]));
96  }
97  else if ( the_aeta < m_etamin_TR00() ) {
98  corr = tr00[6];
99 #ifndef NDEBUG
100  ATH_MSG_DEBUG( "Applying correction for eta = 0 (tight) " );
101 #endif
102  }
103 
104  // -------------------------------------------------------------
105  // Compute correction for eta = 0.8
106  // -------------------------------------------------------------
107 
108  if (the_aeta < m_etamax_TR08() && the_aeta > m_etamin_TR08() ) {
109 #ifndef NDEBUG
110  ATH_MSG_DEBUG( "Applying correction for eta = 0.8 (loose) " );
111  ATH_MSG_DEBUG( tr08[0] << " " << tr08[1] << " " << tr08[2] );
112 #endif
113  corr = (tr08[0] - tr08[1] / (exp( tr08[2] - the_aeta ) +
114  exp( tr08[3] *( the_aeta - tr08[4] )) + tr08[5] ));
115  }
116 
117 
118 #ifndef NDEBUG
119  ATH_MSG_DEBUG( "EgammaTransitionRegions::Energy before correction --> " << clus->energy()
120  << " Correction --> " << corr );
121 #endif
122  if ( corr == 1 ) return;
123 
124 
125 // -------------------------------------------------------------
126 // Apply the correction
127 // -------------------------------------------------------------
128 
129  // update sampling energies
130  for (int sampling=1; sampling<=3; sampling++){
131  if (the_aeta < 1.37 )
132  clus->setEnergy (samps[0][sampling],
133  clus->energy(samps[0][sampling]) / corr );
134  }
135 
136  clus->setEnergy(clus->energy()/corr);
137 
138  clus->setEt(clus->energy()/cosh(the_aeta));
139 
140 }
141 
EgammaTransitionRegions::m_etamin_TR08
Constant< float > m_etamin_TR08
Definition: EgammaTransitionRegions.h:50
xAOD::TrigEMCluster_v1::eta
float eta() const
get Eta (calibrated)
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
EgammaTransitionRegions::initialize
virtual StatusCode initialize() override
Initialization of the tool.
Definition: EgammaTransitionRegions.cxx:43
xAOD::TrigEMCluster_v1::setEnergy
void setEnergy(float energy)
set Energy (calibrated)
EgammaTransitionRegions::makeCorrection
virtual void makeCorrection(xAOD::TrigEMCluster *, const void *v=nullptr) const override
method to perform the correction.
Definition: EgammaTransitionRegions.cxx:61
initialize
void initialize()
Definition: run_EoverP.cxx:894
TrigEMCluster.h
EgammaTransitionRegions::m_etamax_TR08
Constant< float > m_etamax_TR08
Definition: EgammaTransitionRegions.h:51
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
EgammaTransitionRegions.h
EgammaTransitionRegions::finalize
virtual StatusCode finalize() override
Finalization of the tool.
Definition: EgammaTransitionRegions.cxx:56
tools.zlumi_mc_cf.correction
def correction(mu, runmode, campaign, run=None)
Definition: zlumi_mc_cf.py:4
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
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 >
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
EgammaHitsShowerDepth.h
EgammaTransitionRegions::m_etamax_TR00
Constant< float > m_etamax_TR00
Definition: EgammaTransitionRegions.h:49
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
EgammaTransitionRegions::m_etamin_TR00
Constant< float > m_etamin_TR00
Definition: EgammaTransitionRegions.h:48
CaloCell_ID_FCS::PreSamplerE
@ PreSamplerE
Definition: FastCaloSim_CaloCell_ID.h:23
CaloCell_ID_FCS::PreSamplerB
@ PreSamplerB
Definition: FastCaloSim_CaloCell_ID.h:19
xAOD::TrigEMCluster_v1::setEt
void setEt(float)
set Et (calibrated)
xAOD::TrigEMCluster_v1
Description of a trigger EM cluster.
Definition: TrigEMCluster_v1.h:28
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
xAOD::TrigEMCluster_v1::energy
float energy() const
get Energy (calibrated)
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
EgammaTransitionRegions::m_correction
Constant< CxxUtils::Array< 2 > > m_correction
Definition: EgammaTransitionRegions.h:47