62 virtual void endJob() ;
69 static bool compareMuons(
const std::shared_ptr<MicroGMTConfiguration::InterMuon>& mu1,
70 const std::shared_ptr<MicroGMTConfiguration::InterMuon>& mu2);
90 std::auto_ptr<MuonBxCollection>& out,
139 produces<MuonBxCollection>();
140 produces<MuonBxCollection>(
"imdMuonsBMTF");
141 produces<MuonBxCollection>(
"imdMuonsEMTFPos");
142 produces<MuonBxCollection>(
"imdMuonsEMTFNeg");
143 produces<MuonBxCollection>(
"imdMuonsOMTFPos");
144 produces<MuonBxCollection>(
"imdMuonsOMTFNeg");
204 convertMuons(bmtfMuons, internMuonsBmtf, bmtfWedges, bx);
205 splitAndConvertMuons(emtfMuons, internMuonsEmtfPos, internMuonsEmtfNeg, emtfPosWedges, emtfNegWedges, bx);
206 splitAndConvertMuons(omtfMuons, internMuonsOmtfPos, internMuonsOmtfNeg, omtfPosWedges, omtfNegWedges, bx);
256 for (
const auto&
mu : internalMuons) {
257 if (
mu->hwPt() > 0) {
259 int iso =
mu->hwAbsIso() + (
mu->hwRelIso() << 1);
260 Muon outMu{vec,
mu->hwPt(),
mu->hwEta(),
mu->hwGlobalPhi(),
mu->hwQual(),
mu->hwSign(),
mu->hwSignValid(), iso, 0,
true,
mu->hwIsoSum(),
mu->hwDPhi(),
mu->hwDEta(),
mu->hwRank()};
261 m_debugOut <<
mu->hwCaloPhi() <<
" " <<
mu->hwCaloEta() << std::endl;
262 outMuons->push_back(bx, outMu);
267 iEvent.
put(outMuons);
268 iEvent.
put(imdMuonsBMTF,
"imdMuonsBMTF");
269 iEvent.
put(imdMuonsEMTFPos,
"imdMuonsEMTFPos");
270 iEvent.
put(imdMuonsEMTFNeg,
"imdMuonsEMTFNeg");
271 iEvent.
put(imdMuonsOMTFPos,
"imdMuonsOMTFPos");
272 iEvent.
put(imdMuonsOMTFNeg,
"imdMuonsOMTFNeg");
278 const std::shared_ptr<MicroGMTConfiguration::InterMuon>& mu2) {
279 return (mu1->hwWins() > mu2->hwWins());
284 MicroGMTConfiguration::InterMuonList::iterator mu1;
286 for (mu1 = muons.begin(); mu1 != muons.end(); ++mu1) {
287 (*mu1)->setHwWins(0);
290 for (mu1 = muons.begin(); mu1 != muons.end(); ++mu1) {
293 for ( ; mu2 != muons.end(); ++mu2) {
294 if ((*mu1)->hwRank() >= (*mu2)->hwRank() && (*mu1)->hwCancelBit() != 1) {
295 (*mu1)->increaseWins();
296 }
else if ((*mu2)->hwCancelBit() != 1) {
297 (*mu2)->increaseWins();
302 size_t nMuonsBefore = muons.size();
304 int minWins = nMuonsBefore-nSurvivors;
308 while (mu1 != muons.end()) {
309 if ((*mu1)->hwWins() < minWins || (*mu1)->hwCancelBit() == 1) {
322 for (
auto& mu1 : muons) {
324 mu1->setHwRank(rank);
332 std::auto_ptr<MuonBxCollection>&
out,
int bx)
const
334 for (
auto&
mu : coll) {
335 interout.push_back(
mu);
336 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > vec{};
338 Muon outMu{vec,
mu->hwPt(),
mu->hwEta(),
mu->hwGlobalPhi(),
mu->hwQual(),
mu->hwSign(),
mu->hwSignValid(), -1, 0,
true, -1,
mu->hwDPhi(),
mu->hwDEta(),
mu->hwRank()};
340 out->push_back(bx, outMu);
353 for (
int i = 0;
i < 6; ++
i) {
354 wedges_pos[
i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
355 wedges_pos[
i].reserve(3);
356 wedges_neg[
i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
357 wedges_neg[
i].reserve(3);
359 for (
size_t i = 0;
i < in->size(bx); ++
i) {
360 int gPhi = MicroGMTConfiguration::calcGlobalPhi(in->at(bx,
i).hwPhi(), in->at(bx,
i).trackFinderType(), in->at(bx,
i).processor());
361 std::shared_ptr<GMTInternalMuon>
out = std::make_shared<GMTInternalMuon>(in->at(bx,
i), gPhi);
362 if(in->at(bx,
i).hwEta() > 0) {
363 out_pos.push_back(out);
364 wedges_pos[in->at(bx,
i).processor()].push_back(out);
366 out_neg.emplace_back(out);
367 wedges_neg[in->at(bx,
i).processor()].push_back(out);
370 for (
int i = 0;
i < 6; ++
i) {
371 if(wedges_pos[
i].
size() > 3)
edm::LogWarning(
"Input Mismatch") <<
" too many inputs per processor for emtf+ / omtf+" << std::endl;
372 if(wedges_neg[
i].
size() > 3)
edm::LogWarning(
"Input Mismatch") <<
" too many inputs per processor for emtf- / omtf-" << std::endl;
382 for (
int i = 0;
i < 12; ++
i) {
383 wedges[
i] = std::vector<std::shared_ptr<GMTInternalMuon>>();
384 wedges[
i].reserve(3);
386 for (
size_t i = 0;
i < in->size(bx); ++
i) {
387 int gPhi = MicroGMTConfiguration::calcGlobalPhi(in->at(bx,
i).hwPhi(), in->at(bx,
i).trackFinderType(), in->at(bx,
i).processor());
388 std::shared_ptr<GMTInternalMuon> outMu = std::make_shared<GMTInternalMuon>(in->at(bx,
i), gPhi);
389 out.emplace_back(outMu);
390 wedges[in->at(bx,
i).processor()].push_back(outMu);
392 for (
int i = 0;
i < 12; ++
i) {
393 if(wedges[
i].
size() > 3)
edm::LogWarning(
"Input Mismatch") <<
" too many inputs per processor for barrel" << std::endl;
virtual void beginLuminosityBlock(edm::LuminosityBlock &, edm::EventSetup const &)
T getParameter(std::string const &) const
MicroGMTIsolationUnit m_isolationUnit
void extrapolateMuons(MicroGMTConfiguration::InterMuonList &) const
void setCancelOutBitsOverlapEndcap(GMTInternalWedges &, GMTInternalWedges &, cancelmode)
Cancel-out between overlap and endcap track finders.
void setCancelOutBitsOverlapBarrel(GMTInternalWedges &, GMTInternalWedges &, cancelmode)
Cancel-out between overlap and barrel track finders.
edm::InputTag m_trigTowerTag
void sortMuons(MicroGMTConfiguration::InterMuonList &, unsigned) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setTowerSums(const MicroGMTConfiguration::CaloInputCollection &inputs, int bx)
edm::InputTag m_endcapTfInputTag
#define DEFINE_FWK_MODULE(type)
MicroGMTRankPtQualLUT m_rankPtQualityLUT
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_endcapTfInputToken
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_overlapTfInputToken
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static bool compareMuons(const std::shared_ptr< MicroGMTConfiguration::InterMuon > &mu1, const std::shared_ptr< MicroGMTConfiguration::InterMuon > &mu2)
MicroGMTCancelOutUnit m_cancelOutUnit
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
int lookup(int pt, int qual) const
void addDefault(ParameterSetDescription const &psetDescription)
void splitAndConvertMuons(edm::Handle< MicroGMTConfiguration::InputCollection > const &in, MicroGMTConfiguration::InterMuonList &out_pos, MicroGMTConfiguration::InterMuonList &out_neg, GMTInternalWedges &wedges_pos, GMTInternalWedges &wedges_neg, int bx) const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual void endLuminosityBlock(edm::LuminosityBlock &, edm::EventSetup const &)
virtual void endRun(edm::Run &, edm::EventSetup const &)
void calculateRank(MicroGMTConfiguration::InterMuonList &muons) const
GMTInternalMuonList InterMuonList
void addMuonsToCollections(MicroGMTConfiguration::InterMuonList &coll, MicroGMTConfiguration::InterMuonList &interout, std::auto_ptr< MuonBxCollection > &out, int bx) const
BXVector< Muon > MuonBxCollection
void setCancelOutBits(GMTInternalWedges &, tftype, cancelmode)
Cancel out between sectors/wedges in one track finder.
edm::InputTag m_overlapTfInputTag
virtual void produce(edm::Event &, const edm::EventSetup &)
virtual void beginRun(edm::Run &, edm::EventSetup const &)
edm::EDGetTokenT< MicroGMTConfiguration::CaloInputCollection > m_caloTowerInputToken
void convertMuons(edm::Handle< MicroGMTConfiguration::InputCollection > const &in, MicroGMTConfiguration::InterMuonList &out, GMTInternalWedges &wedges, int bx) const
std::map< int, std::vector< std::shared_ptr< GMTInternalMuon > > > GMTInternalWedges
edm::EDGetTokenT< MicroGMTConfiguration::InputCollection > m_barrelTfInputToken
void isolatePreSummed(MicroGMTConfiguration::InterMuonList &muons) const
L1TMicroGMTProducer(const edm::ParameterSet &)
tuple size
Write out results.
edm::InputTag m_barrelTfInputTag