ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
EMConversionBuilder Class Referencefinal

#include <EMConversionBuilder.h>

Inheritance diagram for EMConversionBuilder:
Collaboration diagram for EMConversionBuilder:

Public Member Functions

 EMConversionBuilder (const std::string &type, const std::string &name, const IInterface *parent)
 Default constructor. More...
 
virtual ~EMConversionBuilder ()=default
 Destructor. More...
 
StatusCode initialize () override final
 initialize method More...
 
virtual StatusCode executeRec (const EventContext &ctx, egammaRec *egRec) const override final
 execute method More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 AlgTool interface methods. More...
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

StatusCode vertexExecute (const EventContext &ctx, egammaRec *egRec, const xAOD::VertexContainer *conversions) const
 actual implementation method More...
 
bool passPtAndEoverP (const EventContext &ctx, const xAOD::Vertex &, const xAOD::CaloCluster &) const
 Return true if vertex and cluster pass Pt and E/p cuts. More...
 
float getMaxTRTTubeHitFraction (const xAOD::Vertex &vertex) const
 Return the maximum fraction of TRT tube hits among the tracks. More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

SG::ReadHandleKey< xAOD::VertexContainerm_conversionContainerKey
 Name of conversion container. More...
 
ToolHandle< IEMExtrapolationToolsm_extrapolationTool
 EMExtrapolationTools. More...
 
Gaudi::Property< bool > m_rejectAllTRT
 Ignore all conversion vertices that contain exclusively TRT-only tracks. More...
 
Gaudi::Property< int > m_minTRTHits
 minimum number of TRT hits for TRT-only tracks (both single and double track conversion vertices) More...
 
Gaudi::Property< float > m_minPt_singleTrack
 minimum pT for single-track conversion vertices More...
 
Gaudi::Property< float > m_minPt_singleTRT
 minimum pT for TRT-only single-track conversion vertices More...
 
Gaudi::Property< float > m_minTRTonlyTrackPt
 minimum pT for each track in TRT-only double-track conversion vertices More...
 
Gaudi::Property< float > m_minSumPt_double
 minimum sum pT for double track conversion vertices More...
 
Gaudi::Property< float > m_minSumPt_doubleTRT
 minimum sum pT for double TRT track conversion vertices More...
 
Gaudi::Property< float > m_maxEoverP_singleTrack
 maximum E/p for single track conversion vertices (E is not calibrated) More...
 
Gaudi::Property< float > m_maxEoverP_singleTrack_EtSf
 Scale maxEoverP_singleTrack by 1+sf*Et(cluster)/GeV
More...
 
Gaudi::Property< float > m_maxTRTTubeHitFraction
 "Maximum fraction of tube hits for vertices with TRT tracks
More...
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

EMConversion data object builder. This is an Algorithm class. Selects conversion vertices reconstructed by the ID software after matching them to an EM calorimeter cluster. For normal two-track conversions the original photon track parameters at the conversion vertex are reconstructed. It is then extrapolated to the calorimeter and checked whether it matches the cluster. For single-track conversions, the reconstructed electron track is extrapolated to the calorimeter. A TrackToCalo extrapolation tool that can handle both neutral and charged track parameters (using a Trk::ParametersBase interface) is used throughout. The extrapolation starts at the last track measurement. Matching is done in both eta and phi. The eta matching WAS disabled for TRT-only tracks due to lack of accurate eta prediction BEFORE 12/2011.

Author
D. Zerwas

changes: June 16, 2010 (JM) bring some stuff from PhotonRecoveryTool here Mar, 2014 (BL) xAOD migration and new logic 2020 Athena Mt migration.

Definition at line 42 of file EMConversionBuilder.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ EMConversionBuilder()

EMConversionBuilder::EMConversionBuilder ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Default constructor.

Definition at line 77 of file EMConversionBuilder.cxx.

81 {
82 
83  // declare interface
84  declareInterface<IEMConversionBuilder>(this);
85 }

◆ ~EMConversionBuilder()

virtual EMConversionBuilder::~EMConversionBuilder ( )
virtualdefault

Destructor.

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ executeRec()

StatusCode EMConversionBuilder::executeRec ( const EventContext &  ctx,
egammaRec egRec 
) const
finaloverridevirtual

execute method

Implements IEMConversionBuilder.

Definition at line 106 of file EMConversionBuilder.cxx.

