ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1_ROICnv_p1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6// Gaudi/Athena include(s):
7#include "GaudiKernel/MsgStream.h"
8
9// Local include(s):
12
17
18void LVL1_ROICnv_p1::persToTrans( const LVL1_ROI_p1* persObj, LVL1_ROI* transObj, MsgStream &log ) const {
19
20 log << MSG::DEBUG << "Converting LVL1_ROI from persistent state..." << endmsg;
21
22 transObj->clear();
23
24 //
25 // Translate the muon RoIs:
26 //
27 for( std::vector< Muon_ROI_p1 >::const_iterator it = persObj->m_muonROIs.begin(); it != persObj->m_muonROIs.end(); ++it ) {
28 Muon_ROI roi( it->m_roiWord, it->m_eta, it->m_phi, it->m_thrName, it->m_thrValue );
29 transObj->addMuonROI( roi );
30 }
31 //
32 // Translate the jet RoIs:
33 //
34 for( std::vector< Jet_ROI_p1 >::const_iterator it = persObj->m_jetROIs.begin(); it != persObj->m_jetROIs.end(); ++it ) {
35 Jet_ROI roi( it->m_roiWord, it->m_eta, it->m_phi, ( it->m_roiWord & 0xfff ) );
36 roi.setET4x4( it->m_ET4x4 );
37 roi.setET6x6( it->m_ET6x6 );
38 roi.setET8x8( it->m_ET8x8 );
39 for( std::vector< std::string >::const_iterator it2 = it->m_thresholdNames.begin(); it2 != it->m_thresholdNames.end(); ++it2 ) {
40 roi.addThresholdName( *it2 );
41 }
42 for( std::vector< Float_t >::const_iterator it2 = it->m_thresholdValues.begin(); it2 != it->m_thresholdValues.end(); ++it2 ) {
43 roi.addThresholdValue( *it2 );
44 }
45 transObj->addJetROI( roi );
46 }
47 //
48 // Translate the jetET RoI(s):
49 //
50 for( std::vector< JetET_ROI_p1 >::const_iterator it = persObj->m_jetetROIs.begin(); it != persObj->m_jetetROIs.end(); ++it ) {
51 JetET_ROI roi( it->m_roiWord, ( it->m_roiWord & 0xf ) );
52 for( std::vector< std::string >::const_iterator it2 = it->m_thresholds.begin(); it2 != it->m_thresholds.end(); ++it2 ) {
53 roi.addThreshold( *it2 );
54 }
55 transObj->addJetETROI( roi );
56 }
57 //
58 // Translate the em/tau RoIs:
59 //
60 for( std::vector< EmTau_ROI_p1 >::const_iterator it = persObj->m_emtauROIs.begin(); it != persObj->m_emtauROIs.end(); ++it ) {
61 EmTau_ROI roi( it->m_roiWord, it->m_eta, it->m_phi, ( it->m_roiWord & 0xffff ) );
62 roi.setCore( it->m_Core );
63 roi.setEMClus( it->m_EMClus );
64 roi.setTauClus( it->m_TauClus );
65 roi.setEMIsol( it->m_EMIsol );
66 roi.setHadIsol( it->m_HadIsol );
67 roi.setHadCore( it->m_HadCore );
68 for( std::vector< std::string >::const_iterator it2 = it->m_thresholdNames.begin(); it2 != it->m_thresholdNames.end(); ++it2 ) {
69 roi.addThresholdName( *it2 );
70 }
71 for( std::vector< Float_t >::const_iterator it2 = it->m_thresholdValues.begin(); it2 != it->m_thresholdValues.end(); ++it2 ) {
72 roi.addThresholdValue( *it2 );
73 }
74 transObj->addEmTauROI( roi );
75 }
76 //
77 // Translate energy sum RoI(s):
78 //
79 // Used to test overflow bits (rather than a hard-coded check)
81
82 for( std::vector< EnergySum_ROI_p1 >::const_iterator it = persObj->m_energysumROIs.begin(); it != persObj->m_energysumROIs.end(); ++it ) {
83 // Extract overflow flags from RoIWords
84 unsigned int overflows = 0;
85 if (conv.energyOverflow(it->m_roiWord0)) overflows |= 0x1;
86 if (conv.energyOverflow(it->m_roiWord1)) overflows |= 0x2;
87 if (conv.energyOverflow(it->m_roiWord2)) overflows |= 0x4;
88 // Create transient RoI
89 EnergySum_ROI roi( it->m_roiWord0, it->m_roiWord1, it->m_roiWord2, it->m_energyX, it->m_energyY, it->m_energyT,
90 ( ( it->m_roiWord1 >> 16 ) & 0xff), ( ( it->m_roiWord2 >> 16 ) & 0xff), ( ( it->m_roiWord0 >> 16 ) & 0xff),
91 overflows);
92 for( std::vector< std::string >::const_iterator it2 = it->m_thresholds.begin(); it2 != it->m_thresholds.end(); ++it2 ) {
93 roi.addThreshold( *it2 );
94 }
95 transObj->addEnergySumROI( roi );
96 }
97
98 log << MSG::DEBUG << "Converting LVL1_ROI from persistent state [OK]" << endmsg;
99
100 return;
101
102}
103
104void LVL1_ROICnv_p1::transToPers( const LVL1_ROI* transObj, LVL1_ROI_p1* persObj, MsgStream &log ) const {
105
106 log << MSG::DEBUG << "Creating persistent state of LVL1_ROI..." << endmsg;
107
108 //
109 // Translate the muon RoIs:
110 //
111 for( LVL1_ROI::muons_type::const_iterator it = transObj->getMuonROIs().begin(); it != transObj->getMuonROIs().end(); ++it ) {
112 Muon_ROI_p1 roi;
113 roi.m_roiWord = it->getROIWord();
114 roi.m_eta = it->getEta();
115 roi.m_phi = it->getPhi();
116 roi.m_thrName = it->getThrName();
117 roi.m_thrValue = it->getThrValue();
118 persObj->m_muonROIs.push_back( std::move(roi) );
119 }
120 //
121 // Translate the jet RoIs:
122 //
123 for( LVL1_ROI::jets_type::const_iterator it = transObj->getJetROIs().begin(); it != transObj->getJetROIs().end(); ++it ) {
124 Jet_ROI_p1 roi;
125 roi.m_roiWord = it->getROIWord();
126 roi.m_eta = it->getEta();
127 roi.m_phi = it->getPhi();
128 roi.m_ET4x4 = it->getET4x4();
129 roi.m_ET6x6 = it->getET6x6();
130 roi.m_ET8x8 = it->getET8x8();
131 for( std::vector< std::string >::const_iterator it2 = it->getThresholdNames().begin(); it2 != it->getThresholdNames().end(); ++it2 ) {
132 roi.m_thresholdNames.push_back( *it2 );
133 }
134 for( std::vector< float >::const_iterator it2 = it->getThresholdValues().begin(); it2 != it->getThresholdValues().end(); ++it2 ) {
135 roi.m_thresholdValues.push_back( *it2 );
136 }
137 persObj->m_jetROIs.push_back( std::move(roi) );
138 }
139 //
140 // Translate the jetET RoI(s):
141 //
142 for( LVL1_ROI::jetets_type::const_iterator it = transObj->getJetEtROIs().begin(); it != transObj->getJetEtROIs().end(); ++it ) {
143 JetET_ROI_p1 roi;
144 roi.m_roiWord = it->getROIWord();
145 for( std::vector< std::string >::const_iterator it2 = it->getThresholds().begin(); it2 != it->getThresholds().end(); ++it2 ) {
146 roi.m_thresholds.push_back( *it2 );
147 }
148 persObj->m_jetetROIs.push_back( std::move(roi) );
149 }
150 //
151 // Translate em/tau RoI(s):
152 //
153 for( LVL1_ROI::emtaus_type::const_iterator it = transObj->getEmTauROIs().begin(); it != transObj->getEmTauROIs().end(); ++it ) {
154 EmTau_ROI_p1 roi;
155 roi.m_roiWord = it->getROIWord();
156 roi.m_eta = it->getEta();
157 roi.m_phi = it->getPhi();
158 roi.m_Core = it->getCore();
159 roi.m_EMClus = it->getEMClus();
160 roi.m_EMIsol = it->getEMIsol();
161 roi.m_HadCore = it->getHadCore();
162 roi.m_HadIsol = it->getHadIsol();
163 roi.m_TauClus = it->getTauClus();
164 for( std::vector< std::string >::const_iterator it2 = it->getThresholdNames().begin(); it2 != it->getThresholdNames().end(); ++it2 ) {
165 roi.m_thresholdNames.push_back( *it2 );
166 }
167 for( std::vector< float >::const_iterator it2 = it->getThresholdValues().begin(); it2 != it->getThresholdValues().end(); ++it2 ) {
168 roi.m_thresholdValues.push_back( *it2 );
169 }
170 persObj->m_emtauROIs.push_back( std::move(roi) );
171 }
172 //
173 // Translate energy sum RoI(s):
174 //
175 for( LVL1_ROI::energysums_type::const_iterator it = transObj->getEnergySumROIs().begin(); it != transObj->getEnergySumROIs().end(); ++it ) {
177 roi.m_roiWord0 = it->getROIWord0();
178 roi.m_roiWord1 = it->getROIWord1();
179 roi.m_roiWord2 = it->getROIWord2();
180 roi.m_energyX = it->getEnergyX();
181 roi.m_energyY = it->getEnergyY();
182 roi.m_energyT = it->getEnergyT();
183 for( std::vector< std::string >::const_iterator it2 = it->getThresholds().begin(); it2 != it->getThresholds().end(); ++it2 ) {
184 roi.m_thresholds.push_back( *it2 );
185 }
186 persObj->m_energysumROIs.push_back( std::move(roi) );
187 }
188
189 log << MSG::DEBUG << "Creating persistent state of LVL1_ROI [OK]" << endmsg;
190
191 return;
192
193}
#define endmsg
TPConverterConstBase< TRANS, PERS > T_AthenaPoolTPCnvConstBase
Persistent representation of EmTau_ROI.
Float_t m_HadCore
Float_t m_TauClus
Float_t m_eta
std::vector< Float_t > m_thresholdValues
UInt_t m_roiWord
Float_t m_EMIsol
Float_t m_HadIsol
Float_t m_Core
Float_t m_EMClus
std::vector< std::string > m_thresholdNames
Float_t m_phi
Em/Tau RoI class for analysis.
Definition EmTau_ROI.h:34
void setCore(float value)
Set the ET deposited in the "RoI core".
Definition EmTau_ROI.h:81
void setHadIsol(float value)
Set the hadron calorimeter isolation (outer ring of Had towers)
Definition EmTau_ROI.h:89
void addThresholdName(thresholds_type::value_type thr)
Add the name of a threshold that this RoI passed.
Definition EmTau_ROI.h:76
void addThresholdValue(thr_value_type::value_type thr)
Add the value of a threshold that this RoI passed.
Definition EmTau_ROI.h:78
void setEMIsol(float value)
Set the EM calorimeter isolation (outer ring of EM towers)
Definition EmTau_ROI.h:87
void setTauClus(float value)
Set the deposited ET in the "tau cluster".
Definition EmTau_ROI.h:85
void setEMClus(float value)
Set the deposited ET in the "EM cluster".
Definition EmTau_ROI.h:83
void setHadCore(float value)
Set the ET deposited in the inner hadronic isolation region (2x2 core)
Definition EmTau_ROI.h:91
Persistent representation of EnergySum_ROI.
std::vector< std::string > m_thresholds
Energy-Sum RoI class for analysis.
void addThreshold(thresholds_type::value_type thr)
Add the name of a threshold that this RoI passed.
Persistent representation of JetET_ROI.
std::vector< std::string > m_thresholds
UInt_t m_roiWord
Energy-Sum RoI class for analysis.
Definition JetET_ROI.h:25
void addThreshold(thresholds_type::value_type thr)
Add the name of a threshold that this RoI passed.
Definition JetET_ROI.h:49
Persistent representation of Jet_ROI.
Definition Jet_ROI_p1.h:26
UInt_t m_roiWord
Definition Jet_ROI_p1.h:34
std::vector< std::string > m_thresholdNames
Definition Jet_ROI_p1.h:42
Float_t m_ET6x6
Definition Jet_ROI_p1.h:39
std::vector< Float_t > m_thresholdValues
Definition Jet_ROI_p1.h:43
Float_t m_ET8x8
Definition Jet_ROI_p1.h:40
Float_t m_ET4x4
Definition Jet_ROI_p1.h:38
Float_t m_eta
Definition Jet_ROI_p1.h:36
Float_t m_phi
Definition Jet_ROI_p1.h:37
Jet RoI class for analysis.
Definition Jet_ROI.h:30
void addThresholdName(thresholds_type::value_type thr)
Add the name of a threshold that this RoI passed.
Definition Jet_ROI.h:66
void setET6x6(float value)
Set the ET deposited in a 6x6 cluster.
Definition Jet_ROI.h:73
void setET4x4(float value)
Set the ET deposited in a 4x4 cluster.
Definition Jet_ROI.h:71
void setET8x8(float value)
Set the ET deposited in an 8x8 cluster.
Definition Jet_ROI.h:75
void addThresholdValue(thr_value_type::value_type thr)
Add the value of a threshold that this RoI passed.
Definition Jet_ROI.h:68
A level 1 calorimeter trigger conversion service: returns the Coordinate represented by a RoI word.
virtual void persToTrans(const LVL1_ROI_p1 *persObj, LVL1_ROI *transObj, MsgStream &log) const override
virtual void transToPers(const LVL1_ROI *transObj, LVL1_ROI_p1 *persObj, MsgStream &log) const override
Persistent representation of LVL1_ROI.
Definition LVL1_ROI_p1.h:31
std::vector< Jet_ROI_p1 > m_jetROIs
Definition LVL1_ROI_p1.h:40
std::vector< EnergySum_ROI_p1 > m_energysumROIs
Definition LVL1_ROI_p1.h:43
std::vector< Muon_ROI_p1 > m_muonROIs
Definition LVL1_ROI_p1.h:39
std::vector< EmTau_ROI_p1 > m_emtauROIs
Definition LVL1_ROI_p1.h:42
std::vector< JetET_ROI_p1 > m_jetetROIs
Definition LVL1_ROI_p1.h:41
Top level AOD object storing LVL1 RoIs.
Definition LVL1_ROI.h:43
const emtaus_type & getEmTauROIs() const
Get all the em/tau RoIs in the event.
Definition LVL1_ROI.h:65
void addMuonROI(const muons_type::value_type roi)
Add a muon RoI to the object.
Definition LVL1_ROI.h:74
void addEmTauROI(const emtaus_type::value_type roi)
Add an em/tau RoI to the object.
Definition LVL1_ROI.h:76
const energysums_type & getEnergySumROIs() const
Get all the energy sum RoIs in the event.
Definition LVL1_ROI.h:71
void addJetETROI(const jetets_type::value_type roi)
Add a jet-ET RoI to the object.
Definition LVL1_ROI.h:80
const muons_type & getMuonROIs() const
Get all the muon RoIs in the event.
Definition LVL1_ROI.h:63
void addJetROI(const jets_type::value_type roi)
Add a jet RoI to the object.
Definition LVL1_ROI.h:78
void clear()
Clear all the RoIs from the object.
Definition LVL1_ROI.cxx:31
void addEnergySumROI(const energysums_type::value_type roi)
Add an energy sum RoI to the object.
Definition LVL1_ROI.h:82
const jets_type & getJetROIs() const
Get all the jet RoIs in the event.
Definition LVL1_ROI.h:67
const jetets_type & getJetEtROIs() const
Get all the jet-ET RoIs in the event.
Definition LVL1_ROI.h:69
Persistent representation of Muon_ROI.
Definition Muon_ROI_p1.h:25
Float_t m_eta
Definition Muon_ROI_p1.h:34
UInt_t m_roiWord
Definition Muon_ROI_p1.h:33
Float_t m_thrValue
Definition Muon_ROI_p1.h:36
Float_t m_phi
Definition Muon_ROI_p1.h:35
std::string m_thrName
Definition Muon_ROI_p1.h:37
Muon RoI class for analysis.
Definition Muon_ROI.h:35