66 using namespace l1extra;
73 produces<MuonBxCollection>(
"imdMuonsLegacy");
74 muonSource_InputToken = consumes<L1MuGMTReadoutCollection>(muonSource_InputTag);
89 using namespace l1extra;
98 LogDebug(
"L1TMuonLegacyConverter") <<
"\nWarning: L1MuGMTReadoutCollection with " << muonSource_InputTag
99 <<
"\nrequested in configuration, but not found in the event." << std::endl;
101 if (produceMuonParticles_) {
109 iEvent.
getByToken(muonSource_InputToken, simMuCollection);
111 vector<L1MuGMTExtendedCand> simMuCands;
113 if (!simMuCollection.
isValid()) {
114 LogDebug(
"L1TMuonLegacyConverter") <<
"\nWarning: L1MuGMTReadoutCollection with " << muonSource_InputTag
115 <<
"\nrequested in configuration, but not found in the event." << std::endl;
117 if (centralBxOnly_) {
119 simMuCands = simMuCollection->getRecord().getGMTCands();
122 vector<L1MuGMTReadoutRecord> records = simMuCollection->getRecords();
123 vector<L1MuGMTReadoutRecord>::const_iterator rItr = records.begin();
124 vector<L1MuGMTReadoutRecord>::const_iterator rEnd = records.end();
126 for (; rItr != rEnd; ++rItr) {
127 vector<L1MuGMTExtendedCand> tmpCands = rItr->getGMTCands();
129 simMuCands.insert(simMuCands.end(), tmpCands.begin(), tmpCands.end());
133 vector<L1MuGMTExtendedCand>::const_iterator muItr = simMuCands.begin();
134 vector<L1MuGMTExtendedCand>::const_iterator muEnd = simMuCands.end();
135 for (
int i = 0; muItr != muEnd; ++muItr, ++
i) {
136 if (!muItr->empty()) {
138 double pt = muPtScale->getPtScale()->getLowEdge(muItr->ptIndex()) + 1.
e-6;
139 std::cout <<
"pt from muPtScale = " << pt << std::endl;
140 double eta = muScales->getGMTEtaScale()->getCenter(muItr->etaIndex());
141 double phi = muScales->getPhiScale()->getLowEdge(muItr->phiIndex());
149 (
int)muItr->quality(),
151 (int)muItr->charge_valid(),
160 imdMuonsLegacy->push_back(muItr->bx(), outMu);
166 iEvent.
put(
std::move(imdMuonsLegacy),
"imdMuonsLegacy");
T getUntrackedParameter(std::string const &, T const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
~L1TMuonLegacyConverter() override
BXVector< Muon > MuonBxCollection
L1TMuonLegacyConverter(const edm::ParameterSet &)
static const double muonMassGeV_
T getParameter(std::string const &) const
void produce(edm::Event &, const edm::EventSetup &) override
int charge() const final
electric charge