ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
TrigL1FexJetMonitorTool< T > Class Template Reference

#include <TrigL1FexJetMonitorTool.h>

Inheritance diagram for TrigL1FexJetMonitorTool< T >:
Collaboration diagram for TrigL1FexJetMonitorTool< T >:

Public Types

typedef T::JetContainer JetContainer
 

Public Member Functions

 TrigL1FexJetMonitorTool (const std::string &, const std::string &, const IInterface *)
 
virtual StatusCode initialize () override
 
virtual StatusCode getData (const EventContext &ctx, std::vector< JetData > &jetData) const override
 
virtual StatusCode getMatchData (const EventContext &ctx, MatchToEnum, std::vector< JetMatchData > &jetData) const override
 

Private Attributes

SG::ReadHandleKey< JetContainerm_l1jetContainerkey
 
Gaudi::Property< bool > m_doMatching
 
Gaudi::Property< std::string > m_offlineJetContainerToMatch
 
Gaudi::Property< std::string > m_HLTJetContainerToMatch
 
SG::ReadDecorHandleKey< JetContainerm_offmatchedKey
 
SG::ReadDecorHandleKey< JetContainerm_offptdiffKey
 
SG::ReadDecorHandleKey< JetContainerm_offenergydiffKey
 
SG::ReadDecorHandleKey< JetContainerm_offmassdiffKey
 
SG::ReadDecorHandleKey< JetContainerm_offptrespKey
 
SG::ReadDecorHandleKey< JetContainerm_offenergyrespKey
 
SG::ReadDecorHandleKey< JetContainerm_offmassrespKey
 
SG::ReadDecorHandleKey< JetContainerm_offptrefKey
 
SG::ReadDecorHandleKey< JetContainerm_offetarefKey
 
SG::ReadDecorHandleKey< JetContainerm_hltmatchedKey
 
SG::ReadDecorHandleKey< JetContainerm_hltptdiffKey
 
SG::ReadDecorHandleKey< JetContainerm_hltenergydiffKey
 
SG::ReadDecorHandleKey< JetContainerm_hltmassdiffKey
 
SG::ReadDecorHandleKey< JetContainerm_hltptrespKey
 
SG::ReadDecorHandleKey< JetContainerm_hltenergyrespKey
 
SG::ReadDecorHandleKey< JetContainerm_hltmassrespKey
 
SG::ReadDecorHandleKey< JetContainerm_hltptrefKey
 
SG::ReadDecorHandleKey< JetContainerm_hltetarefKey
 

Detailed Description

template<typename T>
class TrigL1FexJetMonitorTool< T >

Definition at line 21 of file TrigL1FexJetMonitorTool.h.

Member Typedef Documentation

◆ JetContainer

template<typename T >
typedef T::JetContainer TrigL1FexJetMonitorTool< T >::JetContainer

Definition at line 26 of file TrigL1FexJetMonitorTool.h.

Constructor & Destructor Documentation

◆ TrigL1FexJetMonitorTool()

template<typename T >
TrigL1FexJetMonitorTool< T >::TrigL1FexJetMonitorTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 19 of file TrigL1FexJetMonitorTool.cxx.

22  : base_class( type, name, parent )
23 {
24  declareProperty("l1container", m_l1jetContainerkey);
25 
26 }

Member Function Documentation

◆ getData()

template<typename T >
StatusCode TrigL1FexJetMonitorTool< T >::getData ( const EventContext &  ctx,
std::vector< JetData > &  jetData 
) const
overridevirtual

Definition at line 143 of file TrigL1FexJetMonitorTool.cxx.

