ATLAS Offline Software
TrigRNNOutput.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 #include "AthLinks/ElementLink.h"
8 
10  : m_output(), m_cluster() {
11 }
12 
13 TrigRNNOutput::TrigRNNOutput(const std::vector<float> &output)
14  : m_output(output), m_cluster() {
15 }
16 
17 std::vector<float> &TrigRNNOutput::output() {
18  return m_output;
19 }
20 
21 const std::vector<float> &TrigRNNOutput::output() const {
22  return m_output;
23 }
24 
25 void TrigRNNOutput::output(const std::vector<float> &o) {
26  m_output = o;
27 }
28 
29 float &TrigRNNOutput::at(const unsigned int i) {
30  return m_output.at(i);
31 }
32 
33 const float &TrigRNNOutput::at(const unsigned int i) const {
34  return m_output.at(i);
35 }
36 
37 unsigned int TrigRNNOutput::size() const {
38  return m_output.size();
39 }
40 
41 const float &TrigRNNOutput::operator [](const unsigned int i) const {
42  return m_output[i];
43 }
44 
45 float &TrigRNNOutput::operator [](const unsigned int i) {
46  return m_output[i];
47 }
48 
49 bool TrigRNNOutput::isValid() const {
50  return m_cluster.isValid();
51 }
52 
53 void TrigRNNOutput::setCluster(const TrigEMClusterContainer &cluster_con, unsigned int cluster_idx) {
54  if (cluster_idx < cluster_con.size()) {
55  m_cluster.toIndexedElement(cluster_con, cluster_idx);
56  if (!m_cluster.isValid()) {
57  m_cluster.reset();
58  }
59  } else {
60  m_cluster.reset();
61  }
62 }
63 
65  if (m_cluster.isValid()) {
66  return *m_cluster;
67  }
68  return 0;
69 }
70 
71 
73 {
75 }
76 
77 
79 {
80  return m_cluster;
81 }
TrigRNNOutput::cluster
const TrigEMCluster * cluster() const
Definition: TrigRNNOutput.cxx:64
TrigRNNOutput.h
TrigRNNOutput::at
float & at(const unsigned int i)
Definition: TrigRNNOutput.cxx:29
TrigEMCluster
Class with calibrated variables for egamma clustering.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMCluster.h:31
TrigEMClusterContainer
Container from TrigEMCluster type objects.
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigEMClusterContainer.h:32
lumiFormat.i
int i
Definition: lumiFormat.py:85
TrigRNNOutput::m_cluster
ElementLink< TrigEMClusterContainer > m_cluster
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigRNNOutput.h:25
TrigEMCluster.h
TrigRNNOutput::clusterLink
const ElementLink< TrigEMClusterContainer > & clusterLink() const
Definition: TrigRNNOutput.cxx:78
TrigRNNOutput::setCluster
void setCluster(const TrigEMClusterContainer &cluster_con, unsigned int cluster_idx)
Definition: TrigRNNOutput.cxx:53
merge.output
output
Definition: merge.py:17
TrigRNNOutput::size
unsigned int size() const
Definition: TrigRNNOutput.cxx:37
TrigRNNOutput::m_output
std::vector< float > m_output
Definition: Trigger/TrigEvent/TrigCaloEvent/TrigCaloEvent/TrigRNNOutput.h:24
TrigRNNOutput::TrigRNNOutput
TrigRNNOutput()
Class default constructor.
Definition: TrigRNNOutput.cxx:9
TrigRNNOutput::isValid
bool isValid() const
Set and manipulate ElementLink.
Definition: TrigRNNOutput.cxx:49
TrigRNNOutput::output
std::vector< float > & output()
Acessor methods.
Definition: TrigRNNOutput.cxx:17
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
TrigRNNOutput::operator[]
const float & operator[](const unsigned int i) const
Definition: TrigRNNOutput.cxx:41