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 isoTauJetSource_( iConfig.getParameter< edm::InputTag >(
85 "isoTauJetSource" ) ),
86 etTotSource_( iConfig.getParameter< edm::InputTag >(
88 etHadSource_( iConfig.getParameter< edm::InputTag >(
90 etMissSource_( iConfig.getParameter< edm::InputTag >(
92 htMissSource_( iConfig.getParameter< edm::InputTag >(
94 hfRingEtSumsSource_( iConfig.getParameter< edm::InputTag >(
95 "hfRingEtSumsSource" ) ),
96 hfRingBitCountsSource_( iConfig.getParameter< edm::InputTag >(
97 "hfRingBitCountsSource" ) ),
98 centralBxOnly_( iConfig.getParameter< bool >(
"centralBxOnly" ) ),
99 ignoreHtMiss_( iConfig.getParameter< bool >(
"ignoreHtMiss" ) )
101 using namespace l1extra ;
104 produces< L1EmParticleCollection >(
"Isolated" ) ;
105 produces< L1EmParticleCollection >(
"NonIsolated" ) ;
106 produces< L1JetParticleCollection >(
"Central" ) ;
107 produces< L1JetParticleCollection >(
"Forward" ) ;
108 produces< L1JetParticleCollection >(
"Tau" ) ;
109 produces< L1JetParticleCollection >(
"IsoTau" ) ;
110 produces< L1MuonParticleCollection >() ;
111 produces< L1EtMissParticleCollection >(
"MET" ) ;
112 produces< L1EtMissParticleCollection >(
"MHT" ) ;
113 produces< L1HFRingsCollection >() ;
150 using namespace edm ;
151 using namespace l1extra ;
152 using namespace std ;
158 auto_ptr< L1MuonParticleCollection > muColl(
172 vector< L1MuGMTExtendedCand > hwMuCands ;
174 if( !hwMuCollection.
isValid() )
177 <<
"\nWarning: L1MuGMTReadoutCollection with " <<
muonSource_
178 <<
"\nrequested in configuration, but not found in the event."
186 hwMuCands = hwMuCollection->getRecord().getGMTCands() ;
191 vector< L1MuGMTReadoutRecord > records = hwMuCollection->getRecords();
192 vector< L1MuGMTReadoutRecord >::const_iterator rItr = records.begin();
193 vector< L1MuGMTReadoutRecord >::const_iterator rEnd = records.end();
195 for( ; rItr != rEnd ; ++rItr )
197 vector< L1MuGMTExtendedCand > tmpCands = rItr->getGMTCands() ;
199 hwMuCands.insert( hwMuCands.end(),
206 vector< L1MuGMTExtendedCand >::const_iterator muItr = hwMuCands.begin() ;
207 vector< L1MuGMTExtendedCand >::const_iterator muEnd = hwMuCands.end() ;
208 for(
int i = 0 ; muItr != muEnd ; ++muItr, ++
i )
221 if( !muItr->empty() )
225 muPtScale->getPtScale()->getLowEdge( muItr->ptIndex() ) + 1.
e-6 ;
230 muScales->getGMTEtaScale()->getCenter( muItr->etaIndex() ) ;
233 muScales->getPhiScale()->getLowEdge( muItr->phiIndex() ) ;
252 iEvent.
put( muColl );
259 auto_ptr< L1EmParticleCollection > isoEmColl(
262 auto_ptr< L1EmParticleCollection > nonIsoEmColl(
265 auto_ptr< L1JetParticleCollection > cenJetColl(
268 auto_ptr< L1JetParticleCollection > forJetColl(
271 auto_ptr< L1JetParticleCollection > tauJetColl(
274 auto_ptr< L1JetParticleCollection > isoTauJetColl(
277 auto_ptr< L1EtMissParticleCollection > etMissColl(
280 auto_ptr< L1EtMissParticleCollection > htMissColl(
305 <<
"\nWarning: L1GctEmCandCollection with " <<
isoEmSource_
306 <<
"\nrequested in configuration, but not found in the event."
313 L1GctEmCandCollection::const_iterator emItr = hwIsoEmCands->begin() ;
314 L1GctEmCandCollection::const_iterator emEnd = hwIsoEmCands->end() ;
315 for(
int i = 0 ; emItr != emEnd ; ++emItr, ++
i )
328 if( !emItr->empty() &&
331 double et = emScale->et( emItr->rank() ) ;
335 isoEmColl->push_back(
349 if( !hwNonIsoEmCands.
isValid() )
353 <<
"\nrequested in configuration, but not found in the event."
359 L1GctEmCandCollection::const_iterator emItr = hwNonIsoEmCands->begin() ;
360 L1GctEmCandCollection::const_iterator emEnd = hwNonIsoEmCands->end() ;
361 for(
int i = 0 ; emItr != emEnd ; ++emItr, ++
i )
374 if( !emItr->empty() &&
377 double et = emScale->et( emItr->rank() ) ;
381 nonIsoEmColl->push_back(
403 <<
"\nWarning: L1GctJetCandCollection with " <<
cenJetSource_
404 <<
"\nrequested in configuration, but not found in the event."
410 L1GctJetCandCollection::const_iterator jetItr = hwCenJetCands->begin() ;
411 L1GctJetCandCollection::const_iterator jetEnd = hwCenJetCands->end() ;
412 for(
int i = 0 ; jetItr != jetEnd ; ++jetItr, ++
i )
427 if( !jetItr->empty() &&
430 double et = jetScale->et( jetItr->rank() ) ;
434 cenJetColl->push_back(
452 <<
"\nrequested in configuration, but not found in the event."
458 L1GctJetCandCollection::const_iterator jetItr = hwForJetCands->begin() ;
459 L1GctJetCandCollection::const_iterator jetEnd = hwForJetCands->end() ;
460 for(
int i = 0 ; jetItr != jetEnd ; ++jetItr, ++
i )
475 if( !jetItr->empty() &&
478 double et = jetScale->et( jetItr->rank() ) ;
482 forJetColl->push_back(
500 <<
"\nWarning: L1GctJetCandCollection with " <<
tauJetSource_
501 <<
"\nrequested in configuration, but not found in the event."
506 L1GctJetCandCollection::const_iterator jetItr = hwTauJetCands->begin() ;
507 L1GctJetCandCollection::const_iterator jetEnd = hwTauJetCands->end() ;
508 for(
int i = 0 ; jetItr != jetEnd ; ++jetItr, ++
i )
523 if( !jetItr->empty() &&
526 double et = jetScale->et( jetItr->rank() ) ;
530 tauJetColl->push_back(
545 if( !hwIsoTauJetCands.
isValid() )
549 <<
"\nrequested in configuration, but not found in the event."
554 L1GctJetCandCollection::const_iterator jetItr = hwIsoTauJetCands->begin() ;
555 L1GctJetCandCollection::const_iterator jetEnd = hwIsoTauJetCands->end() ;
556 for(
int i = 0 ; jetItr != jetEnd ; ++jetItr, ++
i )
571 if( !jetItr->empty() &&
574 double et = jetScale->et( jetItr->rank() ) ;
578 isoTauJetColl->push_back(
589 double etSumLSB = jetScale->linearLsb() ;
600 <<
"\nWarning: L1GctEtTotalCollection with " <<
etTotSource_
601 <<
"\nrequested in configuration, but not found in the event."
604 else if( !hwEtMissColl.
isValid() )
608 <<
"\nrequested in configuration, but not found in the event."
616 std::vector< bool > etMissMatched ;
618 L1GctEtMissCollection::const_iterator hwEtMissItr =
619 hwEtMissColl->begin() ;
620 L1GctEtMissCollection::const_iterator hwEtMissEnd =
621 hwEtMissColl->end() ;
622 for( ; hwEtMissItr != hwEtMissEnd ; ++hwEtMissItr )
624 etMissMatched.push_back(
false ) ;
628 L1GctEtTotalCollection::const_iterator hwEtTotItr =
629 hwEtTotColl->begin() ;
630 L1GctEtTotalCollection::const_iterator hwEtTotEnd =
634 for( ; hwEtTotItr != hwEtTotEnd ; ++hwEtTotItr, ++iTot )
636 int bx = hwEtTotItr->bx() ;
642 ( hwEtTotItr->overFlow() ?
644 (
double ) hwEtTotItr->et() ) * etSumLSB + 1.
e-6 ;
647 hwEtMissItr = hwEtMissColl->begin() ;
648 hwEtMissEnd = hwEtMissColl->end() ;
649 for( ; hwEtMissItr != hwEtMissEnd ; ++hwEtMissItr, ++iMiss )
651 if( hwEtMissItr->bx() == bx )
653 etMissMatched[ iMiss ] =
true ;
664 if( hwEtMissItr != hwEtMissEnd )
668 ( hwEtMissItr->overFlow() ?
670 (
double ) hwEtMissItr->et() ) * etSumLSB + 1.
e-6 ;
700 etMissColl->push_back(
703 L1EtMissParticle::kMET,
721 hwEtMissItr = hwEtMissColl->begin() ;
722 hwEtMissEnd = hwEtMissColl->end() ;
724 for( ; hwEtMissItr != hwEtMissEnd ; ++hwEtMissItr, ++iMiss )
726 if( !etMissMatched[ iMiss ] )
728 int bx = hwEtMissItr->bx() ;
732 ( hwEtMissItr->overFlow() ?
734 (
double ) hwEtMissItr->et() ) * etSumLSB + 1.
e-6 ;
753 etMissColl->push_back(
756 L1EtMissParticle::kMET,
782 double htSumLSB = jetFinderParams->getHtLsbGeV();
785 std::vector< bool > htMissMatched ;
793 <<
"\nWarning: L1GctEtHadCollection with " <<
etHadSource_
794 <<
"\nrequested in configuration, but not found in the event."
797 else if( !hwHtMissColl.
isValid() )
801 <<
"\nrequested in configuration, but not found in the event."
809 L1GctHtMissCollection::const_iterator hwHtMissItr =
810 hwHtMissColl->begin() ;
811 L1GctHtMissCollection::const_iterator hwHtMissEnd =
812 hwHtMissColl->end() ;
813 for( ; hwHtMissItr != hwHtMissEnd ; ++hwHtMissItr )
815 htMissMatched.push_back(
false ) ;
823 <<
"\nWarning: L1GctEtHadCollection with " <<
etHadSource_
824 <<
"\nrequested in configuration, but not found in the event."
827 else if( !hwHtMissColl.
isValid() )
831 <<
"\nrequested in configuration, but not found in the event."
836 L1GctEtHadCollection::const_iterator hwEtHadItr =
837 hwEtHadColl->begin() ;
838 L1GctEtHadCollection::const_iterator hwEtHadEnd =
842 for( ; hwEtHadItr != hwEtHadEnd ; ++hwEtHadItr, ++iHad )
844 int bx = hwEtHadItr->bx() ;
850 ( hwEtHadItr->overFlow() ?
852 (
double ) hwEtHadItr->et() ) * htSumLSB + 1.
e-6 ;
861 L1GctHtMissCollection::const_iterator hwHtMissItr =
862 hwHtMissColl->begin() ;
863 L1GctHtMissCollection::const_iterator hwHtMissEnd =
864 hwHtMissColl->end() ;
867 for( ; hwHtMissItr != hwHtMissEnd ; ++hwHtMissItr, ++iMiss )
869 if( hwHtMissItr->bx() == bx )
871 htMissMatched[ iMiss ] =
true ;
877 if( hwHtMissItr != hwHtMissEnd )
881 htMissScale->et( hwHtMissItr->overFlow() ?
882 htMissScale->rankScaleMax() :
883 hwHtMissItr->et() ) + 1.
e-6 ;
915 htMissColl->push_back(
918 L1EtMissParticle::kMHT,
935 L1GctHtMissCollection::const_iterator hwHtMissItr =
936 hwHtMissColl->begin() ;
937 L1GctHtMissCollection::const_iterator hwHtMissEnd =
938 hwHtMissColl->end() ;
941 for( ; hwHtMissItr != hwHtMissEnd ; ++hwHtMissItr, ++iMiss )
943 if( !htMissMatched[ iMiss ] )
945 int bx = hwHtMissItr->bx() ;
949 htMissScale->et( hwHtMissItr->overFlow() ?
950 htMissScale->rankScaleMax() :
951 hwHtMissItr->et() ) + 1.
e-6 ;
970 htMissColl->push_back(
973 L1EtMissParticle::kMHT,
997 if( !hwHFEtSumsColl.
isValid() )
1001 <<
"\nrequested in configuration, but not found in the event."
1004 else if( !hwHFBitCountsColl.
isValid() )
1008 <<
"\nrequested in configuration, but not found in the event."
1013 L1GctHFRingEtSumsCollection::const_iterator hwHFEtSumsItr =
1014 hwHFEtSumsColl->begin() ;
1015 L1GctHFRingEtSumsCollection::const_iterator hwHFEtSumsEnd =
1016 hwHFEtSumsColl->end() ;
1019 for( ; hwHFEtSumsItr != hwHFEtSumsEnd ; ++hwHFEtSumsItr, ++iEtSums )
1021 int bx = hwHFEtSumsItr->bx() ;
1025 L1GctHFBitCountsCollection::const_iterator hwHFBitCountsItr =
1026 hwHFBitCountsColl->begin() ;
1027 L1GctHFBitCountsCollection::const_iterator hwHFBitCountsEnd =
1028 hwHFBitCountsColl->end() ;
1030 int iBitCounts = 0 ;
1031 for( ; hwHFBitCountsItr != hwHFBitCountsEnd ;
1032 ++hwHFBitCountsItr, ++iBitCounts )
1034 if( hwHFBitCountsItr->bx() == bx )
1041 if( hwHFBitCountsItr != hwHFBitCountsEnd )
1048 double etSums[ L1HFRings::kNumRings ] ;
1049 etSums[ L1HFRings::kRing1PosEta ] =
1050 hfRingEtScale->et( hwHFEtSumsItr->etSum( 0 ) ) + 1.
e-6 ;
1051 etSums[ L1HFRings::kRing1NegEta ] =
1052 hfRingEtScale->et( hwHFEtSumsItr->etSum( 1 ) ) + 1.
e-6 ;
1053 etSums[ L1HFRings::kRing2PosEta ] =
1054 hfRingEtScale->et( hwHFEtSumsItr->etSum( 2 ) ) + 1.
e-6 ;
1055 etSums[ L1HFRings::kRing2NegEta ] =
1056 hfRingEtScale->et( hwHFEtSumsItr->etSum( 3 ) ) + 1.
e-6 ;
1071 int bitCounts[ L1HFRings::kNumRings ] ;
1072 bitCounts[ L1HFRings::kRing1PosEta ] =
1073 hwHFBitCountsItr->bitCount( 0 ) ;
1074 bitCounts[ L1HFRings::kRing1NegEta ] =
1075 hwHFBitCountsItr->bitCount( 1 ) ;
1076 bitCounts[ L1HFRings::kRing2PosEta ] =
1077 hwHFBitCountsItr->bitCount( 2 ) ;
1078 bitCounts[ L1HFRings::kRing2NegEta ] =
1079 hwHFBitCountsItr->bitCount( 3 ) ;
1088 hfRingsColl->push_back(
1104 iEvent.
put( isoEmColl,
"Isolated" ) ;
1107 iEvent.
put( nonIsoEmColl,
"NonIsolated" ) ;
1110 iEvent.
put( cenJetColl,
"Central" ) ;
1113 iEvent.
put( forJetColl,
"Forward" ) ;
1116 iEvent.
put( tauJetColl,
"Tau" ) ;
1119 iEvent.
put( isoTauJetColl,
"IsoTau" ) ;
1122 iEvent.
put( etMissColl,
"MET" ) ;
1125 iEvent.
put( htMissColl,
"MHT" ) ;
1128 iEvent.
put( hfRingsColl ) ;
1139 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
edm::InputTag isoTauJetSource_
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_