ATLAS Offline Software
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 
14 namespace {
15 
16 
17 std::string hitsSourceComponent(uint8_t source)
18 {
19  switch (source)
20  {
21  case xAOD::CMXJetHits_v1::Sources::REMOTE_MAIN:
22  return "REMOTE_MAIN";
23  case xAOD::CMXJetHits_v1::Sources::LOCAL_MAIN:
24  return "LOCAL_MAIN";
25  case xAOD::CMXJetHits_v1::Sources::TOTAL_MAIN:
26  return "TOTAL_MAIN";
27  case xAOD::CMXJetHits_v1::Sources::REMOTE_FORWARD:
28  return "REMOTE_FORWARD";
29  case xAOD::CMXJetHits_v1::Sources::LOCAL_FORWARD:
30  return "LOCAL_FORWARD";
31  case xAOD::CMXJetHits_v1::Sources::TOTAL_FORWARD:
32  return "TOTAL_FORWARD";
33  case xAOD::CMXJetHits_v1::Sources::TOPO_CHECKSUM:
34  return "TOPO_CHECKSUM";
35  case xAOD::CMXJetHits_v1::Sources::TOPO_OCCUPANCY_MAP:
36  return "TOPO_OCCUPANCY_MAP";
37  case xAOD::CMXJetHits_v1::Sources::TOPO_OCCUPANCY_COUNTS:
38  return "TOPO_OCCUPANCY_COUNTS";
39  default:
40  return std::to_string(source);
41  }
42 }
43 
44 
45 } // anonymous namespace
46 
47 
48 namespace xAOD{
49 
51  SG::AuxElement()
52  {
53  }
54 
57  {
58  setCrate( crate );
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 );
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 
101 
105  uint32_t CMXJetHits_v1::hits0() const
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 
xAOD::AUXSTORE_PRIMITIVE_SETTER_AND_GETTER
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1, float, IP2D_pb, setIP2D_pb) AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1
xAOD::CMXJetHits_v1
Description of CMXJetHits_v1.
Definition: CMXJetHits_v1.h:30
xAOD::CMXJetHits_v1::hitsVec0
const std::vector< uint32_t > & hitsVec0() const
get hitsVec0
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
xAOD::int
setRawEt setRawPhi int
Definition: TrigCaloCluster_v1.cxx:33
xAOD::CMXJetHits_v1::error1
uint32_t error1() const
get errorVec1 at peak bunch crossing
Definition: CMXJetHits_v1.cxx:123
AuxStoreAccessorMacros.h
xAOD::CMXJetHits_v1::error0
uint32_t error0() const
get errorVec0 at peak bunch crossing
Definition: CMXJetHits_v1.cxx:117
xAOD::CMXJetHits_v1::setHitsVec0
void setHitsVec0(const std::vector< uint32_t > &)
set hitsVec0
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
xAOD::CMXJetHits_v1::peak
uint8_t peak() const
get peak
xAOD::CMXJetHits_v1::errorVec1
const std::vector< uint32_t > & errorVec1() const
get errorVec1
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::CMXJetHits_v1::setCrate
void setCrate(uint8_t)
set crate
xAOD::CMXJetHits_v1::setErrorVec0
void setErrorVec0(const std::vector< uint32_t > &)
set errorVec0
xAOD::CMXJetHits_v1::errorVec0
const std::vector< uint32_t > & errorVec0() const
get errorVec0
xAOD::CMXJetHits_v1::setSourceComponent
void setSourceComponent(uint8_t)
set source
beamspotman.n
n
Definition: beamspotman.py:731
xAOD::CMXJetHits_v1::initialize
virtual void initialize(const uint8_t crate, const uint8_t source)
initialize
Definition: CMXJetHits_v1.cxx:56
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
xAOD::CMXJetHits_v1::CMXJetHits_v1
CMXJetHits_v1()
Default constructor.
Definition: CMXJetHits_v1.cxx:50
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
xAOD::CMXJetHits_v1::crate
uint8_t crate() const
get crate
CMXJetHits_v1.h
xAOD::CMXJetHits_v1::addHits
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
Definition: CMXJetHits_v1.cxx:81
xAOD::CMXJetHits_v1::setPeak
void setPeak(uint8_t)
set peak
xAOD::CMXJetHits_v1::setErrorVec1
void setErrorVec1(const std::vector< uint32_t > &)
set errorVec1
xAOD::CMXJetHits_v1::hitsVec1
const std::vector< uint32_t > & hitsVec1() const
get hitsVec1
xAOD::CMXJetHits_v1::hits1
uint32_t hits1() const
get hitsVec1 at peak bunch crossing
Definition: CMXJetHits_v1.cxx:111
copySelective.source
string source
Definition: copySelective.py:32
xAOD::CMXJetHits_v1::setHitsVec1
void setHitsVec1(const std::vector< uint32_t > &)
set hitsVec1
xAOD::operator<<
std::ostream & operator<<(std::ostream &out, const std::pair< FIRST, SECOND > &pair)
Helper print operator.
Definition: RDataSource.cxx:53
xAOD::AUXSTORE_OBJECT_SETTER_AND_GETTER
AUXSTORE_OBJECT_SETTER_AND_GETTER(CaloRings_v1, RingSetLinks, ringSetLinks, setRingSetLinks) unsigned CaloRings_v1
Definition: CaloRings_v1.cxx:27