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  continue;
527  }
528 
529  float ptfrac = acc_ptfrac(*track);
530  track_feat.push_back(ptfrac);
531 
532  float dr_trackjet = acc_dr_trackjet(*track);
533  track_feat.push_back(dr_trackjet);
534 
535  float dr_lepton = acc_dr_lepton(*track);
536  track_feat.push_back(dr_lepton);
537 
538  float qoverp = track->qOverP();
539  track_feat.push_back(qoverp);
540 
541  float d0 = acc_d0(*track);
542  track_feat.push_back(d0);
543 
544  float z0SinTheta = acc_z0SinTheta(*track);
545  track_feat.push_back(z0SinTheta);
546 
547  float d0Uncertainty = acc_d0Uncertainty(*track);
548  float z0SinThetaUncertainty = acc_z0SinThetaUncertainty(*track);
549 
550  float d0_significance = -99;
551  if (std::abs(d0Uncertainty) > 0) d0_significance = d0 / d0Uncertainty;
552  track_feat.push_back(d0_significance);
553 
554  float z0SinTheta_significance = -99;
555  if (std::abs(z0SinThetaUncertainty) > 0) z0SinTheta_significance = z0SinTheta / z0SinThetaUncertainty;
556  track_feat.push_back(z0SinTheta_significance);
557 
558  uint8_t pix_innermosthits = 0;
559  if(!track->summaryValue(pix_innermosthits,xAOD::numberOfInnermostPixelLayerHits)){
560  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerHits");
561  return StatusCode::FAILURE;
562  }
563  track_feat.push_back(pix_innermosthits);
564 
565  uint8_t pix_nextinnermosthits = 0;
566  if(!track->summaryValue(pix_nextinnermosthits,xAOD::numberOfNextToInnermostPixelLayerHits)){
567  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfNextToInnermostPixelLayerHits");
568  return StatusCode::FAILURE;
569  }
570  track_feat.push_back(pix_nextinnermosthits);
571 
572  uint8_t pix_innermostsharedhits = 0;
573  if(!track->summaryValue(pix_innermostsharedhits,xAOD::numberOfInnermostPixelLayerSharedHits)){
574  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerSharedHits");
575  return StatusCode::FAILURE;
576  }
577  track_feat.push_back(pix_innermostsharedhits);
578 
579  uint8_t pix_innermostsplithits = 0;
580  if(!track->summaryValue(pix_innermostsplithits,xAOD::numberOfInnermostPixelLayerSplitHits)){
581  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfInnermostPixelLayerSplitHits");
582  return StatusCode::FAILURE;
583  }
584  track_feat.push_back(pix_innermostsplithits);
585 
586  uint8_t pix_hits = 0;
587  if(!track->summaryValue(pix_hits,xAOD::numberOfPixelHits)){
588  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelHits");
589  return StatusCode::FAILURE;
590  }
591  track_feat.push_back(pix_hits);
592 
593  uint8_t pix_shared = 0;
594  if(!track->summaryValue(pix_shared,xAOD::numberOfPixelSharedHits)){
595  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelSharedHits");
596  return StatusCode::FAILURE;
597  }
598  track_feat.push_back(pix_shared);
599 
600  uint8_t pix_split = 0;
601  if(!track->summaryValue(pix_split,xAOD::numberOfPixelSplitHits)){
602  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfPixelSplitHits");
603  return StatusCode::FAILURE;
604  }
605  track_feat.push_back(pix_split);
606 
607  uint8_t sct_hits = 0;
608  if(!track->summaryValue(sct_hits,xAOD::numberOfSCTHits)){
609  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfSCTHits");
610  return StatusCode::FAILURE;
611  }
612  track_feat.push_back(sct_hits);
613 
614  uint8_t sct_shared = 0;
615  if(!track->summaryValue(sct_shared,xAOD::numberOfSCTSharedHits)){
616  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfSCTSharedHits");
617  return StatusCode::FAILURE;
618  }
619  track_feat.push_back(sct_shared);
620 
621  uint8_t trt_hits = 0;
622  if(!track->summaryValue(trt_hits,xAOD::numberOfTRTHits)){
623  ATH_MSG_ERROR("DecoratePLIT::execute - failed to retrieve xAOD::numberOfTRTHits");
624  return StatusCode::FAILURE;
625  }
626  track_feat.push_back(trt_hits);
627 
628  char electron_track = acc_electron_track(*track);
629  track_feat.push_back(electron_track);
630  }
631 
632  // prepare track features for inference
633  int num_cnsts = parts.size();
634  std::vector<int64_t> track_feat_dim = {num_cnsts, m_num_track_features};
635 
636  FlavorTagDiscriminants::Inputs track_info (track_feat, track_feat_dim);
637  gnn_input.insert({"track_features", track_info});
638 
639  if (msgLvl(MSG::VERBOSE)) {
640  ATH_MSG_VERBOSE("gnn_input size = " << gnn_input.size());
641  for (auto& inp : gnn_input){
642  ATH_MSG_VERBOSE(" " + inp.first + " dim = ");
643  for (auto & dim: inp.second.second) {
645  }
646  ATH_MSG_VERBOSE(" " + inp.first + " content = ");
647  for (auto & con: inp.second.first) {
648  ATH_MSG_VERBOSE(" " + std::to_string(con));
649  }
650  }
651  }
652 
653  // run inference
654  // -------------
655  // use different model for endcap electrons
656  auto [out_f, out_vc, out_vf] = (std::abs(elec_eta) < 1.37) ? m_onnxUtil->runInference(gnn_input) : m_onnxUtil_endcap->runInference(gnn_input);
657  if (msgLvl(MSG::VERBOSE)) {
658  ATH_MSG_VERBOSE("runInference done.");
659 
660  ATH_MSG_VERBOSE("Output Float(s):");
661  for (auto& singlefloat : out_f){
662  ATH_MSG_VERBOSE(singlefloat.first + " = " << singlefloat.second);
663  }
664  ATH_MSG_VERBOSE("Output vector char(s):");
665  for (auto& vecchar : out_vc){
666  ATH_MSG_VERBOSE(vecchar.first + " = ");
667  for (auto& cc : vecchar.second){
669  }
670  }
671  ATH_MSG_VERBOSE("Output vector float(s):");
672  for (auto& vecfloat : out_vf){
673  ATH_MSG_VERBOSE(vecfloat.first + " = ");
674  for (auto& ff : vecfloat.second){
676  }
677  }
678  }
679  // filling the tagger scores
680  auto it_dec_el_plit_output = dec_el_plit_output.begin();
681  for (auto& singlefloat : out_f){
682  (*it_dec_el_plit_output)(electron) = singlefloat.second;
683  ++it_dec_el_plit_output;
684  }
685 
686  return StatusCode::SUCCESS;
687  }
688 
690  const xAOD::Jet* closestJet = nullptr;
691  float minDistance = std::numeric_limits<float>::max();
692 
693  for (const xAOD::Jet* jet : jets) {
694  float distance = part.p4().DeltaR(jet->p4());
695  if (distance < minDistance) {
696  minDistance = distance;
697  closestJet = jet;
698  }
699  }
700 
701  return (minDistance < m_maxLepTrackJetdR) ? closestJet : nullptr;
702  }
703 
704  bool DecoratePLIT::passed_r22tracking_cuts(const xAOD::TrackParticle& tp, const EventContext& ctx) const
705  {
706  // r22 default track selection for flavour tagging GN2 algorithm
707  constexpr float pt_minimum = 500; // MeV
708  constexpr float abs_eta_maximum = 2.5;
709  constexpr float d0_maximum = 3.5;
710  constexpr float z0_maximum= 5.0;
711  constexpr unsigned char si_hits_minimum = 8;
712  constexpr unsigned char si_shared_maximum = 1;
713  constexpr unsigned char si_holes_maximum = 2;
714  constexpr unsigned char pix_holes_maximum = 1;
715 
716  // accessors
719 
720  // get hit pixel info
721  uint8_t pix_shared = 0;
722  if(!tp.summaryValue(pix_shared,xAOD::numberOfPixelSharedHits)){
723  ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfPixelSharedHits");
724  return false;
725  }
726  uint8_t sct_shared = 0;
727  if(!tp.summaryValue(sct_shared,xAOD::numberOfSCTSharedHits)){
728  ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfSCTSharedHits");
729  return false;
730  }
731  uint8_t pix_hits = 0;
732  if(!tp.summaryValue(pix_hits,xAOD::numberOfPixelHits)){
733  ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfPixelHits");
734  return false;
735  }
736  uint8_t sct_hits = 0;
737  if(!tp.summaryValue(sct_hits,xAOD::numberOfSCTHits)){
738  ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfSCTHits");
739  return false;
740  }
741  uint8_t pix_dead = 0;
742  if(!tp.summaryValue(pix_dead,xAOD::numberOfPixelDeadSensors)){
743  ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfPixelDeadSensors");
744  return false;
745  }
746  uint8_t sct_dead = 0;
747  if(!tp.summaryValue(sct_dead,xAOD::numberOfSCTDeadSensors)){
748  ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfSCTDeadSensors");
749  return false;
750  }
751  uint8_t pix_holes = 0;
752  if(!tp.summaryValue(pix_holes,xAOD::numberOfPixelHoles)){
753  ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfPixelHoles");
754  return false;
755  }
756  uint8_t sct_holes = 0;
757  if(!tp.summaryValue(sct_holes,xAOD::numberOfSCTHoles)){
758  ATH_MSG_ERROR("DecoratePLIT::passed_r22tracking_cuts - failed to retrieve xAOD::numberOfSCTHoles");
759  return false;
760  }
761 
762  if (std::abs(tp.eta()) > abs_eta_maximum)
763  return false;
764  double n_module_shared = (pix_shared + sct_shared / 2);
765  if (n_module_shared > si_shared_maximum)
766  return false;
767  if (tp.pt() <= pt_minimum)
768  return false;
769  if (std::isfinite(d0_maximum) &&
770  std::abs(acc_d0(tp)) >= d0_maximum)
771  return false;
772  if (std::isfinite(z0_maximum) &&
773  std::abs(acc_z0SinTheta(tp)) >= z0_maximum)
774  return false;
775  if (pix_hits + pix_dead + sct_hits + sct_dead < si_hits_minimum)
776  return false;
777  if ((pix_holes + sct_holes) > si_holes_maximum)
778  return false;
779  if (pix_holes > pix_holes_maximum)
780  return false;
781  return true;
782  }
783 
785  std::vector<const xAOD::IParticle *> &parts,
786  const xAOD::IParticle &lepton,
787  const xAOD::TrackParticle *trackLep,
788  const xAOD::Jet *trackJet,
789  const xAOD::TrackParticleContainer &trackContainer,
790  const EventContext& ctx) const
791  {
792  // get lepton four momentum
793  const FourMom_t lepton_p4 = lepton.p4();
794 
795  // Precompute tracks used for reconstruction
796  std::set<const xAOD::TrackParticle*> tracksUsedForElectron;
797  std::set<const xAOD::TrackParticle*> tracksUsedForMuon;
798  if (const auto* elec = dynamic_cast<const xAOD::Electron*>(&lepton)) {
799  tracksUsedForElectron = xAOD::EgammaHelpers::getTrackParticles(elec, true); // useBremAssoc = true
800  } else if (const auto* muon = dynamic_cast<const xAOD::Muon*>(&lepton)) {
801  if (muon->muonType() == xAOD::Muon::Combined && muon->inDetTrackParticleLink().isValid()) {
802  tracksUsedForMuon.insert(muon->primaryTrackParticle());
803  }
804  }
805 
806  // Loop over tracks and store them
807  for (const xAOD::TrackParticle *track: trackContainer) {
808  if (!track) {
809  ATH_MSG_ERROR("DecoratePLIT::fillParticles - null track pointer");
810  continue;
811  }
812  // check if track passed selection
813  if (!passed_r22tracking_cuts(*track, ctx)) continue;
814 
815  // decorate track
816  float dr_lepton = (lepton.p4().Pt() > 0.) ? track->p4().DeltaR(lepton.p4()) : -99;
817  bool isUsedForElectron = tracksUsedForElectron.count(track);
818  bool isUsedForMuon = tracksUsedForMuon.count(track);
819 
820  if (!decorateTrack(*track, dr_lepton, isUsedForElectron, isUsedForMuon, trackJet, trackLep)) {
821  ATH_MSG_ERROR("DecoratePLIT::fillParticles - failed to decorate track");
822  return StatusCode::FAILURE;
823  }
824 
825  // fill track
826  if (m_maxLepTrackdR < 0 || dr_lepton < m_maxLepTrackdR)
827  parts.push_back(track);
828  }
829 
830  // Sort tracks by dR distance to lepton
831  auto SORT_TRACKLEP = [&lepton_p4](const xAOD::IParticle* a, const xAOD::IParticle* b) {
832  return a->p4().DeltaR(lepton_p4) < b->p4().DeltaR(lepton_p4);
833  };
834  std::sort(parts.begin(), parts.end(), SORT_TRACKLEP);
835 
836  return StatusCode::SUCCESS;
837  }
838 
840  const xAOD::TrackParticle& track,
841  float dr_lepton,
842  bool isUsedForElectron,
843  bool isUsedForMuon,
844  const xAOD::Jet* trackJet,
845  const xAOD::TrackParticle* trackLep) const
846  {
847  // define decorators
848  SG::AuxElement::Decorator<float> dec_trk_dr_lepton("dr_lepton");
849  SG::AuxElement::Decorator<char> dec_trk_electron_track("electron_track");
850  SG::AuxElement::Decorator<char> dec_trk_muon_track("muon_track");
851  SG::AuxElement::Decorator<float> dec_trk_ptfrac("ptfrac");
852  SG::AuxElement::Decorator<float> dec_trk_dr_trackjet("dr_trackjet");
853  SG::AuxElement::Decorator<float> dec_trk_dr_leptontrack("dr_leptontrack");
854 
855  // Apply values to decorators
856  dec_trk_dr_lepton(track) = dr_lepton;
857  dec_trk_electron_track(track) = static_cast<char>(isUsedForElectron);
858  dec_trk_muon_track(track) = static_cast<char>(isUsedForMuon);
859 
860  // Default values for track-related decorations
861  float ptfrac = -99;
862  float dr_trackjet = -99;
863  float dr_leptontrack = -99;
864 
865  // Update values if trackJet is present
866  if (trackJet) {
867  if (trackJet->pt() > 0.) {
868  ptfrac = track.pt() / trackJet->pt();
869  dr_trackjet = track.p4().DeltaR(trackJet->p4());
870  }
871  }
872 
873  // Update values if trackLep is present
874  if (trackLep) {
875  if (trackLep->pt() > 0.) {
876  dr_leptontrack = track.p4().DeltaR(trackLep->p4());
877  }
878  }
879 
880  // Assign updated values to decorators
881  dec_trk_ptfrac(track) = ptfrac;
882  dec_trk_dr_trackjet(track) = dr_trackjet;
883  dec_trk_dr_leptontrack(track) = dr_leptontrack;
884 
885  return StatusCode::SUCCESS;
886  }
887 }
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:689
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
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
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
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:75
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:704
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:794
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:228
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:756
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:839
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:784