 |
ATLAS Offline Software
|
Implementation for the photon vertex selection tool.
More...
#include <PhotonVertexSelectionTool.h>
|
enum | FailType {
Unkown = -99,
NoFail = 0,
NoVxCont = 1,
NoEventInfo = 2,
FailPointing = 3,
FailEgamVect = 4,
NoGdCandidate = 5,
MatchedTrack = 6
} |
| Declare the interface that the class provides. More...
|
|
enum | yyVtxType { Unknown = -1,
ConvTrack = 0,
SiConvTrack = 1,
NoSiTracks = 2
} |
|
|
| PhotonVertexSelectionTool (const std::string &name) |
|
virtual | ~PhotonVertexSelectionTool () |
|
virtual void | print () const =0 |
| Print the state of the tool. More...
|
|
virtual void | print () const |
| Print the state of the tool. 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 |
|
|
virtual StatusCode | initialize () |
| Function initialising the tool. More...
|
|
|
StatusCode | decorateInputs (const xAOD::EgammaContainer &egammas, FailType *failType=nullptr) const |
| Given a list of photons, decorate vertex container with MVA variables. More...
|
|
StatusCode | getVertex (const xAOD::EgammaContainer &egammas, const xAOD::Vertex *&vertex, bool ignoreConv=false) const |
| Given a list of photons, return the most likely vertex based on MVA likelihood. More...
|
|
std::vector< std::pair< const xAOD::Vertex *, float > > | getVertex (const xAOD::EgammaContainer &egammas, bool ignoreConv=false, bool noDecorate=false, yyVtxType *vtxCase=nullptr, FailType *failType=nullptr) const |
| Given a list of photons, return the MLPs of all vertices in the event. More...
|
|
int | getCase () const |
| Return the last case treated: More...
|
|
const xAOD::Vertex * | getPrimaryVertexFromConv (const xAOD::PhotonContainer *photons) const |
| Get possible vertex directly associated with photon conversions. More...
|
|
|
SG::WriteDecorHandleKey< xAOD::VertexContainer > | m_deltaPhiKey { this, "DeltaPhiKey", m_vertexContainer, "deltaPhi" } |
|
SG::WriteDecorHandleKey< xAOD::VertexContainer > | m_deltaZKey { this, "DeltaZKey", m_vertexContainer, "deltaZ" } |
|
SG::WriteDecorHandleKey< xAOD::VertexContainer > | m_sumPt2Key { this, "SumPt2Key", m_vertexContainer, "sumPt2" } |
|
SG::WriteDecorHandleKey< xAOD::VertexContainer > | m_sumPtKey { this, "SumPtKey", m_vertexContainer, "sumPt" } |
|
|
std::tuple< std::shared_ptr< Ort::Session >, Ort::AllocatorWithDefaultOptions > | setONNXSession (Ort::Env &env, const std::string &modelFilePath) |
|
std::tuple< std::vector< int64_t >, std::vector< const char * > > | getInputNodes (const std::shared_ptr< Ort::Session > &sessionHandle, Ort::AllocatorWithDefaultOptions &allocator) |
|
std::tuple< std::vector< int64_t >, std::vector< const char * > > | getOutputNodes (const std::shared_ptr< Ort::Session > &sessionHandle, Ort::AllocatorWithDefaultOptions &allocator) |
|
float | getScore (int nVars, const std::vector< std::vector< float >> &input_data, const std::shared_ptr< Ort::Session > &sessionHandle, std::vector< int64_t > input_node_dims, std::vector< const char * > input_node_names, std::vector< const char * > output_node_names) const |
|
TLorentzVector | getEgammaVector (const xAOD::EgammaContainer *egammas, FailType &failType) const |
| Get combined 4-vector of photon container. More...
|
|
StatusCode | getVertexImp (const xAOD::EgammaContainer &egammas, const xAOD::Vertex *&vertex, bool ignoreConv, bool noDecorate, std::vector< std::pair< const xAOD::Vertex *, float >> &, yyVtxType &, FailType &) const |
| Given a list of photons, return the MLPs of all vertices in the event. 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...
|
|
Implementation for the photon vertex selection tool.
Takes a list of photons (for example, to two leading photons) and the most likely primary vertex, based on an MVA.
- Author
- Christopher Meyer chris.nosp@m..mey.nosp@m.er@ce.nosp@m.rn.c.nosp@m.h
-
Bruno Lenzi bruno.nosp@m..len.nosp@m.zi@ce.nosp@m.rn.c.nosp@m.h
Definition at line 39 of file PhotonVertexSelectionTool.h.
◆ StoreGateSvc_t
◆ FailType
Declare the interface that the class provides.
enum indicating where the tool has failed
Enumerator |
---|
Unkown | |
NoFail | |
NoVxCont | |
NoEventInfo | |
FailPointing | |
FailEgamVect | |
NoGdCandidate | |
MatchedTrack | |
Definition at line 33 of file IPhotonVertexSelectionTool.h.
◆ yyVtxType
◆ PhotonVertexSelectionTool()
CP::PhotonVertexSelectionTool::PhotonVertexSelectionTool |
( |
const std::string & |
name | ) |
|
◆ ~PhotonVertexSelectionTool()
CP::PhotonVertexSelectionTool::~PhotonVertexSelectionTool |
( |
| ) |
|
|
virtualdefault |
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation 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.
◆ declareProperty() [6/6]
◆ decorateInputs()
Given a list of photons, decorate vertex container with MVA variables.
Implements CP::IPhotonVertexSelectionTool.
Definition at line 282 of file PhotonVertexSelectionTool.cxx.
283 auto fail = FailType::NoFail;
285 const EventContext& ctx = Gaudi::Hive::currentContext();
302 bool writeSumPt2 = !sumPt2.isAvailable();
303 bool writeSumPt = !sumPt.isAvailable();
323 deltaPhi(*vertex) = (
fail != FailType::FailEgamVect) ? std::abs(vmom.DeltaPhi(vegamma)) : -999.;
324 deltaZ(*vertex) = std::abs((zCommon.first -
vertex->z())/zCommon.second);
329 if(failType!=
nullptr)
331 return StatusCode::SUCCESS;
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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
◆ getCase()
int CP::PhotonVertexSelectionTool::getCase |
( |
| ) |
const |
|
inlinevirtual |
◆ getEgammaVector()
Get combined 4-vector of photon container.
Definition at line 628 of file PhotonVertexSelectionTool.cxx.
630 TLorentzVector
v, v1;
635 failType = FailType::FailEgamVect;
639 if (cluster ==
nullptr) {
640 ATH_MSG_WARNING(
"No cluster associated to egamma, not adding to 4-vector.");
◆ getInputNodes()
std::tuple< std::vector< int64_t >, std::vector< const char * > > CP::PhotonVertexSelectionTool::getInputNodes |
( |
const std::shared_ptr< Ort::Session > & |
sessionHandle, |
|
|
Ort::AllocatorWithDefaultOptions & |
allocator |
|
) |
| |
|
private |
Definition at line 137 of file PhotonVertexSelectionTool.cxx.
141 std::vector<int64_t> input_node_dims;
142 size_t num_input_nodes = sessionHandle->GetInputCount();
143 std::vector<const char*> input_node_names(num_input_nodes);
146 for( std::size_t
i = 0;
i < num_input_nodes;
i++ ) {
148 char* input_name = sessionHandle->GetInputNameAllocated(
i, allocator).release();
150 input_node_names[
i] = input_name;
153 Ort::TypeInfo type_info = sessionHandle->GetInputTypeInfo(
i);
154 auto tensor_info = type_info.GetTensorTypeAndShapeInfo();
155 ONNXTensorElementDataType
type = tensor_info.GetElementType();
159 input_node_dims = tensor_info.GetShape();
160 ATH_MSG_DEBUG(
"Input "<<
i<<
" : num_dims= "<<input_node_dims.size());
161 for (std::size_t j = 0; j < input_node_dims.size(); j++){
162 if(input_node_dims[j]<0){input_node_dims[j] =1;}
163 ATH_MSG_DEBUG(
"Input"<<
i<<
" : dim "<<j<<
"= "<<input_node_dims[j]);
166 return std::make_tuple(input_node_dims, input_node_names);
◆ getKey()
Get the (hashed) key of an object that is in the event store.
This is a bit of a special one. StoreGateSvc
and xAOD::TEvent
both provide ways for getting the SG::sgkey_t
key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
- See also
- asg::AsgTool::getName
- Parameters
-
ptr | The bare pointer to the object that the event store should know about |
- Returns
- The hashed key of the object in the store. If not found, an invalid (zero) key.
Definition at line 119 of file AsgTool.cxx.
121 #ifdef XAOD_STANDALONE
127 return (
proxy ==
nullptr ? 0 :
proxy->sgkey() );
128 #endif // XAOD_STANDALONE
◆ getName()
const std::string & asg::AsgTool::getName |
( |
const void * |
ptr | ) |
const |
|
inherited |
Get the name of an object that is / should be in the event store.
This is a bit of a special one. StoreGateSvc
and xAOD::TEvent
both provide ways for getting the std::string
name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
- See also
- asg::AsgTool::getKey
- Parameters
-
ptr | The bare pointer to the object that the event store should know about |
- Returns
- The string name of the object in the store. If not found, an empty string.
Definition at line 106 of file AsgTool.cxx.
108 #ifdef XAOD_STANDALONE
114 static const std::string
dummy =
"";
116 #endif // XAOD_STANDALONE
◆ getOutputNodes()
std::tuple< std::vector< int64_t >, std::vector< const char * > > CP::PhotonVertexSelectionTool::getOutputNodes |
( |
const std::shared_ptr< Ort::Session > & |
sessionHandle, |
|
|
Ort::AllocatorWithDefaultOptions & |
allocator |
|
) |
| |
|
private |
Definition at line 171 of file PhotonVertexSelectionTool.cxx.
175 std::vector<int64_t> output_node_dims;
176 size_t num_output_nodes = sessionHandle->GetOutputCount();
177 std::vector<const char*> output_node_names(num_output_nodes);
180 for( std::size_t
i = 0;
i < num_output_nodes;
i++ ) {
182 char* output_name = sessionHandle->GetOutputNameAllocated(
i, allocator).release();
184 output_node_names[
i] = output_name;
186 Ort::TypeInfo type_info = sessionHandle->GetOutputTypeInfo(
i);
187 auto tensor_info = type_info.GetTensorTypeAndShapeInfo();
188 ONNXTensorElementDataType
type = tensor_info.GetElementType();
192 output_node_dims = tensor_info.GetShape();
193 ATH_MSG_DEBUG(
"Output "<<
i<<
" : num_dims= "<<output_node_dims.size());
194 for (std::size_t j = 0; j < output_node_dims.size(); j++){
195 if(output_node_dims[j]<0){output_node_dims[j] =1;}
196 ATH_MSG_DEBUG(
"Output"<<
i<<
" : dim "<<j<<
"= "<<output_node_dims[j]);
199 return std::make_tuple(output_node_dims, output_node_names);
◆ getPrimaryVertexFromConv()
Get possible vertex directly associated with photon conversions.
Implements CP::IPhotonVertexSelectionTool.
Definition at line 574 of file PhotonVertexSelectionTool.cxx.
576 if (photons ==
nullptr) {
577 ATH_MSG_WARNING(
"Passed nullptr photon container, returning nullptr vertex from getPrimaryVertexFromConv");
581 std::vector<const xAOD::Vertex*> vertices;
584 size_t NumberOfTracks = 0;
590 for (
const auto *photon: *photons) {
591 conversionVertex =
photon->vertex();
592 if (conversionVertex ==
nullptr)
continue;
595 for (
size_t i = 0;
i < NumberOfTracks; ++
i) {
598 if (gsfTp ==
nullptr)
continue;
603 if (
tp ==
nullptr)
continue;
606 if (
primary ==
nullptr)
continue;
610 if (
std::find(vertices.begin(), vertices.end(),
primary) == vertices.end()) {
618 if (!vertices.empty()) {
619 if (vertices.size() > 1)
620 ATH_MSG_WARNING(
"Photons associated to different vertices! Returning lead photon association.");
◆ getProperty()
template<class T >
const T* asg::AsgTool::getProperty |
( |
const std::string & |
name | ) |
const |
|
inherited |
Get one of the tool's properties.
◆ getScore()
float CP::PhotonVertexSelectionTool::getScore |
( |
int |
nVars, |
|
|
const std::vector< std::vector< float >> & |
input_data, |
|
|
const std::shared_ptr< Ort::Session > & |
sessionHandle, |
|
|
std::vector< int64_t > |
input_node_dims, |
|
|
std::vector< const char * > |
input_node_names, |
|
|
std::vector< const char * > |
output_node_names |
|
) |
| const |
|
private |
Definition at line 89 of file PhotonVertexSelectionTool.cxx.
98 std::vector<std::vector<float>> input_tensor_values_ = input_data;
101 size_t input_tensor_size = nVars;
102 std::vector<float> input_tensor_values(nVars);
103 input_tensor_values = input_tensor_values_[0];
107 Ort::MemoryInfo::CreateCpu(OrtArenaAllocator, OrtMemTypeDefault);
109 Ort::Value input_tensor = Ort::Value::CreateTensor<float>(
110 memory_info, input_tensor_values.data(), input_tensor_size,
111 input_node_dims.data(), input_node_dims.size());
114 assert(input_tensor.IsTensor());
117 auto output_tensors =
118 sessionHandle->Run(Ort::RunOptions{
nullptr}, input_node_names.data(),
119 &input_tensor, input_node_names.size(),
120 output_node_names.data(), output_node_names.size());
123 assert(output_tensors.size() == 1 && output_tensors.front().IsTensor());
127 float* floatarr = output_tensors[0].GetTensorMutableData<
float>();
129 int arrSize =
sizeof(*floatarr) /
sizeof(floatarr[0]);
◆ getVertex() [1/2]
Given a list of photons, return the MLPs of all vertices in the event.
Implements CP::IPhotonVertexSelectionTool.
Definition at line 336 of file PhotonVertexSelectionTool.cxx.
342 std::vector<std::pair<const xAOD::Vertex*, float> > vertexMLP;
344 FailType failType = FailType::NoFail;
345 if (
getVertexImp( egammas, vertex, ignoreConv, noDecorate, vertexMLP, vtxCase, failType ).isSuccess()) {
348 if(vtxCasePtr!=
nullptr)
349 *vtxCasePtr = vtxCase;
350 if(failTypePtr!=
nullptr)
351 *failTypePtr = failType;
◆ getVertex() [2/2]
◆ getVertexImp()
Given a list of photons, return the MLPs of all vertices in the event.
Definition at line 367 of file PhotonVertexSelectionTool.cxx.
383 return StatusCode::FAILURE;
387 if (!ignoreConv && photons) {
389 if (prime_vertex !=
nullptr) {
390 vtxCase = yyVtxType::ConvTrack;
391 fail = FailType::MatchedTrack;
392 vertexMLP.emplace_back(prime_vertex, 0.);
393 return StatusCode::SUCCESS;
397 if (
fail != FailType::NoFail){
401 vertexMLP.emplace_back(prime_vertex, 10.);
402 return StatusCode::SUCCESS;
411 bool isConverted =
false;
414 vtxCase = yyVtxType::NoSiTracks;
415 if (!ignoreConv && photons) {
416 for (
const auto *photon: *photons) {
420 return StatusCode::FAILURE;
426 vtxCase = yyVtxType::SiConvTrack;
436 tmva_reader =
m_mva1.get();
440 tmva_reader =
m_mva2.get();
454 std::vector<float> ONNXInputVector;
455 std::vector<std::vector<float>> onnx_input_tensor_values;
456 std::vector<float> TMVAInputVector;
458 float mlp = 0.0, mlp_max = -99999.0;
459 float doSkipByZSigmaScore = -9999.0;
461 float thresGoodVtxScore;
463 else{thresGoodVtxScore = mlp_max;}
469 onnx_input_tensor_values.clear();
473 float log10_sumPt, log10_sumPt2;
475 sumPt = (sumPtA)(*vertex);
476 sumPt2 = (sumPt2A)(*vertex);
478 deltaZ = (deltaZA)(*vertex);
480 " sumPt2: " << sumPt2 <<
487 TMVAMethod =
"MLP method";
488 log10_sumPt =
static_cast<float>(log10(sumPt));
489 log10_sumPt2 =
static_cast<float>(log10(sumPt2));
497 for (
long unsigned int i = 0;
i < ONNXInputVector.size();
i++) {
502 if (ONNXInputVector[
i] != 0 && std::isinf(ONNXInputVector[
i]) !=
true && std::isnan(ONNXInputVector[
i]) !=
true){
503 ONNXInputVector[
i] =
log(std::abs(ONNXInputVector[
i]));
506 ONNXInputVector[
i] =
log(std::abs(0.00000001));
509 onnx_input_tensor_values.push_back(ONNXInputVector);
514 mlp = tmva_reader->EvaluateMVA(TMVAInputVector, TMVAMethod);
529 " log(abs(sumPt2)): " << sumPt2 <<
531 " log(abs(deltaZ)): " <<
deltaZ);
532 ATH_MSG_VERBOSE(
"ONNX output, isConverted = " << isConverted <<
", mlp=" << mlp);
538 if ((isConverted &&
deltaZ > 15) || (!isConverted &&
deltaZ > 10)) {
539 mlp = doSkipByZSigmaScore;
544 vertexMLP.emplace_back(vertex, mlp);
556 if (mlp_max <= thresGoodVtxScore) {
557 ATH_MSG_DEBUG(
"No good vertex candidates from pointing, returning hardest vertex.");
559 fail = FailType::NoGdCandidate;
565 return StatusCode::SUCCESS;
◆ initialize()
StatusCode CP::PhotonVertexSelectionTool::initialize |
( |
| ) |
|
|
virtual |
Function initialising the tool.
Reimplemented from asg::AsgTool.
Definition at line 224 of file PhotonVertexSelectionTool.cxx.
226 ATH_MSG_INFO(
"Initializing PhotonVertexSelectionTool...");
233 std::vector<std::string> var_names = {
234 "deltaZ := TMath::Min(abs(PrimaryVerticesAuxDyn.z-zCommon)/zCommonError,20)",
235 "deltaPhi := abs(deltaPhi(PrimaryVerticesAuxDyn.phi,egamma_phi))" ,
236 "logSumpt := log10(PrimaryVerticesAuxDyn.sumPt)" ,
237 "logSumpt2 := log10(PrimaryVerticesAuxDyn.sumPt2)"
239 auto *mva1 =
new TMVA::Reader(var_names,
"!Silent:Color");
241 m_mva1 = std::unique_ptr<TMVA::Reader>( mva1 );
243 auto mva2 = std::make_unique<TMVA::Reader>(var_names,
"!Silent:Color");
245 m_mva2 = std::unique_ptr<TMVA::Reader>( std::move(mva2) );
273 #ifndef XAOD_STANDALONE
278 return StatusCode::SUCCESS;
◆ inputHandles()
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.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msg_level_name()
const std::string & asg::AsgTool::msg_level_name |
( |
| ) |
const |
|
inherited |
A deprecated function for getting the message level's name.
Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:
MSG::name( msg().level() )
This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.
- Returns
- The string name of the current minimum message level that's printed
Definition at line 101 of file AsgTool.cxx.
◆ msgLvl()
◆ outputHandles()
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.
◆ print() [1/2]
void asg::AsgTool::print |
( |
| ) |
const |
|
virtualinherited |
Print the state of the tool.
Implements asg::IAsgTool.
Reimplemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
Definition at line 131 of file AsgTool.cxx.
◆ print() [2/2]
virtual void asg::IAsgTool::print |
( |
| ) |
const |
|
pure virtualinherited |
Print the state of the tool.
Implemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, asg::AsgTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
◆ renounce()
◆ renounceArray()
◆ setONNXSession()
std::tuple< std::shared_ptr< Ort::Session >, Ort::AllocatorWithDefaultOptions > CP::PhotonVertexSelectionTool::setONNXSession |
( |
Ort::Env & |
env, |
|
|
const std::string & |
modelFilePath |
|
) |
| |
|
private |
Definition at line 204 of file PhotonVertexSelectionTool.cxx.
211 Ort::SessionOptions sessionOptions;
212 sessionOptions.SetIntraOpNumThreads( 1 );
213 sessionOptions.SetGraphOptimizationLevel( ORT_ENABLE_BASIC );
215 Ort::AllocatorWithDefaultOptions allocator;
217 std::shared_ptr<Ort::Session> sessionHandle = std::make_shared<Ort::Session>(
env, modelFileName.c_str(), sessionOptions );
219 ATH_MSG_INFO(
"Created the ONNX Runtime session for model file = " << modelFileName);
220 return std::make_tuple(sessionHandle, allocator);
◆ sortMLP()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_allocator1
Ort::AllocatorWithDefaultOptions CP::PhotonVertexSelectionTool::m_allocator1 |
|
private |
◆ m_allocator2
Ort::AllocatorWithDefaultOptions CP::PhotonVertexSelectionTool::m_allocator2 |
|
private |
◆ m_convPtCut
float CP::PhotonVertexSelectionTool::m_convPtCut |
|
private |
◆ m_deltaPhiKey
◆ m_deltaZKey
◆ m_derivationPrefix
std::string CP::PhotonVertexSelectionTool::m_derivationPrefix |
|
private |
◆ m_detStore
◆ m_doSkipByZSigma
bool CP::PhotonVertexSelectionTool::m_doSkipByZSigma |
|
private |
◆ m_eventInfo
Initial value:{
this, "EventInfoContName", "EventInfo", "event info key"}
Container declarations.
Definition at line 54 of file PhotonVertexSelectionTool.h.
◆ m_evtStore
◆ m_input_node_dims1
std::vector<int64_t> CP::PhotonVertexSelectionTool::m_input_node_dims1 |
|
private |
◆ m_input_node_dims2
std::vector<int64_t> CP::PhotonVertexSelectionTool::m_input_node_dims2 |
|
private |
◆ m_input_node_names1
std::vector<const char*> CP::PhotonVertexSelectionTool::m_input_node_names1 |
|
private |
◆ m_input_node_names2
std::vector<const char*> CP::PhotonVertexSelectionTool::m_input_node_names2 |
|
private |
◆ m_isTMVA
bool CP::PhotonVertexSelectionTool::m_isTMVA |
|
private |
◆ m_mva1
std::unique_ptr<TMVA::Reader> CP::PhotonVertexSelectionTool::m_mva1 |
|
private |
◆ m_mva2
std::unique_ptr<TMVA::Reader> CP::PhotonVertexSelectionTool::m_mva2 |
|
private |
◆ m_nVars
int CP::PhotonVertexSelectionTool::m_nVars |
|
private |
◆ m_ONNXModelFilePath1
std::string CP::PhotonVertexSelectionTool::m_ONNXModelFilePath1 |
|
private |
◆ m_ONNXModelFilePath2
std::string CP::PhotonVertexSelectionTool::m_ONNXModelFilePath2 |
|
private |
◆ m_output_node_dims1
std::vector<int64_t> CP::PhotonVertexSelectionTool::m_output_node_dims1 |
|
private |
◆ m_output_node_dims2
std::vector<int64_t> CP::PhotonVertexSelectionTool::m_output_node_dims2 |
|
private |
◆ m_output_node_names1
std::vector<const char*> CP::PhotonVertexSelectionTool::m_output_node_names1 |
|
private |
◆ m_output_node_names2
std::vector<const char*> CP::PhotonVertexSelectionTool::m_output_node_names2 |
|
private |
◆ m_sessionHandle1
std::shared_ptr<Ort::Session> CP::PhotonVertexSelectionTool::m_sessionHandle1 |
|
private |
◆ m_sessionHandle2
std::shared_ptr<Ort::Session> CP::PhotonVertexSelectionTool::m_sessionHandle2 |
|
private |
◆ m_sumPt2Key
◆ m_sumPtKey
◆ m_TMVAModelFilePath1
std::string CP::PhotonVertexSelectionTool::m_TMVAModelFilePath1 |
|
private |
◆ m_TMVAModelFilePath2
std::string CP::PhotonVertexSelectionTool::m_TMVAModelFilePath2 |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vertexContainer
◆ m_vertexContainerName
std::string CP::PhotonVertexSelectionTool::m_vertexContainerName |
|
private |
◆ m_vhka
The documentation for this class was generated from the following files:
float getVertexSumPt(const xAOD::Vertex *vertex, int power=1, bool useAux=true)
Loop over track particles associated with vertex and return scalar sum of pT^power in GeV (from auxda...
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
std::string find(const std::string &s)
return a remapped string
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
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)
std::pair< float, float > getZCommonAndError(const xAOD::EventInfo *eventInfo, const xAOD::EgammaContainer *egammas, float convPtCut=2e3)
Return zCommon and zCommonError.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
Helper class to provide constant type-safe access to aux data.
#define ATH_MSG_VERBOSE(x)
virtual void setOwner(IDataHandleHolder *o)=0
virtual double e() const
energy
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Description of a calorimeter cluster.
const xAOD::Vertex * getHardestVertex(const xAOD::VertexContainer *vertices)
Return vertex with highest sum pT^2.
Handle class for adding a decoration to an object.
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
TLorentzVector getVertexMomentum(const xAOD::Vertex *vertex, bool useAux=true, const std::string &derivationPrefix="")
Return vector sum of tracks associated with vertex (from auxdata if available and useAux = true)
std::string decorKeyFromKey(const std::string &key, const std::string &deflt)
Extract the decoration part of key.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
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...
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Class describing a Vertex.
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
bool passConvSelection(const xAOD::Photon *photon, float convPtCut=2e3)
Check if photon is converted, and tracks have Si hits and pass selection.
Class describing a TrackParticle.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
const xAOD::Vertex * getVertexFromTrack(const xAOD::TrackParticle *track, const xAOD::VertexContainer *vertices)