ATLAS Offline Software
Loading...
Searching...
No Matches
TileClusterFillerTool.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 * File: TileCaloClusterFillerTool.cxx
7 * Author: Marco van Woerden <mvanwoer@cern.ch>, Gang Qin <gang.qin@cern.ch>, Archil Durglishvili <archil.durglishvili@cern.ch>
8 * Date: Nov 2014
9 *
10 */
11
12// INCLUDE HEADER FILE
15
16using namespace D3PD;
17
18//=========================================================================
20 const std::string& name,
21 const IInterface* parent):
22 BlockFillerTool<xAOD::CaloCluster> (type, name, parent){
23//=========================================================================
24
25 TileClusterFillerTool::book().ignore(); // AVOID COVERITY WARNINGS
26 declareProperty("LevelOfDetails", m_LevelOfDetails = 2);
27
28} // TileClusterFillerTool::TileCaloClusterFillerTool
29
30//=================================================
32//=================================================
33
34 ATH_MSG_DEBUG("TileClusterFillerTool::initialize");
35
37
38 return StatusCode::SUCCESS;
39} // TileClusterFillerTool::initialize
40
41//===========================================
43//===========================================
44
45 if(m_LevelOfDetails > 0){
49 CHECK( addVariable("NSamples", m_nSamples, "", m_defaultValue));
50 CHECK( addVariable("time", m_time, "", m_defaultValue));
51 CHECK( addVariable("size", m_size, "", m_defaultValue));
52 CHECK( addVariable("etasize", m_etaSize, "", m_defaultValue));
53 CHECK( addVariable("phisize", m_phiSize, "", m_defaultValue));
54 CHECK( addVariable("eta0", m_eta0, "", m_defaultValue));
55 CHECK( addVariable("phi0", m_phi0, "", m_defaultValue));
56 }
57
58 if(m_LevelOfDetails > 1){
59 CHECK( addVariable("sample_E", m_eSample ));
60 CHECK( addVariable("sample_eta", m_etaSample ));
61 CHECK( addVariable("sample_phi", m_phiSample ));
62 }
63
64 return StatusCode::SUCCESS;
65
66} // TileClusterFillerTool::book
67
68//===============================================================
70//===============================================================
71 ATH_MSG_DEBUG("TileClusterFillerTool::fill()");
72
73 // RETRIEVE APPROPRIATE POINTERS
74 const xAOD::CaloCluster* clusterPointer = &p;
75
76 if(!clusterPointer) { ATH_MSG_INFO("NULL POINTER"); return StatusCode::RECOVERABLE; }
77
78 if(m_LevelOfDetails > 0){
79 *m_e = clusterPointer->e();
80 *m_eta = clusterPointer->eta();
81 *m_phi = clusterPointer->phi();
82 *m_nSamples = clusterPointer->nSamples();
83 //*m_time = clusterPointer->getTime();
84 //*m_size = clusterPointer->getClusterSize();
85 *m_etaSize = clusterPointer->getClusterEtaSize();
86 *m_phiSize = clusterPointer->getClusterPhiSize();
87 *m_eta0 = clusterPointer->eta0();
88 *m_phi0 = clusterPointer->phi0();
89 }
90
91 if(m_LevelOfDetails > 1){
92 for(int i=0;i<(int)CaloSampling::Unknown;i++) {
94 m_eSample->push_back(clusterPointer->eSample(sam));
95 m_etaSample->push_back(clusterPointer->etaSample(sam));
96 m_phiSample->push_back(clusterPointer->phiSample(sam));
97 }
98 }
99
100 return StatusCode::SUCCESS;
101
102} // TileClusterFillerTool::fill
103
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
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)
Type-safe wrapper for block filler tools.
TileClusterFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode fill(const xAOD::CaloCluster &p)
Fill one block — type-safe version.
std::vector< float > * m_eSample
std::vector< float > * m_phiSample
std::vector< float > * m_etaSample
virtual StatusCode book()
Declare tuple variables.
float phiSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
virtual double eta() const
The pseudorapidity ( ) of the particle.
unsigned int getClusterEtaSize() const
Get eta size from cluster size.
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.
unsigned nSamples() const
unsigned int getClusterPhiSize() const
Get phi size from cluster size.
flt_t phi0() const
Returns raw of cluster seed.
Block filler tool for noisy FEB information.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.