107 {
108  // retrieve Conversion Container
109 
111  ctx);
112 
113  // only for serial running; remove for MT
114  ATH_CHECK(conversions.isValid());
115  // reset the vertices
116  std::vector<ElementLink<xAOD::VertexContainer>> vertices;
117  egRec->setVertices(vertices);
118  ATH_CHECK(vertexExecute(ctx, egRec, conversions.cptr()));
119  return StatusCode::SUCCESS;
120 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ getMaxTRTTubeHitFraction()

float EMConversionBuilder::getMaxTRTTubeHitFraction ( const xAOD::Vertex vertex) const
private

Return the maximum fraction of TRT tube hits among the tracks.

Definition at line 217 of file EMConversionBuilder.cxx.

218 {
219  auto getTRTTubeHitFraction = [](const xAOD::TrackParticle* trk) {
220  uint8_t nTRT;
221  uint8_t nTRTTube;
222  if (!trk || !trk->summaryValue(nTRT, xAOD::numberOfTRTHits) || !nTRT)
223  return 0.;
224  return trk->summaryValue(nTRTTube, xAOD::numberOfTRTTubeHits)
225  ? 1. * nTRTTube / nTRT
226  : 0.;
227  };
228 
229  float maxTubeHitFraction = 0.;
230  for (unsigned int i = 0; i < vertex.nTrackParticles(); ++i) {
231  if (!vertex.trackParticle(i)) {
232  ATH_MSG_WARNING("NULL pointer to track particle in conversion vertex");
233  } else {
234  float tubeHitFraction = getTRTTubeHitFraction(vertex.trackParticle(i));
235  if (tubeHitFraction > maxTubeHitFraction) {
236  maxTubeHitFraction = tubeHitFraction;
237  }
238  }
239  }
240  return maxTubeHitFraction;
241 }

◆ initialize()

StatusCode EMConversionBuilder::initialize ( )
finaloverridevirtual

initialize method

Implements IEMConversionBuilder.

Definition at line 88 of file EMConversionBuilder.cxx.

