Function executing the algorithm.
46 {
47
48
50
51 SG::ReadHandle<xAOD::CaloClusterContainer> clustercontainer{
m_containerName};
53
57 ATH_MSG_INFO(
"Found corresponding cell-link container with size " << cclptr->
size());
58 }
59 else
60 ATH_MSG_INFO(
"Did not find corresponding cell-link container");
61
63 (*m_out) << "Run " << eventInfo->runNumber() << ", evt " << eventInfo->eventNumber() << " contains " << clustercontainer->size() << " CaloClusters" << std::endl;
64
65 for (const auto itr: *clustercontainer) {
67 (*m_out) << "Kinematics :" << std::endl;
69 *
m_out << std::format (
"E={:.0f}, eta={}, phi={}, m={}, pt={:.1f}",
70 cluster.
e(), cluster.
eta(), cluster.
phi(),
71 cluster.
m(), cluster.
pt())
72 << std::endl;
73 }
74 else {
75 *
m_out << std::format (
"E={}, eta={}, phi={}, m={}, pt={}",
76 cluster.
e(), cluster.
eta(), cluster.
phi(),
77 cluster.
m(), cluster.
pt())
78 << std::endl;
79 }
80 (*m_out) <<
"Eta0=" << cluster.
eta0() <<
", Phi0=" << cluster.
phi0() << std::endl;
81
82 (*m_out) << "TLorentzVector :" << std::endl;
86 if (std::abs(mass) < 1e-2)
mass = 0;
87 *
m_out << std::format (
" p4.E={:.0f}, x={:.0f}, y={:.0f}, z={:.0f}, m={:.2f}, pt={:.1f}",
88 p4.E(), p4.X(), p4.Y(), p4.Z(), mass, p4.Pt())
89 << std::endl;
90 }
91 else {
92 *
m_out << std::format (
" p4.E={}, x={}, y={}, z={}, m={}, pt={}",
93 p4.E(), p4.X(), p4.Y(), p4.Z(), p4.M(), p4.Pt())
94 << std::endl;
95 }
96
97 (*m_out) << "Sampling variables :" << std::endl;
98 for (unsigned iSamp=0;iSamp<CaloSampling::Unknown;++iSamp) {
101 (*m_out) <<
" Sampling #" <<
s <<
": E=" << cluster.
eSample(s) <<
", eta=" << cluster.
etaSample(s) <<
", phi=" << cluster.
phiSample(s) << std::endl;
102 }
103 }
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121 constexpr auto allMoments=std::to_array<const char*>({"FIRST_PHI","FIRST_ETA","SECOND_R","SECOND_LAMBDA","DELTA_PHI","DELTA_THETA","DELTA_ALPHA","CENTER_X","CENTER_Y","CENTER_Z","CENTER_MAG","CENTER_LAMBDA","LATERAL","LONGITUDINAL","ENG_FRAC_EM","ENG_FRAC_MAX","ENG_FRAC_CORE","FIRST_ENG_DENS","SECOND_ENG_DENS","ISOLATION","ENG_BAD_CELLS","N_BAD_CELLS","N_BAD_CELLS_CORR","BAD_CELLS_CORR_E","BADLARQ_FRAC","ENG_POS","SIGNIFICANCE.3","CELL_SIGNIFICANCE.3","CELL_SIG_SAMPLING","AVG_LAR_Q","AVG_TILE_Q","EM_PROBABILITY","HAD_WEIGHT","OOC_WEIGHT","DM_WEIGHT.3","TILE_CONFIDENCE_LEVEL","VERTEX_FRACTION","NVERTEX_FRACTION","ENG_CALIB_TOT","ENG_CALIB_OUT_L","ENG_CALIB_OUT_M","ENG_CALIB_OUT_T","ENG_CALIB_DEAD_L","ENG_CALIB_DEAD_M","ENG_CALIB_DEAD_T","ENG_CALIB_EMB0","ENG_CALIB_EME0","ENG_CALIB_TILEG3","ENG_CALIB_DEAD_TOT","ENG_CALIB_DEAD_EMB0","ENG_CALIB_DEAD_TILE0","ENG_CALIB_DEAD_TILEG3","ENG_CALIB_DEAD_EME0","ENG_CALIB_DEAD_HEC0","ENG_CALIB_DEAD_FCAL","ENG_CALIB_DEAD_LEAKAGE","ENG_CALIB_DEAD_UNCLASS","ENG_CALIB_FRAC_EM","ENG_CALIB_FRAC_HAD","ENG_CALIB_FRAC_REST", "ENERGY_Truth"});
122 (*m_out) << "Cluster Moments" << std::endl;
123 for (std::string momName : allMoments) {
124 int precision = 0;
125 std::string::size_type dpos = momName.find ('.');
126 if (dpos != std::string::npos) {
127 precision = std::stoi (momName.substr (dpos+1));
128 momName.erase (dpos, std::string::npos);
129 }
130 SG::AuxElement::Accessor<float>
a(momName);
131 if (
a.isAvailable(cluster)) {
132 float v =
a(cluster);
134 *
m_out << std::format (
" {}: {:.{}f}", momName, v, precision) << std::endl;
135 }
136 else {
137 (*m_out) <<
" " << momName <<
": " <<
v << std::endl;
138 }
139 }
140 }
141
143 if (
a.isAvailable(cluster)) {
144 (*m_out) << "Bad Channel data: " << std::endl;
146 (*m_out) << " eta=" << bc.eta() << ", phi=" << bc.phi() << ", layer=" << bc.layer() << ", word=" << bc.badChannel() << std::endl;
147 }
148 }
149
150 const CaloClusterCellLink* cellLinks = cluster.
getCellLinks();
151 if (cellLinks) {
153 (*m_out) << "Cell-links:" << std::endl;
154 CaloClusterCellLink::const_iterator lnk_it = cellLinks->
begin();
155 CaloClusterCellLink::const_iterator lnk_it_e = cellLinks->
end();
156 for (; lnk_it != lnk_it_e; ++lnk_it) {
157 const CaloCell*
cell = *lnk_it;
159 *
m_out << std::format (
" ID={}, E={:.2f}, weight={:.3f}",
161 << std::endl;
162 }
163 else {
164 *
m_out << std::format (
" ID={}, E={}, weight={}",
166 << std::endl;
167 }
168 }
169 } else
170 (*
m_out) <<
" Nbr of cells: " << cellLinks->
size() << std::endl;
171 } else {
172 (*m_out) << " No Cell Links found" << std::endl;
173 }
174
175 }
176
177 return StatusCode::SUCCESS;
178}
Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current CaloClusterCellLinkContainer
#define CHECK(...)
Evaluate an expression and check for errors.
ServiceHandle< StoreGateSvc > & evtStore()
weight_t weight() const
Accessor for weight associated to this cell.
const_iterator end() const
const end method
size_t size() const
size method
const_iterator begin() const
const begin method
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_containerName
The key for the output xAOD::CaloClusterContainer.
Gaudi::Property< bool > m_reducedPrecision
Gaudi::Property< bool > m_printCellLinks
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
size_type size() const noexcept
Returns the number of elements in the collection.
SG::Accessor< T, ALLOC > Accessor
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
virtual double pt() const
The transverse momentum ( ) of the particle (negative for negative-energy clusters)
float phiSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
virtual double m() const
The invariant mass of the particle.
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double e() const
The total energy of the particle.
float eSample(const CaloSample sampling) const
virtual double phi() const
The azimuthal angle ( ) of the particle.
float etaSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
flt_t eta0() const
Returns raw of cluster seed.
virtual FourMom_t p4() const
The full 4-momentum of the particle.
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
CaloSampling::CaloSample CaloSample
bool hasSampling(const CaloSample s) const
Checks if certain smapling contributes to cluster.
const CaloClusterBadChannelList & badChannelList() const
flt_t phi0() const
Returns raw of cluster seed.
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
retrieve(aClass, aKey=None)
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.