CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/Calibration/IsolatedParticles/src/DebugInfo.cc

Go to the documentation of this file.
00001 #include "Calibration/IsolatedParticles/interface/DebugInfo.h"
00002 #include "DataFormats/EcalDetId/interface/EBDetId.h"
00003 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
00004 #include "DataFormats/EcalDetId/interface/EEDetId.h"
00005 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
00006 
00007 #include<iostream>
00008 
00009 namespace spr{
00010 
00011   void debugEcalDets(unsigned int i, const DetId& det, bool flag) {
00012 
00013     std::cout << "Cell [" << i << "] 0x";
00014     if (det.subdetId() == EcalBarrel) {
00015       EBDetId id = det;
00016       std::cout << std::hex << det() << std::dec << " " << id;
00017     } else if (det.subdetId() == EcalEndcap) {
00018       EEDetId id = det;
00019       std::cout << std::hex << det() << std::dec << " " << id;
00020     } else {
00021       std::cout << std::hex << det() << std::dec << " Unknown Type";
00022     }
00023     if (flag) std::cout << std::endl;
00024   }
00025  
00026   void debugEcalDets(unsigned int last, std::vector<DetId>& vdets) {
00027 
00028      for (unsigned int i=last; i<vdets.size(); ++i) {
00029        debugEcalDets (i, vdets[i], true);
00030      }
00031   }
00032 
00033   void debugEcalDets(unsigned int last, std::vector<DetId>& vdets, 
00034                      std::vector<CaloDirection>& dirs) {
00035 
00036     for (unsigned int i=last; i<vdets.size(); ++i) {
00037       debugEcalDets (i, vdets[i], false);
00038       std::cout << " along " << dirs[i] << std::endl;
00039     }
00040   }
00041 
00042   void debugHcalDets(unsigned int last, std::vector<DetId>& vdets) {
00043 
00044     for (unsigned int i=last; i<vdets.size(); ++i) {
00045       HcalDetId id = vdets[i]();
00046       std::cout << "Cell [" << i << "] 0x" << std::hex << vdets[i]() 
00047                 << std::dec << " " << id << std::endl;
00048     }
00049   }
00050 }