89 {
90 
91  ATH_MSG_DEBUG("Initializing EMConversionBuilder");
92 
93  ATH_CHECK(m_conversionContainerKey.initialize());
94 
95  // the extrapolation tool
96  if (m_extrapolationTool.retrieve().isFailure()) {
97  ATH_MSG_ERROR("Cannot retrieve extrapolationTool " << m_extrapolationTool);
98  return StatusCode::FAILURE;
99  }
100  ATH_MSG_DEBUG("Retrieved extrapolationTool " << m_extrapolationTool);
101 
102  return StatusCode::SUCCESS;
103 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & IEMConversionBuilder::interfaceID ( )
inlinestaticinherited

AlgTool interface methods.

Definition at line 48 of file IEMConversionBuilder.h.

49 {
50  return IID_IEMConversionBuilder;
51 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ passPtAndEoverP()

bool EMConversionBuilder::passPtAndEoverP ( const EventContext &  ctx,
const xAOD::Vertex vertex,
const xAOD::CaloCluster cluster 
) const
private

Return true if vertex and cluster pass Pt and E/p cuts.

Definition at line 179 of file EMConversionBuilder.cxx.

182 {
184  m_extrapolationTool->getMomentumAtVertex(ctx, vertex);
185  float pt = momentum.perp();
186  float EoverP = cluster.e() / momentum.mag();
187 
189  bool isSingle = (convType == singleTRT || convType == singleSi);
190  bool isTRT =
191  (convType == singleTRT || convType == xAOD::EgammaParameters::doubleTRT);
192  float EoverPcut = m_maxEoverP_singleTrack *
193  (1 + m_maxEoverP_singleTrack_EtSf * cluster.et() * 1e-3);
194 
195  // Check TRT tube hit fraction
196  float tubeHitFraction = getMaxTRTTubeHitFraction(vertex);
197  if (isTRT && tubeHitFraction > m_maxTRTTubeHitFraction) {
198  ATH_MSG_DEBUG("Conversion failed cut on TRT tube hit fraction: "
199  << tubeHitFraction << " vs. " << m_maxTRTTubeHitFraction);
200  return false;
201  }
202 
203  bool reject =
204  ((isTRT && m_rejectAllTRT) || (isSingle && pt < m_minPt_singleTrack) ||
205  (!isSingle && pt < m_minSumPt_double) ||
206  (isSingle && EoverP > EoverPcut) ||
207  (convType == singleTRT && pt < m_minPt_singleTRT) ||
208  (convType == doubleTRT && pt < m_minSumPt_doubleTRT));
209 
210  if (reject) {
211  ATH_MSG_DEBUG("Conversion failed pt or E/p cuts");
212  }
213  return !reject;
214 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

◆ vertexExecute()

StatusCode EMConversionBuilder::vertexExecute ( const EventContext &  ctx,
egammaRec egRec,
const xAOD::VertexContainer conversions 
) const
private

actual implementation method

Definition at line 123 of file EMConversionBuilder.cxx.

127 {
128 
129  if (!egRec || !conversions) {
131  "trackExecute: NULL pointer to egammaRec or VertexContainer");
132  return StatusCode::SUCCESS;
133  }
134 
135  static const SG::AuxElement::Accessor<float> accetaAtCalo("etaAtCalo");
136  static const SG::AuxElement::Accessor<float> accphiAtCalo("phiAtCalo");
137 
138  float etaAtCalo(0);
139  float phiAtCalo(0);
140  for (unsigned int iVtx = 0; iVtx < conversions->size(); ++iVtx) {
141 
142  const xAOD::Vertex* vertex = conversions->at(iVtx);
143  // Check if vertex was already decorated with etaAtCalo, phiAtCalo
144  if (accetaAtCalo.isAvailable(*vertex) &&
145  accphiAtCalo.isAvailable(*vertex)) {
146  etaAtCalo = accetaAtCalo(*vertex);
147  phiAtCalo = accphiAtCalo(*vertex);
148  }
149  // check extrapolation, skip vertex in case of failure
150  else if (!m_extrapolationTool->getEtaPhiAtCalo(
151  ctx, vertex, &etaAtCalo, &phiAtCalo)) {
152  continue;
153  }
154  const xAOD::CaloCluster* cluster = egRec->caloCluster();
155  if (!passPtAndEoverP(ctx, *vertex, *cluster)) {
156  continue;
157  }
158  if (!m_extrapolationTool->matchesAtCalo(
159  cluster, vertex, etaAtCalo, phiAtCalo)) {
160  continue;
161  }
162  const ElementLink<xAOD::VertexContainer> vertexLink(*conversions, iVtx, ctx);
163 
164  // If this is the best (or the first) vertex, push front and keep deltaEta,
165  // deltaPhi
166  if (!egRec->getNumberOfVertices() ||
167  ConvVxSorter(*vertex, *egRec->vertex())) {
168  egRec->pushFrontVertex(vertexLink);
169  egRec->setDeltaEtaVtx(cluster->etaBE(2) - etaAtCalo);
170  egRec->setDeltaPhiVtx(P4Helpers::deltaPhi(cluster->phiBE(2), phiAtCalo));
171  } else { // Not the best vertex, push back
172  egRec->pushBackVertex(vertexLink);
173  }
174  }
175  return StatusCode::SUCCESS;
176 }

Member Data Documentation

◆ m_conversionContainerKey

SG::ReadHandleKey<xAOD::VertexContainer> EMConversionBuilder::m_conversionContainerKey
private
Initial value:
{
this,
"ConversionContainerName",
"PhotonConversionVertices",
"Name of the input conversion container"
}

Name of conversion container.

Definition at line 78 of file EMConversionBuilder.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extrapolationTool

ToolHandle<IEMExtrapolationTools> EMConversionBuilder::m_extrapolationTool
private
Initial value:
{
this,
"ExtrapolationTool",
"EMExtrapolationTools",
"Handle of the extrapolation tool"
}

EMExtrapolationTools.

Definition at line 86 of file EMConversionBuilder.h.

◆ m_maxEoverP_singleTrack

Gaudi::Property<float> EMConversionBuilder::m_maxEoverP_singleTrack
private
Initial value:
{
this,
"maxEoverP_singleTrack",
10.,
"Maximum E/p for single track conversion vertices"
}

maximum E/p for single track conversion vertices (E is not calibrated)

Definition at line 155 of file EMConversionBuilder.h.

◆ m_maxEoverP_singleTrack_EtSf

Gaudi::Property<float> EMConversionBuilder::m_maxEoverP_singleTrack_EtSf
private
Initial value:
{
this,
"maxEoverP_singleTrack_EtSf",
0.01,
"Scale maxEoverP_singleTrack by ( 1+sf*Et(cluster)/GeV )"
}

Scale maxEoverP_singleTrack by 1+sf*Et(cluster)/GeV

Definition at line 163 of file EMConversionBuilder.h.

◆ m_maxTRTTubeHitFraction

Gaudi::Property<float> EMConversionBuilder::m_maxTRTTubeHitFraction
private
Initial value:
{
this,
"maxTRTTubeHitFraction",
999.,
"Maximum fraction of tube hits for vertices with TRT tracks"
}

"Maximum fraction of tube hits for vertices with TRT tracks

Definition at line 171 of file EMConversionBuilder.h.

◆ m_minPt_singleTrack

Gaudi::Property<float> EMConversionBuilder::m_minPt_singleTrack
private
Initial value:
{
this,
"minPt_singleTrack",
"minimum pT for single-track conversion vertices"
}

minimum pT for single-track conversion vertices

Definition at line 113 of file EMConversionBuilder.h.

◆ m_minPt_singleTRT

Gaudi::Property<float> EMConversionBuilder::m_minPt_singleTRT
private
Initial value:
{
this,
"minPt_singleTRT",
"minimum pT for TRT-only single-track conversion vertices"
}

minimum pT for TRT-only single-track conversion vertices

Definition at line 121 of file EMConversionBuilder.h.

◆ m_minSumPt_double

Gaudi::Property<float> EMConversionBuilder::m_minSumPt_double
private
Initial value:
{
this,
"minSumPt_double",
"minimum sum pT for double track conversion vertices"
}

minimum sum pT for double track conversion vertices

Definition at line 138 of file EMConversionBuilder.h.

◆ m_minSumPt_doubleTRT

Gaudi::Property<float> EMConversionBuilder::m_minSumPt_doubleTRT
private
Initial value:
{
this,
"minSumPt_doubleTRT",
"minimum sum pT for double TRT track conversion vertices"
}

minimum sum pT for double TRT track conversion vertices

Definition at line 146 of file EMConversionBuilder.h.

◆ m_minTRTHits

Gaudi::Property<int> EMConversionBuilder::m_minTRTHits
private
Initial value:
{
this,
"minTRTHits",
0,
"minimum number of TRT hits for TRT-only tracks (both single and double "
"track conversion vertices)"
}

minimum number of TRT hits for TRT-only tracks (both single and double track conversion vertices)

Definition at line 104 of file EMConversionBuilder.h.

◆ m_minTRTonlyTrackPt

Gaudi::Property<float> EMConversionBuilder::m_minTRTonlyTrackPt
private
Initial value:
{
this,
"minTRTonlyTrackPt",
"minimum pT for each track in TRT-only double-track conversion vertices"
}

minimum pT for each track in TRT-only double-track conversion vertices

Definition at line 130 of file EMConversionBuilder.h.

◆ m_rejectAllTRT

Gaudi::Property<bool> EMConversionBuilder::m_rejectAllTRT
private
Initial value:
{
this,
"RejectAllTRTConversions",
false,
"Ignore all conversion vertices containing exclusively TRT-only tracks"
}

Ignore all conversion vertices that contain exclusively TRT-only tracks.

Definition at line 95 of file EMConversionBuilder.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
egammaRec::pushFrontVertex
void pushFrontVertex(const ElementLink< xAOD::VertexContainer > &vertexElementLink)
Push front another vertex.
Definition: egammaRec.cxx:82
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
egammaRec::getNumberOfVertices
size_t getNumberOfVertices() const
Return the number xAOD::Vertex/vertices that match the photon candidate.
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
EMConversionBuilder::m_maxTRTTubeHitFraction
Gaudi::Property< float > m_maxTRTTubeHitFraction
"Maximum fraction of tube hits for vertices with TRT tracks
Definition: EMConversionBuilder.h:171
EMConversionBuilder::m_minSumPt_double
Gaudi::Property< float > m_minSumPt_double
minimum sum pT for double track conversion vertices
Definition: EMConversionBuilder.h:138
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
EMConversionBuilder::m_minSumPt_doubleTRT
Gaudi::Property< float > m_minSumPt_doubleTRT
minimum sum pT for double TRT track conversion vertices
Definition: EMConversionBuilder.h:146
EMConversionBuilder::m_maxEoverP_singleTrack
Gaudi::Property< float > m_maxEoverP_singleTrack
maximum E/p for single track conversion vertices (E is not calibrated)
Definition: EMConversionBuilder.h:155
egammaRec::caloCluster
const xAOD::CaloCluster * caloCluster(size_t index=0) const
Pointer to the xAOD::CaloCluster/s that define the electron candidate.
Definition: egammaRec.cxx:8
test_pyathena.pt
pt
Definition: test_pyathena.py:11
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
xAOD::CaloCluster_v1::et
double et() const
Definition: CaloCluster_v1.h:856
EMConversionBuilder::getMaxTRTTubeHitFraction
float getMaxTRTTubeHitFraction(const xAOD::Vertex &vertex) const
Return the maximum fraction of TRT tube hits among the tracks.
Definition: EMConversionBuilder.cxx:217
EMConversionBuilder::m_extrapolationTool
ToolHandle< IEMExtrapolationTools > m_extrapolationTool
EMExtrapolationTools.
Definition: EMConversionBuilder.h:86
xAOD::numberOfTRTHits
@ numberOfTRTHits
number of TRT hits [unit8_t].
Definition: TrackingPrimitives.h:275
xAOD::CaloCluster_v1::phiBE
float phiBE(const unsigned layer) const
Get the phi in one layer of the EM Calo.
Definition: CaloCluster_v1.cxx:680
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
xAOD::numberOfTRTTubeHits
@ numberOfTRTTubeHits
number of TRT tube hits [unit8_t].
Definition: TrackingPrimitives.h:283
EMConversionBuilder::m_conversionContainerKey
SG::ReadHandleKey< xAOD::VertexContainer > m_conversionContainerKey
Name of conversion container.
Definition: EMConversionBuilder.h:78
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
EMConversionBuilder::passPtAndEoverP
bool passPtAndEoverP(const EventContext &ctx, const xAOD::Vertex &, const xAOD::CaloCluster &) const
Return true if vertex and cluster pass Pt and E/p cuts.
Definition: EMConversionBuilder.cxx:179
xAOD::CaloCluster_v1::etaBE
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
Definition: CaloCluster_v1.cxx:644
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
P4Helpers::deltaPhi
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
Definition: P4Helpers.h:34
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
egammaRec::setDeltaPhiVtx
void setDeltaPhiVtx(float value)
set deltaPhiVtx
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
lumiFormat.i
int i
Definition: lumiFormat.py:85
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
EMConversionBuilder::vertexExecute
StatusCode vertexExecute(const EventContext &ctx, egammaRec *egRec, const xAOD::VertexContainer *conversions) const
actual implementation method
Definition: EMConversionBuilder.cxx:123
egammaRec::pushBackVertex
void pushBackVertex(const ElementLink< xAOD::VertexContainer > &vertexElementLink)
Push back another vertex.
Definition: egammaRec.cxx:76
test_pyathena.parent
parent
Definition: test_pyathena.py:15
EMConversionBuilder::m_minPt_singleTrack
Gaudi::Property< float > m_minPt_singleTrack
minimum pT for single-track conversion vertices
Definition: EMConversionBuilder.h:113
egammaRec::setVertices
void setVertices(const std::vector< ElementLink< xAOD::VertexContainer >> &links)
set Pointer to the xAOD::vertex/vertices that match the photon candidate
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
xAOD::EgammaParameters::singleTRT
@ singleTRT
one track only, no Si hits (TRT only)
Definition: EgammaEnums.h:276
egammaRec::setDeltaEtaVtx
void setDeltaEtaVtx(float value)
set deltaEtaVtx
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
xAOD::EgammaParameters::singleSi
@ singleSi
one track only, with Si hits
Definition: EgammaEnums.h:273
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
a
TList * a
Definition: liststreamerinfos.cxx:10
h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
EMConversionBuilder::m_minPt_singleTRT
Gaudi::Property< float > m_minPt_singleTRT
minimum pT for TRT-only single-track conversion vertices
Definition: EMConversionBuilder.h:121
egammaRec::vertex
const xAOD::Vertex * vertex(size_t index=0) const
Pointer to the xAOD::Vertex/es that match the photon candidate.
Definition: egammaRec.cxx:54
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
EMConversionBuilder::m_maxEoverP_singleTrack_EtSf
Gaudi::Property< float > m_maxEoverP_singleTrack_EtSf
Scale maxEoverP_singleTrack by 1+sf*Et(cluster)/GeV
Definition: EMConversionBuilder.h:163
xAOD::EgammaHelpers::conversionType
xAOD::EgammaParameters::ConversionType conversionType(const xAOD::Photon *ph)
return the photon conversion type (see EgammaEnums)
Definition: PhotonxAODHelpers.cxx:26
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
xAOD::EgammaParameters::doubleTRT
@ doubleTRT
two tracks, none with Si hits (TRT only)
Definition: EgammaEnums.h:282
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
AllowedVariables::EoverP
@ EoverP
Definition: AsgElectronSelectorTool.cxx:56
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
EMConversionBuilder::m_rejectAllTRT
Gaudi::Property< bool > m_rejectAllTRT
Ignore all conversion vertices that contain exclusively TRT-only tracks.
Definition: EMConversionBuilder.h:95
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
xAOD::CaloCluster_v1::e
virtual double e() const
The total energy of the particle.
Definition: CaloCluster_v1.cxx:265
fitman.k
k
Definition: fitman.py:528