File indexing completed on 2024-04-06 12:21:37
0001 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTORCAMap.h"
0002 #include <iostream>
0003 #include <vector>
0004 using std::vector;
0005 using std::cout;
0006 using std::endl;
0007 int main() {
0008 L1RCTORCAMap theMap;
0009 std::cout << theMap.combine(10,0) << " should equal 10" << std::endl;
0010 std::cout << theMap.combine(0,1) << " should equal 256" << std::endl;
0011 std::cout << theMap.combine(30,1) << " should equal 286" << std::endl;
0012
0013 std::vector<bool> fgbool(56*72);
0014 std::vector<unsigned> het(56*72);
0015 std::vector<unsigned> hfet(18*8);
0016 std::vector<unsigned> eet(56*72);
0017
0018 std::vector<unsigned short> et(56*72);
0019 et.at(0) = 1;
0020 std::vector<unsigned short> fg(56*72);
0021 fg.at(0) = 1;
0022
0023 et.at(1) = 34;
0024 fg.at(1) = 0;
0025
0026 std::vector<unsigned short> vec = theMap.combVec(et,fg);
0027
0028 std::cout << vec.at(0) << " should equal 257" << std::endl;
0029 std::cout << vec.at(1) << " should equal 34" << std::endl;
0030
0031 for(int phi=0;phi<72;phi++){
0032 for(int eta=0;eta<56;eta++){
0033 eet.at(56*phi+eta) = 56*phi+eta;
0034 }
0035 }
0036 theMap.readData(eet,het,fgbool,fgbool,hfet);
0037 std::vector<std::vector<std::vector<unsigned short> > > barrel = theMap.giveBarrel();
0038
0039 for(int i=0;i<18;i++){
0040 for(int j=0;j<7;j++){
0041 for(int k=0;k<32;k++){
0042 cout << "crate " << i << " card " << j << " tower " << k << " value " << barrel.at(i).at(j).at(k) << std::endl;
0043 }
0044 }
0045 }
0046
0047 }