ATLAS Offline Software
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
14 #include "TileClusterFillerTool.h"
15 
16 using namespace D3PD;
17 
18 //=========================================================================
20  const std::string& name,
21  const IInterface* 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){
46  CHECK( addVariable("E", m_e, "", m_defaultValue));
47  CHECK( addVariable("eta", m_eta, "", m_defaultValue));
48  CHECK( addVariable("phi", m_phi, "", m_defaultValue));
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 
xAOD::CaloCluster_v1::phi0
flt_t phi0() const
Returns raw of cluster seed.
xAOD::CaloCluster_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition: CaloCluster_v1.cxx:256
xAOD::CaloCluster_v1::nSamples
unsigned nSamples() const
Definition: CaloCluster_v1.h:884
D3PD::TileClusterFillerTool::m_e
float * m_e
Definition: TileClusterFillerTool.h:50
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
D3PD::TileClusterFillerTool::TileClusterFillerTool
TileClusterFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TileClusterFillerTool.cxx:19
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
D3PD::TileClusterFillerTool::book
virtual StatusCode book()
Declare tuple variables.
Definition: TileClusterFillerTool.cxx:42
D3PD::TileClusterFillerTool::fill
virtual StatusCode fill(const xAOD::CaloCluster &p)
Fill one block — type-safe version.
Definition: TileClusterFillerTool.cxx:69
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
D3PD::TileClusterFillerTool::initialize
virtual StatusCode initialize()
Definition: TileClusterFillerTool.cxx:31
D3PD::TileClusterFillerTool::m_eta0
float * m_eta0
Definition: TileClusterFillerTool.h:58
D3PD::TileClusterFillerTool::m_phi
float * m_phi
Definition: TileClusterFillerTool.h:52
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
D3PD::AddVariable::addVariable
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Add a variable to the tuple.
Definition: AddVariable.cxx:85
D3PD::TileClusterFillerTool::m_phi0
float * m_phi0
Definition: TileClusterFillerTool.h:59
D3PD::TileClusterFillerTool::m_nSamples
int * m_nSamples
Definition: TileClusterFillerTool.h:53
xAOD::CaloCluster_v1::etaSample
float etaSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
Definition: CaloCluster_v1.cxx:532
D3PD::TileClusterFillerTool::m_eSample
std::vector< float > * m_eSample
Definition: TileClusterFillerTool.h:61
GeoPrimitives.h
D3PD::TileClusterFillerTool::m_phiSample
std::vector< float > * m_phiSample
Definition: TileClusterFillerTool.h:63
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
D3PD
Block filler tool for noisy FEB information.
Definition: InnerDetector/InDetMonitoring/InDetGlobalMonitoring/macros/EnhancedPrimaryVertexMonitoring/TrigD3PD/ChainGroup.h:21
xAOD::CaloCluster_v1::getClusterEtaSize
unsigned int getClusterEtaSize() const
Get eta size from cluster size.
Definition: CaloCluster_v1.cxx:823
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: CaloCluster_v1.cxx:251
lumiFormat.i
int i
Definition: lumiFormat.py:92
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
TileClusterFillerTool.h
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
D3PD::TileClusterFillerTool::m_etaSize
unsigned int * m_etaSize
Definition: TileClusterFillerTool.h:56
D3PD::TileClusterFillerTool::m_size
int * m_size
Definition: TileClusterFillerTool.h:55
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloCluster
Principal data class for CaloCell clusters.
Definition: Calorimeter/CaloEvent/CaloEvent/CaloCluster.h:79
D3PD::BlockFillerTool
Type-safe wrapper for block filler tools.
Definition: BlockFillerTool.h:68
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
xAOD::CaloCluster_v1::phiSample
float phiSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
Definition: CaloCluster_v1.cxx:547
xAOD::CaloCluster_v1::getClusterPhiSize
unsigned int getClusterPhiSize() const
Get phi size from cluster size.
Definition: CaloCluster_v1.cxx:845
D3PD::TileClusterFillerTool::m_phiSize
unsigned int * m_phiSize
Definition: TileClusterFillerTool.h:57
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
D3PD::TileClusterFillerTool::m_defaultValue
float m_defaultValue
Definition: TileClusterFillerTool.h:47
D3PD::TileClusterFillerTool::m_LevelOfDetails
short m_LevelOfDetails
Definition: TileClusterFillerTool.h:48
xAOD::CaloCluster_v1::eta0
flt_t eta0() const
Returns raw of cluster seed.
xAOD::CaloCluster_v1::eSample
float eSample(const CaloSample sampling) const
Definition: CaloCluster_v1.cxx:521
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
D3PD::TileClusterFillerTool::m_etaSample
std::vector< float > * m_etaSample
Definition: TileClusterFillerTool.h:62
D3PD::TileClusterFillerTool::m_time
float * m_time
Definition: TileClusterFillerTool.h:54
D3PD::TileClusterFillerTool::m_eta
float * m_eta
Definition: TileClusterFillerTool.h:51
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
xAOD::CaloCluster_v1::e
virtual double e() const
The total energy of the particle.
Definition: CaloCluster_v1.cxx:265