ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloCondPhysAlgs
src
CaloFillCellPositionShift.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include <cmath>
6
7
#include "
CaloFillCellPositionShift.h
"
8
9
#include "
CaloIdentifier/CaloIdManager.h
"
10
#include "CaloDetDescr/CaloDetDescrElement.h"
11
#include "
CaloIdentifier/CaloCell_ID.h
"
12
#include "
CaloConditions/CaloCellPositionShift.h
"
13
#include "CaloGeoHelpers/CaloSampling.h"
14
15
//Constructor
16
CaloFillCellPositionShift::CaloFillCellPositionShift
(
const
std::string& name, ISvcLocator* pSvcLocator):
17
AthAlgorithm
(name,pSvcLocator)
18
{
19
}
20
21
//__________________________________________________________________________
22
//Destructor
23
CaloFillCellPositionShift::~CaloFillCellPositionShift
() =
default
;
24
25
//__________________________________________________________________________
26
StatusCode
CaloFillCellPositionShift::initialize
()
27
{
28
ATH_MSG_DEBUG
(
"CaloFillCellPositionShift initialize()"
);
29
30
const
CaloIdManager
* mgr =
nullptr
;
31
ATH_CHECK
(
detStore
()->retrieve( mgr ) );
32
m_calo_id
= mgr->getCaloCell_ID();
33
34
ATH_CHECK
(
m_caloMgrKey
.initialize() );
35
36
ATH_MSG_INFO
(
" end of CaloFillCellPositionShift::initialize "
);
37
return
StatusCode::SUCCESS;
38
39
}
40
//__________________________________________________________________________
41
StatusCode
CaloFillCellPositionShift::execute
(
const
EventContext&
/*ctx*/
)
42
{
43
ATH_MSG_DEBUG
(
"CaloFillCellPositionShift execute()"
);
44
return
StatusCode::SUCCESS;
45
}
46
47
//__________________________________________________________________________
48
StatusCode
CaloFillCellPositionShift::stop
()
49
{
50
//int ncell=m_calo_id->calo_cell_hash_max();
51
IdentifierHash
emmin,emmax,fcalmin,fcalmax;
52
m_calo_id
->calo_cell_hash_range(
CaloCell_ID::LAREM
,emmin,emmax);
53
m_calo_id
->calo_cell_hash_range(
CaloCell_ID::LARFCAL
,fcalmin,fcalmax);
54
int
ncell=fcalmax-emmin;
55
ATH_MSG_INFO
(
" Number of cells in LAr calo "
<< emmin <<
" "
<< fcalmax <<
" "
<< ncell );
56
57
m_cellPos
=
new
CaloRec::CaloCellPositionShift
(ncell);
58
59
ATH_CHECK
(
detStore
()->record(
m_cellPos
,
m_key
) );
60
61
SG::ReadCondHandle<CaloDetDescrManager>
caloMgrHandle{
m_caloMgrKey
};
62
ATH_CHECK
(caloMgrHandle.
isValid
());
63
const
CaloDetDescrManager
* calodetdescrmgr = *caloMgrHandle;
64
65
ATH_MSG_INFO
(
" start loop over Calo cells "
<< ncell );
66
for
(
int
i=0;i<ncell;i++) {
67
IdentifierHash
idHash=i+emmin;
68
Identifier
id
=
m_calo_id
->cell_id(idHash);
69
const
CaloDetDescrElement
* calodde = calodetdescrmgr->
get_element
(
id
);
70
71
//float eta = calodde->eta();
72
float
phi
= calodde->
phi
();
73
int
layer =
m_calo_id
->calo_sample(
id
);
74
75
float
dx=0.;
76
float
dy=0.;
77
float
dz=0.;
78
if
(layer==CaloSampling::EMB2) {
79
dy = -1.*std::cos(
phi
)*std::cos(
phi
);
80
dx = 1.*std::cos(
phi
)*std::sin(
phi
);
81
dz = 0.;
82
}
83
84
m_cellPos
->set_deltaX(i,dx);
85
m_cellPos
->set_deltaY(i,dy);
86
m_cellPos
->set_deltaZ(i,dz);
87
88
}
// loop over cells
89
90
return
StatusCode::SUCCESS;
91
}
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CaloCellPositionShift.h
Container for a cell-level position corrections to account for distorsion of calo shape in reconstruc...
CaloCell_ID.h
CaloFillCellPositionShift.h
CaloIdManager.h
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
AthCommonAlgorithm< Gaudi::Algorithm >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
CaloCell_Base_ID::LAREM
@ LAREM
Definition
CaloCell_Base_ID.h:45
CaloCell_Base_ID::LARFCAL
@ LARFCAL
Definition
CaloCell_Base_ID.h:45
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell.
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloDetDescrElement::phi
float phi() const
cell phi
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:346
CaloDetDescrManager_Base::get_element
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
Definition
CaloDetDescrManager.cxx:159
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition
CaloDetDescrManager.h:469
CaloFillCellPositionShift::m_calo_id
const CaloCell_ID * m_calo_id
Definition
CaloFillCellPositionShift.h:50
CaloFillCellPositionShift::~CaloFillCellPositionShift
~CaloFillCellPositionShift()
Default Destructor.
CaloFillCellPositionShift::CaloFillCellPositionShift
CaloFillCellPositionShift(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
Definition
CaloFillCellPositionShift.cxx:16
CaloFillCellPositionShift::m_cellPos
CaloRec::CaloCellPositionShift * m_cellPos
Definition
CaloFillCellPositionShift.h:52
CaloFillCellPositionShift::execute
virtual StatusCode execute(const EventContext &ctx) override
standard Athena-Algorithm method
Definition
CaloFillCellPositionShift.cxx:41
CaloFillCellPositionShift::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition
CaloFillCellPositionShift.h:58
CaloFillCellPositionShift::stop
virtual StatusCode stop() override
standard Athena-Algorithm method
Definition
CaloFillCellPositionShift.cxx:48
CaloFillCellPositionShift::m_key
Gaudi::Property< std::string > m_key
Definition
CaloFillCellPositionShift.h:54
CaloFillCellPositionShift::initialize
virtual StatusCode initialize() override
standard Athena-Algorithm method
Definition
CaloFillCellPositionShift.cxx:26
CaloIdManager
This class initializes the Calo (LAr and Tile) offline identifiers.
Definition
CaloIdManager.h:45
CaloRec::CaloCellPositionShift
Container for a cell-level rescaling-factors, typically obtained by Z->ee intercalibration.
Definition
CaloCellPositionShift.h:31
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
SG::ReadCondHandle::isValid
bool isValid()
Definition
ReadCondHandle.h:205
Identifier
Definition
IdentifierFieldParser.cxx:14
Generated on
for ATLAS Offline Software by
1.17.0