CMS 3D CMS Logo

L1TMuonEndCapTrackProducer.cc
Go to the documentation of this file.
2 
4  : track_finder_(new TrackFinder(iConfig, consumesCollector())),
5  uGMT_converter_(new MicroGMTConverter()),
6  config_(iConfig) {
7  // Make output products
8  // produces<l1t::CPPFDigiCollection> (""); // CPPF Digis emulated by EMTF using RPCDigis from Legacy RPC PAC
9  produces<EMTFHitCollection>(""); // All CSC LCTs and RPC clusters received by EMTF
10  produces<EMTFTrackCollection>(""); // All output EMTF tracks, in same format as unpacked data
11  produces<l1t::RegionalMuonCandBxCollection>("EMTF"); // EMTF tracks output to uGMT
12 }
13 
15 
17  // Create pointers to output products
18  // auto out_cppfs = std::make_unique<l1t::CPPFDigiCollection>();
19  auto out_hits_tmp = std::make_unique<EMTFHitCollection>();
20  auto out_hits_ZS = std::make_unique<EMTFHitCollection>();
21  auto out_tracks = std::make_unique<EMTFTrackCollection>();
22  auto out_cands = std::make_unique<l1t::RegionalMuonCandBxCollection>();
23 
24  // Main EMTF emulator process, produces tracks from hits in each sector in each event
25  track_finder_->process(iEvent, iSetup, *out_hits_tmp, *out_tracks);
26 
27  // Apply ZeroSuppression: Only save RPC hits if there is at least one CSC LCT in the sector
28  bool has_LCT[12] = {false};
29  for (int iSect = 0; iSect < 12; iSect++) {
30  for (const auto& h : *out_hits_tmp) {
31  if (h.Is_CSC() && h.Sector_idx() == iSect) {
32  has_LCT[iSect] = true;
33  break;
34  }
35  }
36  }
37  for (const auto& h : *out_hits_tmp) {
38  if (has_LCT[h.Sector_idx()] || h.Is_RPC() == 0) {
39  out_hits_ZS->push_back(h);
40  }
41  }
42 
43  // // Fill collection of emulated CPPFDigis
44  // for (const auto& h : *out_hits_ZS) {
45  // if (h.Is_RPC()) out_cppfs->push_back( h.CreateCPPFDigi() );
46  // }
47 
48  // Convert into uGMT format
49  uGMT_converter_->convert_all(iEvent, *out_tracks, *out_cands);
50 
51  // Fill the output products
52  // iEvent.put(std::move(out_cppfs), "");
53  iEvent.put(std::move(out_hits_ZS), "");
54  iEvent.put(std::move(out_tracks), "");
55  iEvent.put(std::move(out_cands), "EMTF");
56 }
57 
58 // void L1TMuonEndCapTrackProducer::beginJob() {
59 // }
60 
61 // void L1TMuonEndCapTrackProducer::endJob() {
62 // }
63 
64 // Fill 'descriptions' with the allowed parameters
66  // The following says we do not know what parameters are allowed so do no validation
67  // Please change this to state exactly what you do use, even if it is no parameters
69  desc.setUnknown();
70  descriptions.addDefault(desc);
71 }
72 
73 // Define this as a plug-in
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
L1TMuonEndCapTrackProducer(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
std::unique_ptr< MicroGMTConverter > uGMT_converter_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void addDefault(ParameterSetDescription const &psetDescription)
std::unique_ptr< TrackFinder > track_finder_
void produce(edm::Event &, const edm::EventSetup &) override
def move(src, dest)
Definition: eostools.py:511