Skip to content

Commit

Permalink
code-format
Browse files Browse the repository at this point in the history
  • Loading branch information
igv4321 committed May 15, 2020
1 parent 65ce618 commit f1e8061
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions DataFormats/HcalRecHit/src/HBHEChannelInfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,38 @@ namespace {
template <typename T>
void dumpArray(std::ostream& s, const char* p, const T* arr, const unsigned len) {
s << ' ' << p;
for (unsigned i=0; i<len; ++i) {s << ' ' << *arr++;}
for (unsigned i = 0; i < len; ++i) {
s << ' ' << *arr++;
}
}

template <typename T>
void dumpArrayAsUnsigned(std::ostream& s, const char* p, const T* arr, const unsigned len) {
s << ' ' << p;
for (unsigned i=0; i<len; ++i) {s << ' ' << static_cast<unsigned>(*arr++);}
for (unsigned i = 0; i < len; ++i) {
s << ' ' << static_cast<unsigned>(*arr++);
}
}
}
} // namespace

std::ostream& operator<<(std::ostream& s, const HBHEChannelInfo& inf) {
const unsigned nSamples = inf.nSamples();

s << inf.id() << " :"
<< " recoShape " << inf.recoShape()
<< " nSamples " << nSamples
<< " soi " << inf.soi()
<< " capid " << inf.capid()
<< " hasTDC " << inf.hasTimeInfo()
<< " hasEffPeds " << inf.hasEffectivePedestals()
<< " dropped " << inf.isDropped()
<< " linkErr " << inf.hasLinkError()
<< " capidErr " << inf.hasCapidError()
<< " darkI " << inf.darkCurrent()
<< " fcByPE " << inf.fcByPE()
<< " lambda " << inf.lambda();
<< " recoShape " << inf.recoShape() << " nSamples " << nSamples << " soi " << inf.soi() << " capid " << inf.capid()
<< " hasTDC " << inf.hasTimeInfo() << " hasEffPeds " << inf.hasEffectivePedestals() << " dropped "
<< inf.isDropped() << " linkErr " << inf.hasLinkError() << " capidErr " << inf.hasCapidError() << " darkI "
<< inf.darkCurrent() << " fcByPE " << inf.fcByPE() << " lambda " << inf.lambda();
dumpArray(s, "rawCharge", inf.rawCharge(), nSamples);
dumpArray(s, "peds", inf.pedestal(), nSamples);
dumpArray(s, "noise", inf.pedestalWidth(), nSamples);
dumpArray(s, "gain", inf.gain(), nSamples);
dumpArray(s, "gainWidth", inf.gainWidth(), nSamples);
dumpArray(s, "dFcPerADC", inf.dFcPerADC(), nSamples);
dumpArrayAsUnsigned(s, "adc", inf.adc(), nSamples);
if (inf.hasTimeInfo()) {dumpArray(s, "tdc", inf.riseTime(), nSamples);}
if (inf.hasTimeInfo()) {
dumpArray(s, "tdc", inf.riseTime(), nSamples);
}

return s;
}

0 comments on commit f1e8061

Please sign in to comment.