ATLAS Offline Software
TrigEMClusterCnvTool.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 "TrigEMClusterCnvTool.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< ITrigEMClusterCnvTool >( this );
24  }
25 
37  xAOD::TrigEMClusterContainer* xaod ) const {
38 
39  ATH_MSG_DEBUG( "Size of the xAOD container before loop: "
40  << xaod->size() );
41 
42  // Number of available samplings:
43  const unsigned int samplings = 25; // Is this really right?...
44 
45  // Loop over the AOD objects:
48 
49  for( ; aod_itr != aod_end; ++aod_itr ) {
50 
51  // Create the xAOD object:
53  xaod->push_back( cluster );
54 
55  cluster->setRawEnergy ( ( *aod_itr )->rawEnergy() );
56  cluster->setRawEt ( ( *aod_itr )->rawEt() );
57  cluster->setRawEta ( ( *aod_itr )->rawEta() );
58  cluster->setRawPhi ( ( *aod_itr )->rawPhi() );
59  cluster->setRoIword ( ( *aod_itr )->RoIword() );
60  cluster->setNCells ( ( *aod_itr )->nCells() );
61  cluster->setClusterQuality( ( *aod_itr )->quality() );
62 
63  cluster->setEnergy ( ( *aod_itr )->energy() );
64  cluster->setEt ( ( *aod_itr )->et() );
65  cluster->setEta ( ( *aod_itr )->eta() );
66  cluster->setPhi ( ( *aod_itr )->phi() );
67  cluster->setE237 ( ( *aod_itr )->e237() );
68  cluster->setE277 ( ( *aod_itr )->e277() );
69  cluster->setFracs1 ( ( *aod_itr )->fracs1() );
70  cluster->setWeta2 ( ( *aod_itr )->weta2() );
71  cluster->setEhad1 ( ( *aod_itr )->ehad1() );
72  cluster->setEta1 ( ( *aod_itr )->Eta1() );
73  cluster->setEmaxs1 ( ( *aod_itr )->emaxs1() );
74  cluster->setE2tsts1( ( *aod_itr )->e2tsts1() );
75  cluster->setE233 ( ( *aod_itr )->e233() );
76  cluster->setWstot ( ( *aod_itr )->wstot() );
77 
78  for( unsigned int i = 0; i < samplings; ++i ) {
80  static_cast< CaloSampling::CaloSample >( i );
81  const float rawValue = ( *aod_itr )->rawEnergy( sample );
82  if( ! cluster->setRawEnergy( sample, rawValue ) ) {
83  ATH_MSG_WARNING( "Unable to set raw energy for sampling "
84  << sample );
85  }
86  const float value = ( *aod_itr )->energy( sample );
87  if( ! cluster->setEnergy( sample, value ) ) {
88  ATH_MSG_WARNING( "Unable to set energy for sampling "
89  << sample );
90  }
91  }
92 
93  ATH_MSG_DEBUG( "rawEnergy: "
94  << ( *aod_itr )->rawEnergy() << "; "
95  << "rawEt: "
96  << ( *aod_itr )->rawEt() << "; "
97  << "rawEta: "
98  << ( *aod_itr )->rawEta() << "; "
99  << "rawPhi: "
100  << ( *aod_itr )->rawPhi() << "; "
101  << std::hex << "m_roiWord: 0x"
102  << ( *aod_itr )->RoIword() << "; " << std::dec
103  << "numberUsedCells: "
104  << ( *aod_itr )->nCells() << "; "
105  << "quality: "
106  << ( *aod_itr )->quality() << ";" );
107 
108  if( msg().level() <= MSG::DEBUG ) {
109  for( unsigned int i = 0; i < samplings; ++i ) {
111  static_cast< CaloSampling::CaloSample >( i );
112  ATH_MSG_DEBUG( "rawEnergySample : "
114  << " = "
115  << ( *aod_itr )->rawEnergy( sample ) << ";" );
116  }
117  }
118 
119  ATH_MSG_DEBUG( "energy: "
120  << ( *aod_itr )->energy() << "; "
121  << "et: "
122  << ( *aod_itr )->et() << "; "
123  << "eta: "
124  << ( *aod_itr )->eta() << "; "
125  << "phi: "
126  << ( *aod_itr )->phi() << "; "
127  << "e237: "
128  << ( *aod_itr )->e237() << "; "
129  << "e277: "
130  << ( *aod_itr )->e277() << "; "
131  << "fracs1: "
132  << ( *aod_itr )->fracs1() << "; "
133  << "weta2: "
134  << ( *aod_itr )->weta2() << "; "
135  << "ehad1: "
136  << ( *aod_itr )->ehad1() << "; "
137  << "Eta1: "
138  << ( *aod_itr )->Eta1() << "; "
139  << "emaxs1: "
140  << ( *aod_itr )->emaxs1() << "; "
141  << "e2tsts1: "
142  << ( *aod_itr )->e2tsts1() << "; "
143  << "e233: "
144  << ( *aod_itr )->e233() << "; "
145  << "wstot: "
146  << ( *aod_itr )->wstot() );
147 
148  if( msg().level() <= MSG::DEBUG ) {
149  for( unsigned int i = 0; i < samplings; ++i ) {
151  static_cast< CaloSampling::CaloSample >( i );
152  ATH_MSG_DEBUG( "energySample : "
154  << " = "
155  << ( *aod_itr )->energy( sample ) << ";" );
156  }
157  }
158 
159  }
160 
161  ATH_MSG_DEBUG( "Size of the xAOD container after loop: "
162  << xaod->size() );
163 
164  // Return gracefully:
165  return StatusCode::SUCCESS;
166  }
167 
168 } // namespace xAODMaker
xAOD::TrigCaloCluster_v1::setRawPhi
void setRawPhi(float)
set Raw Phi (no calibration)
xAOD::TrigEMCluster_v1::setEta
void setEta(float)
set Eta (calibrated)
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
xAOD::TrigEMCluster_v1::setE237
void setE237(float)
set Energy in a 3x7 cluster (no calibration) around hottest cell
xAOD::TrigEMCluster_v1::setEnergy
void setEnergy(float energy)
set Energy (calibrated)
xAOD::TrigCaloCluster_v1::setRawEt
void setRawEt(float)
set Raw Et (no calibration)
TrigEMCluster.h
xAOD::TrigEMCluster_v1::setE233
void setE233(float)
set Energy in a 3x3 cluster (no calibration) around hottest cell
TrigEMClusterContainer.h
xAOD::TrigEMCluster_v1::setEhad1
void setEhad1(float)
set hadronic Energy (first hadronic layer)
athena.value
value
Definition: athena.py:122
xAOD::TrigCaloCluster_v1::setRawEta
void setRawEta(float)
set Raw Eta (no calibration)
xAODMaker
Definition: StoreGateSvc.h:72
TrigEMClusterContainer
Container from TrigEMCluster type objects.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMClusterContainer.h:32
xAOD::TrigEMCluster_v1::setE277
void setE277(float)
set Energy in a 7x7 cluster (no calibration) around hottest cell
xAOD::TrigEMCluster_v1::setPhi
void setPhi(float)
set Phi (calibrated)
TrigEMClusterCnvTool.h
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
xAODMaker::TrigEMClusterCnvTool::TrigEMClusterCnvTool
TrigEMClusterCnvTool(const std::string &type, const std::string &name, const IInterface *parent)
Regular AlgTool constructor.
Definition: TrigEMClusterCnvTool.cxx:17
xAOD::TrigEMCluster_v1::setEmaxs1
void setEmaxs1(float)
set maximum energy in sampling 1 (strip layer)
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
xAOD::TrigEMCluster
TrigEMCluster_v1 TrigEMCluster
Define the latest version of the trigger EM cluster class.
Definition: Event/xAOD/xAODTrigCalo/xAODTrigCalo/TrigEMCluster.h:17
xAOD::TrigEMCluster_v1::setE2tsts1
void setE2tsts1(float)
set second maximum energy in sampling 1 (strip layer)
test_pyathena.parent
parent
Definition: test_pyathena.py:15
xAOD::TrigEMCluster_v1::setWeta2
void setWeta2(float)
set cluster width (based on a 3x5 cluster - 2nd layer)
TrigEMCluster.h
xAOD::TrigEMCluster_v1::setFracs1
void setFracs1(float)
set Energy in a 7 strips (around hottest strip) minus energy in 3 strips divided by energy in 3 strip...
xAOD::TrigEMCluster_v1::setEta1
void setEta1(float)
set Eta sampling 1 (strip layer)
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
xAOD::TrigCaloCluster_v1::setRoIword
void setRoIword(long)
set RoI Word
xAODMaker::TrigEMClusterCnvTool::convert
virtual StatusCode convert(const TrigEMClusterContainer *aod, xAOD::TrigEMClusterContainer *xaod) const override
Function that fills an existing xAOD::TrigEMCluster.
Definition: TrigEMClusterCnvTool.cxx:36
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
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
TrigEMClusterContainer.h
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::setRawEnergy
void setRawEnergy(float)
set Raw Energy (no calibration)
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
xAOD::TrigEMCluster_v1::setEt
void setEt(float)
set Et (calibrated)
xAOD::TrigEMCluster_v1::setWstot
void setWstot(float)
set width in first layer
CaloSampling::getSamplingName
static std::string getSamplingName(CaloSample theSample)
Returns a string (name) for each CaloSampling.
Definition: Calorimeter/CaloGeoHelpers/Root/CaloSampling.cxx:18
xAOD::TrigCaloCluster_v1::setClusterQuality
void setClusterQuality(unsigned int)
set quality of cluster built (to be defined)
AthAlgTool
Definition: AthAlgTool.h:26
xAOD::TrigEMCluster_v1
Description of a trigger EM cluster.
Definition: TrigEMCluster_v1.h:28
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.