135 using namespace edm ;
136 using namespace l1extra ;
137 using namespace std ;
143 auto_ptr< L1MuonParticleCollection > muColl(
157 vector< L1MuGMTExtendedCand > hwMuCands ;
159 if( !hwMuCollection.
isValid() )
162 <<
"\nWarning: L1MuGMTReadoutCollection with " <<
muonSource_
163 <<
"\nrequested in configuration, but not found in the event."
171 hwMuCands = hwMuCollection->getRecord().getGMTCands() ;
176 vector< L1MuGMTReadoutRecord > records = hwMuCollection->getRecords();
177 vector< L1MuGMTReadoutRecord >::const_iterator rItr = records.begin();
178 vector< L1MuGMTReadoutRecord >::const_iterator rEnd = records.end();
180 for( ; rItr != rEnd ; ++rItr )
182 vector< L1MuGMTExtendedCand > tmpCands = rItr->getGMTCands() ;
184 hwMuCands.insert( hwMuCands.end(),
191 vector< L1MuGMTExtendedCand >::const_iterator muItr = hwMuCands.begin() ;
192 vector< L1MuGMTExtendedCand >::const_iterator muEnd = hwMuCands.end() ;
193 for(
int i = 0 ; muItr != muEnd ; ++muItr, ++
i )
206 if( !muItr->empty() )
210 muPtScale->getPtScale()->getLowEdge( muItr->ptIndex() ) + 1.e-6 ;
215 muScales->getGMTEtaScale()->getCenter( muItr->etaIndex() ) ;
218 muScales->getPhiScale()->getLowEdge( muItr->phiIndex() ) ;
237 iEvent.
put( muColl );
244 auto_ptr< L1EmParticleCollection > isoEmColl(
247 auto_ptr< L1EmParticleCollection > nonIsoEmColl(
250 auto_ptr< L1JetParticleCollection > cenJetColl(
253 auto_ptr< L1JetParticleCollection > forJetColl(
256 auto_ptr< L1JetParticleCollection > tauJetColl(
259 auto_ptr< L1EtMissParticleCollection > etMissColl(
262 auto_ptr< L1EtMissParticleCollection > htMissColl(
287 <<
"\nWarning: L1GctEmCandCollection with " <<
isoEmSource_
288 <<
"\nrequested in configuration, but not found in the event."
295 L1GctEmCandCollection::const_iterator emItr = hwIsoEmCands->begin() ;
296 L1GctEmCandCollection::const_iterator emEnd = hwIsoEmCands->end() ;
297 for(
int i = 0 ; emItr != emEnd ; ++emItr, ++
i )
310 if( !emItr->empty() &&
313 double et = emScale->et( emItr->rank() ) ;
317 isoEmColl->push_back(
331 if( !hwNonIsoEmCands.
isValid() )
335 <<
"\nrequested in configuration, but not found in the event."
341 L1GctEmCandCollection::const_iterator emItr = hwNonIsoEmCands->begin() ;
342 L1GctEmCandCollection::const_iterator emEnd = hwNonIsoEmCands->end() ;
343 for(
int i = 0 ; emItr != emEnd ; ++emItr, ++
i )
356 if( !emItr->empty() &&
359 double et = emScale->et( emItr->rank() ) ;
363 nonIsoEmColl->push_back(
385 <<
"\nWarning: L1GctJetCandCollection with " <<
cenJetSource_
386 <<
"\nrequested in configuration, but not found in the event."
392 L1GctJetCandCollection::const_iterator jetItr = hwCenJetCands->begin() ;
393 L1GctJetCandCollection::const_iterator jetEnd = hwCenJetCands->end() ;
394 for(
int i = 0 ; jetItr != jetEnd ; ++jetItr, ++
i )
409 if( !jetItr->empty() &&
412 double et = jetScale->et( jetItr->rank() ) ;
416 cenJetColl->push_back(
434 <<
"\nrequested in configuration, but not found in the event."
440 L1GctJetCandCollection::const_iterator jetItr = hwForJetCands->begin() ;
441 L1GctJetCandCollection::const_iterator jetEnd = hwForJetCands->end() ;
442 for(
int i = 0 ; jetItr != jetEnd ; ++jetItr, ++
i )
457 if( !jetItr->empty() &&
460 double et = jetScale->et( jetItr->rank() ) ;
464 forJetColl->push_back(
482 <<
"\nWarning: L1GctJetCandCollection with " <<
tauJetSource_
483 <<
"\nrequested in configuration, but not found in the event."
488 L1GctJetCandCollection::const_iterator jetItr = hwTauJetCands->begin() ;
489 L1GctJetCandCollection::const_iterator jetEnd = hwTauJetCands->end() ;
490 for(
int i = 0 ; jetItr != jetEnd ; ++jetItr, ++
i )
505 if( !jetItr->empty() &&
508 double et = jetScale->et( jetItr->rank() ) ;
512 tauJetColl->push_back(
523 double etSumLSB = jetScale->linearLsb() ;
534 <<
"\nWarning: L1GctEtTotalCollection with " <<
etTotSource_
535 <<
"\nrequested in configuration, but not found in the event."
538 else if( !hwEtMissColl.
isValid() )
542 <<
"\nrequested in configuration, but not found in the event."
550 std::vector< bool > etMissMatched ;
552 L1GctEtMissCollection::const_iterator hwEtMissItr =
553 hwEtMissColl->begin() ;
554 L1GctEtMissCollection::const_iterator hwEtMissEnd =
555 hwEtMissColl->end() ;
556 for( ; hwEtMissItr != hwEtMissEnd ; ++hwEtMissItr )
558 etMissMatched.push_back(
false ) ;
562 L1GctEtTotalCollection::const_iterator hwEtTotItr =
563 hwEtTotColl->begin() ;
564 L1GctEtTotalCollection::const_iterator hwEtTotEnd =
568 for( ; hwEtTotItr != hwEtTotEnd ; ++hwEtTotItr, ++iTot )
570 int bx = hwEtTotItr->bx() ;
576 ( hwEtTotItr->overFlow() ?
578 (
double ) hwEtTotItr->et() ) * etSumLSB + 1.e-6 ;
581 hwEtMissItr = hwEtMissColl->begin() ;
582 hwEtMissEnd = hwEtMissColl->end() ;
583 for( ; hwEtMissItr != hwEtMissEnd ; ++hwEtMissItr, ++iMiss )
585 if( hwEtMissItr->bx() == bx )
587 etMissMatched[ iMiss ] =
true ;
598 if( hwEtMissItr != hwEtMissEnd )
602 ( hwEtMissItr->overFlow() ?
604 (
double ) hwEtMissItr->et() ) * etSumLSB + 1.e-6 ;
634 etMissColl->push_back(
637 L1EtMissParticle::kMET,
655 hwEtMissItr = hwEtMissColl->begin() ;
656 hwEtMissEnd = hwEtMissColl->end() ;
658 for( ; hwEtMissItr != hwEtMissEnd ; ++hwEtMissItr, ++iMiss )
660 if( !etMissMatched[ iMiss ] )
662 int bx = hwEtMissItr->bx() ;
666 ( hwEtMissItr->overFlow() ?
668 (
double ) hwEtMissItr->et() ) * etSumLSB + 1.e-6 ;
687 etMissColl->push_back(
690 L1EtMissParticle::kMET,
716 double htSumLSB = jetFinderParams->getHtLsbGeV();
719 std::vector< bool > htMissMatched ;
727 <<
"\nWarning: L1GctEtHadCollection with " <<
etHadSource_
728 <<
"\nrequested in configuration, but not found in the event."
731 else if( !hwHtMissColl.
isValid() )
735 <<
"\nrequested in configuration, but not found in the event."
743 L1GctHtMissCollection::const_iterator hwHtMissItr =
744 hwHtMissColl->begin() ;
745 L1GctHtMissCollection::const_iterator hwHtMissEnd =
746 hwHtMissColl->end() ;
747 for( ; hwHtMissItr != hwHtMissEnd ; ++hwHtMissItr )
749 htMissMatched.push_back(
false ) ;
757 <<
"\nWarning: L1GctEtHadCollection with " <<
etHadSource_
758 <<
"\nrequested in configuration, but not found in the event."
761 else if( !hwHtMissColl.
isValid() )
765 <<
"\nrequested in configuration, but not found in the event."
770 L1GctEtHadCollection::const_iterator hwEtHadItr =
771 hwEtHadColl->begin() ;
772 L1GctEtHadCollection::const_iterator hwEtHadEnd =
776 for( ; hwEtHadItr != hwEtHadEnd ; ++hwEtHadItr, ++iHad )
778 int bx = hwEtHadItr->bx() ;
784 ( hwEtHadItr->overFlow() ?
786 (
double ) hwEtHadItr->et() ) * htSumLSB + 1.e-6 ;
795 L1GctHtMissCollection::const_iterator hwHtMissItr =
796 hwHtMissColl->begin() ;
797 L1GctHtMissCollection::const_iterator hwHtMissEnd =
798 hwHtMissColl->end() ;
801 for( ; hwHtMissItr != hwHtMissEnd ; ++hwHtMissItr, ++iMiss )
803 if( hwHtMissItr->bx() == bx )
805 htMissMatched[ iMiss ] =
true ;
811 if( hwHtMissItr != hwHtMissEnd )
815 htMissScale->et( hwHtMissItr->overFlow() ?
816 htMissScale->rankScaleMax() :
817 hwHtMissItr->et() ) + 1.e-6 ;
849 htMissColl->push_back(
852 L1EtMissParticle::kMHT,
869 L1GctHtMissCollection::const_iterator hwHtMissItr =
870 hwHtMissColl->begin() ;
871 L1GctHtMissCollection::const_iterator hwHtMissEnd =
872 hwHtMissColl->end() ;
875 for( ; hwHtMissItr != hwHtMissEnd ; ++hwHtMissItr, ++iMiss )
877 if( !htMissMatched[ iMiss ] )
879 int bx = hwHtMissItr->bx() ;
883 htMissScale->et( hwHtMissItr->overFlow() ?
884 htMissScale->rankScaleMax() :
885 hwHtMissItr->et() ) + 1.e-6 ;
904 htMissColl->push_back(
907 L1EtMissParticle::kMHT,
931 if( !hwHFEtSumsColl.
isValid() )
935 <<
"\nrequested in configuration, but not found in the event."
938 else if( !hwHFBitCountsColl.
isValid() )
942 <<
"\nrequested in configuration, but not found in the event."
947 L1GctHFRingEtSumsCollection::const_iterator hwHFEtSumsItr =
948 hwHFEtSumsColl->begin() ;
949 L1GctHFRingEtSumsCollection::const_iterator hwHFEtSumsEnd =
950 hwHFEtSumsColl->end() ;
953 for( ; hwHFEtSumsItr != hwHFEtSumsEnd ; ++hwHFEtSumsItr, ++iEtSums )
955 int bx = hwHFEtSumsItr->bx() ;
959 L1GctHFBitCountsCollection::const_iterator hwHFBitCountsItr =
960 hwHFBitCountsColl->begin() ;
961 L1GctHFBitCountsCollection::const_iterator hwHFBitCountsEnd =
962 hwHFBitCountsColl->end() ;
965 for( ; hwHFBitCountsItr != hwHFBitCountsEnd ;
966 ++hwHFBitCountsItr, ++iBitCounts )
968 if( hwHFBitCountsItr->bx() == bx )
975 if( hwHFBitCountsItr != hwHFBitCountsEnd )
982 double etSums[ L1HFRings::kNumRings ] ;
983 etSums[ L1HFRings::kRing1PosEta ] =
984 hfRingEtScale->et( hwHFEtSumsItr->etSum( 0 ) ) + 1.e-6 ;
985 etSums[ L1HFRings::kRing1NegEta ] =
986 hfRingEtScale->et( hwHFEtSumsItr->etSum( 1 ) ) + 1.e-6 ;
987 etSums[ L1HFRings::kRing2PosEta ] =
988 hfRingEtScale->et( hwHFEtSumsItr->etSum( 2 ) ) + 1.e-6 ;
989 etSums[ L1HFRings::kRing2NegEta ] =
990 hfRingEtScale->et( hwHFEtSumsItr->etSum( 3 ) ) + 1.e-6 ;
1005 int bitCounts[ L1HFRings::kNumRings ] ;
1006 bitCounts[ L1HFRings::kRing1PosEta ] =
1007 hwHFBitCountsItr->bitCount( 0 ) ;
1008 bitCounts[ L1HFRings::kRing1NegEta ] =
1009 hwHFBitCountsItr->bitCount( 1 ) ;
1010 bitCounts[ L1HFRings::kRing2PosEta ] =
1011 hwHFBitCountsItr->bitCount( 2 ) ;
1012 bitCounts[ L1HFRings::kRing2NegEta ] =
1013 hwHFBitCountsItr->bitCount( 3 ) ;
1022 hfRingsColl->push_back(
1038 iEvent.
put( isoEmColl,
"Isolated" ) ;
1041 iEvent.
put( nonIsoEmColl,
"NonIsolated" ) ;
1044 iEvent.
put( cenJetColl,
"Central" ) ;
1047 iEvent.
put( forJetColl,
"Forward" ) ;
1050 iEvent.
put( tauJetColl,
"Tau" ) ;
1053 iEvent.
put( etMissColl,
"MET" ) ;
1056 iEvent.
put( htMissColl,
"MHT" ) ;
1059 iEvent.
put( hfRingsColl ) ;
edm::InputTag muonSource_
math::PtEtaPhiMLorentzVector gctLorentzVector(const double &et, const L1GctCand &cand, const L1CaloGeometry *geom, bool central)
bool produceCaloParticles_
static 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.
bool produceMuonParticles_
double htSumPhiBinCenter(unsigned int phiIndex) const
edm::InputTag hfRingEtSumsSource_
edm::InputTag hfRingBitCountsSource_
edm::InputTag etTotSource_
edm::InputTag tauJetSource_
edm::InputTag isoEmSource_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::InputTag etHadSource_
edm::InputTag forJetSource_
double etSumPhiBinCenter(unsigned int phiIndex) const
edm::InputTag nonIsoEmSource_