ATLAS Offline Software
Loading...
Searching...
No Matches
ClusterPositionInCaloFillerTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5// $Id$
12
13
15#include "CaloEvent/CaloCluster.h"
17
18
19namespace D3PD {
20
21
29 (const std::string& type,
30 const std::string& name,
31 const IInterface* parent)
32 : Base (type, name, parent)
33{
34 declareProperty("FillSeedCoordinates", m_FillSeedCoordinates=false);
35
36 book().ignore(); // Avoid coverity warnings.
37}
38
40{
41 ATH_CHECK(m_caloDetDescrMgrKey.initialize());
42 return StatusCode::SUCCESS;
43}
44
45
46
51{
52
54 CHECK( addVariable ("eta0Calo", m_eta0Calo,
55 "Cluster seed eta position in local calorimeter coordinates") );
56 CHECK( addVariable ("phi0Calo", m_phi0Calo,
57 "Cluster seed phi position in local calorimeter coordinates") );
58 }
59 else{
60 CHECK( addVariable ("etaCalo", m_etaCalo,
61 "Cluster eta position in local calorimeter coordinates") );
62 CHECK( addVariable ("phiCalo", m_phiCalo,
63 "Cluster phi position in local calorimeter coordinates") );
64 }
65
66 return StatusCode::SUCCESS;
67}
68
69
79{
80 CHECK( fillT (p) );
81 return StatusCode::SUCCESS;
82}
83
84
94{
95 CHECK( fillT (p) );
96 return StatusCode::SUCCESS;
97}
98
99
106template <class T>
108{
109
111 CaloCell_ID::CaloSample sam = CaloCell_ID::EMB2;
112 if (p.inBarrel() && !p.inEndcap())
113 sam = CaloCell_ID::EMB2;
114 else if (!p.inBarrel() && p.inEndcap())
115 sam = CaloCell_ID::EME2;
116 else {
117 if (p.eSample(CaloSampling::EMB2) > p.eSample(CaloSampling::EME2)) sam=CaloCell_ID::EMB2;
118 else sam = CaloCell_ID::EME2;
119 }
120
122 CaloCellDetPos::getDetPosition(**caloDetDescrMgrHandle,
123 sam,
124 p.eta0(),
125 p.phi0(),
126 *m_eta0Calo,
127 *m_phi0Calo);
128 } else {
130 **caloDetDescrMgrHandle, sam, p.eta(), p.phi(), *m_etaCalo, *m_phiCalo);
131 }
132
133 return StatusCode::SUCCESS;
134}
135
136
137} // namespace D3PD
#define ATH_CHECK
Evaluate an expression and check for errors.
Block filler tool for eta/phi positions in calo coordinates from a CaloCluster.
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
static bool getDetPosition(const CaloDetDescrManager &mgr, CaloCell_ID::CaloSample sam, double etaAtlas, double phiAtlas, double &etaDet, double &phiDet)
get Detector level eta-phi position from Atlas level (aligned) position
CaloSampling::CaloSample CaloSample
Definition CaloCell_ID.h:53
Principal data class for CaloCell clusters.
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
ClusterPositionInCaloFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
double * m_phi0Calo
Variable: seed phi position in calo frame.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloDetDescrMgrKey
virtual StatusCode book() final
Book variables for this block.
virtual StatusCode fill(const CaloCluster &p) override
Fill one block — type-safe version.
double * m_eta0Calo
Variable: seed eta position in calo frame.
BlockFillerTool< Types< CaloCluster, xAOD::CaloCluster > > Base
double * m_etaCalo
Variable: eta position in calo frame.
bool m_FillSeedCoordinates
Variable: whether to dump the seed coordinates.
double * m_phiCalo
Variable: phi position in calo frame.
Block filler tool for noisy FEB information.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.