Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:15

0001 // prints EBDetId mappings for humans to check over
0002 
0003 #include <iostream>
0004 #include <string>
0005 #include <stdexcept>
0006 
0007 #include "DataFormats/EcalDetId/interface/EBDetId.h"
0008 
0009 using namespace std;
0010 
0011 int main(int argc, char* argv[]) {
0012   try {
0013     for (int SM = 1; SM <= 36; SM++) {
0014       for (int crystal = 1; crystal <= 1700; crystal++) {
0015         EBDetId detid(SM, crystal, EBDetId::SMCRYSTALMODE);
0016         cout << "SMCRYSTALMODE: SM " << SM << " Crystal " << crystal << " -> "
0017              << "ieta " << detid.ieta() << " iphi " << detid.iphi() << endl;
0018         if (SM != detid.ism() || crystal != detid.ic()) {
0019           cout << "^^^ INSANE ^^^" << endl;
0020         }
0021       }
0022     }
0023 
0024     for (int ieta = -EBDetId::MAX_IETA; ieta <= EBDetId::MAX_IETA; ieta++) {
0025       if (ieta == 0)
0026         continue;
0027       for (int iphi = EBDetId::MIN_IPHI; iphi <= EBDetId::MAX_IPHI; iphi++) {
0028         EBDetId detid(ieta, iphi);
0029         cout << "ETAPHIMODE: ieta " << ieta << " iphi " << iphi << " -> "
0030              << "SM " << detid.ism() << " Crystal " << detid.ic() << endl;
0031         if (ieta != detid.ieta() || iphi != detid.iphi()) {
0032           cout << "^^^ INSANE ^^^" << endl;
0033         }
0034       }
0035     }
0036   } catch (exception& e) {
0037     cerr << e.what();
0038   }
0039 }