145  {
146 
147 
148  // Retrieve the L1 jet container
150  if( !jets.isValid() ){
151  // the L1 containers should _always_ be present, although may be empty.
152  ATH_MSG_WARNING("evtStore() does not contain the L1 jet collection with name "
154  return StatusCode::SUCCESS;
155  }
156 
157  // find variables associated with jets in the input container.
158  for(const auto jet : *jets){
159  /*
160  Ensure that the the et is above a hardware threshold:
161  From Sergi Rodriguez 23/02/2022
162  in the bitwise simulation we also have an energy threshold,
163  which is taken from the trigger menu.
164  If the Et is below the threshold the TOB word is set to 0
165  */
166 
167  if (vetoJet(jet)) {continue;} // see L1MonitoredAdaptors
168 
169  jetData.emplace_back(et(jet)*0.001, // see L1MonitoredAdaptors
170  jet->eta(),
171  jet->phi(),
172  et_label(jet));
173 
174  }
175  return StatusCode::SUCCESS;
176 }

◆ getMatchData()

template<typename T >
StatusCode TrigL1FexJetMonitorTool< T >::getMatchData ( const EventContext &  ctx,
MatchToEnum  matchTo,
std::vector< JetMatchData > &  jetData 
) const
overridevirtual

Definition at line 182 of file TrigL1FexJetMonitorTool.cxx.

185  {
186  if (!m_doMatching) {
187  // otherwise will attempt to use uniniatialied Keys
188  return StatusCode::SUCCESS;
189  }
190 
191  std::unique_ptr<SG::ReadDecorHandle<JetContainer, char>> matchedHandle;
192  std::unique_ptr<SG::ReadDecorHandle<JetContainer, double>> ptdiffHandle;
193  std::unique_ptr<SG::ReadDecorHandle<JetContainer, double>> energydiffHandle;
194  std::unique_ptr<SG::ReadDecorHandle<JetContainer, double>> massdiffHandle;
195  std::unique_ptr<SG::ReadDecorHandle<JetContainer, double>> ptrespHandle;
196  std::unique_ptr<SG::ReadDecorHandle<JetContainer, double>> energyrespHandle;
197  std::unique_ptr<SG::ReadDecorHandle<JetContainer, double>> massrespHandle;
198  std::unique_ptr<SG::ReadDecorHandle<JetContainer, double>> ptrefHandle;
199  std::unique_ptr<SG::ReadDecorHandle<JetContainer, double>> etarefHandle;
200 
201  if (matchTo == MatchToEnum::hlt) {
202 
203  matchedHandle.reset(new SG::ReadDecorHandle<JetContainer, char> (m_hltmatchedKey, ctx));
204  ptdiffHandle.reset(new SG::ReadDecorHandle<JetContainer, double> (m_hltptdiffKey, ctx));
205  energydiffHandle.reset(new SG::ReadDecorHandle<JetContainer, double> (m_hltenergydiffKey, ctx));
206  massdiffHandle.reset(new SG::ReadDecorHandle<JetContainer, double> (m_hltmassdiffKey, ctx));
207  ptrespHandle.reset(new SG::ReadDecorHandle<JetContainer, double> (m_hltptrespKey, ctx));
208  energyrespHandle.reset(new SG::ReadDecorHandle<JetContainer, double> (m_hltenergyrespKey, ctx));
209  massrespHandle.reset(new SG::ReadDecorHandle<JetContainer, double> (m_hltmassrespKey, ctx));
210  ptrefHandle.reset(new SG::ReadDecorHandle<JetContainer, double> (m_hltptrefKey, ctx));
211  etarefHandle.reset(new SG::ReadDecorHandle<JetContainer, double> (m_hltetarefKey, ctx));
212  } else if (matchTo == MatchToEnum::offline) {
213  matchedHandle.reset(new SG::ReadDecorHandle<JetContainer, char> (m_offmatchedKey, ctx));
214  ptdiffHandle.reset(new SG::ReadDecorHandle<JetContainer, double> (m_offptdiffKey, ctx));
215  energydiffHandle.reset(new SG::ReadDecorHandle<JetContainer, double> (m_offenergydiffKey, ctx));
216  massdiffHandle.reset(new SG::ReadDecorHandle<JetContainer, double> (m_offmassdiffKey, ctx));
217  ptrespHandle.reset(new SG::ReadDecorHandle<JetContainer, double> (m_offptrespKey, ctx));
218  energyrespHandle.reset(new SG::ReadDecorHandle<JetContainer, double> (m_offenergyrespKey, ctx));
219  massrespHandle.reset(new SG::ReadDecorHandle<JetContainer, double> (m_offmassrespKey, ctx));
220  ptrefHandle.reset(new SG::ReadDecorHandle<JetContainer, double> (m_offptrefKey, ctx));
221  etarefHandle.reset(new SG::ReadDecorHandle<JetContainer, double> (m_offetarefKey, ctx));
222  } else {
223  ATH_MSG_ERROR ("unsupported MatchTo value");
224  return StatusCode::FAILURE;
225  }
226 
227  ATH_CHECK((*matchedHandle).initialize());
228  ATH_CHECK((*ptdiffHandle).initialize());
229  ATH_CHECK((*energydiffHandle).initialize());
230  ATH_CHECK((*massdiffHandle).initialize());
231  ATH_CHECK((*ptrespHandle).initialize());
232  ATH_CHECK((*energyrespHandle).initialize());
233  ATH_CHECK((*massrespHandle).initialize());
234  ATH_CHECK((*ptrefHandle).initialize());
235  ATH_CHECK((*etarefHandle).initialize());
236 
237 
238  // Loop over L1 jets and fill pt, energy, mass differences and responses
239  // between matched jets, plus reference pT and eta
240 
241  // Retrieve the L1 jet container
243  if(!jets.isValid()){
244  // the L1 containers should _always_ be present, although may be empty.
245  ATH_MSG_WARNING("evtStore() does not contain the L1 jet collection with name "
247  return StatusCode::SUCCESS;
248  }
249 
250  for(const auto jet : *jets){
251  bool matched = (*matchedHandle)(*jet);
252 
253  if(matched){
254  jetMatchData.emplace_back((*ptdiffHandle)(*jet),
255  (*energydiffHandle)(*jet),
256  (*massdiffHandle)(*jet),
257  (*ptrespHandle)(*jet),
258  (*energyrespHandle)(*jet),
259  (*massrespHandle)(*jet),
260  (*ptrefHandle)(*jet),
261  (*etarefHandle)(*jet));
262  }
263  }
264 
265  return StatusCode::SUCCESS;
266 }

◆ initialize()

template<typename T >
StatusCode TrigL1FexJetMonitorTool< T >::initialize
overridevirtual

Definition at line 31 of file TrigL1FexJetMonitorTool.cxx.

32 {
34 
35  if (m_doMatching) {
38 
41 
44 
47 
50 
53 
56 
59 
62 
72 
75 
78 
81 
84 
87 
90 
93 
96 
99 
109 
110  } else {
111  // declare the keys unused if no matching is configured
112 
113  // offline container matching
123 
124  // trigger container matching
134  }
135 
136  return StatusCode::SUCCESS;
137 }

Member Data Documentation

◆ m_doMatching

template<typename T >
Gaudi::Property<bool> TrigL1FexJetMonitorTool< T >::m_doMatching
private
Initial value:
{
this, "do_matching", false,
"Plotting response histograms for L1 jets matched to online/offline jets"}

Definition at line 51 of file TrigL1FexJetMonitorTool.h.

◆ m_hltenergydiffKey

template<typename T >
SG::ReadDecorHandleKey<JetContainer> TrigL1FexJetMonitorTool< T >::m_hltenergydiffKey
private
Initial value:
{
this, "hltenergydiff", "hltenergydiff",
"SG key for input matched energydiff decoration"}

Definition at line 104 of file TrigL1FexJetMonitorTool.h.

◆ m_hltenergyrespKey

template<typename T >
SG::ReadDecorHandleKey<JetContainer> TrigL1FexJetMonitorTool< T >::m_hltenergyrespKey
private
Initial value:
{
this, "hltenergyresp", "hltenergyresp",
"SG key for input matched energyresp decoration"}

Definition at line 116 of file TrigL1FexJetMonitorTool.h.

◆ m_hltetarefKey

template<typename T >
SG::ReadDecorHandleKey<JetContainer> TrigL1FexJetMonitorTool< T >::m_hltetarefKey
private
Initial value:
{
this, "hltetaref", "hltetaref",
"SG key for input matched etaref decoration"}

Definition at line 128 of file TrigL1FexJetMonitorTool.h.

◆ m_HLTJetContainerToMatch

template<typename T >
Gaudi::Property<std::string> TrigL1FexJetMonitorTool< T >::m_HLTJetContainerToMatch
private
Initial value:
{
this, "HLTJetsToMatch", "", "Name of matched HLT jet collection"}

Definition at line 59 of file TrigL1FexJetMonitorTool.h.

◆ m_hltmassdiffKey

template<typename T >
SG::ReadDecorHandleKey<JetContainer> TrigL1FexJetMonitorTool< T >::m_hltmassdiffKey
private
Initial value:
{
this, "hltmassdiff", "hltmassdiff",
"SG key for input matched massdiff decoration"}

Definition at line 108 of file TrigL1FexJetMonitorTool.h.

◆ m_hltmassrespKey

template<typename T >
SG::ReadDecorHandleKey<JetContainer> TrigL1FexJetMonitorTool< T >::m_hltmassrespKey
private
Initial value:
{
this, "hltmassresp", "hltmassresp",
"SG key for input matched massresp decoration"}

Definition at line 120 of file TrigL1FexJetMonitorTool.h.

◆ m_hltmatchedKey

template<typename T >
SG::ReadDecorHandleKey<JetContainer> TrigL1FexJetMonitorTool< T >::m_hltmatchedKey
private
Initial value:
{
this, "hltmatched", "hltmatched", "SG key for input matched decoration"}

Definition at line 97 of file TrigL1FexJetMonitorTool.h.

◆ m_hltptdiffKey

template<typename T >
SG::ReadDecorHandleKey<JetContainer> TrigL1FexJetMonitorTool< T >::m_hltptdiffKey
private
Initial value:
{
this, "hltptdiff", "hltptdiff",
"SG key for input matched ptdiff decoration"}

Definition at line 100 of file TrigL1FexJetMonitorTool.h.

◆ m_hltptrefKey

template<typename T >
SG::ReadDecorHandleKey<JetContainer> TrigL1FexJetMonitorTool< T >::m_hltptrefKey
private
Initial value:
{
this, "hltptref", "hltptref",
"SG key for input matched ptref decoration"}

Definition at line 124 of file TrigL1FexJetMonitorTool.h.

◆ m_hltptrespKey

template<typename T >
SG::ReadDecorHandleKey<JetContainer> TrigL1FexJetMonitorTool< T >::m_hltptrespKey
private
Initial value:
{
this, "hltptresp", "hltptresp",
"SG key for input matched ptresp decoration"}

Definition at line 112 of file TrigL1FexJetMonitorTool.h.

◆ m_l1jetContainerkey

template<typename T >
SG::ReadHandleKey<JetContainer> TrigL1FexJetMonitorTool< T >::m_l1jetContainerkey
private

Definition at line 48 of file TrigL1FexJetMonitorTool.h.

◆ m_offenergydiffKey

template<typename T >
SG::ReadDecorHandleKey<JetContainer> TrigL1FexJetMonitorTool< T >::m_offenergydiffKey
private
Initial value:
{
this, "offenergydiff", "offenergydiff",
"SG key for input matched energydiff decoration"}

Definition at line 69 of file TrigL1FexJetMonitorTool.h.

◆ m_offenergyrespKey

template<typename T >
SG::ReadDecorHandleKey<JetContainer> TrigL1FexJetMonitorTool< T >::m_offenergyrespKey
private
Initial value:
{
this, "offenergyresp", "offenergyresp",
"SG key for input matched energyresp decoration"}

Definition at line 81 of file TrigL1FexJetMonitorTool.h.

◆ m_offetarefKey

template<typename T >
SG::ReadDecorHandleKey<JetContainer> TrigL1FexJetMonitorTool< T >::m_offetarefKey
private
Initial value:
{
this, "offetaref", "offetaref",
"SG key for input matched etaref decoration"}

Definition at line 93 of file TrigL1FexJetMonitorTool.h.

◆ m_offlineJetContainerToMatch

template<typename T >
Gaudi::Property<std::string> TrigL1FexJetMonitorTool< T >::m_offlineJetContainerToMatch
private
Initial value:
{
this, "offlineJetsToMatch", "",
"Name of matched offline jet collection"}

Definition at line 55 of file TrigL1FexJetMonitorTool.h.

◆ m_offmassdiffKey

template<typename T >
SG::ReadDecorHandleKey<JetContainer> TrigL1FexJetMonitorTool< T >::m_offmassdiffKey
private
Initial value:
{
this, "offmassdiff", "offmassdiff",
"SG key for input matched massdiff decoration"}

Definition at line 73 of file TrigL1FexJetMonitorTool.h.

◆ m_offmassrespKey

template<typename T >
SG::ReadDecorHandleKey<JetContainer> TrigL1FexJetMonitorTool< T >::m_offmassrespKey
private
Initial value:
{
this, "offmassresp", "offmassresp",
"SG key for input matched massresp decoration"}

Definition at line 85 of file TrigL1FexJetMonitorTool.h.

◆ m_offmatchedKey

template<typename T >
SG::ReadDecorHandleKey<JetContainer> TrigL1FexJetMonitorTool< T >::m_offmatchedKey
private
Initial value:
{
this, "offmatched", "offmatched", "SG key for input matched decoration"}

Definition at line 62 of file TrigL1FexJetMonitorTool.h.

◆ m_offptdiffKey

template<typename T >
SG::ReadDecorHandleKey<JetContainer> TrigL1FexJetMonitorTool< T >::m_offptdiffKey
private
Initial value:
{
this, "offptdiff", "offptdiff",
"SG key for input matched ptdiff decoration"}

Definition at line 65 of file TrigL1FexJetMonitorTool.h.

◆ m_offptrefKey

template<typename T >
SG::ReadDecorHandleKey<JetContainer> TrigL1FexJetMonitorTool< T >::m_offptrefKey
private
Initial value:
{
this, "offptref", "offptref",
"SG key for input matched ptref decoration"}

Definition at line 89 of file TrigL1FexJetMonitorTool.h.

◆ m_offptrespKey

template<typename T >
SG::ReadDecorHandleKey<JetContainer> TrigL1FexJetMonitorTool< T >::m_offptrespKey
private
Initial value:
{
this, "offptresp", "offptresp",
"SG key for input matched ptresp decoration"}

Definition at line 77 of file TrigL1FexJetMonitorTool.h.


The documentation for this class was generated from the following files:
TrigL1FexJetMonitorTool::m_offmatchedKey
SG::ReadDecorHandleKey< JetContainer > m_offmatchedKey
Definition: TrigL1FexJetMonitorTool.h:62
xAOD::et
et
Definition: TrigEMCluster_v1.cxx:25
MatchToEnum::offline
@ offline
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
TrigL1FexJetMonitorTool::m_hltenergydiffKey
SG::ReadDecorHandleKey< JetContainer > m_hltenergydiffKey
Definition: TrigL1FexJetMonitorTool.h:104
MatchToEnum::hlt
@ hlt
TrigL1FexJetMonitorTool::m_hltetarefKey
SG::ReadDecorHandleKey< JetContainer > m_hltetarefKey
Definition: TrigL1FexJetMonitorTool.h:128
TrigL1FexJetMonitorTool::m_l1jetContainerkey
SG::ReadHandleKey< JetContainer > m_l1jetContainerkey
Definition: TrigL1FexJetMonitorTool.h:48
TrigL1FexJetMonitorTool::m_offptrefKey
SG::ReadDecorHandleKey< JetContainer > m_offptrefKey
Definition: TrigL1FexJetMonitorTool.h:89
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
TrigL1FexJetMonitorTool::m_hltptdiffKey
SG::ReadDecorHandleKey< JetContainer > m_hltptdiffKey
Definition: TrigL1FexJetMonitorTool.h:100
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition: StoreGate/StoreGate/ReadDecorHandle.h:94
SG::ReadDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
TrigL1FexJetMonitorTool::m_offmassrespKey
SG::ReadDecorHandleKey< JetContainer > m_offmassrespKey
Definition: TrigL1FexJetMonitorTool.h:85
TrigL1FexJetMonitorTool::m_doMatching
Gaudi::Property< bool > m_doMatching
Definition: TrigL1FexJetMonitorTool.h:51
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TrigL1FexJetMonitorTool::m_hltptrefKey
SG::ReadDecorHandleKey< JetContainer > m_hltptrefKey
Definition: TrigL1FexJetMonitorTool.h:124
TrigL1FexJetMonitorTool::m_hltptrespKey
SG::ReadDecorHandleKey< JetContainer > m_hltptrespKey
Definition: TrigL1FexJetMonitorTool.h:112
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
et_label
std::string et_label(const xAOD::jFexSRJetRoI *)
Definition: L1MonitorAdaptors.h:20
TrigL1FexJetMonitorTool::m_offptdiffKey
SG::ReadDecorHandleKey< JetContainer > m_offptdiffKey
Definition: TrigL1FexJetMonitorTool.h:65
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TrigL1FexJetMonitorTool::m_hltmatchedKey
SG::ReadDecorHandleKey< JetContainer > m_hltmatchedKey
Definition: TrigL1FexJetMonitorTool.h:97
python.ElectronD3PDObject.matched
matched
Definition: ElectronD3PDObject.py:138
TrigL1FexJetMonitorTool::m_offetarefKey
SG::ReadDecorHandleKey< JetContainer > m_offetarefKey
Definition: TrigL1FexJetMonitorTool.h:93
TrigL1FexJetMonitorTool::m_hltmassrespKey
SG::ReadDecorHandleKey< JetContainer > m_hltmassrespKey
Definition: TrigL1FexJetMonitorTool.h:120
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
TrigL1FexJetMonitorTool::m_offptrespKey
SG::ReadDecorHandleKey< JetContainer > m_offptrespKey
Definition: TrigL1FexJetMonitorTool.h:77
TrigL1FexJetMonitorTool::m_offenergyrespKey
SG::ReadDecorHandleKey< JetContainer > m_offenergyrespKey
Definition: TrigL1FexJetMonitorTool.h:81
TrigL1FexJetMonitorTool::m_hltmassdiffKey
SG::ReadDecorHandleKey< JetContainer > m_hltmassdiffKey
Definition: TrigL1FexJetMonitorTool.h:108
TrigL1FexJetMonitorTool::m_hltenergyrespKey
SG::ReadDecorHandleKey< JetContainer > m_hltenergyrespKey
Definition: TrigL1FexJetMonitorTool.h:116
TrigL1FexJetMonitorTool::m_offenergydiffKey
SG::ReadDecorHandleKey< JetContainer > m_offenergydiffKey
Definition: TrigL1FexJetMonitorTool.h:69
TrigL1FexJetMonitorTool::m_offlineJetContainerToMatch
Gaudi::Property< std::string > m_offlineJetContainerToMatch
Definition: TrigL1FexJetMonitorTool.h:55
TrigL1FexJetMonitorTool::m_offmassdiffKey
SG::ReadDecorHandleKey< JetContainer > m_offmassdiffKey
Definition: TrigL1FexJetMonitorTool.h:73
vetoJet
bool vetoJet(const xAOD::jFexSRJetRoI *j)
Definition: L1MonitorAdaptors.h:14
TrigL1FexJetMonitorTool::m_HLTJetContainerToMatch
Gaudi::Property< std::string > m_HLTJetContainerToMatch
Definition: TrigL1FexJetMonitorTool.h:59