ATLAS Offline Software
Loading...
Searching...
No Matches
CMXJetHits_v1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
5// $Id: CMXJetHits_v1.cxx 687949 2015-08-06 15:48:49Z amazurov $
6
7// EDM includes(s):
9
10// Local include(s):
12
13
14namespace {
15
16
17std::string hitsSourceComponent(uint8_t source)
18{
19 switch (source)
20 {
22 return "REMOTE_MAIN";
24 return "LOCAL_MAIN";
26 return "TOTAL_MAIN";
28 return "REMOTE_FORWARD";
30 return "LOCAL_FORWARD";
32 return "TOTAL_FORWARD";
34 return "TOPO_CHECKSUM";
36 return "TOPO_OCCUPANCY_MAP";
38 return "TOPO_OCCUPANCY_COUNTS";
39 default:
40 return std::to_string(source);
41 }
42}
43
44
45} // anonymous namespace
46
47
48namespace xAOD{
49
54
57 {
58 setCrate( crate );
59 setSourceComponent( source );
60 }
61
64 const std::vector<uint32_t>& hitsVec0,
65 const std::vector<uint32_t>& hitsVec1,
66 const std::vector<uint32_t>& errorVec0,
67 const std::vector<uint32_t>& errorVec1,
68 const uint8_t peak)
69 {
70 setCrate( crate );
71 setSourceComponent( source );
76 setPeak( peak );
77 }
78
79
81 void CMXJetHits_v1::addHits(const std::vector<uint32_t>& hitsVec0,
82 const std::vector<uint32_t>& hitsVec1,
83 const std::vector<uint32_t>& errorVec0,
84 const std::vector<uint32_t>& errorVec1)
85 {
90 }
91
93 AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( CMXJetHits_v1 , uint8_t , sourceComponent , setSourceComponent )
95 AUXSTORE_OBJECT_SETTER_AND_GETTER( CMXJetHits_v1 , std::vector<uint32_t> , hitsVec0 , setHitsVec0 )
96 AUXSTORE_OBJECT_SETTER_AND_GETTER( CMXJetHits_v1 , std::vector<uint32_t> , hitsVec1 , setHitsVec1 )
97 AUXSTORE_OBJECT_SETTER_AND_GETTER( CMXJetHits_v1 , std::vector<uint32_t> , errorVec0 , setErrorVec0 )
98 AUXSTORE_OBJECT_SETTER_AND_GETTER( CMXJetHits_v1 , std::vector<uint32_t> , errorVec1 , setErrorVec1 )
99
100
103
106 {
107 return hitsVec0()[ peak() ];
108 }
109
112 {
113 return hitsVec1()[ peak() ];
114 }
115
118 {
119 return errorVec0()[ peak() ];
120 }
121
124 {
125 return errorVec1()[ peak() ];
126 }
127
128 std::ostream &operator<<(std::ostream &os, const xAOD::CMXJetHits_v1 &el)
129 {
130 os << "xAOD::CMXJetHits crate=" << int(el.crate())
131 << " sourceComponent=" << hitsSourceComponent(el.sourceComponent())
132 << " peak=" << int(el.peak()) << " hits0=0x" << std::hex << el.hits0() << std::dec
133 << " hits1=0x" << std::hex << el.hits1() << std::dec << " hits0Vec=[";
134
135 std::for_each(el.hitsVec0().begin(), el.hitsVec0().end(), [&](uint32_t n) { os << " 0x" << std::hex << int(n) << std::dec; });
136 os << "]";
137 return os;
138 }
139
140} // namespace xAOD
141
#define AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of primitive auxiliary properties.
#define AUXSTORE_OBJECT_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of complex auxiliary properties.
AuxElement()
Default constructor.
Description of CMXJetHits_v1.
CMXJetHits_v1()
Default constructor.
uint32_t error1() const
get errorVec1 at peak bunch crossing
void setPeak(uint8_t)
set peak
virtual void initialize(const uint8_t crate, const uint8_t source)
initialize
void setErrorVec0(const std::vector< uint32_t > &)
set errorVec0
uint8_t crate() const
get crate
void setHitsVec0(const std::vector< uint32_t > &)
set hitsVec0
void setErrorVec1(const std::vector< uint32_t > &)
set errorVec1
const std::vector< uint32_t > & errorVec0() const
get errorVec0
uint32_t error0() const
get errorVec0 at peak bunch crossing
uint8_t peak() const
get peak
void setHitsVec1(const std::vector< uint32_t > &)
set hitsVec1
void addHits(const std::vector< uint32_t > &hitsVec0, const std::vector< uint32_t > &hitsVec1, const std::vector< uint32_t > &errorVec0, const std::vector< uint32_t > &errorVec1)
add data to existing object
const std::vector< uint32_t > & hitsVec1() const
get hitsVec1
uint32_t hits0() const
Peak functions - return value of peak bunch crossing Assuming we have got the timing calibration corr...
const std::vector< uint32_t > & hitsVec0() const
get hitsVec0
void setSourceComponent(uint8_t)
set source
uint32_t hits1() const
get hitsVec1 at peak bunch crossing
void setCrate(uint8_t)
set crate
const std::vector< uint32_t > & errorVec1() const
get errorVec1
Forward declaration.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
setRawEt setRawPhi int
std::ostream & operator<<(std::ostream &out, const std::pair< FIRST, SECOND > &pair)
Helper print operator.
setEventNumber uint32_t