ATLAS Offline Software
LVL1_ROICnv_p1.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 // Gaudi/Athena include(s):
7 #include "GaudiKernel/MsgStream.h"
8 
9 // Local include(s):
12 
15 
16 }
17 
18 void 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 
104 void 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( 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( 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( 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( 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 ) {
176  EnergySum_ROI_p1 roi;
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( roi );
187  }
188 
189  log << MSG::DEBUG << "Creating persistent state of LVL1_ROI [OK]" << endmsg;
190 
191  return;
192 
193 }
LVL1_ROI_p1
Persistent representation of LVL1_ROI.
Definition: LVL1_ROI_p1.h:31
LVL1_ROI::getMuonROIs
const muons_type & getMuonROIs() const
Get all the muon RoIs in the event.
Definition: LVL1_ROI.h:63
EmTau_ROI_p1::m_thresholdValues
std::vector< Float_t > m_thresholdValues
Definition: EmTau_ROI_p1.h:47
EnergySum_ROI
Energy-Sum RoI class for analysis.
Definition: EnergySum_ROI.h:25
Jet_ROI::setET4x4
void setET4x4(float value)
Set the ET deposited in a 4x4 cluster.
Definition: Jet_ROI.h:71
LVL1_ROI::addJetROI
void addJetROI(const jets_type::value_type roi)
Add a jet RoI to the object.
Definition: LVL1_ROI.h:78
EmTau_ROI_p1::m_eta
Float_t m_eta
Definition: EmTau_ROI_p1.h:37
LVL1_ROICnv_p1::persToTrans
virtual void persToTrans(const LVL1_ROI_p1 *persObj, LVL1_ROI *transObj, MsgStream &log) const override
Definition: LVL1_ROICnv_p1.cxx:18
EmTau_ROI_p1::m_TauClus
Float_t m_TauClus
Definition: EmTau_ROI_p1.h:41
Muon_ROI_p1
Persistent representation of Muon_ROI.
Definition: Muon_ROI_p1.h:25
Jet_ROI::addThresholdName
void addThresholdName(thresholds_type::value_type thr)
Add the name of a threshold that this RoI passed.
Definition: Jet_ROI.h:66
LVL1_ROI_p1::m_energysumROIs
std::vector< EnergySum_ROI_p1 > m_energysumROIs
Definition: LVL1_ROI_p1.h:43
LVL1_ROI::addEmTauROI
void addEmTauROI(const emtaus_type::value_type roi)
Add an em/tau RoI to the object.
Definition: LVL1_ROI.h:76
LVL1_ROI_p1::m_jetROIs
std::vector< Jet_ROI_p1 > m_jetROIs
Definition: LVL1_ROI_p1.h:40
Jet_ROI
Jet RoI class for analysis.
Definition: Jet_ROI.h:30
EmTau_ROI_p1::m_HadIsol
Float_t m_HadIsol
Definition: EmTau_ROI_p1.h:43
LVL1::JEPRoIDecoder
A level 1 calorimeter trigger conversion service: returns the Coordinate represented by a RoI word.
Definition: JEPRoIDecoder.h:33
Jet_ROI::setET6x6
void setET6x6(float value)
Set the ET deposited in a 6x6 cluster.
Definition: Jet_ROI.h:73
Jet_ROI_p1::m_thresholdValues
std::vector< Float_t > m_thresholdValues
Definition: Jet_ROI_p1.h:43
JetET_ROI_p1::m_roiWord
UInt_t m_roiWord
Definition: JetET_ROI_p1.h:34
JetET_ROI_p1::m_thresholds
std::vector< std::string > m_thresholds
Definition: JetET_ROI_p1.h:36
skel.it
it
Definition: skel.GENtoEVGEN.py:423
EnergySum_ROI_p1::m_energyT
Float_t m_energyT
Definition: EnergySum_ROI_p1.h:40
JetET_ROI
Energy-Sum RoI class for analysis.
Definition: JetET_ROI.h:25
EmTau_ROI::addThresholdName
void addThresholdName(thresholds_type::value_type thr)
Add the name of a threshold that this RoI passed.
Definition: EmTau_ROI.h:76
LVL1_ROI::addMuonROI
void addMuonROI(const muons_type::value_type roi)
Add a muon RoI to the object.
Definition: LVL1_ROI.h:74
LVL1_ROICnv_p1.h
EmTau_ROI::setCore
void setCore(float value)
Set the ET deposited in the "RoI core".
Definition: EmTau_ROI.h:81
EnergySum_ROI_p1::m_roiWord1
UInt_t m_roiWord1
Definition: EnergySum_ROI_p1.h:35
Jet_ROI_p1::m_ET4x4
Float_t m_ET4x4
Definition: Jet_ROI_p1.h:38
EmTau_ROI::setHadIsol
void setHadIsol(float value)
Set the hadron calorimeter isolation (outer ring of Had towers)
Definition: EmTau_ROI.h:89
EmTau_ROI::setEMIsol
void setEMIsol(float value)
Set the EM calorimeter isolation (outer ring of EM towers)
Definition: EmTau_ROI.h:87
Muon_ROI
Muon RoI class for analysis.
Definition: Muon_ROI.h:35
EnergySum_ROI_p1::m_roiWord0
UInt_t m_roiWord0
Definition: EnergySum_ROI_p1.h:34
LVL1_ROI::addJetETROI
void addJetETROI(const jetets_type::value_type roi)
Add a jet-ET RoI to the object.
Definition: LVL1_ROI.h:80
Muon_ROI_p1::m_thrValue
Float_t m_thrValue
Definition: Muon_ROI_p1.h:36
EmTau_ROI_p1
Persistent representation of EmTau_ROI.
Definition: EmTau_ROI_p1.h:27
EmTau_ROI_p1::m_Core
Float_t m_Core
Definition: EmTau_ROI_p1.h:39
Jet_ROI_p1
Persistent representation of Jet_ROI.
Definition: Jet_ROI_p1.h:26
LVL1_ROI::getJetROIs
const jets_type & getJetROIs() const
Get all the jet RoIs in the event.
Definition: LVL1_ROI.h:67
JetET_ROI::addThreshold
void addThreshold(thresholds_type::value_type thr)
Add the name of a threshold that this RoI passed.
Definition: JetET_ROI.h:49
EmTau_ROI::setHadCore
void setHadCore(float value)
Set the ET deposited in the inner hadronic isolation region (2x2 core)
Definition: EmTau_ROI.h:91
EmTau_ROI_p1::m_EMIsol
Float_t m_EMIsol
Definition: EmTau_ROI_p1.h:42
Muon_ROI_p1::m_roiWord
UInt_t m_roiWord
Definition: Muon_ROI_p1.h:33
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
LVL1_ROI::addEnergySumROI
void addEnergySumROI(const energysums_type::value_type roi)
Add an energy sum RoI to the object.
Definition: LVL1_ROI.h:82
LVL1_ROICnv_p1::transToPers
virtual void transToPers(const LVL1_ROI *transObj, LVL1_ROI_p1 *persObj, MsgStream &log) const override
Definition: LVL1_ROICnv_p1.cxx:104
LVL1_ROI_p1::m_muonROIs
std::vector< Muon_ROI_p1 > m_muonROIs
Definition: LVL1_ROI_p1.h:39
JEPRoIDecoder.h
EmTau_ROI::setTauClus
void setTauClus(float value)
Set the deposited ET in the "tau cluster".
Definition: EmTau_ROI.h:85
LVL1_ROI::getJetEtROIs
const jetets_type & getJetEtROIs() const
Get all the jet-ET RoIs in the event.
Definition: LVL1_ROI.h:69
LVL1_ROI
Top level AOD object storing LVL1 RoIs.
Definition: LVL1_ROI.h:43
Jet_ROI_p1::m_ET8x8
Float_t m_ET8x8
Definition: Jet_ROI_p1.h:40
Jet_ROI_p1::m_ET6x6
Float_t m_ET6x6
Definition: Jet_ROI_p1.h:39
EnergySum_ROI_p1::m_energyY
Float_t m_energyY
Definition: EnergySum_ROI_p1.h:39
EmTau_ROI_p1::m_roiWord
UInt_t m_roiWord
Definition: EmTau_ROI_p1.h:35
Jet_ROI_p1::m_thresholdNames
std::vector< std::string > m_thresholdNames
Definition: Jet_ROI_p1.h:42
EmTau_ROI::addThresholdValue
void addThresholdValue(thr_value_type::value_type thr)
Add the value of a threshold that this RoI passed.
Definition: EmTau_ROI.h:78
EmTau_ROI_p1::m_phi
Float_t m_phi
Definition: EmTau_ROI_p1.h:38
LVL1_ROI::getEnergySumROIs
const energysums_type & getEnergySumROIs() const
Get all the energy sum RoIs in the event.
Definition: LVL1_ROI.h:71
Jet_ROI::addThresholdValue
void addThresholdValue(thr_value_type::value_type thr)
Add the value of a threshold that this RoI passed.
Definition: Jet_ROI.h:68
EmTau_ROI_p1::m_HadCore
Float_t m_HadCore
Definition: EmTau_ROI_p1.h:44
EmTau_ROI_p1::m_EMClus
Float_t m_EMClus
Definition: EmTau_ROI_p1.h:40
EnergySum_ROI_p1::m_roiWord2
UInt_t m_roiWord2
Definition: EnergySum_ROI_p1.h:36
Muon_ROI_p1::m_phi
Float_t m_phi
Definition: Muon_ROI_p1.h:35
EmTau_ROI::setEMClus
void setEMClus(float value)
Set the deposited ET in the "EM cluster".
Definition: EmTau_ROI.h:83
EmTau_ROI_p1::m_thresholdNames
std::vector< std::string > m_thresholdNames
Definition: EmTau_ROI_p1.h:46
LVL1_ROI_p1::m_emtauROIs
std::vector< EmTau_ROI_p1 > m_emtauROIs
Definition: LVL1_ROI_p1.h:42
LVL1_ROI::clear
void clear()
Clear all the RoIs from the object.
Definition: LVL1_ROI.cxx:31
Jet_ROI_p1::m_roiWord
UInt_t m_roiWord
Definition: Jet_ROI_p1.h:34
EmTau_ROI
Em/Tau RoI class for analysis.
Definition: EmTau_ROI.h:34
EnergySum_ROI_p1::m_energyX
Float_t m_energyX
Definition: EnergySum_ROI_p1.h:38
DEBUG
#define DEBUG
Definition: page_access.h:11
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
EnergySum_ROI::addThreshold
void addThreshold(thresholds_type::value_type thr)
Add the name of a threshold that this RoI passed.
Definition: EnergySum_ROI.h:83
Muon_ROI_p1::m_thrName
std::string m_thrName
Definition: Muon_ROI_p1.h:37
EnergySum_ROI_p1
Persistent representation of EnergySum_ROI.
Definition: EnergySum_ROI_p1.h:26
Jet_ROI::setET8x8
void setET8x8(float value)
Set the ET deposited in an 8x8 cluster.
Definition: Jet_ROI.h:75
LVL1_ROI::getEmTauROIs
const emtaus_type & getEmTauROIs() const
Get all the em/tau RoIs in the event.
Definition: LVL1_ROI.h:65
Jet_ROI_p1::m_phi
Float_t m_phi
Definition: Jet_ROI_p1.h:37
Jet_ROI_p1::m_eta
Float_t m_eta
Definition: Jet_ROI_p1.h:36
LVL1_ROI_p1::m_jetetROIs
std::vector< JetET_ROI_p1 > m_jetetROIs
Definition: LVL1_ROI_p1.h:41
EnergySum_ROI_p1::m_thresholds
std::vector< std::string > m_thresholds
Definition: EnergySum_ROI_p1.h:42
LVL1_ROICnv_p1::LVL1_ROICnv_p1
LVL1_ROICnv_p1()
Definition: LVL1_ROICnv_p1.cxx:13
TPConverterConstBase
Definition: TPConverter.h:776
Muon_ROI_p1::m_eta
Float_t m_eta
Definition: Muon_ROI_p1.h:34
pdg_comparison.conv
conv
Definition: pdg_comparison.py:321
JetET_ROI_p1
Persistent representation of JetET_ROI.
Definition: JetET_ROI_p1.h:26