25{
27
28
29 SG::ReadHandle<DecisionContainer> inputDecisionsHandle(decisionInput(), context);
30 SG::WriteHandle<DecisionContainer> outputDecisionsHandle =
createAndStore(decisionOutput(), context );
31
32
33 SG::ReadHandle<xAOD::VertexContainer> idVtxHandle(
m_inputIdVtxKey, context);
35
36
37 SG::ReadHandle<xAOD::AFPVertexContainer> afpVtxHandle(
m_inputAfpVtxKey, context);
39
40
41 auto skipHypoTool = Monitored::Scalar<int>("skipHypoTool", 0);
42
43
44 if (!afpVtxHandle.isValid()) {
46 skipHypoTool = 1;
47 }
48 if (!idVtxHandle.isValid()) {
50 skipHypoTool = 2;
51 }
52
53
54 if (afpVtxHandle->size() == 0) {
56 skipHypoTool = 3;
57 }
58 if (idVtxHandle->size() == 0) {
60 skipHypoTool = 4;
61 }
62
63
64 if (skipHypoTool != 3 && idVtxHandle->size() == 1 && idVtxHandle->at(0)->vxTrackAtVertexAvailable() == false) {
66 skipHypoTool = 5;
67 }
68
69
70 auto n_afp_vertex = Monitored::Scalar<size_t>("afp_vtx_count", 0);
71 auto n_id_vertex = Monitored::Scalar<size_t>("id_vtx_count", 0);
72
73
74 for (
size_t i = 0;
i < afpVtxHandle->size(); ++
i) {
76
78 auto afp_vtx_z = Monitored::Scalar<float>(
"afp_vtx_z", afpVtx->
position());
80 n_afp_vertex += 1;
81 }
83
84
85 for (
size_t i = 0;
i < idVtxHandle->size(); ++
i) {
87
88 if (skipHypoTool == 0)
ATH_MSG_DEBUG(
"ID vertex [" << i <<
"] z position: " << idVtx->
z()
91
94
95 auto id_vtx_z = Monitored::Scalar<float>(
"id_vtx_z", idVtx->
z());
97 n_id_vertex += 1;
98 }
100
101
102 std::vector<TrigAFPToFHypoTool::AFPToFHypoToolInfo> hypoToolInput;
103
104
106
107 if (skipHypoTool != 0)
108 {
110 }
111 else
112 {
113 for (
size_t i = 0;
i < inputDecisionsHandle->size(); ++
i) {
114 const Decision* previousDecision = inputDecisionsHandle->at(i);
115
118
119
120 auto delta_z = Monitored::Scalar<float>(
"delta_z", afpVtx->
position() - idVtx->
z());
122
123
125
126
128
129
131
132
135
136 hypoToolInput.emplace_back(inputPassingChains, afpVtx, idVtx, outputDecision);
137 }
138 }
139
140
143 }
144
145
146 ATH_CHECK( hypoBaseOutputProcessing(outputDecisionsHandle) );
147
148 return StatusCode::SUCCESS;
149}
#define ATH_CHECK
Evaluate an expression and check for errors.
pointer_type ptr()
Dereference the pointer.
ToolHandle< GenericMonitoringTool > m_monTool
SG::ReadHandleKey< xAOD::VertexContainer > m_inputIdVtxKey
SG::ReadHandleKey< xAOD::AFPVertexContainer > m_inputAfpVtxKey
ToolHandleArray< TrigAFPToFHypoTool > m_hypoTools
float position() const
Vertex position .
bool setObjectLink(const std::string &name, const ElementLink< CONTAINER > &link)
Set the link to an object.
float z() const
Returns the z position.
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
float numberDoF() const
Returns the number of degrees of freedom of the vertex fit as float.
bool vxTrackAtVertexAvailable() const
Check if VxTrackAtVertices are attached to the object.
float chiSquared() const
Returns the of the vertex fit as float.
void fill(const ToolHandle< GenericMonitoringTool > &tool, T &&... variables)
xAOD::TrigComposite Decision
Decision * newDecisionIn(DecisionContainer *dc, const std::string &name)
Helper method to create a Decision object, place it in the container and return a pointer to it.
const std::string & featureString()
std::set< DecisionID > DecisionIDContainer
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
const std::string & hypoAlgNodeName()
void linkToPrevious(Decision *d, const std::string &previousCollectionKey, size_t previousIndex)
Links to the previous object, location of previous 'seed' decision supplied by hand.
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
Vertex_v1 Vertex
Define the latest version of the vertex class.