ATLAS Offline Software
DecoratePLIT.cxx
Go to the documentation of this file.
1 // This is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 */
6 
11 
12 
13 namespace Prompt {
14 
15  DecoratePLIT::DecoratePLIT(const std::string &name, ISvcLocator *pSvcLocator)
16  : AthReentrantAlgorithm(name, pSvcLocator)
17  {}
18 
20  ATH_MSG_DEBUG("Initializing DecoratePLIT " << name() );
21  ATH_MSG_DEBUG("m_leptonsName = " << m_leptonsName);
22 
23  ATH_MSG_DEBUG("Initializing " << m_electronsKey);
24  ATH_MSG_DEBUG("Initializing " << m_muonsKey);
25  ATH_MSG_DEBUG("Initializing " << m_trackjetsKey);
26  ATH_MSG_DEBUG("Initializing " << m_tracksKey);
27  ATH_MSG_DEBUG("Initializing " << m_caloclustersKey);
28 
30  ATH_CHECK(m_muonsKey.initialize(m_leptonsName == "Muons"));
31  ATH_CHECK(m_trackjetsKey.initialize());
34 
35  // initialise accessors
37 
38  // Load and initialize the neural network model from the given file path.
39  if(m_leptonsName == "Electrons") {
40  std::string fullPathToOnnxFile = PathResolverFindCalibFile(m_configPath.value() + m_configFileVersion.value());
41  m_onnxUtil = std::make_shared<FlavorTagDiscriminants::OnnxUtil>(fullPathToOnnxFile);
42 
43  std::string fullPathToOnnxFile_endcap = PathResolverFindCalibFile(m_configPath.value() + m_configFileVersion_endcap.value());
44  m_onnxUtil_endcap = std::make_shared<FlavorTagDiscriminants::OnnxUtil>(fullPathToOnnxFile_endcap);
45 
48 
49  // set up decorators using a dummy query of the onnx model
50  std::map<std::string, FlavorTagDiscriminants::Inputs> gnn_input;
51  std::vector<float> elec_feat(m_num_lepton_features, 0.);
52  std::vector<int64_t> elec_feat_dim = {1, static_cast<int64_t>(elec_feat.size())};
53  FlavorTagDiscriminants::Inputs elec_info (elec_feat, elec_feat_dim);
54  gnn_input.insert({"jet_features", elec_info});
55  std::vector<float> track_feat(m_num_track_features, 0.);
56  std::vector<int64_t> track_feat_dim = {1, m_num_track_features};
57  FlavorTagDiscriminants::Inputs track_info(track_feat, track_feat_dim);
58  gnn_input.insert({"track_features", track_info});
59  auto [out_f, out_vc, out_vf] = m_onnxUtil->runInference(gnn_input);
60 
61  std::vector<std::string> output_names;
62  for (auto& singlefloat : out_f){
63  output_names.push_back(m_electronsKey.key()+"." + m_TaggerName + "_" + singlefloat.first);
64  }
65  ATH_CHECK(m_dec_el_plit_output.assign(output_names));
66  ATH_CHECK(m_dec_el_plit_output.initialize());
67  }
68  else if (m_leptonsName == "Muons") {
69  std::string fullPathToOnnxFile = PathResolverFindCalibFile(m_configPath.value() + m_configFileVersion.value());
70  m_onnxUtil = std::make_shared<FlavorTagDiscriminants::OnnxUtil>(fullPathToOnnxFile);
71 
74 
75  // set up decorators using a dummy query of the onnx model
76  std::map<std::string, FlavorTagDiscriminants::Inputs> gnn_input;
77  std::vector<float> muon_feat(m_num_lepton_features, 0.);
78  std::vector<int64_t> muon_feat_dim = {1, static_cast<int64_t>(muon_feat.size())};
79  FlavorTagDiscriminants::Inputs muon_info (muon_feat, muon_feat_dim);
80  gnn_input.insert({"jet_features", muon_info});
81  std::vector<float> track_feat(m_num_track_features, 0.);
82  std::vector<int64_t> track_feat_dim = {1, m_num_track_features};
83  FlavorTagDiscriminants::Inputs track_info(track_feat, track_feat_dim);
84  gnn_input.insert({"track_features", track_info});
85  auto [out_f, out_vc, out_vf] = m_onnxUtil->runInference(gnn_input);
86 
87  std::vector<std::string> output_names;
88  for (auto& singlefloat : out_f){
89  output_names.push_back(m_muonsKey.key()+"." + m_TaggerName + "_" + singlefloat.first);
90  }
91  ATH_CHECK(m_dec_mu_plit_output.assign(output_names));
92  ATH_CHECK(m_dec_mu_plit_output.initialize());
93  }
94  else {
95  ATH_MSG_ERROR(" ==> topology is not recognised! aborting.");
96  return StatusCode::FAILURE;
97  }
98 
99  ATH_MSG_INFO("DecoratePLIT " << name() << " initialization done." );
100 
101  return StatusCode::SUCCESS;
102  }
103 
104  StatusCode DecoratePLIT::execute(const EventContext& ctx) const {
108 
109  if (!m_electronsKey.empty()) {
110  // prepare decorators
111  // ------------------
112  std::vector<SG::WriteDecorHandle<xAOD::ElectronContainer, float>> dec_el_plit_output;
113  for (const auto& wdhk: m_dec_el_plit_output) {
114  dec_el_plit_output.emplace_back(wdhk, ctx);
115  }
117  for (const xAOD::Electron* elec : *electrons) {
118  if (!predictElec(*elec, *trackjets, *tracks, *caloclusters, dec_el_plit_output, ctx)) {
119  ATH_MSG_ERROR("DecoratePLIT::execute - failed to predict electron");
120  return StatusCode::FAILURE;
121  }
122  }
123  } else if (!m_muonsKey.empty()) {
124  // prepare decorators
125  // ------------------
126  std::vector<SG::WriteDecorHandle<xAOD::MuonContainer, float>> dec_mu_plit_output;
127  for (const auto& wdhk: m_dec_mu_plit_output) {
128  dec_mu_plit_output.emplace_back(wdhk, ctx);
129  }
131  for (const xAOD::Muon* muon : *muons) {
132  if (!predictMuon(*muon, *trackjets, *tracks, dec_mu_plit_output, ctx)) {
133  ATH_MSG_ERROR("DecoratePLIT::execute - failed to predict muon");
134  return StatusCode::FAILURE;
135  }
136  }
137  }
138 
139  return StatusCode::SUCCESS;
140  }
141 
143 
144  ATH_CHECK(m_acc_mu_ptvarcone30TTVA.initialize(!m_muonsKey.empty()));
145  ATH_CHECK(m_acc_mu_topoetcone30.initialize(!m_muonsKey.empty()));
146 
149 
150  ATH_CHECK(m_acc_trk_ptfrac.initialize());
151  ATH_CHECK(m_acc_trk_dr_trackjet.initialize());
152  ATH_CHECK(m_acc_trk_dr_lepton.initialize());
153  ATH_CHECK(m_acc_trk_d0.initialize());
154  ATH_CHECK(m_acc_trk_z0SinTheta.initialize());
155  ATH_CHECK(m_acc_trk_d0Uncertainty.initialize());
157  ATH_CHECK(m_acc_trk_muon_track.initialize());
158  ATH_CHECK(m_acc_trk_electron_track.initialize());
159 
160  return StatusCode::SUCCESS;
161  }
162 
164  const xAOD::Muon &muon,
165  const xAOD::JetContainer &trackjets,
166  const xAOD::TrackParticleContainer &tracks,
167  std::vector<SG::WriteDecorHandle<xAOD::MuonContainer, float>> &dec_mu_plit_output,
168  const EventContext& ctx) const {
169  // set up accessors
170  // ---------------
173 
180 
181  // prepare input
182  // -------------
183  std::map<std::string, FlavorTagDiscriminants::Inputs> gnn_input;
184 
185  // collect muon features
186  float muon_pt = muon.pt();
187  float muon_eta = muon.eta();
188  float muon_phi = muon.phi();
189 
190  float muon_ptvarcone30TTVARel = acc_ptvarcone30TTVA(muon) / muon_pt;
191  float muon_topoetcone30Rel = acc_topoetcone30(muon) / muon_pt;
192 
193  float muon_caloClusterERel = -99;
194  const xAOD::CaloCluster* cluster = muon.cluster();
195  if (cluster) {
196  float energyloss = 0;
197  if (!muon.parameter(energyloss,xAOD::Muon::MeasEnergyLoss)) {
198  ATH_MSG_WARNING("DecoratePLIT::execute - failed to retrieve energy loss");
199  return StatusCode::FAILURE;
200  }
201  float calE = cluster->calE();
202  if (std::abs(energyloss) > 0)
203  muon_caloClusterERel = calE / energyloss;
204  }
205 
206  // collect muon and trackjet-related features
207  const xAOD::Jet *trackjet = findClosestTrackJet(muon, trackjets);
208  float muon_ptfrac_lepton{-99.f}, muon_ptrel_lepton{-99.f}, muon_dRtrackjet_lepton{-99.f}, muon_nTracksTrackjet{-99.f};
209 
210  if (trackjet) {
211  muon_nTracksTrackjet = trackjet->getConstituents().size();
212 
213  muon_ptfrac_lepton = muon_pt / trackjet->pt();
214 
215  float angle = muon.p4().Vect().Angle(trackjet->p4().Vect());
216  muon_ptrel_lepton = muon_pt * std::sin(angle);
217 
218  muon_dRtrackjet_lepton = muon.p4().DeltaR(trackjet->p4());
219  }
220 
221  // package muon features for inference
222  std::vector<float> muon_feat = {
223  muon_pt, muon_eta, muon_phi, muon_ptvarcone30TTVARel, muon_topoetcone30Rel,
224  muon_caloClusterERel, muon_ptfrac_lepton, muon_ptrel_lepton,
225  muon_dRtrackjet_lepton, muon_nTracksTrackjet
226  };
227  std::vector<int64_t> muon_feat_dim = {1, static_cast<int64_t>(muon_feat.size())};
228 
229  // need to use the "jet_features" keyword as we are borrowing flavour tagging code
230  FlavorTagDiscriminants::Inputs muon_info (muon_feat, muon_feat_dim);
231  gnn_input.insert({"jet_features", muon_info});
232 
233  // decorate and fill track particles around the muon
234  const xAOD::TrackParticle *muonTrack = muon.primaryTrackParticle();
235  std::vector<const xAOD::IParticle *> parts;
236 
237  if(!fillParticles(parts, muon, muonTrack, trackjet, tracks, ctx)) {
238  ATH_MSG_ERROR("DecoratePLIT::execute - failed to fill particles");
239  return StatusCode::FAILURE;
240  }
241 
242  // extract track features from track particles
243  std::vector<float> track_feat;
244  track_feat.reserve(parts.size() * static_cast<int64_t>(muon_feat.size()));
245  // loop over parts and fill track_feat vector
246  for (const xAOD::IParticle *part: parts) {
247  const xAOD::TrackParticle *track = dynamic_cast<const xAOD::TrackParticle*>(part);
248 
249  float ptfrac = acc_ptfrac(*track);
250  track_feat.push_back(ptfrac);
251 
252  float dr_trackjet = acc_dr_trackjet(*track);
253  track_feat.push_back(dr_trackjet);
254 
255  float qoverp = track->qOverP();
256  track_feat.push_back(qoverp);
257 
258  float d0 = acc_d0(*track);
259  track_feat.push_back(d0);
260 
261  float z0SinTheta = acc_z0SinTheta(*track);
262  track_feat.push_back(z0SinTheta);
263 
264  float d0Uncertainty = acc_d0Uncertainty(*track);
265  track_feat.push_back(d0Uncertainty);
266 
267  float z0SinThetaUncertainty = acc_z0SinThetaUncertainty(*track);
268  track_feat.push_back(z0SinThetaUncertainty);
269 
270  float d0_significance = -99;
271  if (abs(d0Uncertainty) > 0) d0_significance = d0 / d0Uncertainty;
272  track_feat.push_back(d0_significance);
273 
274  float z0SinTheta_significance = -99;
275  if (std::abs(z0SinThetaUncertainty) > 0) z0SinTheta_significance = z0SinTheta / z0SinThetaUncertainty;
276  track_feat.push_back(z0SinTheta_significance);
277 
278  uint8_t pix_hits = 0;
279  if(!track->summaryValue(pix_hits,xAOD::numberOfPixelHits)){
280  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelHits");
281  return StatusCode::FAILURE;
282  }
283  track_feat.push_back(pix_hits);
284 
285  uint8_t pix_innermosthits = 0;
286  if(!track->summaryValue(pix_innermosthits,xAOD::numberOfInnermostPixelLayerHits)){
287  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerHits");
288  return StatusCode::FAILURE;
289  }
290  track_feat.push_back(pix_innermosthits);
291 
292  uint8_t pix_nextinnermosthits = 0;
293  if(!track->summaryValue(pix_nextinnermosthits,xAOD::numberOfNextToInnermostPixelLayerHits)){
294  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfNextToInnermostPixelLayerHits");
295  return StatusCode::FAILURE;
296  }
297  track_feat.push_back(pix_nextinnermosthits);
298 
299  uint8_t pix_innermostsharedhits = 0;
300  if(!track->summaryValue(pix_innermostsharedhits,xAOD::numberOfInnermostPixelLayerSharedHits)){
301  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerSharedHits");
302  return StatusCode::FAILURE;
303  }
304  track_feat.push_back(pix_innermostsharedhits);
305 
306  uint8_t pix_innermostsplithits = 0;
307  if(!track->summaryValue(pix_innermostsplithits,xAOD::numberOfInnermostPixelLayerSplitHits)){
308  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerSplitHits");
309  return StatusCode::FAILURE;
310  }
311  track_feat.push_back(pix_innermostsplithits);
312 
313  uint8_t pix_shared = 0;
314  if(!track->summaryValue(pix_shared,xAOD::numberOfPixelSharedHits)){
315  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelSharedHits");
316  return StatusCode::FAILURE;
317  }
318  track_feat.push_back(pix_shared);
319 
320  uint8_t pix_split = 0;
321  if(!track->summaryValue(pix_split,xAOD::numberOfPixelSplitHits)){
322  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelSplitHits");
323  return StatusCode::FAILURE;
324  }
325  track_feat.push_back(pix_split);
326 
327  uint8_t sct_hits = 0;
328  if(!track->summaryValue(sct_hits,xAOD::numberOfSCTHits)){
329  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfSCTHits");
330  return StatusCode::FAILURE;
331  }
332  track_feat.push_back(sct_hits);
333 
334  uint8_t sct_shared = 0;
335  if(!track->summaryValue(sct_shared,xAOD::numberOfSCTSharedHits)){
336  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfSCTSharedHits");
337  return StatusCode::FAILURE;
338  }
339  track_feat.push_back(sct_shared);
340  }
341 
342  // prepare track features for inference
343  int num_cnsts = parts.size();
344  std::vector<int64_t> track_feat_dim = {num_cnsts, m_num_track_features};
345 
346  FlavorTagDiscriminants::Inputs track_info(track_feat, track_feat_dim);
347  gnn_input.insert({"track_features", track_info});
348  if (msgLvl(MSG::VERBOSE)) {
349  ATH_MSG_VERBOSE("gnn_input size = " << gnn_input.size());
350  for (auto& inp : gnn_input){
351  ATH_MSG_VERBOSE(" " + inp.first + " dim = ");
352  for (auto & dim: inp.second.second) {
354  }
355  ATH_MSG_VERBOSE(" " + inp.first + " content = ");
356  for (auto & con: inp.second.first) {
357  ATH_MSG_VERBOSE(" " + std::to_string(con));
358  }
359  }
360  }
361 
362  // run inference
363  // -------------
364  auto [out_f, out_vc, out_vf] = m_onnxUtil->runInference(gnn_input);
365  if (msgLvl(MSG::VERBOSE)) {
366  ATH_MSG_VERBOSE("runInference done.");
367 
368  ATH_MSG_VERBOSE("Output Float(s):");
369  for (auto& singlefloat : out_f){
370  ATH_MSG_VERBOSE(singlefloat.first + " = " << singlefloat.second);
371  }
372  ATH_MSG_VERBOSE("Output vector char(s):");
373  for (auto& vecchar : out_vc){
374  ATH_MSG_VERBOSE(vecchar.first + " = ");
375  for (auto& cc : vecchar.second){
377  }
378  }
379  ATH_MSG_VERBOSE("Output vector float(s):");
380  for (auto& vecfloat : out_vf){
381  ATH_MSG_VERBOSE(vecfloat.first + " = ");
382  for (auto& ff : vecfloat.second){
384  }
385  }
386  }
387  // filling the tagger scores
388  auto it_dec_mu_plit_output = dec_mu_plit_output.begin();
389  for (auto& singlefloat : out_f){
390  (*it_dec_mu_plit_output)(muon) = singlefloat.second;
391  ++it_dec_mu_plit_output;
392  }
393 
394  return StatusCode::SUCCESS;
395  }
396 
398  const xAOD::Electron &electron,
399  const xAOD::JetContainer &trackjets,
400  const xAOD::TrackParticleContainer &tracks,
401  const xAOD::CaloClusterContainer &caloclusters,
402  std::vector<SG::WriteDecorHandle<xAOD::ElectronContainer, float>> &dec_el_plit_output,
403  const EventContext& ctx) const {
404  // prepare input
405  // -------------
406  std::map<std::string, FlavorTagDiscriminants::Inputs> gnn_input;
407 
408  // accessors
409  // ---------
412 
421 
422  // collect electron features
423  float elec_pt = electron.pt();
424  float elec_eta = electron.eta();
425  float elec_phi = electron.phi();
426  float elec_ntracks = static_cast<float>(electron.nTrackParticles());
427  float elec_ptvarcone30Rel = acc_ptvarcone30(electron) / elec_pt;
428  float elec_topoetcone30Rel = acc_topoetcone30(electron) / elec_pt;
429 
430  // compute electron calorimeter cluster information
431  float elec_caloClusterSumEtRel = 0.0;
432  float sumCoreEt_large = 0.0;
433  if (electron.caloCluster()) {
434  float elec_calEta = electron.caloCluster()->eta();
435  float elec_calPhi = electron.caloCluster()->phi();
436 
437  for (const xAOD::CaloCluster *cluster: caloclusters) {
438  float deta = elec_calEta - cluster->eta();
439  float dphi = TVector2::Phi_mpi_pi(elec_calPhi - cluster->phi());
440  float dr = std::sqrt(deta*deta + dphi*dphi);
441 
442  if (dr < m_lepCalErelConeSize) {
443  sumCoreEt_large += cluster->pt();
444  }
445  }
446  }
447  elec_caloClusterSumEtRel = sumCoreEt_large / elec_pt;
448 
449  // collect electron and trackjet-related variables
450  const xAOD::Jet *trackjet = findClosestTrackJet(electron, trackjets);
451  float elec_ptfrac_lepton = -99;
452  float elec_ptrel_lepton = -99;
453  float elec_dRtrackjet_lepton = -99;
454  float elec_nTracksTrackjet = -99;
455 
456  if (trackjet) {
457  elec_nTracksTrackjet = trackjet->getConstituents().size();
458 
459  elec_ptfrac_lepton = elec_pt / trackjet->pt();
460 
461  float angle = electron.p4().Vect().Angle(trackjet->p4().Vect());
462  elec_ptrel_lepton = elec_pt * std::sin(angle);
463 
464  elec_dRtrackjet_lepton = electron.p4().DeltaR(trackjet->p4());
465  }
466 
467  // collect best matched GSF electron track kinematics
468  const xAOD::TrackParticle *electronTrack = nullptr;
469  const xAOD::TrackParticle *bestmatchedGSFElTrack = electron.trackParticle(0);
470  if (bestmatchedGSFElTrack) {
471  electronTrack = xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(bestmatchedGSFElTrack);
472  }
473  float elec_d0sig = -99;
474  float elec_qd0 = -99;
475  float elec_z0sinTheta = -99;
476  if (electronTrack) {
477  float d0 = electronTrack->d0();
478  float vard0 = electronTrack->definingParametersCovMatrix()(0, 0);
479  if (vard0 > 0){
480  float d0sigma = std::sqrt(vard0);
481  if (std::abs(d0sigma) > 0)
482  elec_d0sig = std::abs(d0 / d0sigma);
483  }
484  elec_qd0 = (electron.charge())*d0;
485  elec_z0sinTheta = electronTrack->z0() * std::sin(electronTrack->theta());
486  }
487 
488  // compute SCT weighted charge (can be used for electron charge identification)
489  float elec_SCTWeightedCharge{0.f}, charge{0.f};
490  uint8_t SCT = 0;
491  for (unsigned TPit = 0; TPit < electron.nTrackParticles(); TPit++) {
492  uint8_t temp_NSCTHits = 0;
493  if (electron.trackParticle(TPit)) {
494  electron.trackParticle(TPit)->summaryValue(temp_NSCTHits, xAOD::numberOfSCTHits);
495  SCT += temp_NSCTHits;
496  charge += temp_NSCTHits*(electron.trackParticle(TPit)->charge());
497  }
498  }
499  if (SCT > 0) {
500  elec_SCTWeightedCharge = (electron.charge()*charge/SCT);
501  } else {
502  ATH_MSG_WARNING("No SCT hit for any track associated to electron ! nTP = " << electron.nTrackParticles());
503  }
504 
505  std::vector<float> electron_feat = {elec_pt, elec_eta, elec_phi, elec_ptvarcone30Rel, elec_topoetcone30Rel, elec_caloClusterSumEtRel, elec_ptfrac_lepton, elec_ptrel_lepton, elec_dRtrackjet_lepton, elec_d0sig, elec_z0sinTheta, elec_SCTWeightedCharge, elec_qd0, elec_ntracks, elec_nTracksTrackjet};
506  std::vector<int64_t> electron_feat_dim = {1, static_cast<int64_t>(electron_feat.size())};
507 
508  // need to use the "jet_features" keyword as we are borrowing flavour tagging code
509  FlavorTagDiscriminants::Inputs electron_info (electron_feat, electron_feat_dim);
510  gnn_input.insert({"jet_features", electron_info});
511 
512  // decorate and fill track particles around the electron
513  std::vector<const xAOD::IParticle *> parts;
514  if (!fillParticles(parts, electron, electronTrack, trackjet, tracks, ctx)) {
515  ATH_MSG_ERROR("DecoratePLIT::execute - failed to fill particles");
516  return StatusCode::FAILURE;
517  }
518 
519  // collect track features from track particles
520  std::vector<float> track_feat;
521  track_feat.reserve(parts.size() * static_cast<int64_t>(electron_feat.size()));
522  for (const xAOD::IParticle *part: parts) {
523  const xAOD::TrackParticle *track = dynamic_cast<const xAOD::TrackParticle*>(part);
524  if (!track) {
525  ATH_MSG_ERROR("DecoratePLIT::execute - null track pointer");
526  }
527 
528  float ptfrac = acc_ptfrac(*track);
529  track_feat.push_back(ptfrac);
530 
531  float dr_trackjet = acc_dr_trackjet(*track);
532  track_feat.push_back(dr_trackjet);
533 
534  float dr_lepton = acc_dr_lepton(*track);
535  track_feat.push_back(dr_lepton);
536 
537  float qoverp = track->qOverP();
538  track_feat.push_back(qoverp);
539 
540  float d0 = acc_d0(*track);
541  track_feat.push_back(d0);
542 
543  float z0SinTheta = acc_z0SinTheta(*track);
544  track_feat.push_back(z0SinTheta);
545 
546  float d0Uncertainty = acc_d0Uncertainty(*track);
547  float z0SinThetaUncertainty = acc_z0SinThetaUncertainty(*track);
548 
549  float d0_significance = -99;
550  if (std::abs(d0Uncertainty) > 0) d0_significance = d0 / d0Uncertainty;
551  track_feat.push_back(d0_significance);
552 
553  float z0SinTheta_significance = -99;
554  if (std::abs(z0SinThetaUncertainty) > 0) z0SinTheta_significance = z0SinTheta / z0SinThetaUncertainty;
555  track_feat.push_back(z0SinTheta_significance);
556 
557  uint8_t pix_innermosthits = 0;
558  if(!track->summaryValue(pix_innermosthits,xAOD::numberOfInnermostPixelLayerHits)){
559  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerHits");
560  return StatusCode::FAILURE;
561  }
562  track_feat.push_back(pix_innermosthits);
563 
564  uint8_t pix_nextinnermosthits = 0;
565  if(!track->summaryValue(pix_nextinnermosthits,xAOD::numberOfNextToInnermostPixelLayerHits)){
566  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfNextToInnermostPixelLayerHits");
567  return StatusCode::FAILURE;
568  }
569  track_feat.push_back(pix_nextinnermosthits);
570 
571  uint8_t pix_innermostsharedhits = 0;
572  if(!track->summaryValue(pix_innermostsharedhits,xAOD::numberOfInnermostPixelLayerSharedHits)){
573  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerSharedHits");
574  return StatusCode::FAILURE;
575  }
576  track_feat.push_back(pix_innermostsharedhits);
577 
578  uint8_t pix_innermostsplithits = 0;
579  if(!track->summaryValue(pix_innermostsplithits,xAOD::numberOfInnermostPixelLayerSplitHits)){
580  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerSplitHits");
581  return StatusCode::FAILURE;
582  }
583  track_feat.push_back(pix_innermostsplithits);
584 
585  uint8_t pix_hits = 0;
586  if(!track->summaryValue(pix_hits,xAOD::numberOfPixelHits)){
587  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelHits");
588  return StatusCode::FAILURE;
589  }
590  track_feat.push_back(pix_hits);
591 
592  uint8_t pix_shared = 0;
593  if(!track->summaryValue(pix_shared,xAOD::numberOfPixelSharedHits)){
594  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelSharedHits");
595  return StatusCode::FAILURE;
596  }
597  track_feat.push_back(pix_shared);
598 
599  uint8_t pix_split = 0;
600  if(!track->summaryValue(pix_split,xAOD::numberOfPixelSplitHits)){
601  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelSplitHits");
602  return StatusCode::FAILURE;
603  }
604  track_feat.push_back(pix_split);
605 
606  uint8_t sct_hits = 0;
607  if(!track->summaryValue(sct_hits,xAOD::numberOfSCTHits)){
608  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfSCTHits");
609  return StatusCode::FAILURE;
610  }
611  track_feat.push_back(sct_hits);
612 
613  uint8_t sct_shared = 0;
614  if(!track->summaryValue(sct_shared,xAOD::numberOfSCTSharedHits)){
615  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfSCTSharedHits");
616  return StatusCode::FAILURE;
617  }
618  track_feat.push_back(sct_shared);
619 
620  uint8_t trt_hits = 0;
621  if(!track->summaryValue(trt_hits,xAOD::numberOfTRTHits)){
622  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfTRTHits");
623  return StatusCode::FAILURE;
624  }
625  track_feat.push_back(trt_hits);
626 
627  char electron_track = acc_electron_track(*track);
628  track_feat.push_back(electron_track);
629  }
630 
631  // prepare track features for inference
632  int num_cnsts = parts.size();
633  std::vector<int64_t> track_feat_dim = {num_cnsts, m_num_track_features};
634 
635  FlavorTagDiscriminants::Inputs track_info (track_feat, track_feat_dim);
636  gnn_input.insert({"track_features", track_info});
637 
638  if (msgLvl(MSG::VERBOSE)) {
639  ATH_MSG_VERBOSE("gnn_input size = " << gnn_input.size());
640  for (auto& inp : gnn_input){
641  ATH_MSG_VERBOSE(" " + inp.first + " dim = ");
642  for (auto & dim: inp.second.second) {
644  }
645  ATH_MSG_VERBOSE(" " + inp.first + " content = ");
646  for (auto & con: inp.second.first) {
647  ATH_MSG_VERBOSE(" " + std::to_string(con));
648  }
649  }
650  }
651 
652  // run inference
653  // -------------
654  // use different model for endcap electrons
655  auto [out_f, out_vc, out_vf] = (std::abs(elec_eta) < 1.37) ? m_onnxUtil->runInference(gnn_input) : m_onnxUtil_endcap->runInference(gnn_input);
656  if (msgLvl(MSG::VERBOSE)) {
657  ATH_MSG_VERBOSE("runInference done.");
658 
659  ATH_MSG_VERBOSE("Output Float(s):");
660  for (auto& singlefloat : out_f){
661  ATH_MSG_VERBOSE(singlefloat.first + " = " << singlefloat.second);
662  }
663  ATH_MSG_VERBOSE("Output vector char(s):");
664  for (auto& vecchar : out_vc){
665  ATH_MSG_VERBOSE(vecchar.first + " = ");
666  for (auto& cc : vecchar.second){
668  }
669  }
670  ATH_MSG_VERBOSE("Output vector float(s):");
671  for (auto& vecfloat : out_vf){
672  ATH_MSG_VERBOSE(vecfloat.first + " = ");
673  for (auto& ff : vecfloat.second){
675  }
676  }
677  }
678  // filling the tagger scores
679  auto it_dec_el_plit_output = dec_el_plit_output.begin();
680  for (auto& singlefloat : out_f){
681  (*it_dec_el_plit_output)(electron) = singlefloat.second;
682  ++it_dec_el_plit_output;
683  }
684 
685  return StatusCode::SUCCESS;
686  }
687 
689  const xAOD::Jet* closestJet = nullptr;
690  float minDistance = std::numeric_limits<float>::max();
691 
692  for (const xAOD::Jet* jet : jets) {
693  float distance = part.p4().DeltaR(jet->p4());
694  if (distance < minDistance) {
695  minDistance = distance;
696  closestJet = jet;
697  }
698  }
699 
700  return (minDistance < m_maxLepTrackJetdR) ? closestJet : nullptr;
701  }
702 
703  bool DecoratePLIT::passed_r22tracking_cuts(const xAOD::TrackParticle& tp, const EventContext& ctx) const
704  {
705  // r22 default track selection for flavour tagging GN2 algorithm
706  constexpr float pt_minimum = 500; // MeV
707  constexpr float abs_eta_maximum = 2.5;
708  constexpr float d0_maximum = 3.5;
709  constexpr float z0_maximum= 5.0;
710  constexpr unsigned char si_hits_minimum = 8;
711  constexpr unsigned char si_shared_maximum = 1;
712  constexpr unsigned char si_holes_maximum = 2;
713  constexpr unsigned char pix_holes_maximum = 1;
714 
715  // accessors
718 
719  // get hit pixel info
720  uint8_t pix_shared = 0;
721  if(!tp.summaryValue(pix_shared,xAOD::numberOfPixelSharedHits)){
722  ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfPixelSharedHits");
723  return false;
724  }
725  uint8_t sct_shared = 0;
726  if(!tp.summaryValue(sct_shared,xAOD::numberOfSCTSharedHits)){
727  ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfSCTSharedHits");
728  return false;
729  }
730  uint8_t pix_hits = 0;
731  if(!tp.summaryValue(pix_hits,xAOD::numberOfPixelHits)){
732  ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfPixelHits");
733  return false;
734  }
735  uint8_t sct_hits = 0;
736  if(!tp.summaryValue(sct_hits,xAOD::numberOfSCTHits)){
737  ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfSCTHits");
738  return false;
739  }
740  uint8_t pix_dead = 0;
741  if(!tp.summaryValue(pix_dead,xAOD::numberOfPixelDeadSensors)){
742  ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfPixelDeadSensors");
743  return false;
744  }
745  uint8_t sct_dead = 0;
746  if(!tp.summaryValue(sct_dead,xAOD::numberOfSCTDeadSensors)){
747  ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfSCTDeadSensors");
748  return false;
749  }
750  uint8_t pix_holes = 0;
751  if(!tp.summaryValue(pix_holes,xAOD::numberOfPixelHoles)){
752  ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfPixelHoles");
753  return false;
754  }
755  uint8_t sct_holes = 0;
756  if(!tp.summaryValue(sct_holes,xAOD::numberOfSCTHoles)){
757  ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfSCTHoles");
758  return false;
759  }
760 
761  if (std::abs(tp.eta()) > abs_eta_maximum)
762  return false;
763  double n_module_shared = (pix_shared + sct_shared / 2);
764  if (n_module_shared > si_shared_maximum)
765  return false;
766  if (tp.pt() <= pt_minimum)
767  return false;
768  if (std::isfinite(d0_maximum) &&
769  std::abs(acc_d0(tp)) >= d0_maximum)
770  return false;
771  if (std::isfinite(z0_maximum) &&
772  std::abs(acc_z0SinTheta(tp)) >= z0_maximum)
773  return false;
774  if (pix_hits + pix_dead + sct_hits + sct_dead < si_hits_minimum)
775  return false;
776  if ((pix_holes + sct_holes) > si_holes_maximum)
777  return false;
778  if (pix_holes > pix_holes_maximum)
779  return false;
780  return true;
781  }
782 
784  std::vector<const xAOD::IParticle *> &parts,
785  const xAOD::IParticle &lepton,
786  const xAOD::TrackParticle *trackLep,
787  const xAOD::Jet *trackJet,
788  const xAOD::TrackParticleContainer &trackContainer,
789  const EventContext& ctx) const
790  {
791  // get lepton four momentum
792  const FourMom_t lepton_p4 = lepton.p4();
793 
794  // Precompute tracks used for reconstruction
795  std::set<const xAOD::TrackParticle*> tracksUsedForElectron;
796  std::set<const xAOD::TrackParticle*> tracksUsedForMuon;
797  if (const auto* elec = dynamic_cast<const xAOD::Electron*>(&lepton)) {
798  tracksUsedForElectron = xAOD::EgammaHelpers::getTrackParticles(elec, true); // useBremAssoc = true
799  } else if (const auto* muon = dynamic_cast<const xAOD::Muon*>(&lepton)) {
800  if (muon->muonType() == xAOD::Muon::Combined && muon->inDetTrackParticleLink().isValid()) {
801  tracksUsedForMuon.insert(muon->primaryTrackParticle());
802  }
803  }
804 
805  // Loop over tracks and store them
806  for (const xAOD::TrackParticle *track: trackContainer) {
807  if (!track) {
808  ATH_MSG_ERROR("DecoratePLIT::fillParticles - null track pointer");
809  }
810  // check if track passed selection
811  if (!passed_r22tracking_cuts(*track, ctx)) continue;
812 
813  // decorate track
814  float dr_lepton = (lepton.p4().Pt() > 0.) ? track->p4().DeltaR(lepton.p4()) : -99;
815  bool isUsedForElectron = tracksUsedForElectron.count(track);
816  bool isUsedForMuon = tracksUsedForMuon.count(track);
817 
818  if (!decorateTrack(*track, dr_lepton, isUsedForElectron, isUsedForMuon, trackJet, trackLep)) {
819  ATH_MSG_ERROR("DecoratePLIT::fillParticles - failed to decorate track");
820  return StatusCode::FAILURE;
821  }
822 
823  // fill track
824  if (m_maxLepTrackdR < 0 || dr_lepton < m_maxLepTrackdR)
825  parts.push_back(track);
826  }
827 
828  // Sort tracks by dR distance to lepton
829  auto SORT_TRACKLEP = [&lepton_p4](const xAOD::IParticle* a, const xAOD::IParticle* b) {
830  return a->p4().DeltaR(lepton_p4) < b->p4().DeltaR(lepton_p4);
831  };
832  std::sort(parts.begin(), parts.end(), SORT_TRACKLEP);
833 
834  return StatusCode::SUCCESS;
835  }
836 
838  const xAOD::TrackParticle& track,
839  float dr_lepton,
840  bool isUsedForElectron,
841  bool isUsedForMuon,
842  const xAOD::Jet* trackJet,
843  const xAOD::TrackParticle* trackLep) const
844  {
845  // define decorators
846  SG::AuxElement::Decorator<float> dec_trk_dr_lepton("dr_lepton");
847  SG::AuxElement::Decorator<char> dec_trk_electron_track("electron_track");
848  SG::AuxElement::Decorator<char> dec_trk_muon_track("muon_track");
849  SG::AuxElement::Decorator<float> dec_trk_ptfrac("ptfrac");
850  SG::AuxElement::Decorator<float> dec_trk_dr_trackjet("dr_trackjet");
851  SG::AuxElement::Decorator<float> dec_trk_dr_leptontrack("dr_leptontrack");
852 
853  // Apply values to decorators
854  dec_trk_dr_lepton(track) = dr_lepton;
855  dec_trk_electron_track(track) = static_cast<char>(isUsedForElectron);
856  dec_trk_muon_track(track) = static_cast<char>(isUsedForMuon);
857 
858  // Default values for track-related decorations
859  float ptfrac = -99;
860  float dr_trackjet = -99;
861  float dr_leptontrack = -99;
862 
863  // Update values if trackJet is present
864  if (trackJet) {
865  if (trackJet->pt() > 0.) {
866  ptfrac = track.pt() / trackJet->pt();
867  dr_trackjet = track.p4().DeltaR(trackJet->p4());
868  }
869  }
870 
871  // Update values if trackLep is present
872  if (trackLep) {
873  if (trackLep->pt() > 0.) {
874  dr_leptontrack = track.p4().DeltaR(trackLep->p4());
875  }
876  }
877 
878  // Assign updated values to decorators
879  dec_trk_ptfrac(track) = ptfrac;
880  dec_trk_dr_trackjet(track) = dr_trackjet;
881  dec_trk_dr_leptontrack(track) = dr_leptontrack;
882 
883  return StatusCode::SUCCESS;
884  }
885 }
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
Prompt::DecoratePLIT::m_num_lepton_features
int m_num_lepton_features
Definition: DecoratePLIT.h:45
Prompt::DecoratePLIT::findClosestTrackJet
const xAOD::Jet * findClosestTrackJet(const xAOD::IParticle &part, const xAOD::JetContainer &jets) const
Definition: DecoratePLIT.cxx:688
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:73
xAOD::numberOfPixelHoles
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
Definition: TrackingPrimitives.h:261
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
Prompt::DecoratePLIT::m_acc_trk_z0SinTheta
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_z0SinTheta
Definition: DecoratePLIT.h:128
Prompt
Definition: DecoratePLIT.h:28
xAOD::numberOfInnermostPixelLayerSplitHits
@ numberOfInnermostPixelLayerSplitHits
number of Pixel 0th layer barrel hits split by cluster splitting
Definition: TrackingPrimitives.h:240
yodamerge_tmp.dim
dim
Definition: yodamerge_tmp.py:239
max
#define max(a, b)
Definition: cfImp.cxx:41
xAOD::numberOfSCTSharedHits
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
Definition: TrackingPrimitives.h:272
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
FlavorTagDiscriminants::Inputs
std::pair< std::vector< float >, std::vector< int64_t > > Inputs
Definition: FlavorTagDiscriminants/FlavorTagDiscriminants/OnnxUtil.h:28
Prompt::DecoratePLIT::m_acc_trk_ptfrac
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_ptfrac
Definition: DecoratePLIT.h:124
Prompt::DecoratePLIT::m_onnxUtil
std::shared_ptr< const FlavorTagDiscriminants::OnnxUtil > m_onnxUtil
Definition: DecoratePLIT.h:42
ConstDataVector.h
DataVector adapter that acts like it holds const pointers.
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
xAOD::CaloCluster_v1::calE
flt_t calE() const
Geet Energy in signal state CALIBRATED.
Prompt::DecoratePLIT::DecoratePLIT
DecoratePLIT(const std::string &name, ISvcLocator *pSvcLocator)
Definition: DecoratePLIT.cxx:15
Prompt::DecoratePLIT::m_caloclustersKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_caloclustersKey
Definition: DecoratePLIT.h:112
Prompt::DecoratePLIT::initialize
virtual StatusCode initialize() override
Definition: DecoratePLIT.cxx:19
Prompt::DecoratePLIT::m_electronsKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronsKey
Definition: DecoratePLIT.h:96
xAOD::TrackParticle_v1::z0
float z0() const
Returns the parameter.
ElectronxAODHelpers.h
Prompt::DecoratePLIT::m_configFileVersion_endcap
Gaudi::Property< std::string > m_configFileVersion_endcap
Definition: DecoratePLIT.h:84
ParticleTest.tp
tp
Definition: ParticleTest.py:25
AthCommonMsg< Gaudi::Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
xAOD::JetConstituentVector::size
size_t size() const
number of constituents
Definition: JetConstituentVector.cxx:102
Prompt::DecoratePLIT::execute
virtual StatusCode execute(const EventContext &) const override
Definition: DecoratePLIT.cxx:104
xAOD::numberOfPixelHits
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
Definition: TrackingPrimitives.h:259
xAOD::EgammaHelpers::getTrackParticles
std::set< const xAOD::TrackParticle * > getTrackParticles(const xAOD::Egamma *eg, bool useBremAssoc=true, bool allParticles=true)
Return a list of all or only the best TrackParticle associated to the object.
Definition: EgammaxAODHelpers.cxx:120
xAOD::numberOfTRTHits
@ numberOfTRTHits
number of TRT hits [unit8_t].
Definition: TrackingPrimitives.h:275
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
str::z0SinThetaUncertainty
const std::string z0SinThetaUncertainty
Definition: BTagTrackIpAccessor.cxx:13
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
Prompt::DecoratePLIT::m_dec_mu_plit_output
SG::WriteDecorHandleKeyArray< xAOD::MuonContainer > m_dec_mu_plit_output
Definition: DecoratePLIT.h:135
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
xAOD::Jet_v1::getConstituents
JetConstituentVector getConstituents() const
Return a vector of consituents. The object behaves like vector<const IParticle*>. See JetConstituentV...
Definition: Jet_v1.cxx:147
Prompt::DecoratePLIT::m_acc_trk_z0SinThetaUncertainty
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_z0SinThetaUncertainty
Definition: DecoratePLIT.h:130
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
Phi_mpi_pi
__HOSTDEV__ double Phi_mpi_pi(double)
Definition: GeoRegion.cxx:7
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
xAOD::TrackParticle_v1::d0
float d0() const
Returns the parameter.
Prompt::DecoratePLIT::m_acc_trk_muon_track
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_muon_track
Definition: DecoratePLIT.h:131
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
IDTPM::z0SinTheta
float z0SinTheta(const U &p)
Definition: TrackParametersHelper.h:73
Prompt::DecoratePLIT::initializeAccessors
StatusCode initializeAccessors()
Definition: DecoratePLIT.cxx:142
xAOD::TrackParticle_v1::p4
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
Definition: TrackParticle_v1.cxx:129
Prompt::DecoratePLIT::m_acc_mu_topoetcone30
SG::ReadDecorHandleKey< xAOD::MuonContainer > m_acc_mu_topoetcone30
Definition: DecoratePLIT.h:119
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
xAOD::numberOfPixelSharedHits
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
Definition: TrackingPrimitives.h:262
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::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
D3PDSizeSummary.ff
ff
Definition: D3PDSizeSummary.py:305
Prompt::DecoratePLIT::m_acc_el_ptvarcone30
SG::ReadDecorHandleKey< xAOD::ElectronContainer > m_acc_el_ptvarcone30
Definition: DecoratePLIT.h:121
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
angle
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
Definition: TRTDetectorFactory_Full.cxx:73
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
Prompt::DecoratePLIT::m_acc_el_topoetcone30
SG::ReadDecorHandleKey< xAOD::ElectronContainer > m_acc_el_topoetcone30
Definition: DecoratePLIT.h:122
Prompt::DecoratePLIT::m_maxLepTrackdR
Gaudi::Property< float > m_maxLepTrackdR
Definition: DecoratePLIT.h:88
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
Prompt::DecoratePLIT::passed_r22tracking_cuts
bool passed_r22tracking_cuts(const xAOD::TrackParticle &tp, const EventContext &ctx) const
Definition: DecoratePLIT.cxx:703
Prompt::DecoratePLIT::m_dec_el_plit_output
SG::WriteDecorHandleKeyArray< xAOD::ElectronContainer > m_dec_el_plit_output
Definition: DecoratePLIT.h:134
Prompt::DecoratePLIT::m_maxLepTrackJetdR
Gaudi::Property< float > m_maxLepTrackJetdR
Definition: DecoratePLIT.h:86
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Prompt::DecoratePLIT::m_configFileVersion
Gaudi::Property< std::string > m_configFileVersion
Definition: DecoratePLIT.h:83
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
xAOD::numberOfPixelSplitHits
@ numberOfPixelSplitHits
number of Pixel all-layer hits split by cluster splitting [unit8_t].
Definition: TrackingPrimitives.h:263
xAOD::numberOfSCTHoles
@ numberOfSCTHoles
number of SCT holes [unit8_t].
Definition: TrackingPrimitives.h:270
Prompt::FourMom_t
TLorentzVector FourMom_t
Definition: DecoratePLIT.h:31
Prompt::DecoratePLIT::m_tracksKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_tracksKey
Definition: DecoratePLIT.h:108
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
SCT
Definition: SCT_ChipUtils.h:14
Prompt::DecoratePLIT::m_acc_trk_dr_trackjet
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_dr_trackjet
Definition: DecoratePLIT.h:125
Trk::Combined
@ Combined
Definition: TrackSummaryTool.h:32
Prompt::DecoratePLIT::m_acc_trk_dr_lepton
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_dr_lepton
Definition: DecoratePLIT.h:126
Prompt::DecoratePLIT::m_onnxUtil_endcap
std::shared_ptr< const FlavorTagDiscriminants::OnnxUtil > m_onnxUtil_endcap
Definition: DecoratePLIT.h:43
Prompt::DecoratePLIT::m_TaggerName
Gaudi::Property< std::string > m_TaggerName
Definition: DecoratePLIT.h:85
xAOD::numberOfNextToInnermostPixelLayerHits
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer
Definition: TrackingPrimitives.h:248
xAOD::TrackParticle_v1::definingParametersCovMatrix
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
Definition: TrackParticle_v1.cxx:246
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
charge
double charge(const T &p)
Definition: AtlasPID.h:538
xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF
const xAOD::TrackParticle * getOriginalTrackParticleFromGSF(const xAOD::TrackParticle *trkPar)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the GSF Track Particle...
Definition: ElectronxAODHelpers.cxx:22
xAOD::IParticle::p4
virtual FourMom_t p4() const =0
The full 4-momentum of the particle.
xAOD::Electron_v1
Definition: Electron_v1.h:34
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
Prompt::DecoratePLIT::m_muonsKey
SG::ReadHandleKey< xAOD::MuonContainer > m_muonsKey
Definition: DecoratePLIT.h:100
Prompt::DecoratePLIT::m_lepCalErelConeSize
Gaudi::Property< float > m_lepCalErelConeSize
Definition: DecoratePLIT.h:90
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
Prompt::DecoratePLIT::m_configPath
Gaudi::Property< std::string > m_configPath
Definition: DecoratePLIT.h:82
xAOD::Jet_v1::p4
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition: Jet_v1.cxx:71
Prompt::DecoratePLIT::m_acc_trk_d0
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_d0
Definition: DecoratePLIT.h:127
Prompt::DecoratePLIT::m_acc_trk_electron_track
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_electron_track
Definition: DecoratePLIT.h:132
a
TList * a
Definition: liststreamerinfos.cxx:10
DecoratePLIT.h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
xAOD::numberOfSCTDeadSensors
@ numberOfSCTDeadSensors
number of dead SCT sensors crossed [unit8_t].
Definition: TrackingPrimitives.h:273
Prompt::DecoratePLIT::m_acc_mu_ptvarcone30TTVA
SG::ReadDecorHandleKey< xAOD::MuonContainer > m_acc_mu_ptvarcone30TTVA
Definition: DecoratePLIT.h:118
Prompt::DecoratePLIT::m_num_track_features
int m_num_track_features
Definition: DecoratePLIT.h:46
ReadDecorHandle.h
Handle class for reading a decoration on an object.
xAOD::EgammaParameters::electron
@ electron
Definition: EgammaEnums.h:18
xAOD::numberOfInnermostPixelLayerSharedHits
@ numberOfInnermostPixelLayerSharedHits
number of Pixel 0th layer barrel hits shared by several tracks.
Definition: TrackingPrimitives.h:239
xAOD::numberOfSCTHits
@ numberOfSCTHits
number of hits in SCT [unit8_t].
Definition: TrackingPrimitives.h:268
doL1CaloHVCorrections.parts
parts
Definition: doL1CaloHVCorrections.py:334
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
xAOD::numberOfPixelDeadSensors
@ numberOfPixelDeadSensors
number of dead pixel sensors crossed [unit8_t].
Definition: TrackingPrimitives.h:266
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
Prompt::DecoratePLIT::m_acc_trk_d0Uncertainty
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_acc_trk_d0Uncertainty
Definition: DecoratePLIT.h:129
xAOD::Jet_v1::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition: Jet_v1.cxx:44
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
xAOD::TrackParticle_v1::theta
float theta() const
Returns the parameter, which has range 0 to .
Prompt::DecoratePLIT::decorateTrack
StatusCode decorateTrack(const xAOD::TrackParticle &track, float dr_lepton, bool isUsedForElectron, bool isUsedForMuon, const xAOD::Jet *trackJet, const xAOD::TrackParticle *trackLep) const
Definition: DecoratePLIT.cxx:837
Prompt::DecoratePLIT::predictMuon
StatusCode predictMuon(const xAOD::Muon &muon, const xAOD::JetContainer &trackjets, const xAOD::TrackParticleContainer &tracks, std::vector< SG::WriteDecorHandle< xAOD::MuonContainer, float >> &dec_mu_plit_output, const EventContext &ctx) const
Definition: DecoratePLIT.cxx:163
InDetDD::electrons
@ electrons
Definition: InDetDD_Defs.h:17
Prompt::DecoratePLIT::predictElec
StatusCode predictElec(const xAOD::Electron &electron, const xAOD::JetContainer &trackjets, const xAOD::TrackParticleContainer &tracks, const xAOD::CaloClusterContainer &caloclusters, std::vector< SG::WriteDecorHandle< xAOD::ElectronContainer, float >> &dec_el_plit_output, const EventContext &ctx) const
Definition: DecoratePLIT.cxx:397
xAOD::numberOfInnermostPixelLayerHits
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
Definition: TrackingPrimitives.h:237
python.handimod.cc
int cc
Definition: handimod.py:523
Prompt::DecoratePLIT::m_leptonsName
Gaudi::Property< std::string > m_leptonsName
Definition: DecoratePLIT.h:78
SCT
@ SCT
Definition: RegSelEnums.h:25
Prompt::DecoratePLIT::m_trackjetsKey
SG::ReadHandleKey< xAOD::JetContainer > m_trackjetsKey
Definition: DecoratePLIT.h:104
str::d0Uncertainty
const std::string d0Uncertainty
Definition: BTagTrackIpAccessor.cxx:12
Prompt::DecoratePLIT::fillParticles
StatusCode fillParticles(std::vector< const xAOD::IParticle * > &parts, const xAOD::IParticle &lepton, const xAOD::TrackParticle *trackLep, const xAOD::Jet *trackJet, const xAOD::TrackParticleContainer &trackContainer, const EventContext &ctx) const
Definition: DecoratePLIT.cxx:783