Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include <memory>
0002 
0003 #include "L1Trigger/L1TGEM/interface/ME0TriggerBuilder.h"
0004 
0005 ME0TriggerBuilder::ME0TriggerBuilder(const edm::ParameterSet& conf) {
0006   config_ = conf;
0007 
0008   for (int endc = 0; endc < MAX_ENDCAPS; endc++) {
0009     for (int cham = 0; cham < MAX_CHAMBERS; cham++) {
0010       tmb_[endc][cham] = std::make_unique<ME0Motherboard>(endc, cham, config_);
0011     }
0012   }
0013 }
0014 
0015 ME0TriggerBuilder::~ME0TriggerBuilder() {}
0016 
0017 void ME0TriggerBuilder::build(const ME0PadDigiCollection* me0Pads, ME0TriggerDigiCollection& oc_trig) {
0018   for (int endc = 0; endc < 2; endc++) {
0019     for (int cham = ME0DetId::minChamberId; cham < ME0DetId::maxChamberId; cham++) {
0020       ME0Motherboard* tmb = tmb_[endc][cham].get();
0021       tmb->setME0Geometry(me0_g);
0022 
0023       // 0th layer means whole chamber.
0024       const int region(endc == 0 ? -1 : 1);
0025       ME0DetId detid(region, 0, cham + 1, 0);
0026 
0027       // Run processors only if chamber exists in geometry.
0028       if (tmb == nullptr || me0_g->chamber(detid) == nullptr)
0029         continue;
0030 
0031       tmb->run(me0Pads);
0032 
0033       const std::vector<ME0TriggerDigi>& trigV = tmb->readoutTriggers();
0034 
0035       if (!trigV.empty()) {
0036         LogTrace("L1ME0Trigger") << "ME0TriggerBuilder got results in " << detid << std::endl
0037                                  << "Put " << trigV.size() << " Trigger digi" << ((trigV.size() > 1) ? "s " : " ")
0038                                  << "in collection\n";
0039         oc_trig.put(std::make_pair(trigV.begin(), trigV.end()), detid);
0040       }
0041     }
0042   }
0043 }