CMS 3D CMS Logo

L1TMuonEndCapTrackProducer.cc
Go to the documentation of this file.
2 
4  : track_finder_(new TrackFinder(iConfig, consumesCollector())), uGMT_converter_(new MicroGMTConverter()) {
5  // Make output products
6  produces<EMTFHitCollection>(""); // All CSC LCTs and RPC clusters received by EMTF
7  produces<EMTFTrackCollection>(""); // All output EMTF tracks, in same format as unpacked data
8  produces<l1t::RegionalMuonCandBxCollection>("EMTF"); // EMTF tracks output to uGMT
9 }
10 
12  // Create pointers to output products
13  auto out_hits_tmp = std::make_unique<EMTFHitCollection>(); // before zero suppression
14  auto out_hits = std::make_unique<EMTFHitCollection>(); // after zero suppression
15  auto out_tracks = std::make_unique<EMTFTrackCollection>();
16  auto out_cands = std::make_unique<l1t::RegionalMuonCandBxCollection>();
17 
18  // Main EMTF emulator process, produces tracks from hits in each sector in each event
19  track_finder_->process(iEvent, iSetup, *out_hits_tmp, *out_tracks);
20 
21  // Apply zero suppression: only sectors with at least one CSC LCT are read out
22  // In Run 2, it means RPC hits are only saved if there is at least one CSC LCT in the sector
23  emtf::sector_array<bool> good_sectors;
24  good_sectors.fill(false);
25 
26  for (const auto& h : *out_hits_tmp) {
27  if (h.Is_CSC()) {
28  good_sectors.at(h.Sector_idx()) = true;
29  }
30  }
31 
32  for (const auto& h : *out_hits_tmp) {
33  if (good_sectors.at(h.Sector_idx())) {
34  out_hits->push_back(h);
35  }
36  }
37 
38  // Convert into uGMT format
39  uGMT_converter_->convert_all(iEvent, *out_tracks, *out_cands);
40 
41  // Fill the output products
42  iEvent.put(std::move(out_hits), "");
43  iEvent.put(std::move(out_tracks), "");
44  iEvent.put(std::move(out_cands), "EMTF");
45 }
46 
47 // Fill 'descriptions' with the allowed parameters
49  // The following says we do not know what parameters are allowed so do no validation
50  // Please change this to state exactly what you do use, even if it is no parameters
52  desc.setUnknown();
53  descriptions.addDefault(desc);
54 }
55 
56 // Define this as a plug-in
L1TMuonEndCapTrackProducer(const edm::ParameterSet &)
std::unique_ptr< MicroGMTConverter > uGMT_converter_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
int iEvent
Definition: GenABIO.cc:224
void addDefault(ParameterSetDescription const &psetDescription)
std::unique_ptr< TrackFinder > track_finder_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void produce(edm::Event &, const edm::EventSetup &) override
std::array< T, NUM_SECTORS > sector_array
Definition: Common.h:63
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
def move(src, dest)
Definition: eostools.py:511