ATLAS Offline Software
EgammaDetails.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef XAODEGAMMA_EGAMMADETAILS_H
6 #define XAODEGAMMA_EGAMMADETAILS_H
7 
10 
11 namespace xAOD
12 {
13  namespace EgammaDetails
14  {
36 
38 
40  inline ConversionType conversionType(const bool hasTrk1, const bool hasTrk2, const std::uint8_t nSiHits1, const std::uint8_t nSiHits2) {
41 
42  if (!hasTrk1) {return xAOD::EgammaParameters::unconverted;}
43 
44  if (!hasTrk2)
46 
47  if (nSiHits1 && nSiHits2){
49  }
50  if (nSiHits1 || nSiHits2){
52  }
53  else{
55  }
56  }
57 
59  inline bool isConvertedPhoton (const bool excludeTRT, const float eta, const std::size_t nVertices, const ConversionType conversionType) {
60  const bool hasVertices = nVertices > 0;
61  if (excludeTRT) {
62  // special case for Run3: consider unconv if TRT Conv in the barrel
64  const bool isTRTConv = (conversionType == singleTRT) || (conversionType == doubleTRT);
65  return hasVertices && (std::abs(eta) > 0.8 || !isTRTConv);
66  }
67  return hasVertices;
68  }
69  }
70 }
71 
72 #endif
xAOD::EgammaParameters::unconverted
@ unconverted
unconverted photon
Definition: EgammaEnums.h:270
NSWL1::nVertices
int nVertices(const Polygon &p)
Definition: GeoUtils.cxx:35
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:558
ElectronxAODHelpers.h
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::EgammaDetails::isConvertedPhoton
bool isConvertedPhoton(const bool excludeTRT, const float eta, const std::size_t nVertices, const ConversionType conversionType)
is the object a converted photon
Definition: EgammaDetails.h:59
xAOD::EgammaParameters::ConversionType
ConversionType
Definition: EgammaEnums.h:268
xAOD::EgammaDetails::conversionType
ConversionType conversionType(const bool hasTrk1, const bool hasTrk2, const std::uint8_t nSiHits1, const std::uint8_t nSiHits2)
return the photon conversion type (see EgammaEnums)
Definition: EgammaDetails.h:40
xAOD::EgammaParameters::doubleSi
@ doubleSi
two tracks, both with Si hits
Definition: EgammaEnums.h:279
PhotonxAODHelpers.h
xAOD::EgammaParameters::doubleSiTRT
@ doubleSiTRT
two tracks, only one with Si hits
Definition: EgammaEnums.h:285
xAOD::EgammaParameters::singleTRT
@ singleTRT
one track only, no Si hits (TRT only)
Definition: EgammaEnums.h:276
xAOD::EgammaParameters::singleSi
@ singleSi
one track only, with Si hits
Definition: EgammaEnums.h:273
xAOD::EgammaParameters::doubleTRT
@ doubleTRT
two tracks, none with Si hits (TRT only)
Definition: EgammaEnums.h:282