Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-09 22:24:50

0001 #include "Calibration/IsolatedParticles/interface/DebugInfo.h"
0002 #include "DataFormats/EcalDetId/interface/EBDetId.h"
0003 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
0004 #include "DataFormats/EcalDetId/interface/EEDetId.h"
0005 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0006 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0007 
0008 #include <iostream>
0009 
0010 namespace spr {
0011 
0012   std::ostringstream debugEcalDet(unsigned int i, const DetId& det) {
0013     std::ostringstream st1;
0014     st1 << "Cell [" << i << "] 0x";
0015     if (det.subdetId() == EcalBarrel) {
0016       EBDetId id(det);
0017       st1 << std::hex << det() << std::dec << " " << id;
0018     } else if (det.subdetId() == EcalEndcap) {
0019       EEDetId id(det);
0020       st1 << std::hex << det() << std::dec << " " << id;
0021     } else {
0022       st1 << std::hex << det() << std::dec << " Unknown Type";
0023     }
0024     return st1;
0025   }
0026 
0027   void debugEcalDets(unsigned int last, std::vector<DetId>& vdets) {
0028     for (unsigned int i = last; i < vdets.size(); ++i) {
0029       edm::LogVerbatim("IsoTrack") << spr::debugEcalDet(i, vdets[i]).str();
0030     }
0031   }
0032 
0033   void debugEcalDets(unsigned int last, std::vector<DetId>& vdets, std::vector<CaloDirection>& dirs) {
0034     for (unsigned int i = last; i < vdets.size(); ++i) {
0035       edm::LogVerbatim("IsoTrack") << spr::debugEcalDet(i, vdets[i]).str() << " along " << dirs[i] << std::endl;
0036     }
0037   }
0038 
0039   void debugHcalDets(unsigned int last, std::vector<DetId>& vdets) {
0040     for (unsigned int i = last; i < vdets.size(); ++i) {
0041       HcalDetId id = vdets[i]();
0042       edm::LogVerbatim("IsoTrack") << "Cell [" << i << "] 0x" << std::hex << vdets[i]() << std::dec << " " << id;
0043     }
0044   }
0045 }  // namespace spr