Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include <iostream>
0002 #include <fstream>
0003 #include <iomanip>
0004 #include <vector>
0005 
0006 #include "DataFormats/L1CaloTrigger/interface/L1CaloRegionDetId.h"
0007 
0008 using namespace std;
0009 
0010 // print the region map and region-associated data (rct/gct card/input numbers)
0011 
0012 void makePlot(ofstream& of, int plot);
0013 
0014 int main() {
0015   // RCT crate number
0016   ofstream rctCratePlot("rctCratePlot.txt");
0017   makePlot(rctCratePlot, 2);
0018 
0019   // RCT card number
0020   ofstream rctCardPlot("rctCardPlot.txt");
0021   makePlot(rctCardPlot, 3);
0022 
0023   // RCT region number
0024   ofstream rctRgnPlot("rctRgnPlot.txt");
0025   makePlot(rctRgnPlot, 4);
0026 
0027   // RCT phi
0028   ofstream rctPhiPlot("rctPhiPlot.txt");
0029   makePlot(rctPhiPlot, 5);
0030 
0031   // RCT eta
0032   ofstream rctEtaPlot("rctEtaPlot.txt");
0033   makePlot(rctEtaPlot, 6);
0034 
0035   // forward
0036   ofstream fwdRgnPlot("fwdRgnPlot.txt");
0037   makePlot(fwdRgnPlot, 7);
0038 
0039   return 0;
0040 }
0041 
0042 void makePlot(ofstream& of, int plot) {
0043   // print header line
0044   of << "     ieta->" << endl;
0045   of << "    : ";
0046   for (int ieta = 0; ieta < 22; ieta++) {
0047     of << setw(3) << ieta << " ";
0048   }
0049   of << endl;
0050 
0051   // main loop
0052   for (int iphi = 0; iphi < 18; iphi++) {
0053     of << setw(3) << iphi << "  : ";
0054 
0055     for (int ieta = 0; ieta < 22; ieta++) {
0056       L1CaloRegionDetId rgn(ieta, iphi);
0057 
0058       switch (plot) {
0059         case 2:
0060           of << setw(3) << rgn.rctCrate() << " ";
0061           break;
0062         case 3:
0063           of << setw(3) << rgn.rctCard() << " ";
0064           break;
0065         case 4:
0066           of << setw(3) << rgn.rctRegion() << " ";
0067           break;
0068         case 5:
0069           of << setw(3) << rgn.rctPhi() << " ";
0070           break;
0071         case 6:
0072           of << setw(3) << rgn.rctEta() << " ";
0073           break;
0074         case 7:
0075           of << setw(3) << (rgn.isHf() ? 1 : 0) << " ";
0076           break;
0077 
0078         default:
0079           break;
0080       }
0081     }
0082 
0083     of << endl;
0084   }
0085 }