|
ATLAS Offline Software
|
Go to the documentation of this file.
44 std::string
msg =
"JetContainerKey2 has not been configured correctly - "
48 return StatusCode::FAILURE;
87 " containers requested. This should be exactly 1");
88 return StatusCode::FAILURE;
105 return StatusCode::FAILURE;
124 return StatusCode::SUCCESS;
131 return StatusCode::SUCCESS;
139 tlv.SetPtEtaPhiE(
jet->pt(),
jet->eta(),
jet->phi(),
jet->e());
145 return StatusCode::FAILURE;
147 tlv.SetPtEtaPhiE(fourVec.Pt(),fourVec.Eta(),fourVec.Phi(),fourVec.E());
149 return StatusCode::SUCCESS;
154 tlv.SetPtEtaPhiM(
jet->et8x8(),
jet->eta(),
jet->phi(),0.);
155 return StatusCode::SUCCESS;
160 tlv.SetPtEtaPhiM(
jet->et(),
jet->eta(),
jet->phi(),0.);
161 return StatusCode::SUCCESS;
166 tlv.SetPtEtaPhiM(
jet->et(),
jet->eta(),
jet->phi(),0.);
167 return StatusCode::SUCCESS;
172 tlv.SetPtEtaPhiM(
jet->et(),
jet->eta(),
jet->phi(),0.);
173 return StatusCode::SUCCESS;
180 template <
typename T>
185 const EventContext& ctx)
const{
197 std::vector<int> matchedIndices;
199 for (
const T *
j1 : *jets1) {
200 TLorentzVector tlvjet1 = TLorentzVector();
203 ATH_MSG_WARNING(
"Could not retrieve full jet 4-momentum. Skipping jet matching.");
204 return StatusCode::SUCCESS;
206 bool j1matched =
false;
207 double ptDiff = -999., energyDiff = -999., massDiff = -999., ptResp = -999., energyResp = -999., massResp = -999., ptRef = -999., etaRef = -999.;
208 if (tlvjet1.Pt() < 10000.) {
209 matchedHandle(*
j1) = j1matched;
210 ptDiffHandle(*
j1) = ptDiff;
211 energyDiffHandle(*
j1) = energyDiff;
212 massDiffHandle(*
j1) = massDiff;
213 ptRespHandle(*
j1) = ptResp;
214 energyRespHandle(*
j1) = energyResp;
215 massRespHandle(*
j1) = massResp;
216 ptRefHandle(*
j1) = ptRef;
217 etaRefHandle(*
j1) = etaRef;
221 int jetIndex = 0, jetMatchIndex = 0;
224 if (
j2->pt() < 10000.) { jetIndex++;
continue; }
225 bool alreadymatched =
false;
226 for (
int jetIndexIterator : matchedIndices) {
227 if (jetIndex == jetIndexIterator) { alreadymatched =
true;
break; }
229 if (alreadymatched) { jetIndex++;
continue; }
230 TLorentzVector tlvjet2 = TLorentzVector();
231 tlvjet2.SetPtEtaPhiE(
j2->pt(),
j2->eta(),
j2->phi(),
j2->e());
233 double dr = tlvjet1.DeltaR(tlvjet2);
236 ptDiff = tlvjet1.Pt()-tlvjet2.Pt();
237 energyDiff = tlvjet1.E()-tlvjet2.E();
238 massDiff = tlvjet1.M()-tlvjet2.M();
239 ptResp = ptDiff/tlvjet2.Pt();
240 if (tlvjet2.E() == 0.) energyResp = -999.;
241 else energyResp = energyDiff/tlvjet2.E();
242 if (tlvjet2.M() == 0.) massResp = -999.;
243 else massResp = massDiff/tlvjet2.M();
244 ptRef = tlvjet2.Pt();
245 etaRef = tlvjet2.Eta();
247 jetMatchIndex = jetIndex;
251 matchedHandle(*
j1) = j1matched;
252 ptDiffHandle(*
j1) = ptDiff;
253 energyDiffHandle(*
j1) = energyDiff;
254 massDiffHandle(*
j1) = massDiff;
255 ptRespHandle(*
j1) = ptResp;
256 energyRespHandle(*
j1) = energyResp;
257 massRespHandle(*
j1) = massResp;
258 ptRefHandle(*
j1) = ptRef;
259 etaRefHandle(*
j1) = etaRef;
260 if (j1matched) matchedIndices.push_back(jetMatchIndex);
262 return StatusCode::SUCCESS;
275 return StatusCode::FAILURE;
282 return StatusCode::FAILURE;
290 return StatusCode::FAILURE;
298 return StatusCode::FAILURE;
307 return StatusCode::FAILURE;
315 return StatusCode::FAILURE;
321 return StatusCode::FAILURE;
359 return StatusCode::SUCCESS;
393 return StatusCode::SUCCESS;
427 return StatusCode::SUCCESS;
459 return StatusCode::SUCCESS;
491 return StatusCode::SUCCESS;
528 return StatusCode::FAILURE;
530 return StatusCode::SUCCESS;
539 return StatusCode::SUCCESS;
547 return StatusCode::SUCCESS;
556 return StatusCode::SUCCESS;
564 return StatusCode::SUCCESS;
573 return StatusCode::SUCCESS;
StatusCode finalize() override
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Class describing properties of a LVL1 jFEX global Trigger Object (TOB) in the xAOD format.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_ptRefKey
StatusCode initialize_JetRoI_varHandleKeys(bool)
SG::WriteDecorHandleKey< xAOD::JetContainer > m_ptDiffKey
SG::WriteDecorHandleKey< xAOD::gFexJetRoIContainer > m_l1gFexmatchedKey
StatusCode initialize_jFexSRJetRoI_varHandleKeys(bool)
SG::WriteDecorHandleKey< xAOD::jFexLRJetRoIContainer > m_l1jFexLRenergyDiffKey
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StatusCode set_jFexSRJetRoI_varHandleKeys()
SG::WriteDecorHandleKey< xAOD::gFexJetRoIContainer > m_l1gFexetaRefKey
StatusCode set_gFexJetRoI_varHandleKeys()
StatusCode initialize_varHandleKeys()
SG::WriteDecorHandleKey< xAOD::jFexLRJetRoIContainer > m_l1jFexLRmatchedKey
SG::ReadHandleKey< xAOD::JetContainer > m_jetContainerKey2
SG::WriteDecorHandleKey< xAOD::jFexSRJetRoIContainer > m_l1jFexSRptRespKey
std::vector< std::reference_wrapper< SG::WriteDecorHandleKey< xAOD::gFexJetRoIContainer > > > m_l1gFexJetVarHandleKeys
SG::WriteDecorHandleKey< xAOD::JetRoIContainer > m_l1energyRespKey
StatusCode jetMatching(SG::ReadHandle< DataVector< T >> jets1, SG::ReadHandle< xAOD::JetContainer > jets2, SG::WriteDecorHandleKey< DataVector< T >> matchedHandleKey, std::vector< std::reference_wrapper< SG::WriteDecorHandleKey< DataVector< T >>>> varHandleKeys, const EventContext &ctx) const
Gaudi::Property< std::string > m_calibScale
SG::WriteDecorHandleKey< xAOD::jFexLRJetRoIContainer > m_l1jFexLRptRespKey
SG::WriteDecorHandleKey< xAOD::jFexSRJetRoIContainer > m_l1jFexSRmatchedKey
SG::WriteDecorHandleKey< xAOD::JetRoIContainer > m_l1ptRefKey
Gaudi::Property< bool > m_matchL1
SG::WriteDecorHandleKey< xAOD::JetContainer > m_massRespKey
An algorithm that can be simultaneously executed in multiple threads.
SG::ReadHandleKey< xAOD::JetContainer > m_jetContainerKey1
StatusCode initialize() override
SG::WriteDecorHandleKey< xAOD::JetRoIContainer > m_l1ptRespKey
Class describing properties of a LVL1 jFEX global Trigger Object (TOB) in the xAOD format.
StatusCode set_JetRoI_varHandleKeys()
SG::WriteDecorHandleKey< xAOD::gFexJetRoIContainer > m_l1gFexenergyDiffKey
SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_gFexJetRoIKey
SG::WriteDecorHandleKey< xAOD::jFexSRJetRoIContainer > m_l1jFexSRenergyDiffKey
SG::WriteDecorHandleKey< xAOD::jFexSRJetRoIContainer > m_l1jFexSRmassRespKey
SG::WriteDecorHandleKey< xAOD::jFexSRJetRoIContainer > m_l1jFexSRetaRefKey
::StatusCode StatusCode
StatusCode definition for legacy code.
Handle class for adding a decoration to an object.
Class describing properties of a LVL1 gFEX jet Trigger Object (TOB) in the xAOD format.
StatusCode initialize_jFexLRJetRoI_varHandleKeys(bool)
SG::WriteDecorHandleKey< xAOD::JetRoIContainer > m_l1ptDiffKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_matchedKey
SG::ReadHandleKey< xAOD::jFexLRJetRoIContainer > m_jFexLRJetRoIKey
SG::WriteDecorHandleKey< xAOD::jFexSRJetRoIContainer > m_l1jFexSRptDiffKey
SG::WriteDecorHandleKey< xAOD::jFexLRJetRoIContainer > m_l1jFexLRetaRefKey
SG::WriteDecorHandleKey< xAOD::JetContainer > m_energyDiffKey
SG::WriteDecorHandleKey< xAOD::JetRoIContainer > m_l1etaRefKey
SG::WriteDecorHandleKey< xAOD::jFexSRJetRoIContainer > m_l1jFexSRmassDiffKey
SG::WriteDecorHandleKey< xAOD::jFexLRJetRoIContainer > m_l1jFexLRptRefKey
StatusCode GetTLV(const xAOD::Jet *jet, TLorentzVector &) const
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::WriteDecorHandleKey< xAOD::jFexSRJetRoIContainer > m_l1jFexSRenergyRespKey
SG::WriteDecorHandleKey< xAOD::JetRoIContainer > m_l1energyDiffKey
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_energyRespKey
SG::WriteDecorHandleKey< xAOD::jFexSRJetRoIContainer > m_l1jFexSRptRefKey
SG::ReadHandleKey< xAOD::JetRoIContainer > m_l1jetContainerKey1
SG::WriteDecorHandleKey< xAOD::gFexJetRoIContainer > m_l1gFexptDiffKey
SG::WriteDecorHandleKey< xAOD::gFexJetRoIContainer > m_l1gFexptRefKey
std::vector< std::reference_wrapper< SG::WriteDecorHandleKey< xAOD::jFexSRJetRoIContainer > > > m_l1jFexSRJetVarHandleKeys
Gaudi::Property< float > m_Rmatch
SG::WriteDecorHandleKey< xAOD::JetContainer > m_massDiffKey
Class describing a LVL1 jet region of interest.
SG::WriteDecorHandleKey< xAOD::JetContainer > m_etaRefKey
JetMatcherAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::WriteDecorHandleKey< xAOD::JetContainer > m_ptRespKey
std::vector< std::reference_wrapper< SG::WriteDecorHandleKey< xAOD::JetRoIContainer > > > m_l1JetVarHandleKeys
#define ATH_MSG_WARNING(x)
SG::WriteDecorHandleKey< xAOD::jFexLRJetRoIContainer > m_l1jFexLRenergyRespKey
SG::WriteDecorHandleKey< xAOD::gFexJetRoIContainer > m_l1gFexmassRespKey
StatusCode set_jFexLRJetRoI_varHandleKeys()
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
StatusCode initialize_xAODJet_varHandleKeys(bool)
SG::WriteDecorHandleKey< xAOD::JetRoIContainer > m_l1massRespKey
std::vector< std::reference_wrapper< SG::WriteDecorHandleKey< xAOD::jFexLRJetRoIContainer > > > m_l1jFexLRJetVarHandleKeys
SG::WriteDecorHandleKey< xAOD::jFexLRJetRoIContainer > m_l1jFexLRmassDiffKey
SG::WriteDecorHandleKey< xAOD::JetRoIContainer > m_l1massDiffKey
SG::ReadHandleKey< xAOD::jFexSRJetRoIContainer > m_jFexSRJetRoIKey
StatusCode initialize_gFexJetRoI_varHandleKeys(bool)
StatusCode execute(const EventContext &ctx) const override
SG::WriteDecorHandleKey< xAOD::JetRoIContainer > m_l1matchedKey
SG::WriteDecorHandleKey< xAOD::jFexLRJetRoIContainer > m_l1jFexLRptDiffKey
SG::WriteDecorHandleKey< xAOD::jFexLRJetRoIContainer > m_l1jFexLRmassRespKey
SG::WriteDecorHandleKey< xAOD::gFexJetRoIContainer > m_l1gFexenergyRespKey
SG::WriteDecorHandleKey< xAOD::gFexJetRoIContainer > m_l1gFexptRespKey
std::vector< std::reference_wrapper< SG::WriteDecorHandleKey< xAOD::JetContainer > > > m_jetVarHandleKeys
StatusCode set_xAODJet_varHandleKeys()
SG::WriteDecorHandleKey< xAOD::gFexJetRoIContainer > m_l1gFexmassDiffKey