Go to the documentation of this file.00001 #ifndef L1RCT_h
00002 #define L1RCT_h
00003
00004 #include <vector>
00005 #include <bitset>
00006 #include <iostream>
00007 #include <iomanip>
00008 #include <string>
00009
00010 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTCrate.h"
00011 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTNeighborMap.h"
00012
00013 #include "DataFormats/L1CaloTrigger/interface/L1CaloRegion.h"
00014 #include "DataFormats/L1CaloTrigger/interface/L1CaloCollections.h"
00015 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
00016 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
00017
00018 class L1RCTLookupTables;
00019
00020 class L1RCT {
00021
00022 public:
00023
00024 L1RCT(const L1RCTLookupTables* rctLookupTables);
00025
00026
00027 void input();
00028
00029
00030 void input(std::vector<std::vector<std::vector<unsigned short> > > barrelIn,
00031 std::vector<std::vector<unsigned short> > hfIn);
00032
00033
00034
00035
00036 void processEvent();
00037
00038 void fileInput(const char* filename);
00039
00040 void digiInput(const EcalTrigPrimDigiCollection& ecalCollection,
00041 const HcalTrigPrimDigiCollection& hcalCollection);
00042
00043 void randomInput();
00044
00045 void print();
00046 void printCrate(int i){
00047 crates.at(i).print();
00048 }
00049 void printJSC(int i){
00050 crates.at(i).printJSC();
00051 }
00052 void printJSC(){
00053 for(int i=0;i<18;i++){
00054 std::cout << "JSC for Crate " << i << std::endl;
00055 crates.at(i).printJSC();
00056 }
00057 }
00058 void printRC(int i, int j){
00059 crates.at(i).printRC(j);
00060 }
00061 void printEIC(int i, int j){
00062 crates.at(i).printEIC(j);
00063 }
00064 void printEICEdges(int i, int j){
00065 crates.at(i).printEICEdges(j);
00066 }
00067
00068 L1CaloEmCollection getIsolatedEGObjects(unsigned crate);
00069
00070 L1CaloEmCollection getNonisolatedEGObjects(unsigned crate);
00071
00072 std::vector<unsigned short> getJetRegions(unsigned crate){
00073 return crates.at(crate).getJetRegions();
00074 }
00075
00076 std::vector<L1CaloRegion> getRegions(unsigned crate);
00077
00078 unsigned short ecalCompressedET(int crate, int card, int tower)
00079 {return barrel.at(crate).at(card).at(tower) / 2;}
00080 unsigned short ecalFineGrainBit(int crate, int card, int tower)
00081 {return barrel.at(crate).at(card).at(tower) & 1;}
00082 unsigned short hcalCompressedET(int crate, int card, int tower)
00083 {return barrel.at(crate).at(card).at(tower+32) / 2;}
00084 unsigned short hcalFineGrainBit(int crate, int card, int tower)
00085 {return barrel.at(crate).at(card).at(tower+32) & 1;}
00086 unsigned short hfCompressedET(int crate, int tower)
00087 {return hf.at(crate).at(tower) / 2;}
00088 unsigned short hfFineGrainBit(int crate, int tower)
00089 {return hf.at(crate).at(tower) & 1;}
00090
00091 private:
00092
00093 L1RCT();
00094
00095 const L1RCTLookupTables* rctLookupTables_;
00096
00097
00098
00099
00100 void makeCrates();
00101 void configureCards();
00102 void shareNeighbors();
00103
00104 L1RCTRegion empty;
00105
00106
00107
00108
00109
00110
00111 L1RCTNeighborMap neighborMap;
00112
00113
00114
00115
00116
00117
00118
00119 std::vector<L1RCTCrate> crates;
00120
00121
00122
00123
00124
00125
00126
00127
00128 std::vector<std::vector<std::vector<unsigned short> > > barrel;
00129 std::vector<std::vector<unsigned short> > hf;
00130
00131 };
00132
00133 #endif