Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:19

0001 #include "DataFormats/HcalRecHit/interface/HBHEChannelInfo.h"
0002 
0003 namespace {
0004   template <typename T>
0005   void dumpArray(std::ostream& s, const char* p, const T* arr, const unsigned len) {
0006     s << ' ' << p;
0007     for (unsigned i = 0; i < len; ++i) {
0008       s << ' ' << *arr++;
0009     }
0010   }
0011 
0012   template <typename T>
0013   void dumpArrayAsUnsigned(std::ostream& s, const char* p, const T* arr, const unsigned len) {
0014     s << ' ' << p;
0015     for (unsigned i = 0; i < len; ++i) {
0016       s << ' ' << static_cast<unsigned>(*arr++);
0017     }
0018   }
0019 }  // namespace
0020 
0021 std::ostream& operator<<(std::ostream& s, const HBHEChannelInfo& inf) {
0022   const unsigned nSamples = inf.nSamples();
0023 
0024   s << inf.id() << " :"
0025     << " recoShape " << inf.recoShape() << " nSamples " << nSamples << " soi " << inf.soi() << " capid " << inf.capid()
0026     << " hasTDC " << inf.hasTimeInfo() << " hasEffPeds " << inf.hasEffectivePedestals() << " dropped "
0027     << inf.isDropped() << " linkErr " << inf.hasLinkError() << " capidErr " << inf.hasCapidError() << " darkI "
0028     << inf.darkCurrent() << " fcByPE " << inf.fcByPE() << " lambda " << inf.lambda();
0029   dumpArray(s, "rawCharge", inf.rawCharge(), nSamples);
0030   dumpArray(s, "peds", inf.pedestal(), nSamples);
0031   dumpArray(s, "noise", inf.pedestalWidth(), nSamples);
0032   dumpArray(s, "gain", inf.gain(), nSamples);
0033   dumpArray(s, "gainWidth", inf.gainWidth(), nSamples);
0034   dumpArray(s, "dFcPerADC", inf.dFcPerADC(), nSamples);
0035   dumpArrayAsUnsigned(s, "adc", inf.adc(), nSamples);
0036   if (inf.hasTimeInfo()) {
0037     dumpArray(s, "tdc", inf.riseTime(), nSamples);
0038   }
0039 
0040   return s;
0041 }