76 produces<MuonBxCollection>(
"imdMuonsLegacy");
77 muonSource_InputToken = consumes<L1MuGMTReadoutCollection>(muonSource_InputTag);
101 using namespace std ;
107 std::unique_ptr< MuonBxCollection > imdMuonsLegacy(
new MuonBxCollection() );
109 if( produceMuonParticles_ )
118 iEvent.
getByToken( muonSource_InputToken, hwMuCollection ) ;
120 vector< L1MuGMTExtendedCand > hwMuCands ;
122 if( !hwMuCollection.
isValid() )
125 <<
"\nWarning: L1MuGMTReadoutCollection with " << muonSource_InputTag
126 <<
"\nrequested in configuration, but not found in the event." 139 vector< L1MuGMTReadoutRecord > records = hwMuCollection->
getRecords();
140 vector< L1MuGMTReadoutRecord >::const_iterator rItr = records.begin();
141 vector< L1MuGMTReadoutRecord >::const_iterator rEnd = records.end();
143 for( ; rItr != rEnd ; ++rItr )
145 vector< L1MuGMTExtendedCand > tmpCands = rItr->getGMTCands() ;
147 hwMuCands.insert( hwMuCands.end(),
154 vector< L1MuGMTExtendedCand >::const_iterator muItr = hwMuCands.begin() ;
155 vector< L1MuGMTExtendedCand >::const_iterator muEnd = hwMuCands.end() ;
156 for(
int i = 0 ; muItr != muEnd ; ++muItr, ++
i )
169 if( !muItr->empty() ){
183 Muon outMu{
p4, (
int)muItr->ptIndex(), (
int)muItr->etaIndex(), (
int)muItr->phiIndex(), (
int)muItr->quality(), muItr->charge(), muItr->isol(), (
int)muItr->etaRegionIndex(), 0,
true, 0, 0, 0 , (
int)muItr->rank() };
184 imdMuonsLegacy->push_back( muItr->bx(), outMu ) ;
190 iEvent.
put(
std::move(imdMuonsLegacy),
"imdMuonsLegacy" );
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::vector< L1MuGMTExtendedCand > getGMTCands() const
get GMT candidates vector
const L1MuScale * getPtScale() const
get the Pt scale
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
virtual float getCenter(unsigned packed) const =0
get the center of bin represented by packed
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
const L1MuScale * getPhiScale() const
get the phi scale
~L1TMuonLegacyConverter()
BXVector< Muon > MuonBxCollection
L1TMuonLegacyConverter(const edm::ParameterSet &)
static const double muonMassGeV_
virtual void produce(edm::Event &, const edm::EventSetup &) override
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
virtual float getLowEdge(unsigned packed) const =0
get the low edge of bin represented by packed
const L1MuScale * getGMTEtaScale() const
get the GMT eta scale
L1MuGMTReadoutRecord const & getRecord(int bx=0) const