71 using namespace l1extra ;
76 produces<MuonBxCollection>(
"imdMuonsLegacy");
77 muonSource_InputToken = consumes<L1MuGMTReadoutCollection>(muonSource_InputTag);
100 using namespace l1extra ;
101 using namespace std ;
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."
134 hwMuCands = hwMuCollection->getRecord().getGMTCands() ;
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() ){
171 double pt = muPtScale->getPtScale()->getLowEdge( muItr->ptIndex() ) + 1.
e-6 ;
172 double eta = muScales->getGMTEtaScale()->getCenter( muItr->etaIndex() ) ;
173 double phi = muScales->getPhiScale()->getLowEdge( muItr->phiIndex() ) ;
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( imdMuonsLegacy,
"imdMuonsLegacy" );
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
~L1TMuonLegacyConverter()
BXVector< Muon > MuonBxCollection
L1TMuonLegacyConverter(const edm::ParameterSet &)
static const double muonMassGeV_
Geom::Phi< T > phi() const
virtual void produce(edm::Event &, const edm::EventSetup &) override