68 : produceMuonParticles_( iConfig.getParameter< bool >(
69 "produceMuonParticles" ) ),
70 muonSource_( iConfig.getParameter< edm::InputTag >(
72 produceCaloParticles_( iConfig.getParameter< bool >(
73 "produceCaloParticles" ) ),
74 isoEmSource_( iConfig.getParameter< edm::InputTag >(
75 "isolatedEmSource" ) ),
76 nonIsoEmSource_( iConfig.getParameter< edm::InputTag >(
77 "nonIsolatedEmSource" ) ),
78 cenJetSource_( iConfig.getParameter< edm::InputTag >(
79 "centralJetSource" ) ),
80 forJetSource_( iConfig.getParameter< edm::InputTag >(
81 "forwardJetSource" ) ),
82 tauJetSource_( iConfig.getParameter< edm::InputTag >(
84 etTotSource_( iConfig.getParameter< edm::InputTag >(
86 etHadSource_( iConfig.getParameter< edm::InputTag >(
88 etMissSource_( iConfig.getParameter< edm::InputTag >(
90 htMissSource_( iConfig.getParameter< edm::InputTag >(
92 hfRingEtSumsSource_( iConfig.getParameter< edm::InputTag >(
93 "hfRingEtSumsSource" ) ),
94 hfRingBitCountsSource_( iConfig.getParameter< edm::InputTag >(
95 "hfRingBitCountsSource" ) ),
96 centralBxOnly_( iConfig.getParameter< bool >(
"centralBxOnly" ) ),
97 ignoreHtMiss_( iConfig.getParameter< bool >(
"ignoreHtMiss" ) )
99 using namespace l1extra ;
102 produces< L1EmParticleCollection >(
"Isolated" ) ;
103 produces< L1EmParticleCollection >(
"NonIsolated" ) ;
104 produces< L1JetParticleCollection >(
"Central" ) ;
105 produces< L1JetParticleCollection >(
"Forward" ) ;
106 produces< L1JetParticleCollection >(
"Tau" ) ;
107 produces< L1MuonParticleCollection >() ;
108 produces< L1EtMissParticleCollection >(
"MET" ) ;
109 produces< L1EtMissParticleCollection >(
"MHT" ) ;
110 produces< L1HFRingsCollection >() ;
146 using namespace edm ;
147 using namespace l1extra ;
148 using namespace std ;
154 auto_ptr< L1MuonParticleCollection > muColl(
168 vector< L1MuGMTExtendedCand > hwMuCands ;
170 if( !hwMuCollection.
isValid() )
173 <<
"\nWarning: L1MuGMTReadoutCollection with " <<
muonSource_
174 <<
"\nrequested in configuration, but not found in the event."
182 hwMuCands = hwMuCollection->getRecord().getGMTCands() ;
187 vector< L1MuGMTReadoutRecord > records = hwMuCollection->getRecords();
188 vector< L1MuGMTReadoutRecord >::const_iterator rItr = records.begin();
189 vector< L1MuGMTReadoutRecord >::const_iterator rEnd = records.end();
191 for( ; rItr != rEnd ; ++rItr )
193 vector< L1MuGMTExtendedCand > tmpCands = rItr->getGMTCands() ;
195 hwMuCands.insert( hwMuCands.end(),
202 vector< L1MuGMTExtendedCand >::const_iterator muItr = hwMuCands.begin() ;
203 vector< L1MuGMTExtendedCand >::const_iterator muEnd = hwMuCands.end() ;
204 for(
int i = 0 ; muItr != muEnd ; ++muItr, ++
i )
217 if( !muItr->empty() )
221 muPtScale->getPtScale()->getLowEdge( muItr->ptIndex() ) + 1.
e-6 ;
226 muScales->getGMTEtaScale()->getCenter( muItr->etaIndex() ) ;
229 muScales->getPhiScale()->getLowEdge( muItr->phiIndex() ) ;
248 iEvent.
put( muColl );
255 auto_ptr< L1EmParticleCollection > isoEmColl(
258 auto_ptr< L1EmParticleCollection > nonIsoEmColl(
261 auto_ptr< L1JetParticleCollection > cenJetColl(
264 auto_ptr< L1JetParticleCollection > forJetColl(
267 auto_ptr< L1JetParticleCollection > tauJetColl(
270 auto_ptr< L1EtMissParticleCollection > etMissColl(
273 auto_ptr< L1EtMissParticleCollection > htMissColl(
298 <<
"\nWarning: L1GctEmCandCollection with " <<
isoEmSource_
299 <<
"\nrequested in configuration, but not found in the event."
306 L1GctEmCandCollection::const_iterator emItr = hwIsoEmCands->begin() ;
307 L1GctEmCandCollection::const_iterator emEnd = hwIsoEmCands->end() ;
308 for(
int i = 0 ; emItr != emEnd ; ++emItr, ++
i )
321 if( !emItr->empty() &&
324 double et = emScale->et( emItr->rank() ) ;
328 isoEmColl->push_back(
342 if( !hwNonIsoEmCands.
isValid() )
346 <<
"\nrequested in configuration, but not found in the event."
352 L1GctEmCandCollection::const_iterator emItr = hwNonIsoEmCands->begin() ;
353 L1GctEmCandCollection::const_iterator emEnd = hwNonIsoEmCands->end() ;
354 for(
int i = 0 ; emItr != emEnd ; ++emItr, ++
i )
367 if( !emItr->empty() &&
370 double et = emScale->et( emItr->rank() ) ;
374 nonIsoEmColl->push_back(
396 <<
"\nWarning: L1GctJetCandCollection with " <<
cenJetSource_
397 <<
"\nrequested in configuration, but not found in the event."
403 L1GctJetCandCollection::const_iterator jetItr = hwCenJetCands->begin() ;
404 L1GctJetCandCollection::const_iterator jetEnd = hwCenJetCands->end() ;
405 for(
int i = 0 ; jetItr != jetEnd ; ++jetItr, ++
i )
420 if( !jetItr->empty() &&
423 double et = jetScale->et( jetItr->rank() ) ;
427 cenJetColl->push_back(
445 <<
"\nrequested in configuration, but not found in the event."
451 L1GctJetCandCollection::const_iterator jetItr = hwForJetCands->begin() ;
452 L1GctJetCandCollection::const_iterator jetEnd = hwForJetCands->end() ;
453 for(
int i = 0 ; jetItr != jetEnd ; ++jetItr, ++
i )
468 if( !jetItr->empty() &&
471 double et = jetScale->et( jetItr->rank() ) ;
475 forJetColl->push_back(
493 <<
"\nWarning: L1GctJetCandCollection with " <<
tauJetSource_
494 <<
"\nrequested in configuration, but not found in the event."
499 L1GctJetCandCollection::const_iterator jetItr = hwTauJetCands->begin() ;
500 L1GctJetCandCollection::const_iterator jetEnd = hwTauJetCands->end() ;
501 for(
int i = 0 ; jetItr != jetEnd ; ++jetItr, ++
i )
516 if( !jetItr->empty() &&
519 double et = jetScale->et( jetItr->rank() ) ;
523 tauJetColl->push_back(
534 double etSumLSB = jetScale->linearLsb() ;
545 <<
"\nWarning: L1GctEtTotalCollection with " <<
etTotSource_
546 <<
"\nrequested in configuration, but not found in the event."
549 else if( !hwEtMissColl.
isValid() )
553 <<
"\nrequested in configuration, but not found in the event."
561 std::vector< bool > etMissMatched ;
563 L1GctEtMissCollection::const_iterator hwEtMissItr =
564 hwEtMissColl->begin() ;
565 L1GctEtMissCollection::const_iterator hwEtMissEnd =
566 hwEtMissColl->end() ;
567 for( ; hwEtMissItr != hwEtMissEnd ; ++hwEtMissItr )
569 etMissMatched.push_back(
false ) ;
573 L1GctEtTotalCollection::const_iterator hwEtTotItr =
574 hwEtTotColl->begin() ;
575 L1GctEtTotalCollection::const_iterator hwEtTotEnd =
579 for( ; hwEtTotItr != hwEtTotEnd ; ++hwEtTotItr, ++iTot )
581 int bx = hwEtTotItr->bx() ;
587 ( hwEtTotItr->overFlow() ?
589 (
double ) hwEtTotItr->et() ) * etSumLSB + 1.
e-6 ;
592 hwEtMissItr = hwEtMissColl->begin() ;
593 hwEtMissEnd = hwEtMissColl->end() ;
594 for( ; hwEtMissItr != hwEtMissEnd ; ++hwEtMissItr, ++iMiss )
596 if( hwEtMissItr->bx() == bx )
598 etMissMatched[ iMiss ] =
true ;
609 if( hwEtMissItr != hwEtMissEnd )
613 ( hwEtMissItr->overFlow() ?
615 (
double ) hwEtMissItr->et() ) * etSumLSB + 1.
e-6 ;
645 etMissColl->push_back(
648 L1EtMissParticle::kMET,
666 hwEtMissItr = hwEtMissColl->begin() ;
667 hwEtMissEnd = hwEtMissColl->end() ;
669 for( ; hwEtMissItr != hwEtMissEnd ; ++hwEtMissItr, ++iMiss )
671 if( !etMissMatched[ iMiss ] )
673 int bx = hwEtMissItr->bx() ;
677 ( hwEtMissItr->overFlow() ?
679 (
double ) hwEtMissItr->et() ) * etSumLSB + 1.
e-6 ;
698 etMissColl->push_back(
701 L1EtMissParticle::kMET,
727 double htSumLSB = jetFinderParams->getHtLsbGeV();
730 std::vector< bool > htMissMatched ;
738 <<
"\nWarning: L1GctEtHadCollection with " <<
etHadSource_
739 <<
"\nrequested in configuration, but not found in the event."
742 else if( !hwHtMissColl.
isValid() )
746 <<
"\nrequested in configuration, but not found in the event."
754 L1GctHtMissCollection::const_iterator hwHtMissItr =
755 hwHtMissColl->begin() ;
756 L1GctHtMissCollection::const_iterator hwHtMissEnd =
757 hwHtMissColl->end() ;
758 for( ; hwHtMissItr != hwHtMissEnd ; ++hwHtMissItr )
760 htMissMatched.push_back(
false ) ;
768 <<
"\nWarning: L1GctEtHadCollection with " <<
etHadSource_
769 <<
"\nrequested in configuration, but not found in the event."
772 else if( !hwHtMissColl.
isValid() )
776 <<
"\nrequested in configuration, but not found in the event."
781 L1GctEtHadCollection::const_iterator hwEtHadItr =
782 hwEtHadColl->begin() ;
783 L1GctEtHadCollection::const_iterator hwEtHadEnd =
787 for( ; hwEtHadItr != hwEtHadEnd ; ++hwEtHadItr, ++iHad )
789 int bx = hwEtHadItr->bx() ;
795 ( hwEtHadItr->overFlow() ?
797 (
double ) hwEtHadItr->et() ) * htSumLSB + 1.
e-6 ;
806 L1GctHtMissCollection::const_iterator hwHtMissItr =
807 hwHtMissColl->begin() ;
808 L1GctHtMissCollection::const_iterator hwHtMissEnd =
809 hwHtMissColl->end() ;
812 for( ; hwHtMissItr != hwHtMissEnd ; ++hwHtMissItr, ++iMiss )
814 if( hwHtMissItr->bx() == bx )
816 htMissMatched[ iMiss ] =
true ;
822 if( hwHtMissItr != hwHtMissEnd )
826 htMissScale->et( hwHtMissItr->overFlow() ?
827 htMissScale->rankScaleMax() :
828 hwHtMissItr->et() ) + 1.
e-6 ;
860 htMissColl->push_back(
863 L1EtMissParticle::kMHT,
880 L1GctHtMissCollection::const_iterator hwHtMissItr =
881 hwHtMissColl->begin() ;
882 L1GctHtMissCollection::const_iterator hwHtMissEnd =
883 hwHtMissColl->end() ;
886 for( ; hwHtMissItr != hwHtMissEnd ; ++hwHtMissItr, ++iMiss )
888 if( !htMissMatched[ iMiss ] )
890 int bx = hwHtMissItr->bx() ;
894 htMissScale->et( hwHtMissItr->overFlow() ?
895 htMissScale->rankScaleMax() :
896 hwHtMissItr->et() ) + 1.
e-6 ;
915 htMissColl->push_back(
918 L1EtMissParticle::kMHT,
942 if( !hwHFEtSumsColl.
isValid() )
946 <<
"\nrequested in configuration, but not found in the event."
949 else if( !hwHFBitCountsColl.
isValid() )
953 <<
"\nrequested in configuration, but not found in the event."
958 L1GctHFRingEtSumsCollection::const_iterator hwHFEtSumsItr =
959 hwHFEtSumsColl->begin() ;
960 L1GctHFRingEtSumsCollection::const_iterator hwHFEtSumsEnd =
961 hwHFEtSumsColl->end() ;
964 for( ; hwHFEtSumsItr != hwHFEtSumsEnd ; ++hwHFEtSumsItr, ++iEtSums )
966 int bx = hwHFEtSumsItr->bx() ;
970 L1GctHFBitCountsCollection::const_iterator hwHFBitCountsItr =
971 hwHFBitCountsColl->begin() ;
972 L1GctHFBitCountsCollection::const_iterator hwHFBitCountsEnd =
973 hwHFBitCountsColl->end() ;
976 for( ; hwHFBitCountsItr != hwHFBitCountsEnd ;
977 ++hwHFBitCountsItr, ++iBitCounts )
979 if( hwHFBitCountsItr->bx() == bx )
986 if( hwHFBitCountsItr != hwHFBitCountsEnd )
993 double etSums[ L1HFRings::kNumRings ] ;
994 etSums[ L1HFRings::kRing1PosEta ] =
995 hfRingEtScale->et( hwHFEtSumsItr->etSum( 0 ) ) + 1.
e-6 ;
996 etSums[ L1HFRings::kRing1NegEta ] =
997 hfRingEtScale->et( hwHFEtSumsItr->etSum( 1 ) ) + 1.
e-6 ;
998 etSums[ L1HFRings::kRing2PosEta ] =
999 hfRingEtScale->et( hwHFEtSumsItr->etSum( 2 ) ) + 1.
e-6 ;
1000 etSums[ L1HFRings::kRing2NegEta ] =
1001 hfRingEtScale->et( hwHFEtSumsItr->etSum( 3 ) ) + 1.
e-6 ;
1016 int bitCounts[ L1HFRings::kNumRings ] ;
1017 bitCounts[ L1HFRings::kRing1PosEta ] =
1018 hwHFBitCountsItr->bitCount( 0 ) ;
1019 bitCounts[ L1HFRings::kRing1NegEta ] =
1020 hwHFBitCountsItr->bitCount( 1 ) ;
1021 bitCounts[ L1HFRings::kRing2PosEta ] =
1022 hwHFBitCountsItr->bitCount( 2 ) ;
1023 bitCounts[ L1HFRings::kRing2NegEta ] =
1024 hwHFBitCountsItr->bitCount( 3 ) ;
1033 hfRingsColl->push_back(
1049 iEvent.
put( isoEmColl,
"Isolated" ) ;
1052 iEvent.
put( nonIsoEmColl,
"NonIsolated" ) ;
1055 iEvent.
put( cenJetColl,
"Central" ) ;
1058 iEvent.
put( forJetColl,
"Forward" ) ;
1061 iEvent.
put( tauJetColl,
"Tau" ) ;
1064 iEvent.
put( etMissColl,
"MET" ) ;
1067 iEvent.
put( htMissColl,
"MHT" ) ;
1070 iEvent.
put( hfRingsColl ) ;
1081 double etCorr = et + 1.e-6 ;
edm::InputTag muonSource_
math::PtEtaPhiMLorentzVector gctLorentzVector(const double &et, const L1GctCand &cand, const L1CaloGeometry *geom, bool central)
#define DEFINE_FWK_MODULE(type)
bool produceCaloParticles_
double etaBinCenter(unsigned int etaIndex, bool central=true) const
static const double muonMassGeV_
edm::InputTag etMissSource_
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
edm::InputTag htMissSource_
edm::InputTag cenJetSource_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual unsigned etaIndex() const =0
get eta index (bit 3 is sign, 1 for -ve Z, 0 for +ve Z)
bool produceMuonParticles_
double htSumPhiBinCenter(unsigned int phiIndex) const
edm::InputTag hfRingEtSumsSource_
edm::InputTag hfRingBitCountsSource_
virtual 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
virtual unsigned phiIndex() const =0
get phi index (0-17)
edm::InputTag etHadSource_
ABC for GCT EM and jet candidates.
double emJetPhiBinCenter(unsigned int phiIndex) const
L1ExtraParticlesProd(const edm::ParameterSet &)
edm::InputTag forJetSource_
double etSumPhiBinCenter(unsigned int phiIndex) const
edm::InputTag nonIsoEmSource_