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 >() ;
134 using namespace edm ;
135 using namespace l1extra ;
136 using namespace std ;
142 auto_ptr< L1MuonParticleCollection > muColl(
156 vector< L1MuGMTExtendedCand > hwMuCands ;
158 if( !hwMuCollection.
isValid() )
161 <<
"\nWarning: L1MuGMTReadoutCollection with " <<
muonSource_
162 <<
"\nrequested in configuration, but not found in the event."
170 hwMuCands = hwMuCollection->getRecord().getGMTCands() ;
175 vector< L1MuGMTReadoutRecord > records = hwMuCollection->getRecords();
176 vector< L1MuGMTReadoutRecord >::const_iterator rItr = records.begin();
177 vector< L1MuGMTReadoutRecord >::const_iterator rEnd = records.end();
179 for( ; rItr != rEnd ; ++rItr )
181 vector< L1MuGMTExtendedCand > tmpCands = rItr->getGMTCands() ;
183 hwMuCands.insert( hwMuCands.end(),
190 vector< L1MuGMTExtendedCand >::const_iterator muItr = hwMuCands.begin() ;
191 vector< L1MuGMTExtendedCand >::const_iterator muEnd = hwMuCands.end() ;
192 for(
int i = 0 ; muItr != muEnd ; ++muItr, ++
i )
205 if( !muItr->empty() )
209 muPtScale->getPtScale()->getLowEdge( muItr->ptIndex() ) + 1.
e-6 ;
214 muScales->getGMTEtaScale()->getCenter( muItr->etaIndex() ) ;
217 muScales->getPhiScale()->getLowEdge( muItr->phiIndex() ) ;
236 iEvent.
put( muColl );
243 auto_ptr< L1EmParticleCollection > isoEmColl(
246 auto_ptr< L1EmParticleCollection > nonIsoEmColl(
249 auto_ptr< L1JetParticleCollection > cenJetColl(
252 auto_ptr< L1JetParticleCollection > forJetColl(
255 auto_ptr< L1JetParticleCollection > tauJetColl(
258 auto_ptr< L1EtMissParticleCollection > etMissColl(
261 auto_ptr< L1EtMissParticleCollection > htMissColl(
286 <<
"\nWarning: L1GctEmCandCollection with " <<
isoEmSource_
287 <<
"\nrequested in configuration, but not found in the event."
294 L1GctEmCandCollection::const_iterator emItr = hwIsoEmCands->begin() ;
295 L1GctEmCandCollection::const_iterator emEnd = hwIsoEmCands->end() ;
296 for(
int i = 0 ; emItr != emEnd ; ++emItr, ++
i )
309 if( !emItr->empty() &&
312 double et = emScale->et( emItr->rank() ) ;
316 isoEmColl->push_back(
330 if( !hwNonIsoEmCands.
isValid() )
334 <<
"\nrequested in configuration, but not found in the event."
340 L1GctEmCandCollection::const_iterator emItr = hwNonIsoEmCands->begin() ;
341 L1GctEmCandCollection::const_iterator emEnd = hwNonIsoEmCands->end() ;
342 for(
int i = 0 ; emItr != emEnd ; ++emItr, ++
i )
355 if( !emItr->empty() &&
358 double et = emScale->et( emItr->rank() ) ;
362 nonIsoEmColl->push_back(
384 <<
"\nWarning: L1GctJetCandCollection with " <<
cenJetSource_
385 <<
"\nrequested in configuration, but not found in the event."
391 L1GctJetCandCollection::const_iterator jetItr = hwCenJetCands->begin() ;
392 L1GctJetCandCollection::const_iterator jetEnd = hwCenJetCands->end() ;
393 for(
int i = 0 ; jetItr != jetEnd ; ++jetItr, ++
i )
408 if( !jetItr->empty() &&
411 double et = jetScale->et( jetItr->rank() ) ;
415 cenJetColl->push_back(
433 <<
"\nrequested in configuration, but not found in the event."
439 L1GctJetCandCollection::const_iterator jetItr = hwForJetCands->begin() ;
440 L1GctJetCandCollection::const_iterator jetEnd = hwForJetCands->end() ;
441 for(
int i = 0 ; jetItr != jetEnd ; ++jetItr, ++
i )
456 if( !jetItr->empty() &&
459 double et = jetScale->et( jetItr->rank() ) ;
463 forJetColl->push_back(
481 <<
"\nWarning: L1GctJetCandCollection with " <<
tauJetSource_
482 <<
"\nrequested in configuration, but not found in the event."
487 L1GctJetCandCollection::const_iterator jetItr = hwTauJetCands->begin() ;
488 L1GctJetCandCollection::const_iterator jetEnd = hwTauJetCands->end() ;
489 for(
int i = 0 ; jetItr != jetEnd ; ++jetItr, ++
i )
504 if( !jetItr->empty() &&
507 double et = jetScale->et( jetItr->rank() ) ;
511 tauJetColl->push_back(
522 double etSumLSB = jetScale->linearLsb() ;
533 <<
"\nWarning: L1GctEtTotalCollection with " <<
etTotSource_
534 <<
"\nrequested in configuration, but not found in the event."
537 else if( !hwEtMissColl.
isValid() )
541 <<
"\nrequested in configuration, but not found in the event."
549 std::vector< bool > etMissMatched ;
551 L1GctEtMissCollection::const_iterator hwEtMissItr =
552 hwEtMissColl->begin() ;
553 L1GctEtMissCollection::const_iterator hwEtMissEnd =
554 hwEtMissColl->end() ;
555 for( ; hwEtMissItr != hwEtMissEnd ; ++hwEtMissItr )
557 etMissMatched.push_back(
false ) ;
561 L1GctEtTotalCollection::const_iterator hwEtTotItr =
562 hwEtTotColl->begin() ;
563 L1GctEtTotalCollection::const_iterator hwEtTotEnd =
567 for( ; hwEtTotItr != hwEtTotEnd ; ++hwEtTotItr, ++iTot )
569 int bx = hwEtTotItr->bx() ;
575 ( hwEtTotItr->overFlow() ?
577 (
double ) hwEtTotItr->et() ) * etSumLSB + 1.
e-6 ;
580 hwEtMissItr = hwEtMissColl->begin() ;
581 hwEtMissEnd = hwEtMissColl->end() ;
582 for( ; hwEtMissItr != hwEtMissEnd ; ++hwEtMissItr, ++iMiss )
584 if( hwEtMissItr->bx() == bx )
586 etMissMatched[ iMiss ] =
true ;
597 if( hwEtMissItr != hwEtMissEnd )
601 ( hwEtMissItr->overFlow() ?
603 (
double ) hwEtMissItr->et() ) * etSumLSB + 1.
e-6 ;
633 etMissColl->push_back(
636 L1EtMissParticle::kMET,
654 hwEtMissItr = hwEtMissColl->begin() ;
655 hwEtMissEnd = hwEtMissColl->end() ;
657 for( ; hwEtMissItr != hwEtMissEnd ; ++hwEtMissItr, ++iMiss )
659 if( !etMissMatched[ iMiss ] )
661 int bx = hwEtMissItr->bx() ;
665 ( hwEtMissItr->overFlow() ?
667 (
double ) hwEtMissItr->et() ) * etSumLSB + 1.
e-6 ;
686 etMissColl->push_back(
689 L1EtMissParticle::kMET,
715 double htSumLSB = jetFinderParams->getHtLsbGeV();
718 std::vector< bool > htMissMatched ;
726 <<
"\nWarning: L1GctEtHadCollection with " <<
etHadSource_
727 <<
"\nrequested in configuration, but not found in the event."
730 else if( !hwHtMissColl.
isValid() )
734 <<
"\nrequested in configuration, but not found in the event."
742 L1GctHtMissCollection::const_iterator hwHtMissItr =
743 hwHtMissColl->begin() ;
744 L1GctHtMissCollection::const_iterator hwHtMissEnd =
745 hwHtMissColl->end() ;
746 for( ; hwHtMissItr != hwHtMissEnd ; ++hwHtMissItr )
748 htMissMatched.push_back(
false ) ;
756 <<
"\nWarning: L1GctEtHadCollection with " <<
etHadSource_
757 <<
"\nrequested in configuration, but not found in the event."
760 else if( !hwHtMissColl.
isValid() )
764 <<
"\nrequested in configuration, but not found in the event."
769 L1GctEtHadCollection::const_iterator hwEtHadItr =
770 hwEtHadColl->begin() ;
771 L1GctEtHadCollection::const_iterator hwEtHadEnd =
775 for( ; hwEtHadItr != hwEtHadEnd ; ++hwEtHadItr, ++iHad )
777 int bx = hwEtHadItr->bx() ;
783 ( hwEtHadItr->overFlow() ?
785 (
double ) hwEtHadItr->et() ) * htSumLSB + 1.
e-6 ;
794 L1GctHtMissCollection::const_iterator hwHtMissItr =
795 hwHtMissColl->begin() ;
796 L1GctHtMissCollection::const_iterator hwHtMissEnd =
797 hwHtMissColl->end() ;
800 for( ; hwHtMissItr != hwHtMissEnd ; ++hwHtMissItr, ++iMiss )
802 if( hwHtMissItr->bx() == bx )
804 htMissMatched[ iMiss ] =
true ;
810 if( hwHtMissItr != hwHtMissEnd )
814 htMissScale->et( hwHtMissItr->overFlow() ?
815 htMissScale->rankScaleMax() :
816 hwHtMissItr->et() ) + 1.
e-6 ;
848 htMissColl->push_back(
851 L1EtMissParticle::kMHT,
868 L1GctHtMissCollection::const_iterator hwHtMissItr =
869 hwHtMissColl->begin() ;
870 L1GctHtMissCollection::const_iterator hwHtMissEnd =
871 hwHtMissColl->end() ;
874 for( ; hwHtMissItr != hwHtMissEnd ; ++hwHtMissItr, ++iMiss )
876 if( !htMissMatched[ iMiss ] )
878 int bx = hwHtMissItr->bx() ;
882 htMissScale->et( hwHtMissItr->overFlow() ?
883 htMissScale->rankScaleMax() :
884 hwHtMissItr->et() ) + 1.
e-6 ;
903 htMissColl->push_back(
906 L1EtMissParticle::kMHT,
930 if( !hwHFEtSumsColl.
isValid() )
934 <<
"\nrequested in configuration, but not found in the event."
937 else if( !hwHFBitCountsColl.
isValid() )
941 <<
"\nrequested in configuration, but not found in the event."
946 L1GctHFRingEtSumsCollection::const_iterator hwHFEtSumsItr =
947 hwHFEtSumsColl->begin() ;
948 L1GctHFRingEtSumsCollection::const_iterator hwHFEtSumsEnd =
949 hwHFEtSumsColl->end() ;
952 for( ; hwHFEtSumsItr != hwHFEtSumsEnd ; ++hwHFEtSumsItr, ++iEtSums )
954 int bx = hwHFEtSumsItr->bx() ;
958 L1GctHFBitCountsCollection::const_iterator hwHFBitCountsItr =
959 hwHFBitCountsColl->begin() ;
960 L1GctHFBitCountsCollection::const_iterator hwHFBitCountsEnd =
961 hwHFBitCountsColl->end() ;
964 for( ; hwHFBitCountsItr != hwHFBitCountsEnd ;
965 ++hwHFBitCountsItr, ++iBitCounts )
967 if( hwHFBitCountsItr->bx() == bx )
974 if( hwHFBitCountsItr != hwHFBitCountsEnd )
981 double etSums[ L1HFRings::kNumRings ] ;
982 etSums[ L1HFRings::kRing1PosEta ] =
983 hfRingEtScale->et( hwHFEtSumsItr->etSum( 0 ) ) + 1.
e-6 ;
984 etSums[ L1HFRings::kRing1NegEta ] =
985 hfRingEtScale->et( hwHFEtSumsItr->etSum( 1 ) ) + 1.
e-6 ;
986 etSums[ L1HFRings::kRing2PosEta ] =
987 hfRingEtScale->et( hwHFEtSumsItr->etSum( 2 ) ) + 1.
e-6 ;
988 etSums[ L1HFRings::kRing2NegEta ] =
989 hfRingEtScale->et( hwHFEtSumsItr->etSum( 3 ) ) + 1.
e-6 ;
1004 int bitCounts[ L1HFRings::kNumRings ] ;
1005 bitCounts[ L1HFRings::kRing1PosEta ] =
1006 hwHFBitCountsItr->bitCount( 0 ) ;
1007 bitCounts[ L1HFRings::kRing1NegEta ] =
1008 hwHFBitCountsItr->bitCount( 1 ) ;
1009 bitCounts[ L1HFRings::kRing2PosEta ] =
1010 hwHFBitCountsItr->bitCount( 2 ) ;
1011 bitCounts[ L1HFRings::kRing2NegEta ] =
1012 hwHFBitCountsItr->bitCount( 3 ) ;
1021 hfRingsColl->push_back(
1037 iEvent.
put( isoEmColl,
"Isolated" ) ;
1040 iEvent.
put( nonIsoEmColl,
"NonIsolated" ) ;
1043 iEvent.
put( cenJetColl,
"Central" ) ;
1046 iEvent.
put( forJetColl,
"Forward" ) ;
1049 iEvent.
put( tauJetColl,
"Tau" ) ;
1052 iEvent.
put( etMissColl,
"MET" ) ;
1055 iEvent.
put( htMissColl,
"MHT" ) ;
1058 iEvent.
put( hfRingsColl ) ;
1069 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_
virtual void produce(edm::Event &, const edm::EventSetup &)
edm::InputTag hfRingBitCountsSource_
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_