ATLAS Offline Software
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 
16 namespace xAOD{
17 
19  SG::AuxElement()
20  {
21  }
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 )
51  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( CPMTower_v2 , float , eta , setEta )
54 
55 
56  uint8_t CPMTower_v2::emEnergy() const
57  {
58  return emSliceEnergy(peak());
59  }
60 
62  {
63  return hadSliceEnergy(peak());
64  }
65 
67  {
68  if( slice < emEnergyVec().size() ){
69  return emEnergyVec()[ slice ];
70  }
71  return 0;
72  }
73 
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 
93  {
94  if( slice < emErrorVec().size() ){
95  return emErrorVec()[ slice ];
96  }
97  return 0;
98  }
99 
101  {
102  if( slice < hadErrorVec().size() ){
103  return hadErrorVec()[ slice ];
104  }
105  return 0;
106  }
107 
108 } // namespace xAOD
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::CPMTower_v2::phi
float phi() const
get phi (note that for L1Calo phi runs from 0 to 2pi)
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
AuxStoreAccessorMacros.h
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
xAOD::CPMTower_v2::hadSliceEnergy
uint8_t hadSliceEnergy(unsigned int slice) const
get hadEnergy for hadEnergyVec[slice] - time slice for arbitary slice
Definition: CPMTower_v2.cxx:74
xAOD::CPMTower_v2::eta
float eta() const
get eta
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
Amg::setPhi
Amg::RotationMatrix3D setPhi(Amg::RotationMatrix3D mat, double angle, int convention=0)
Definition: EulerAnglesHelpers.h:102
xAOD::CPMTower_v2::setHadEnergyVec
void setHadEnergyVec(const std::vector< uint8_t > &)
set hadEnergyVec - hadEnergy for all time slices
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
xAOD::CPMTower_v2::hadSliceError
uint32_t hadSliceError(unsigned int slice) const
get hadError for hadErrorVec[slice] - time slice for arbitary slice
Definition: CPMTower_v2.cxx:100
perfmonmt-refit.slice
slice
Definition: perfmonmt-refit.py:52
xAOD::CPMTower_v2::emError
uint32_t emError() const
Definition: CPMTower_v2.cxx:82
CPMTower_v2.h
xAOD::CPMTower_v2::hadEnergyVec
const std::vector< uint8_t > & hadEnergyVec() const
get hadEnergyVec - hadEnergy for all time slices
xAOD::CPMTower_v2::emEnergyVec
const std::vector< uint8_t > & emEnergyVec() const
get emEnergyVec - emEnergy for all time slices
xAOD::CPMTower_v2::setHadErrorVec
void setHadErrorVec(const std::vector< uint32_t > &)
set hadErrorVec - hadError for all time slices
xAOD::CPMTower_v2::setEmErrorVec
void setEmErrorVec(const std::vector< uint32_t > &)
set emErrorVec - emError for all time slices
xAOD::CPMTower_v2::CPMTower_v2
CPMTower_v2()
Default constructor.
Definition: CPMTower_v2.cxx:18
xAOD::CPMTower_v2::peak
uint8_t peak() const
xAOD::CPMTower_v2::emErrorVec
const std::vector< uint32_t > & emErrorVec() const
get emErrorVec - emError for all time slices
xAOD::CPMTower_v2::initialize
virtual void initialize(const float eta, const float phi)
initialize
Definition: CPMTower_v2.cxx:24
xAOD::CPMTower_v2::emSliceError
uint32_t emSliceError(unsigned int slice) const
get emError for emErrorVec[slice] - time slice for arbitary slice
Definition: CPMTower_v2.cxx:92
xAOD::CPMTower_v2::emSliceEnergy
uint8_t emSliceEnergy(unsigned int slice) const
get emEnergy for emEnergyVec[slice] - time slice for arbitary slice
Definition: CPMTower_v2.cxx:66
xAOD::CPMTower_v2::hadError
uint32_t hadError() const
Definition: CPMTower_v2.cxx:87
xAOD::CPMTower_v2::setPeak
void setPeak(uint8_t)
xAOD::CPMTower_v2::hadErrorVec
const std::vector< uint32_t > & hadErrorVec() const
get hadErrorVec - hadError for all time slices
xAOD::CPMTower_v2::setEta
void setEta(float)
set eta
xAOD::CPMTower_v2::setPhi
void setPhi(float)
set phi
xAOD::CPMTower_v2::setEmEnergyVec
void setEmEnergyVec(const std::vector< uint8_t > &)
set emEnergyVec - emEnergy for all time slices
xAOD::CPMTower_v2::hadEnergy
uint8_t hadEnergy() const
get hadEnergy for hadEnergyVec[peak] - time slice that (hopefully) contains the collision
Definition: CPMTower_v2.cxx:61
xAOD::AUXSTORE_OBJECT_SETTER_AND_GETTER
AUXSTORE_OBJECT_SETTER_AND_GETTER(CaloRings_v1, RingSetLinks, ringSetLinks, setRingSetLinks) unsigned CaloRings_v1
Definition: CaloRings_v1.cxx:27
xAOD::CPMTower_v2
Description of CPMTower_v2.
Definition: CPMTower_v2.h:26