CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/L1Trigger/RegionalCaloTrigger/interface/L1RCTCrate.h

Go to the documentation of this file.
00001 #ifndef L1RCTCrate_h
00002 #define L1RCTCRate_h
00003 
00004 #include <vector>
00005 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTReceiverCard.h"
00006 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTElectronIsolationCard.h"
00007 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTJetSummaryCard.h"
00008 
00009 class L1RCTLookupTables;
00010 
00011 class L1RCTCrate {
00012 
00013  public:
00014   L1RCTCrate(int crtNo, const L1RCTLookupTables* rctLookupTables);
00015 
00016   ~L1RCTCrate();
00017 
00018   int crateNumber(){return crtNo;}
00019 
00020   //For sharing information between crates.
00021   //It passes the pointers to the cards rather than the copies of the cards
00022   //because we need to modify the actual regions when setting their
00023   //neighbors rather than just copies.
00024   //Working in non garbage collected languages can really suck sometimes.
00025   L1RCTReceiverCard* getReceiverCard(int i) { return &receiverCards.at(i);}
00026   // L1RCTJetSummaryCard* getJetSummaryCard { return &jetSummaryCard;}
00027   
00028   //This method receives the input from the L1RCT class and distributes
00029   //the RCInput to the 7 receiver cards and sends the HFInput straight
00030   //to the JSC for this crate.  The RCs never see the HF data.  Instead
00031   //the JSC acts like a primitive RC for these regions.
00032   void input(std::vector<std::vector<unsigned short> > RCInput,
00033              std::vector<unsigned short> HFInput);
00034   //The two following are methods for running the actual data processing
00035   //in the RCs and the EICs.  They're to be called for each card
00036   //from the L1RCT process method
00037   void processReceiverCards();
00038   void fillElectronIsolationCards();
00039   void processElectronIsolationCards();
00040   //Pulls the information from the RCs and EICs and sends it to the 
00041   //JSC.
00042   void fillJetSummaryCard();
00043   void processJetSummaryCard();
00044   void print();
00045   void printJSC(){
00046     jetSummaryCard.print();
00047   }
00048   void printRC(int i){
00049     receiverCards.at(i).print();
00050   }
00051   void printEIC(int i){
00052     electronCards.at(i).print();
00053   }
00054   void printEICEdges(int i){
00055     electronCards.at(i).printEdges();
00056   }
00057 
00058   // region sums
00059   std::vector<unsigned short> getJetRegions(){
00060     return jetSummaryCard.getJetRegions();
00061   }
00062   std::vector<unsigned short> getBarrelRegions(){
00063     return jetSummaryCard.getBarrelRegions();
00064   }
00065   std::vector<unsigned short> getHFRegions(){
00066     return jetSummaryCard.getHFRegions();
00067   }
00068 
00069   // e-gamma objects
00070   std::vector<unsigned short> getIsolatedEGObjects(){
00071     return jetSummaryCard.getIsolatedEGObjects();
00072   }
00073   std::vector<unsigned short> getNonisolatedEGObjects(){
00074     return jetSummaryCard.getNonisolatedEGObjects();
00075   }
00076 
00077   // the bits
00078   unsigned short getTauBits(){
00079     return jetSummaryCard.getTauBits();
00080   }
00081   unsigned short getMIPBits(){
00082     return jetSummaryCard.getMIPBits();
00083   }
00084   unsigned short getOverFlowBits(){
00085     return jetSummaryCard.getOverFlowBits();
00086   }
00087   unsigned short getQuietBits(){
00088     return jetSummaryCard.getQuietBits();
00089   }
00090   // hf bit
00091   std::vector<unsigned short> getHFFineGrainBits(){
00092     return jetSummaryCard.getHFFineGrainBits();
00093   }
00094 
00095  private:
00096   //The seven RCs and EICs
00097   //They are laid out according to CMS IN 2004/008
00098   //Increasing number towards higher absolute eta
00099   //The seventh card is always sideways with respect to the
00100   //other six.
00101   std::vector<L1RCTReceiverCard> receiverCards;
00102   std::vector<L1RCTElectronIsolationCard> electronCards;
00103   //The JSC receives the jet and electron information from the 
00104   //RCs and EICs.  There is only one per crate.
00105   L1RCTJetSummaryCard jetSummaryCard;
00106   
00107   int crtNo;
00108   const L1RCTLookupTables* rctLookupTables_;
00109 
00110   L1RCTCrate();
00111 
00112   //L1RCTJetCaptureCard jetCaptureCard;
00113 };
00114 #endif