Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-11-04 03:24:55

0001 #include "L1Trigger/L1TMuonEndCap/plugins/L1TMuonEndCapShowerProducer.h"
0002 #include "L1Trigger/L1TMuonEndCap/interface/Common.h"
0003 
0004 L1TMuonEndCapShowerProducer::L1TMuonEndCapShowerProducer(const edm::ParameterSet& iConfig)
0005     : config_(iConfig),
0006       tokenCSCShower_(consumes<CSCShowerDigiCollection>(iConfig.getParameter<edm::InputTag>("CSCShowerInput"))),
0007       sector_processors_shower_() {
0008   // Make output products
0009   produces<l1t::RegionalMuonShowerBxCollection>("EMTF");
0010 }
0011 
0012 L1TMuonEndCapShowerProducer::~L1TMuonEndCapShowerProducer() {}
0013 
0014 void L1TMuonEndCapShowerProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
0015   // Create pointers to output products
0016   auto out_showers = std::make_unique<l1t::RegionalMuonShowerBxCollection>();
0017   out_showers->clear();
0018   out_showers->setBXRange(0, 0);
0019 
0020   edm::Handle<CSCShowerDigiCollection> showersH;
0021   iEvent.getByToken(tokenCSCShower_, showersH);
0022   const CSCShowerDigiCollection& showers = *showersH.product();
0023 
0024   // ___________________________________________________________________________
0025   // Run the sector processors
0026 
0027   for (int endcap = emtf::MIN_ENDCAP; endcap <= emtf::MAX_ENDCAP; ++endcap) {
0028     for (int sector = emtf::MIN_TRIGSECTOR; sector <= emtf::MAX_TRIGSECTOR; ++sector) {
0029       const int es = (endcap - emtf::MIN_ENDCAP) * (emtf::MAX_TRIGSECTOR - emtf::MIN_TRIGSECTOR + 1) +
0030                      (sector - emtf::MIN_TRIGSECTOR);
0031 
0032       sector_processors_shower_.at(es).configure(config_, endcap, sector);
0033       sector_processors_shower_.at(es).process(showers, *out_showers);
0034     }
0035   }
0036 
0037   // Fill the output products
0038   iEvent.put(std::move(out_showers), "EMTF");
0039 }
0040 
0041 void L1TMuonEndCapShowerProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0042   edm::ParameterSetDescription desc;
0043   // these are different shower selections that can be enabled
0044   desc.add<bool>("enableOneNominalShowers", true);
0045   desc.add<bool>("enableOneTightShowers", true);
0046   desc.add<bool>("enableTwoLooseShowers", false);
0047   desc.add<unsigned>("nLooseShowers", 2);
0048   desc.add<unsigned>("nNominalShowers", 1);
0049   desc.add<unsigned>("nTightShowers", 1);
0050   desc.add<edm::InputTag>("CSCShowerInput", edm::InputTag("simCscTriggerPrimitiveDigis"));
0051   descriptions.add("simEmtfShowersDef", desc);
0052   descriptions.setComment("This is the generic cfi file for the EMTF shower producer");
0053 }
0054 
0055 // Define this as a plug-in
0056 DEFINE_FWK_MODULE(L1TMuonEndCapShowerProducer);