Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:22:49

0001 #include "L1Trigger/L1TGEM/interface/ME0Motherboard.h"
0002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0003 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0004 #include "Geometry/GEMGeometry/interface/ME0Geometry.h"
0005 
0006 ME0Motherboard::ME0Motherboard(unsigned endcap, unsigned chamber, const edm::ParameterSet& conf)
0007     : theEndcap(endcap), theChamber(chamber) {
0008   edm::ParameterSet tmbParams = conf.getParameter<edm::ParameterSet>("tmbParam");
0009   infoV = tmbParams.getParameter<int>("verbosity");
0010 }
0011 
0012 ME0Motherboard::ME0Motherboard() : theEndcap(1), theChamber(1) { infoV = 2; }
0013 
0014 ME0Motherboard::~ME0Motherboard() {}
0015 
0016 void ME0Motherboard::clear() {
0017   for (int bx = 0; bx < MAX_TRIGGER_BINS; bx++) {
0018     for (int i = 0; i < MAX_TRIGGERS; i++) {
0019       Triggers[bx][i].clear();
0020     }
0021   }
0022 }
0023 
0024 void ME0Motherboard::run(const ME0PadDigiCollection*) { clear(); }
0025 
0026 // Returns vector of read-out correlated Triggers, if any.  Starts with
0027 // the vector of all found Triggers and selects the ones in the read-out
0028 // time window.
0029 std::vector<ME0TriggerDigi> ME0Motherboard::readoutTriggers() {
0030   std::vector<ME0TriggerDigi> tmpV;
0031 
0032   std::vector<ME0TriggerDigi> all_trigs = getTriggers();
0033   tmpV.reserve(all_trigs.size());
0034   for (const auto& ptrig : all_trigs) {
0035     // in the future, add a selection on the BX
0036     tmpV.push_back(ptrig);
0037   }
0038   return tmpV;
0039 }
0040 
0041 // Returns vector of all found correlated Triggers, if any.
0042 std::vector<ME0TriggerDigi> ME0Motherboard::getTriggers() {
0043   std::vector<ME0TriggerDigi> tmpV;
0044 
0045   for (int bx = 0; bx < MAX_TRIGGER_BINS; bx++) {
0046     for (int i = 0; i < MAX_TRIGGERS; i++) {
0047       tmpV.push_back(Triggers[bx][i]);
0048     }
0049   }
0050   return tmpV;
0051 }
0052 
0053 // compare Triggers by quality
0054 bool ME0Motherboard::sortByQuality(const ME0TriggerDigi& trig1, const ME0TriggerDigi& trig2) {
0055   return trig1.getQuality() > trig2.getQuality();
0056 }
0057 
0058 // compare Triggers by GEM bending angle
0059 bool ME0Motherboard::sortByME0Dphi(const ME0TriggerDigi& trig1, const ME0TriggerDigi& trig2) {
0060   // todo: In the future I plan a member to be added to ME0TriggerDigi, getME0Dphi().
0061   // That function will derive the bending angle from the pattern.
0062   // The ME0TriggerDigi pattterns are at this point not defined yet.
0063   return true;
0064 }