File indexing completed on 2024-04-06 12:19:55
0001
0002 #include <iostream>
0003 #include <fstream>
0004 #include <iomanip>
0005
0006 #include "DataFormats/L1CaloTrigger/interface/L1CaloRegionDetId.h"
0007
0008 using std::cout;
0009 using std::endl;
0010 using std::ofstream;
0011 using std::setw;
0012
0013
0014
0015 void makePlot(ofstream& of, int plot);
0016
0017 int main() {
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 ofstream rctCratePlot("rctCratePlot.txt");
0032 makePlot(rctCratePlot, 2);
0033
0034
0035 ofstream rctCardPlot("rctCardPlot.txt");
0036 makePlot(rctCardPlot, 3);
0037
0038
0039 ofstream rctRgnPlot("rctRgnPlot.txt");
0040 makePlot(rctRgnPlot, 4);
0041
0042
0043 ofstream rctPhiPlot("rctPhiPlot.txt");
0044 makePlot(rctPhiPlot, 5);
0045
0046
0047 ofstream rctEtaPlot("rctEtaPlot.txt");
0048 makePlot(rctEtaPlot, 6);
0049
0050
0051 ofstream fwdRgnPlot("fwdRgnPlot.txt");
0052 makePlot(fwdRgnPlot, 7);
0053
0054
0055 for (unsigned crate = 0; crate < 18; crate++) {
0056 for (unsigned card = 0; card < 7; card++) {
0057 for (unsigned rgn = 0; rgn < 2; rgn++) {
0058 L1CaloRegionDetId r(crate, card, rgn);
0059 if ((r.rctCrate() != crate) || (r.rctCard() != card) || (r.rctRegion() != rgn)) {
0060 cout << "Error! : RCT crate " << crate << " card " << card << " region " << rgn << endl;
0061 }
0062 }
0063 }
0064 }
0065
0066
0067 for (unsigned crate = 0; crate < 18; crate++) {
0068 for (unsigned rgn = 0; rgn < 8; rgn++) {
0069 L1CaloRegionDetId r(crate, 999, rgn);
0070 if ((r.rctCrate() != crate) || (r.rctRegion() != rgn)) {
0071 cout << "Error! : RCT crate " << crate << " HF region " << rgn << endl;
0072 }
0073 }
0074 }
0075
0076 return 0;
0077 }
0078
0079 void makePlot(ofstream& of, int plot) {
0080
0081 of << " ieta->" << endl;
0082 of << " : ";
0083 for (int ieta = 0; ieta < 22; ieta++) {
0084 of << setw(3) << ieta << " ";
0085 }
0086 of << endl;
0087
0088
0089 for (int iphi = 0; iphi < 18; iphi++) {
0090 of << setw(3) << iphi << " : ";
0091
0092 for (int ieta = 0; ieta < 22; ieta++) {
0093 L1CaloRegionDetId rgn(ieta, iphi);
0094
0095 switch (plot) {
0096
0097
0098
0099
0100
0101
0102
0103
0104 case 2:
0105 of << setw(3) << rgn.rctCrate() << " ";
0106 break;
0107 case 3:
0108 of << setw(3) << rgn.rctCard() << " ";
0109 break;
0110 case 4:
0111 of << setw(3) << rgn.rctRegion() << " ";
0112 break;
0113 case 5:
0114 of << setw(3) << rgn.rctPhi() << " ";
0115 break;
0116 case 6:
0117 of << setw(3) << rgn.rctEta() << " ";
0118 break;
0119 case 7:
0120 of << setw(3) << (rgn.isHf() ? 1 : 0) << " ";
0121 break;
0122
0123 default:
0124 break;
0125 }
0126 }
0127
0128 of << endl;
0129 }
0130 }