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")),
72 iConfig.getParameter<
edm::InputTag>(
"nonIsolatedEmSource")),
73 cenJetSource_(iConfig.getParameter<
edm::InputTag>(
"centralJetSource")),
74 forJetSource_(iConfig.getParameter<
edm::InputTag>(
"forwardJetSource")),
75 tauJetSource_(iConfig.getParameter<
edm::InputTag>(
"tauJetSource")),
76 isoTauJetSource_(iConfig.getParameter<
edm::InputTag>(
"isoTauJetSource")),
77 etTotSource_(iConfig.getParameter<
edm::InputTag>(
"etTotalSource")),
78 etHadSource_(iConfig.getParameter<
edm::InputTag>(
"etHadSource")),
79 etMissSource_(iConfig.getParameter<
edm::InputTag>(
"etMissSource")),
80 htMissSource_(iConfig.getParameter<
edm::InputTag>(
"htMissSource")),
82 iConfig.getParameter<
edm::InputTag>(
"hfRingEtSumsSource")),
83 hfRingBitCountsSource_(
84 iConfig.getParameter<
edm::InputTag>(
"hfRingBitCountsSource")),
85 centralBxOnly_(iConfig.getParameter<
bool>(
"centralBxOnly")),
86 ignoreHtMiss_(iConfig.getParameter<
bool>(
"ignoreHtMiss")) {
90 produces<L1EmParticleCollection>(
"Isolated");
91 produces<L1EmParticleCollection>(
"NonIsolated");
92 produces<L1JetParticleCollection>(
"Central");
93 produces<L1JetParticleCollection>(
"Forward");
94 produces<L1JetParticleCollection>(
"Tau");
95 produces<L1JetParticleCollection>(
"IsoTau");
96 produces<L1MuonParticleCollection>();
97 produces<L1EtMissParticleCollection>(
"MET");
98 produces<L1EtMissParticleCollection>(
"MHT");
99 produces<L1HFRingsCollection>();
150 vector<L1MuGMTExtendedCand> hwMuCands;
152 if (!hwMuCollection.
isValid()) {
154 <<
"\nWarning: L1MuGMTReadoutCollection with " <<
muonSource_ 155 <<
"\nrequested in configuration, but not found in the event." 163 vector<L1MuGMTReadoutRecord> records = hwMuCollection->
getRecords();
164 vector<L1MuGMTReadoutRecord>::const_iterator rItr = records.begin();
165 vector<L1MuGMTReadoutRecord>::const_iterator rEnd = records.end();
167 for (; rItr != rEnd; ++rItr) {
168 vector<L1MuGMTExtendedCand> tmpCands = rItr->getGMTCands();
170 hwMuCands.insert(hwMuCands.end(), tmpCands.begin(), tmpCands.end());
175 vector<L1MuGMTExtendedCand>::const_iterator muItr = hwMuCands.begin();
176 vector<L1MuGMTExtendedCand>::const_iterator muEnd = hwMuCands.end();
177 for (
int i = 0; muItr != muEnd; ++muItr, ++
i) {
189 if (!muItr->empty()) {
226 unique_ptr<L1JetParticleCollection> isoTauJetColl(
229 unique_ptr<L1EtMissParticleCollection> etMissColl(
232 unique_ptr<L1EtMissParticleCollection> htMissColl(
255 <<
"\nWarning: L1GctEmCandCollection with " <<
isoEmSource_ 256 <<
"\nrequested in configuration, but not found in the event." 261 L1GctEmCandCollection::const_iterator emItr = hwIsoEmCands->begin();
262 L1GctEmCandCollection::const_iterator emEnd = hwIsoEmCands->end();
263 for (
int i = 0; emItr != emEnd; ++emItr, ++
i) {
276 double et = emScale->
et(emItr->rank());
291 if (!hwNonIsoEmCands.
isValid()) {
294 <<
"\nrequested in configuration, but not found in the event." 298 L1GctEmCandCollection::const_iterator emItr = hwNonIsoEmCands->begin();
299 L1GctEmCandCollection::const_iterator emEnd = hwNonIsoEmCands->end();
300 for (
int i = 0; emItr != emEnd; ++emItr, ++
i) {
313 double et = emScale->
et(emItr->rank());
333 if (!hwCenJetCands.
isValid()) {
335 <<
"\nWarning: L1GctJetCandCollection with " <<
cenJetSource_ 336 <<
"\nrequested in configuration, but not found in the event." 340 L1GctJetCandCollection::const_iterator jetItr = hwCenJetCands->begin();
341 L1GctJetCandCollection::const_iterator jetEnd = hwCenJetCands->end();
342 for (
int i = 0; jetItr != jetEnd; ++jetItr, ++
i) {
357 double et = jetScale->
et(jetItr->rank());
372 if (!hwForJetCands.
isValid()) {
375 <<
"\nrequested in configuration, but not found in the event." 379 L1GctJetCandCollection::const_iterator jetItr = hwForJetCands->begin();
380 L1GctJetCandCollection::const_iterator jetEnd = hwForJetCands->end();
381 for (
int i = 0; jetItr != jetEnd; ++jetItr, ++
i) {
396 double et = jetScale->
et(jetItr->rank());
412 if (!hwTauJetCands.
isValid()) {
414 <<
"\nWarning: L1GctJetCandCollection with " <<
tauJetSource_ 415 <<
"\nrequested in configuration, but not found in the event." 418 L1GctJetCandCollection::const_iterator jetItr = hwTauJetCands->begin();
419 L1GctJetCandCollection::const_iterator jetEnd = hwTauJetCands->end();
420 for (
int i = 0; jetItr != jetEnd; ++jetItr, ++
i) {
435 double et = jetScale->
et(jetItr->rank());
451 if (!hwIsoTauJetCands.
isValid()) {
454 <<
"\nrequested in configuration, but not found in the event." 457 L1GctJetCandCollection::const_iterator jetItr = hwIsoTauJetCands->begin();
458 L1GctJetCandCollection::const_iterator jetEnd = hwIsoTauJetCands->end();
459 for (
int i = 0; jetItr != jetEnd; ++jetItr, ++
i) {
474 double et = jetScale->
et(jetItr->rank());
497 <<
"\nWarning: L1GctEtTotalCollection with " <<
etTotSource_ 498 <<
"\nrequested in configuration, but not found in the event." 500 }
else if (!hwEtMissColl.
isValid()) {
503 <<
"\nrequested in configuration, but not found in the event." 509 std::vector<bool> etMissMatched;
511 L1GctEtMissCollection::const_iterator hwEtMissItr = hwEtMissColl->begin();
512 L1GctEtMissCollection::const_iterator hwEtMissEnd = hwEtMissColl->end();
513 for (; hwEtMissItr != hwEtMissEnd; ++hwEtMissItr) {
514 etMissMatched.push_back(
false);
518 L1GctEtTotalCollection::const_iterator hwEtTotItr = hwEtTotColl->begin();
519 L1GctEtTotalCollection::const_iterator hwEtTotEnd = hwEtTotColl->end();
522 for (; hwEtTotItr != hwEtTotEnd; ++hwEtTotItr, ++iTot) {
523 int bx = hwEtTotItr->bx();
529 : (
double)hwEtTotItr->et()) *
534 hwEtMissItr = hwEtMissColl->begin();
535 hwEtMissEnd = hwEtMissColl->end();
536 for (; hwEtMissItr != hwEtMissEnd; ++hwEtMissItr, ++iMiss) {
537 if (hwEtMissItr->bx() == bx) {
538 etMissMatched[iMiss] =
true;
549 if (hwEtMissItr != hwEtMissEnd) {
553 : (
double)hwEtMissItr->et()) *
583 p4, L1EtMissParticle::kMET, etTot, metRef,
595 hwEtMissItr = hwEtMissColl->begin();
596 hwEtMissEnd = hwEtMissColl->end();
598 for (; hwEtMissItr != hwEtMissEnd; ++hwEtMissItr, ++iMiss) {
599 if (!etMissMatched[iMiss]) {
600 int bx = hwEtMissItr->bx();
605 : (
double)hwEtMissItr->et()) *
624 p4, L1EtMissParticle::kMET, etTot,
648 std::vector<bool> htMissMatched;
654 <<
"\nWarning: L1GctEtHadCollection with " <<
etHadSource_ 655 <<
"\nrequested in configuration, but not found in the event." 657 }
else if (!hwHtMissColl.
isValid()) {
660 <<
"\nrequested in configuration, but not found in the event." 666 L1GctHtMissCollection::const_iterator hwHtMissItr =
667 hwHtMissColl->begin();
668 L1GctHtMissCollection::const_iterator hwHtMissEnd = hwHtMissColl->end();
669 for (; hwHtMissItr != hwHtMissEnd; ++hwHtMissItr) {
670 htMissMatched.push_back(
false);
677 <<
"\nWarning: L1GctEtHadCollection with " <<
etHadSource_ 678 <<
"\nrequested in configuration, but not found in the event." 680 }
else if (!hwHtMissColl.
isValid()) {
683 <<
"\nrequested in configuration, but not found in the event." 686 L1GctEtHadCollection::const_iterator hwEtHadItr = hwEtHadColl->begin();
687 L1GctEtHadCollection::const_iterator hwEtHadEnd = hwEtHadColl->end();
690 for (; hwEtHadItr != hwEtHadEnd; ++hwEtHadItr, ++iHad) {
691 int bx = hwEtHadItr->bx();
697 : (
double)hwEtHadItr->et()) *
707 L1GctHtMissCollection::const_iterator hwHtMissItr =
708 hwHtMissColl->begin();
709 L1GctHtMissCollection::const_iterator hwHtMissEnd =
713 for (; hwHtMissItr != hwHtMissEnd; ++hwHtMissItr, ++iMiss) {
714 if (hwHtMissItr->bx() == bx) {
715 htMissMatched[iMiss] =
true;
721 if (hwHtMissItr != hwHtMissEnd) {
723 htMiss = htMissScale->
et(hwHtMissItr->overFlow()
725 : hwHtMissItr->et()) +
771 L1GctHtMissCollection::const_iterator hwHtMissItr =
772 hwHtMissColl->begin();
773 L1GctHtMissCollection::const_iterator hwHtMissEnd = hwHtMissColl->end();
776 for (; hwHtMissItr != hwHtMissEnd; ++hwHtMissItr, ++iMiss) {
777 if (!htMissMatched[iMiss]) {
778 int bx = hwHtMissItr->bx();
781 double htMiss = htMissScale->
et(hwHtMissItr->overFlow()
783 : hwHtMissItr->et()) +
821 if (!hwHFEtSumsColl.
isValid()) {
823 <<
"\nWarning: L1GctHFRingEtSumsCollection with " 825 <<
"\nrequested in configuration, but not found in the event." 827 }
else if (!hwHFBitCountsColl.
isValid()) {
829 <<
"\nWarning: L1GctHFBitCountsCollection with " 831 <<
"\nrequested in configuration, but not found in the event." 834 L1GctHFRingEtSumsCollection::const_iterator hwHFEtSumsItr =
835 hwHFEtSumsColl->begin();
836 L1GctHFRingEtSumsCollection::const_iterator hwHFEtSumsEnd =
837 hwHFEtSumsColl->end();
840 for (; hwHFEtSumsItr != hwHFEtSumsEnd; ++hwHFEtSumsItr, ++iEtSums) {
841 int bx = hwHFEtSumsItr->bx();
844 L1GctHFBitCountsCollection::const_iterator hwHFBitCountsItr =
845 hwHFBitCountsColl->begin();
846 L1GctHFBitCountsCollection::const_iterator hwHFBitCountsEnd =
847 hwHFBitCountsColl->end();
850 for (; hwHFBitCountsItr != hwHFBitCountsEnd;
851 ++hwHFBitCountsItr, ++iBitCounts) {
852 if (hwHFBitCountsItr->bx() == bx) {
858 if (hwHFBitCountsItr != hwHFBitCountsEnd) {
864 double etSums[L1HFRings::kNumRings];
865 etSums[L1HFRings::kRing1PosEta] =
866 hfRingEtScale->
et(hwHFEtSumsItr->etSum(0)) + 1.
e-6;
867 etSums[L1HFRings::kRing1NegEta] =
868 hfRingEtScale->
et(hwHFEtSumsItr->etSum(1)) + 1.
e-6;
869 etSums[L1HFRings::kRing2PosEta] =
870 hfRingEtScale->
et(hwHFEtSumsItr->etSum(2)) + 1.
e-6;
871 etSums[L1HFRings::kRing2NegEta] =
872 hfRingEtScale->
et(hwHFEtSumsItr->etSum(3)) + 1.
e-6;
887 int bitCounts[L1HFRings::kNumRings];
888 bitCounts[L1HFRings::kRing1PosEta] = hwHFBitCountsItr->bitCount(0);
889 bitCounts[L1HFRings::kRing1NegEta] = hwHFBitCountsItr->bitCount(1);
890 bitCounts[L1HFRings::kRing2PosEta] = hwHFBitCountsItr->bitCount(2);
891 bitCounts[L1HFRings::kRing2NegEta] = hwHFBitCountsItr->bitCount(3);
945 double etCorr = et + 1.e-6;
edm::InputTag muonSource_
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
math::PtEtaPhiMLorentzVector gctLorentzVector(const double &et, const L1GctCand &cand, const L1CaloGeometry *geom, bool central)
bool produceCaloParticles_
virtual float getCenter(unsigned packed) const =0
get the center of bin represented by packed
double etaBinCenter(unsigned int etaIndex, bool central=true) const
double getHtLsbGeV() const
double et(const uint16_t rank) const
convert from rank to physically meaningful quantity
double linearLsb() const
get LSB of linear input scale
static const double muonMassGeV_
edm::InputTag etMissSource_
virtual unsigned phiIndex() const =0
get phi index (0-17)
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
#define DEFINE_FWK_MODULE(type)
edm::InputTag htMissSource_
edm::InputTag cenJetSource_
bool produceMuonParticles_
double htSumPhiBinCenter(unsigned int phiIndex) const
~L1ExtraParticlesProd() override
edm::InputTag hfRingEtSumsSource_
const L1MuScale * getPhiScale() const
get the phi scale
virtual unsigned etaIndex() const =0
get eta index (bit 3 is sign, 1 for -ve Z, 0 for +ve Z)
edm::InputTag hfRingBitCountsSource_
void produce(edm::Event &, const edm::EventSetup &) override
edm::InputTag etTotSource_
edm::InputTag tauJetSource_
edm::InputTag isoEmSource_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::InputTag isoTauJetSource_
edm::InputTag etHadSource_
et
define resolution functions of each parameter
std::vector< L1MuGMTReadoutRecord > const & getRecords() const
virtual float getLowEdge(unsigned packed) const =0
get the low edge of bin represented by packed
ABC for GCT EM and jet candidates.
double emJetPhiBinCenter(unsigned int phiIndex) const
const L1MuScale * getGMTEtaScale() const
get the GMT eta scale
L1MuGMTReadoutRecord const & getRecord(int bx=0) const
L1ExtraParticlesProd(const edm::ParameterSet &)
edm::InputTag forJetSource_
double etSumPhiBinCenter(unsigned int phiIndex) const
unsigned rankScaleMax() const
edm::InputTag nonIsoEmSource_