ATLAS Offline Software
Loading...
Searching...
No Matches
ToString.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#include "ToString.h"
6#include <sstream>
7
8
9namespace {
10
11 template<typename T>
12 std::string ToString(const std::vector<T>& vv){
13 std::stringstream o;
14 std::string delim = "";
15 for(auto val: vv){
16 o << delim << int(val) << /*"(0x" << std::hex << int(val) << ")" << */ std::dec;
17 delim ="|";
18 }
19 return o.str();
20 }
21}
22
23std::string LVL1BS::ToString(const xAOD::TriggerTower& tt){
24 std::stringstream o;
25 if(tt.coolId() == 0) {
26 o << "xAOD::TriggerTower, coolId=0";
27 } else {
28 o << "xAOD::TriggerTower, coolId=" << std::hex << tt.coolId() << std::dec
29 << ", layer=" << int(tt.layer())
30 << ", sampling=" << int(tt.sampling())
31 << ", eta=" << tt.eta()
32 << ", phi=" << tt.phi()
33 << ", lut_cp=" << ::ToString(tt.lut_cp())
34 << ", lut_jep=" << ::ToString(tt.lut_jep())
35 << ", correction=" << ::ToString(tt.correction())
36 << ", correctionEnabled=" << ::ToString(tt.correctionEnabled())
37 << ", bcidVec=" << ::ToString(tt.bcidVec())
38 << ", adc=" << ::ToString(tt.adc())
39 << ", bcidExt=" << ::ToString(tt.bcidExt())
40 << ", errorWord=" << tt.errorWord()
41 << ", peak=" << int(tt.peak())
42 << ", adcPeak=" << int(tt.adcPeak());
43 if (!tt.lut_cp().empty()) {
44 o << ", cpET=" << int(tt.cpET());
45 }
46 if (!tt.lut_jep().empty()) {
47 o << ", jepET=" << int(tt.jepET());
48 }
49
50 }
51
52 return o.str();
53}
54
56 std::stringstream o;
58 iter != tt.end(); ++iter){
59 o << ToString(**iter) << std::endl;
60 }
61 return o.str();
62}
63
64std::string LVL1BS::ToString(const xAOD::CPMTower& cpm){
65 std::stringstream o;
66
67 o << "xAOD::CPMTower"
68 << ", eta=" << cpm.eta()
69 << ", phi=" << cpm.phi()
70 << ", em peak energy=" << cpm.emEnergy()
71 << ", had peak energy=" << cpm.hadEnergy()
72 ;
73
74 return o.str();
75}
76
78 std::stringstream o;
79 for(auto iter = tt.begin();
80 iter != tt.end(); ++iter){
81 o << ToString(**iter) << std::endl;
82 }
83 return o.str();
84}
85
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
uint8_t emEnergy() const
get emEnergy for emEnergyVec[peak] - time slice that (hopefully) contains the collision
uint8_t hadEnergy() const
get hadEnergy for hadEnergyVec[peak] - time slice that (hopefully) contains the collision
float phi() const
get phi (note that for L1Calo phi runs from 0 to 2pi)
float eta() const
get eta
std::string ToString(const xAOD::TriggerTower &tt)
Definition ToString.cxx:23
CPMTowerContainer_v2 CPMTowerContainer
Define the latest version of the CPMHits container.
TriggerTowerContainer_v2 TriggerTowerContainer
Define the latest version of the TriggerTower container.
CPMTower_v2 CPMTower
Define the latest version of the CPMTower class.
TriggerTower_v2 TriggerTower
Define the latest version of the TriggerTower class.