ATLAS Offline Software
Loading...
Searching...
No Matches
ZdcToString.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include <sstream>
7
8
9//namespace {
10
11template<typename T>
12std::string ZdcToString(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 ZdcToString(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
34 /*
35 << ", lut_cp=" << ::ZdcToString(tt.lut_cp())
36 << ", lut_jep=" << ::ZdcToString(tt.lut_jep())
37 << ", correction=" << ::ZdcToString(tt.correction())
38 << ", correctionEnabled=" << ::ZdcToString(tt.correctionEnabled())
39 << ", bcidVec=" << ::ZdcToString(tt.bcidVec())
40 << ", adc=" << ::ZdcToString(tt.adc())
41 << ", bcidExt=" << ::ZdcToString(tt.bcidExt())
42 */
43
44 << ", lut_cp=" << ZdcToString(tt.lut_cp())
45 << ", lut_jep=" << ZdcToString(tt.lut_jep())
46 << ", correction=" << ZdcToString(tt.correction())
47 << ", correctionEnabled=" << ZdcToString(tt.correctionEnabled())
48 << ", bcidVec=" << ZdcToString(tt.bcidVec())
49 << ", adc=" << ZdcToString(tt.adc())
50 << ", bcidExt=" << ZdcToString(tt.bcidExt())
51
52 << ", errorWord=" << tt.errorWord()
53 << ", peak=" << int(tt.peak())
54 << ", adcPeak=" << int(tt.adcPeak());
55 if (!tt.lut_cp().empty()) {
56 o << ", cpET=" << int(tt.cpET());
57 }
58 if (!tt.lut_jep().empty()) {
59 o << ", jepET=" << int(tt.jepET());
60 }
61
62 }
63
64 return o.str();
65}
66
68 std::stringstream o;
70 iter != tt.end(); ++iter){
71 o << ZdcToString(**iter) << std::endl;
72 }
73 return o.str();
74}
75
76std::string ZdcToString(const xAOD::CPMTower& cpm){
77 std::stringstream o;
78
79 o << "xAOD::CPMTower"
80 << ", eta=" << cpm.eta()
81 << ", phi=" << cpm.phi()
82 << ", em peak energy=" << cpm.emEnergy()
83 << ", had peak energy=" << cpm.hadEnergy()
84 ;
85
86 return o.str();
87}
88
89std::string ZdcToString(const xAOD::CPMTowerContainer& tt){
90 std::stringstream o;
91 for(auto iter = tt.begin();
92 iter != tt.end(); ++iter){
93 o << ZdcToString(**iter) << std::endl;
94 }
95 return o.str();
96}
97
std::string ZdcToString(const std::vector< T > &vv)
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
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.