ATLAS Offline Software
TrigCaloClusterCnvTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 // EDM include(s):
11 
12 // Local include(s):
13 #include "TrigCaloClusterCnvTool.h"
14 
15 namespace xAODMaker {
16 
18  const std::string& name,
19  const IInterface* parent )
20  : AthAlgTool( type, name, parent ) {
21 
22  // Declare the interface(s) provided by the tool:
23  declareInterface< ITrigCaloClusterCnvTool >( this );
24  }
25 
26 
38  xAOD::TrigCaloClusterContainer* xaod ) const {
39 
40  ATH_MSG_DEBUG( "Size of the xAOD container before loop: "
41  << xaod->size() );
42 
43  // Number of available samplings:
44  const unsigned int samplings = 25; // Is this really right?...
45 
46  // Loop over the AOD objects:
49 
50  for( ; aod_itr != aod_end; ++aod_itr ) {
51 
52  // Create the xAOD object:
54  xaod->push_back( cluster );
55 
56  cluster->setRawEnergy ( ( *aod_itr )->rawEnergy() );
57  cluster->setRawEt ( ( *aod_itr )->rawEt() );
58  cluster->setRawEta ( ( *aod_itr )->rawEta() );
59  cluster->setRawPhi ( ( *aod_itr )->rawPhi() );
60  cluster->setRoIword ( ( *aod_itr )->RoIword() );
61  cluster->setNCells ( ( *aod_itr )->nCells() );
62  cluster->setClusterQuality( ( *aod_itr )->quality() );
63 
64  for( unsigned int i = 0; i < samplings; ++i ) {
66  static_cast< CaloSampling::CaloSample >( i );
67  const float value = ( *aod_itr )->rawEnergy( sample );
68  if( ! cluster->setRawEnergy( sample, value ) ) {
69  ATH_MSG_WARNING( "Unable to set raw energy for sampling "
70  << sample );
71  }
72  }
73 
74  ATH_MSG_DEBUG( "rawEnergy: "
75  << ( *aod_itr )->rawEnergy() << "; "
76  << "rawEt: "
77  << ( *aod_itr )->rawEt() << "; "
78  << "rawEta: "
79  << ( *aod_itr )->rawEta() << "; "
80  << "rawPhi: "
81  << ( *aod_itr )->rawPhi() << "; "
82  << std::hex << "m_roiWord: 0x"
83  << ( *aod_itr )->RoIword() << "; " << std::dec
84  << "numberUsedCells: "
85  << ( *aod_itr )->nCells() << "; "
86  << "quality: "
87  << ( *aod_itr )->quality() );
88 
89  if( msg().level() <= MSG::DEBUG ) {
90  for( unsigned int i = 0; i < samplings; ++i ) {
92  static_cast< CaloSampling::CaloSample >( i );
93  ATH_MSG_DEBUG( "rawEnergySample : "
95  << " = "
96  << ( *aod_itr )->rawEnergy( sample ) << ";" );
97  }
98  }
99 
100  }
101 
102  ATH_MSG_DEBUG( "Size of the xAOD container after loop: "
103  << xaod->size() );
104 
105  // Return gracefully:
106  return StatusCode::SUCCESS;
107  }
108 
109 } // namespace xAODMaker
xAOD::TrigCaloCluster_v1::setRawPhi
void setRawPhi(float)
set Raw Phi (no calibration)
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
xAOD::TrigCaloCluster_v1::setRawEt
void setRawEt(float)
set Raw Et (no calibration)
athena.value
value
Definition: athena.py:122
xAOD::TrigCaloCluster_v1::setRawEta
void setRawEta(float)
set Raw Eta (no calibration)
TrigCaloClusterContainer.h
xAODMaker
Definition: StoreGateSvc.h:72
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
TrigCaloClusterCnvTool.h
xAODMaker::TrigCaloClusterCnvTool::TrigCaloClusterCnvTool
TrigCaloClusterCnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
Definition: TrigCaloClusterCnvTool.cxx:17
TrigCaloCluster.h
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:100
lumiFormat.i
int i
Definition: lumiFormat.py:92
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
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
test_pyathena.parent
parent
Definition: test_pyathena.py:15
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
xAOD::TrigCaloCluster_v1::setRoIword
void setRoIword(long)
set RoI Word
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
xAOD::TrigCaloCluster_v1::setNCells
void setNCells(int)
set number of cells used from RoI
TrigCaloClusterContainer.h
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
xAODMaker::TrigCaloClusterCnvTool::convert
virtual StatusCode convert(const TrigCaloClusterContainer *aod, xAOD::TrigCaloClusterContainer *xaod) const override
Function that fills an existing xAOD::TrigCaloCluster.
Definition: TrigCaloClusterCnvTool.cxx:37
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
xAOD::TrigCaloCluster_v1
Description of a trigger calorimeter cluster.
Definition: TrigCaloCluster_v1.h:28
xAOD::TrigCaloCluster_v1::setRawEnergy
void setRawEnergy(float)
set Raw Energy (no calibration)
TrigCaloCluster.h
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
CaloSampling::getSamplingName
static std::string getSamplingName(CaloSample theSample)
Returns a string (name) for each CaloSampling.
Definition: Calorimeter/CaloGeoHelpers/Root/CaloSampling.cxx:18
xAOD::TrigCaloCluster
TrigCaloCluster_v1 TrigCaloCluster
Define the latest version of the trigger calorimeter cluster class.
Definition: Event/xAOD/xAODTrigCalo/xAODTrigCalo/TrigCaloCluster.h:17
xAOD::TrigCaloCluster_v1::setClusterQuality
void setClusterQuality(unsigned int)
set quality of cluster built (to be defined)
AthAlgTool
Definition: AthAlgTool.h:26
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
TrigCaloClusterContainer
Container from TrigCaloCluster type objects.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigCaloClusterContainer.h:29
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.