ATLAS Offline Software
Loading...
Searching...
No Matches
CPMTower_v2.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5// $Id: CPMTower_v2.cxx 687949 2015-08-06 15:48:49Z amazurov $
6
7// System include(s):
8#include <cmath>
9
10// EDM includes(s):
12
13// Local include(s):
15
16namespace xAOD{
17
22
24 void CPMTower_v2::initialize(const float eta,const float phi)
25 {
26 setEta( eta );
27 setPhi( phi );
28 }
29
31 void CPMTower_v2::initialize(const float eta,const float phi,
32 const std::vector<uint8_t>& emEnergyVec,
33 const std::vector<uint8_t>& hadEnergyVec,
34 const std::vector<uint32_t>& emErrorVec,
35 const std::vector<uint32_t>& hadErrorVec,
36 const uint8_t peak)
37 {
38 setEta( eta );
39 setPhi( phi );
44 setPeak( peak );
45 }
46
47 AUXSTORE_OBJECT_SETTER_AND_GETTER( CPMTower_v2 , std::vector<uint8_t> , emEnergyVec , setEmEnergyVec )
48 AUXSTORE_OBJECT_SETTER_AND_GETTER( CPMTower_v2 , std::vector<uint8_t> , hadEnergyVec , setHadEnergyVec )
49 AUXSTORE_OBJECT_SETTER_AND_GETTER( CPMTower_v2 , std::vector<uint32_t> , emErrorVec , setEmErrorVec )
50 AUXSTORE_OBJECT_SETTER_AND_GETTER( CPMTower_v2 , std::vector<uint32_t> , hadErrorVec , setHadErrorVec )
54
55
57 {
58 return emSliceEnergy(peak());
59 }
60
62 {
63 return hadSliceEnergy(peak());
64 }
65
66 uint8_t CPMTower_v2::emSliceEnergy(unsigned int slice) const
67 {
68 if( slice < emEnergyVec().size() ){
69 return emEnergyVec()[ slice ];
70 }
71 return 0;
72 }
73
74 uint8_t CPMTower_v2::hadSliceEnergy(unsigned int slice) const
75 {
76 if( slice < hadEnergyVec().size() ){
77 return hadEnergyVec()[ slice ];
78 }
79 return 0;
80 }
81
83 {
84 return emSliceError(peak());
85 }
86
88 {
89 return hadSliceError(peak());
90 }
91
92 uint32_t CPMTower_v2::emSliceError(unsigned int slice) const
93 {
94 if( slice < emErrorVec().size() ){
95 return emErrorVec()[ slice ];
96 }
97 return 0;
98 }
99
100 uint32_t CPMTower_v2::hadSliceError(unsigned int slice) const
101 {
102 if( slice < hadErrorVec().size() ){
103 return hadErrorVec()[ slice ];
104 }
105 return 0;
106 }
107
108} // namespace xAOD
Scalar eta() const
pseudorapidity method
#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 CPMTower_v2.
Definition CPMTower_v2.h:26
uint8_t emEnergy() const
get emEnergy for emEnergyVec[peak] - time slice that (hopefully) contains the collision
const std::vector< uint8_t > & emEnergyVec() const
get emEnergyVec - emEnergy for all time slices
uint8_t hadSliceEnergy(unsigned int slice) const
get hadEnergy for hadEnergyVec[slice] - time slice for arbitary slice
void setEmErrorVec(const std::vector< uint32_t > &)
set emErrorVec - emError for all time slices
uint8_t hadEnergy() const
get hadEnergy for hadEnergyVec[peak] - time slice that (hopefully) contains the collision
void setPeak(uint8_t)
float phi() const
get phi (note that for L1Calo phi runs from 0 to 2pi)
CPMTower_v2()
Default constructor.
void setHadEnergyVec(const std::vector< uint8_t > &)
set hadEnergyVec - hadEnergy for all time slices
void setHadErrorVec(const std::vector< uint32_t > &)
set hadErrorVec - hadError for all time slices
uint32_t hadSliceError(unsigned int slice) const
get hadError for hadErrorVec[slice] - time slice for arbitary slice
uint8_t peak() const
void setEmEnergyVec(const std::vector< uint8_t > &)
set emEnergyVec - emEnergy for all time slices
void setEta(float)
set eta
virtual void initialize(const float eta, const float phi)
initialize
void setPhi(float)
set phi
const std::vector< uint8_t > & hadEnergyVec() const
get hadEnergyVec - hadEnergy for all time slices
const std::vector< uint32_t > & emErrorVec() const
get emErrorVec - emError for all time slices
uint32_t emError() const
uint32_t emSliceError(unsigned int slice) const
get emError for emErrorVec[slice] - time slice for arbitary slice
uint8_t emSliceEnergy(unsigned int slice) const
get emEnergy for emEnergyVec[slice] - time slice for arbitary slice
float eta() const
get eta
const std::vector< uint32_t > & hadErrorVec() const
get hadErrorVec - hadError for all time slices
uint32_t hadError() const
Forward declaration.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
setEventNumber uint32_t