Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:38

0001 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTRegion.h"
0002 
0003 #include <vector>
0004 using std::vector;
0005 #include <iostream>
0006 using std::cout;
0007 using std::cerr;
0008 using std::endl;
0009 
0010 int main(){
0011   //Create a vector to be used in the borders and then set it to be
0012   //1 2 3 4 and use it as the borders to make sure that all the orientations
0013   //are being preserved correctly.  We'll also make sure all the corners
0014   //are working correctly.
0015   //We'll also set the Et of each of the elements in the main
0016   //region itself, 30-46
0017   //That way the region will ultimately look like *this*
0018   //7BitEt 10  1  2  3  4 11
0019   //       1  30 31 32 33  1
0020   //       2  34 35 36 37  2
0021   //       3  38 39 40 41  3
0022   //       4  42 43 44 45  4
0023   //       12  1  2  3  4 13
0024 
0025   //9BitEt    30 31 32 33
0026   //          34 35 36 37
0027   //          38 39 40 41
0028   //          42 43 44 45
0029 
0030   //HE_FG   1 0 1 0 1 0
0031   //        0 0 1 0 1 0
0032   //        1 0 1 0 1 1
0033   //        0 0 1 0 1 0
0034   //        1 0 1 0 1 1
0035   //        1 0 1 0 1 0
0036 
0037   std::vector<unsigned short> thing(4);
0038   std::vector<unsigned short> fgthing(4);
0039   fgthing.at(0)=0;
0040   fgthing.at(1)=1;
0041   fgthing.at(2)=0;
0042   fgthing.at(3)=1;
0043   thing.at(0)=1;
0044   thing.at(1)=2;
0045   thing.at(2)=3;
0046   thing.at(3)=4;
0047   unsigned short nw = 10, ne = 11, sw = 12, se = 13;
0048   unsigned short nwhe = 1, nehe = 0, swhe = 1, sehe = 0;
0049   L1RCTRegion region;
0050   for(int i = 0;i<4;i++){
0051     for(int j = 0;j<4;j++){
0052       region.setEtIn7Bits(i,j,30+j+4*i);
0053       region.setEtIn9Bits(i,j,30+j+4*i);
0054       region.setHE_FGBit(i,j,(4*i+j)%2);
0055     }
0056   }
0057   region.setNorthEt(thing);
0058   region.setNorthHE_FG(fgthing);
0059   region.setSouthEt(thing);
0060   region.setSouthHE_FG(fgthing);
0061   region.setWestEt(thing);
0062   region.setWestHE_FG(fgthing);
0063   region.setEastEt(thing);
0064   region.setEastHE_FG(fgthing);
0065   region.setSEEt(se);
0066   region.setSEHE_FG(sehe);
0067   region.setSWEt(sw);
0068   region.setSWHE_FG(swhe);
0069   region.setNEEt(ne);
0070   region.setNEHE_FG(nehe);
0071   region.setNWEt(nw);
0072   region.setNWHE_FG(nwhe);
0073 
0074   std::cout << "northEt ";
0075   for(int i=0;i<4;i++){
0076     std::cout << region.getEtIn7Bits(-1,i);
0077   }
0078   std::cout << std::endl;
0079 
0080   std::cout << "westEt ";
0081   for(int i=0;i<4;i++){
0082     std::cout << region.getEtIn7Bits(i,-1);
0083   }
0084   std::cout << std::endl;
0085 
0086   std::cout << "eastEt ";
0087   for(int i=0;i<4;i++){
0088     std::cout << region.getEtIn7Bits(i,4);
0089   }
0090   std::cout << std::endl;
0091 
0092   std::cout << "southEt ";
0093   for(int i=0;i<4;i++){
0094     std::cout << region.getEtIn7Bits(4,i);
0095   }
0096   std::cout << std::endl;
0097 
0098   std::cout << "given North Et ";
0099   std::vector<unsigned short> n = region.giveNorthEt();
0100   for(int i=0;i<4;i++){
0101     std::cout << n.at(i) << " ";
0102   }
0103   std::cout << std::endl;
0104 
0105   std::cout << "given North HEFG ";
0106   std::vector<unsigned short> nhe = region.giveNorthHE_FG();
0107   for(int i=0;i<4;i++){
0108     std::cout << nhe.at(i) << " ";
0109   }
0110   std::cout << std::endl;
0111 
0112   std::cout << "given South Et ";
0113   std::vector<unsigned short> s = region.giveSouthEt();
0114   for(int i=0;i<4;i++){
0115     std::cout << s.at(i) << " ";
0116   }
0117   std::cout << std::endl;
0118 
0119   std::cout << "given South HEFG ";
0120   std::vector<unsigned short> she = region.giveSouthHE_FG();
0121   for(int i=0;i<4;i++){
0122     std::cout << she.at(i) << " ";
0123   }
0124   std::cout << std::endl;
0125 
0126   std::cout << "given East et ";
0127   std::vector<unsigned short> e = region.giveEastEt();
0128   for(int i=0;i<4;i++){
0129     std::cout << e.at(i) << " ";
0130   }
0131   std::cout << std::endl;
0132 
0133   std::cout << "given East HEFG ";
0134   std::vector<unsigned short> ehe = region.giveEastEt();
0135   for(int i=0;i<4;i++){
0136     std::cout << e.at(i) << " ";
0137   }
0138   std::cout << std::endl;
0139 
0140   std::cout << "given West et ";
0141   std::vector<unsigned short> w = region.giveWestEt();
0142   for(int i=0;i<4;i++){
0143     std::cout << w.at(i) << " ";
0144   }
0145   std::cout << std::endl;
0146 
0147 
0148   std::cout << "7BitEt ";
0149   for(int i=-1;i<5;i++){
0150     std::cout << std::endl;
0151     for(int j=-1;j<5;j++){
0152       std::cout << region.getEtIn7Bits(i,j) << " ";
0153     }
0154   }
0155   std::cout << std::endl;
0156   std::cout << "HEFG ";
0157   for(int i=-1;i<5;i++){
0158     std::cout << std::endl;
0159     for(int j=-1;j<5;j++){
0160       std::cout << region.getHE_FGBit(i,j) << " ";
0161     }
0162   }
0163   std::cout << std::endl;
0164 }
0165   
0166