67 : produceMuonParticles_(iConfig.getParameter<
bool>(
"produceMuonParticles")),
68 muonSource_(iConfig.getParameter<
edm::
InputTag>(
"muonSource")),
69 produceCaloParticles_(iConfig.getParameter<
bool>(
"produceCaloParticles")),
70 isoEmSource_(iConfig.getParameter<
edm::
InputTag>(
"isolatedEmSource")),
71 nonIsoEmSource_(iConfig.getParameter<
edm::
InputTag>(
"nonIsolatedEmSource")),
72 cenJetSource_(iConfig.getParameter<
edm::
InputTag>(
"centralJetSource")),
73 forJetSource_(iConfig.getParameter<
edm::
InputTag>(
"forwardJetSource")),
74 tauJetSource_(iConfig.getParameter<
edm::
InputTag>(
"tauJetSource")),
75 isoTauJetSource_(iConfig.getParameter<
edm::
InputTag>(
"isoTauJetSource")),
76 etTotSource_(iConfig.getParameter<
edm::
InputTag>(
"etTotalSource")),
77 etHadSource_(iConfig.getParameter<
edm::
InputTag>(
"etHadSource")),
78 etMissSource_(iConfig.getParameter<
edm::
InputTag>(
"etMissSource")),
79 htMissSource_(iConfig.getParameter<
edm::
InputTag>(
"htMissSource")),
80 hfRingEtSumsSource_(iConfig.getParameter<
edm::
InputTag>(
"hfRingEtSumsSource")),
81 hfRingBitCountsSource_(iConfig.getParameter<
edm::
InputTag>(
"hfRingBitCountsSource")),
82 centralBxOnly_(iConfig.getParameter<
bool>(
"centralBxOnly")),
83 ignoreHtMiss_(iConfig.getParameter<
bool>(
"ignoreHtMiss")) {
87 produces<L1EmParticleCollection>(
"Isolated");
88 produces<L1EmParticleCollection>(
"NonIsolated");
89 produces<L1JetParticleCollection>(
"Central");
90 produces<L1JetParticleCollection>(
"Forward");
91 produces<L1JetParticleCollection>(
"Tau");
92 produces<L1JetParticleCollection>(
"IsoTau");
93 produces<L1MuonParticleCollection>();
94 produces<L1EtMissParticleCollection>(
"MET");
95 produces<L1EtMissParticleCollection>(
"MHT");
96 produces<L1HFRingsCollection>();
145 vector<L1MuGMTExtendedCand> hwMuCands;
147 if (!hwMuCollection.
isValid()) {
148 LogDebug(
"L1ExtraParticlesProd") <<
"\nWarning: L1MuGMTReadoutCollection with " <<
muonSource_
149 <<
"\nrequested in configuration, but not found in the event." << std::endl;
156 vector<L1MuGMTReadoutRecord> records = hwMuCollection->
getRecords();
157 vector<L1MuGMTReadoutRecord>::const_iterator rItr = records.begin();
158 vector<L1MuGMTReadoutRecord>::const_iterator rEnd = records.end();
160 for (; rItr != rEnd; ++rItr) {
161 vector<L1MuGMTExtendedCand> tmpCands = rItr->getGMTCands();
163 hwMuCands.insert(hwMuCands.end(), tmpCands.begin(), tmpCands.end());
168 vector<L1MuGMTExtendedCand>::const_iterator muItr = hwMuCands.begin();
169 vector<L1MuGMTExtendedCand>::const_iterator muEnd = hwMuCands.end();
170 for (
int i = 0; muItr != muEnd; ++muItr, ++
i) {
182 if (!muItr->empty()) {
194 muColl->push_back(
L1MuonParticle(muItr->charge(),
p4, *muItr, muItr->bx()));
242 <<
"\nrequested in configuration, but not found in the event." << std::endl;
246 L1GctEmCandCollection::const_iterator emItr = hwIsoEmCands->begin();
247 L1GctEmCandCollection::const_iterator emEnd = hwIsoEmCands->end();
248 for (
int i = 0; emItr != emEnd; ++emItr, ++
i) {
261 double et = emScale->
et(emItr->rank());
275 if (!hwNonIsoEmCands.
isValid()) {
277 <<
"\nrequested in configuration, but not found in the event." << std::endl;
280 L1GctEmCandCollection::const_iterator emItr = hwNonIsoEmCands->begin();
281 L1GctEmCandCollection::const_iterator emEnd = hwNonIsoEmCands->end();
282 for (
int i = 0; emItr != emEnd; ++emItr, ++
i) {
295 double et = emScale->
et(emItr->rank());
315 if (!hwCenJetCands.
isValid()) {
317 <<
"\nrequested in configuration, but not found in the event." << std::endl;
320 L1GctJetCandCollection::const_iterator jetItr = hwCenJetCands->begin();
321 L1GctJetCandCollection::const_iterator jetEnd = hwCenJetCands->end();
322 for (
int i = 0; jetItr != jetEnd; ++jetItr, ++
i) {
352 if (!hwForJetCands.
isValid()) {
354 <<
"\nrequested in configuration, but not found in the event." << std::endl;
357 L1GctJetCandCollection::const_iterator jetItr = hwForJetCands->begin();
358 L1GctJetCandCollection::const_iterator jetEnd = hwForJetCands->end();
359 for (
int i = 0; jetItr != jetEnd; ++jetItr, ++
i) {
390 if (!hwTauJetCands.
isValid()) {
392 <<
"\nrequested in configuration, but not found in the event." << std::endl;
394 L1GctJetCandCollection::const_iterator jetItr = hwTauJetCands->begin();
395 L1GctJetCandCollection::const_iterator jetEnd = hwTauJetCands->end();
396 for (
int i = 0; jetItr != jetEnd; ++jetItr, ++
i) {
427 if (!hwIsoTauJetCands.
isValid()) {
429 <<
"\nrequested in configuration, but not found in the event." << std::endl;
431 L1GctJetCandCollection::const_iterator jetItr = hwIsoTauJetCands->begin();
432 L1GctJetCandCollection::const_iterator jetEnd = hwIsoTauJetCands->end();
433 for (
int i = 0; jetItr != jetEnd; ++jetItr, ++
i) {
461 double etSumLSB =
jetScale->linearLsb();
471 <<
"\nrequested in configuration, but not found in the event." << std::endl;
472 }
else if (!hwEtMissColl.
isValid()) {
474 <<
"\nrequested in configuration, but not found in the event." << std::endl;
479 std::vector<bool> etMissMatched;
481 L1GctEtMissCollection::const_iterator hwEtMissItr = hwEtMissColl->begin();
482 L1GctEtMissCollection::const_iterator hwEtMissEnd = hwEtMissColl->end();
483 for (; hwEtMissItr != hwEtMissEnd; ++hwEtMissItr) {
484 etMissMatched.push_back(
false);
488 L1GctEtTotalCollection::const_iterator hwEtTotItr = hwEtTotColl->begin();
489 L1GctEtTotalCollection::const_iterator hwEtTotEnd = hwEtTotColl->end();
492 for (; hwEtTotItr != hwEtTotEnd; ++hwEtTotItr, ++iTot) {
493 int bx = hwEtTotItr->bx();
502 hwEtMissItr = hwEtMissColl->begin();
503 hwEtMissEnd = hwEtMissColl->end();
504 for (; hwEtMissItr != hwEtMissEnd; ++hwEtMissItr, ++iMiss) {
505 if (hwEtMissItr->bx() ==
bx) {
506 etMissMatched[iMiss] =
true;
517 if (hwEtMissItr != hwEtMissEnd) {
549 L1EtMissParticle::kMET,
565 hwEtMissItr = hwEtMissColl->begin();
566 hwEtMissEnd = hwEtMissColl->end();
568 for (; hwEtMissItr != hwEtMissEnd; ++hwEtMissItr, ++iMiss) {
569 if (!etMissMatched[iMiss]) {
570 int bx = hwEtMissItr->bx();
593 L1EtMissParticle::kMET,
620 std::vector<bool> htMissMatched;
626 <<
"\nrequested in configuration, but not found in the event." << std::endl;
627 }
else if (!hwHtMissColl.
isValid()) {
629 <<
"\nrequested in configuration, but not found in the event." << std::endl;
634 L1GctHtMissCollection::const_iterator hwHtMissItr = hwHtMissColl->begin();
635 L1GctHtMissCollection::const_iterator hwHtMissEnd = hwHtMissColl->end();
636 for (; hwHtMissItr != hwHtMissEnd; ++hwHtMissItr) {
637 htMissMatched.push_back(
false);
644 <<
"\nrequested in configuration, but not found in the event." << std::endl;
645 }
else if (!hwHtMissColl.
isValid()) {
647 <<
"\nrequested in configuration, but not found in the event." << std::endl;
649 L1GctEtHadCollection::const_iterator hwEtHadItr = hwEtHadColl->begin();
650 L1GctEtHadCollection::const_iterator hwEtHadEnd = hwEtHadColl->end();
653 for (; hwEtHadItr != hwEtHadEnd; ++hwEtHadItr, ++iHad) {
654 int bx = hwEtHadItr->bx();
668 L1GctHtMissCollection::const_iterator hwHtMissItr = hwHtMissColl->begin();
669 L1GctHtMissCollection::const_iterator hwHtMissEnd = hwHtMissColl->end();
672 for (; hwHtMissItr != hwHtMissEnd; ++hwHtMissItr, ++iMiss) {
673 if (hwHtMissItr->bx() ==
bx) {
674 htMissMatched[iMiss] =
true;
680 if (hwHtMissItr != hwHtMissEnd) {
683 htMissScale->
et(hwHtMissItr->overFlow() ? htMissScale->
rankScaleMax() : hwHtMissItr->et()) + 1.
e-6;
717 L1EtMissParticle::kMHT,
732 L1GctHtMissCollection::const_iterator hwHtMissItr = hwHtMissColl->begin();
733 L1GctHtMissCollection::const_iterator hwHtMissEnd = hwHtMissColl->end();
736 for (; hwHtMissItr != hwHtMissEnd; ++hwHtMissItr, ++iMiss) {
737 if (!htMissMatched[iMiss]) {
738 int bx = hwHtMissItr->bx();
742 htMissScale->
et(hwHtMissItr->overFlow() ? htMissScale->
rankScaleMax() : hwHtMissItr->et()) + 1.
e-6;
759 L1EtMissParticle::kMHT,
782 if (!hwHFEtSumsColl.
isValid()) {
784 <<
"\nrequested in configuration, but not found in the event." << std::endl;
785 }
else if (!hwHFBitCountsColl.
isValid()) {
787 <<
"\nrequested in configuration, but not found in the event." << std::endl;
789 L1GctHFRingEtSumsCollection::const_iterator hwHFEtSumsItr = hwHFEtSumsColl->begin();
790 L1GctHFRingEtSumsCollection::const_iterator hwHFEtSumsEnd = hwHFEtSumsColl->end();
793 for (; hwHFEtSumsItr != hwHFEtSumsEnd; ++hwHFEtSumsItr, ++iEtSums) {
794 int bx = hwHFEtSumsItr->bx();
797 L1GctHFBitCountsCollection::const_iterator hwHFBitCountsItr = hwHFBitCountsColl->begin();
798 L1GctHFBitCountsCollection::const_iterator hwHFBitCountsEnd = hwHFBitCountsColl->end();
801 for (; hwHFBitCountsItr != hwHFBitCountsEnd; ++hwHFBitCountsItr, ++iBitCounts) {
802 if (hwHFBitCountsItr->bx() ==
bx) {
808 if (hwHFBitCountsItr != hwHFBitCountsEnd) {
814 double etSums[L1HFRings::kNumRings];
815 etSums[L1HFRings::kRing1PosEta] = hfRingEtScale->
et(hwHFEtSumsItr->etSum(0)) + 1.
e-6;
816 etSums[L1HFRings::kRing1NegEta] = hfRingEtScale->
et(hwHFEtSumsItr->etSum(1)) + 1.
e-6;
817 etSums[L1HFRings::kRing2PosEta] = hfRingEtScale->
et(hwHFEtSumsItr->etSum(2)) + 1.
e-6;
818 etSums[L1HFRings::kRing2NegEta] = hfRingEtScale->
et(hwHFEtSumsItr->etSum(3)) + 1.
e-6;
833 int bitCounts[L1HFRings::kNumRings];
834 bitCounts[L1HFRings::kRing1PosEta] = hwHFBitCountsItr->bitCount(0);
835 bitCounts[L1HFRings::kRing1NegEta] = hwHFBitCountsItr->bitCount(1);
836 bitCounts[L1HFRings::kRing2PosEta] = hwHFBitCountsItr->bitCount(2);
837 bitCounts[L1HFRings::kRing2NegEta] = hwHFBitCountsItr->bitCount(3);
882 double etCorr =
et + 1.e-6;
891 double phi =
geom->emJetPhiBinCenter(
cand.phiIndex());