Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-04 02:02:47

0001 #ifndef L1RCTCrate_h
0002 #define L1RCTCrate_h
0003 
0004 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTElectronIsolationCard.h"
0005 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTJetSummaryCard.h"
0006 #include "L1Trigger/RegionalCaloTrigger/interface/L1RCTReceiverCard.h"
0007 #include <vector>
0008 
0009 class L1RCTLookupTables;
0010 
0011 class L1RCTCrate {
0012 public:
0013   L1RCTCrate(int crtNo, const L1RCTLookupTables *rctLookupTables);
0014 
0015   L1RCTCrate() = delete;
0016 
0017   ~L1RCTCrate();
0018 
0019   int crateNumber() { return crtNo; }
0020 
0021   // For sharing information between crates.
0022   // It passes the pointers to the cards rather than the copies of the cards
0023   // because we need to modify the actual regions when setting their
0024   // neighbors rather than just copies.
0025   // Working in non garbage collected languages can really suck sometimes.
0026   L1RCTReceiverCard *getReceiverCard(int i) { return &receiverCards.at(i); }
0027   // L1RCTJetSummaryCard* getJetSummaryCard { return &jetSummaryCard;}
0028 
0029   // This method receives the input from the L1RCT class and distributes
0030   // the RCInput to the 7 receiver cards and sends the HFInput straight
0031   // to the JSC for this crate.  The RCs never see the HF data.  Instead
0032   // the JSC acts like a primitive RC for these regions.
0033   void input(const std::vector<std::vector<unsigned short>> &RCInput, const std::vector<unsigned short> &HFInput);
0034   // The two following are methods for running the actual data processing
0035   // in the RCs and the EICs.  They're to be called for each card
0036   // from the L1RCT process method
0037   void processReceiverCards();
0038   void fillElectronIsolationCards();
0039   void processElectronIsolationCards();
0040   // Pulls the information from the RCs and EICs and sends it to the
0041   // JSC.
0042   void fillJetSummaryCard();
0043   void processJetSummaryCard();
0044   void print();
0045   void printJSC() { jetSummaryCard.print(); }
0046   void printRC(int i) { receiverCards.at(i).print(); }
0047   void printEIC(int i) { electronCards.at(i).print(); }
0048   void printEICEdges(int i) { electronCards.at(i).printEdges(); }
0049 
0050   // region sums
0051   std::vector<unsigned short> getJetRegions() { return jetSummaryCard.getJetRegions(); }
0052   std::vector<unsigned short> getBarrelRegions() { return jetSummaryCard.getBarrelRegions(); }
0053   std::vector<unsigned short> getHFRegions() { return jetSummaryCard.getHFRegions(); }
0054 
0055   // e-gamma objects
0056   std::vector<unsigned short> getIsolatedEGObjects() { return jetSummaryCard.getIsolatedEGObjects(); }
0057   std::vector<unsigned short> getNonisolatedEGObjects() { return jetSummaryCard.getNonisolatedEGObjects(); }
0058 
0059   // the bits
0060   unsigned short getTauBits() { return jetSummaryCard.getTauBits(); }
0061   unsigned short getMIPBits() { return jetSummaryCard.getMIPBits(); }
0062   unsigned short getOverFlowBits() { return jetSummaryCard.getOverFlowBits(); }
0063   unsigned short getQuietBits() { return jetSummaryCard.getQuietBits(); }
0064   // hf bit
0065   std::vector<unsigned short> getHFFineGrainBits() { return jetSummaryCard.getHFFineGrainBits(); }
0066 
0067 private:
0068   // The seven RCs and EICs
0069   // They are laid out according to CMS IN 2004/008
0070   // Increasing number towards higher absolute eta
0071   // The seventh card is always sideways with respect to the
0072   // other six.
0073   std::vector<L1RCTReceiverCard> receiverCards;
0074   std::vector<L1RCTElectronIsolationCard> electronCards;
0075   // The JSC receives the jet and electron information from the
0076   // RCs and EICs.  There is only one per crate.
0077   L1RCTJetSummaryCard jetSummaryCard;
0078 
0079   int crtNo;
0080   const L1RCTLookupTables *rctLookupTables_;
0081 
0082   // L1RCTJetCaptureCard jetCaptureCard;
0083 };
0084 #endif  // L1RCTCrate_h