65 virtual void endJob()
override;
124 std::map< ObjectType, TFileDirectory >
dirs_;
125 std::map< ObjectType, TH1F* >
het_;
126 std::map< ObjectType, TH1F* >
heta_;
127 std::map< ObjectType, TH1F* >
hphi_;
128 std::map< ObjectType, TH1F* >
hbx_;
179 doText_(iConfig.getUntrackedParameter<bool>(
"doText",
true)),
180 doHistos_(iConfig.getUntrackedParameter<bool>(
"doHistos",
true))
189 m_gmuToken = consumes<l1t::MuonBxCollection>(gmuTag);
193 m_dmxEGToken = consumes<l1t::EGammaBxCollection>(dmxEGTag);
209 m_muToken = consumes<l1t::MuonBxCollection>(muTag);
213 m_egToken = consumes<l1t::EGammaBxCollection>(egTag);
225 m_sumToken = consumes<l1t::EtSumBxCollection>(sumTag);
229 m_gtAlgToken = consumes<GlobalAlgBlkBxCollection>(gtAlgTag);
284 std::stringstream
text;
291 for (
int ibx=gmuons->getFirstBX(); ibx<=gmuons->getLastBX(); ++ibx) {
293 for (
auto itr = gmuons->begin(ibx); itr != gmuons->end(ibx); ++itr ) {
295 het_.at(
gMU)->Fill( itr->hwPt() );
296 heta_.at(
gMU)->Fill( itr->hwEtaAtVtx() );
297 hphi_.at(
gMU)->Fill( itr->hwPhiAtVtx() );
298 hetaphi_.at(
gMU)->Fill( itr->hwEtaAtVtx(), itr->hwPhiAtVtx(), itr->hwPt() );
300 text <<
"Muon : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEtaAtVtx() <<
" iphi=" << itr->hwPhiAtVtx() << std::endl;
314 for (
int ibx=dmxegs->getFirstBX(); ibx<=dmxegs->getLastBX(); ++ibx) {
316 for (
auto itr = dmxegs->begin(ibx); itr != dmxegs->end(ibx); ++itr ) {
321 hetaphi_.at(
DmxEG)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
323 text <<
"Dmx EG : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
338 for (
int ibx=dmxtaus->getFirstBX(); ibx<=dmxtaus->getLastBX(); ++ibx) {
340 for (
auto itr = dmxtaus->begin(ibx); itr != dmxtaus->end(ibx); ++itr ) {
345 hetaphi_.at(
DmxTau)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
347 text <<
"Dmx Tau : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
360 for (
int ibx=dmxjets->getFirstBX(); ibx<=dmxjets->getLastBX(); ++ibx) {
362 for (
auto itr = dmxjets->begin(ibx); itr != dmxjets->end(ibx); ++itr ) {
367 hetaphi_.at(
DmxJet)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
369 text <<
"Dmx Jet : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
382 for (
int ibx=dmxsums->getFirstBX(); ibx<=dmxsums->getLastBX(); ++ibx) {
384 for (
auto itr = dmxsums->begin(ibx); itr != dmxsums->end(ibx); ++itr ) {
389 hetaphi_.at(
DmxSum)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
391 text <<
"Dmx Sum : " <<
" type=" << itr->getType() <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
405 for (
int ibx=muons->getFirstBX(); ibx<=muons->getLastBX(); ++ibx) {
407 for (
auto itr = muons->begin(ibx); itr != muons->end(ibx); ++itr ) {
409 het_.at(
MU)->Fill( itr->hwPt() );
410 heta_.at(
MU)->Fill( itr->hwEtaAtVtx() );
411 hphi_.at(
MU)->Fill( itr->hwPhiAtVtx() );
412 hetaphi_.at(
MU)->Fill( itr->hwEtaAtVtx(), itr->hwPhiAtVtx(), itr->hwPt() );
414 text <<
"Muon : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEtaAtVtx() <<
" iphi=" << itr->hwPhiAtVtx() << std::endl;
429 for (
int ibx=egs->getFirstBX(); ibx<=egs->getLastBX(); ++ibx) {
431 for (
auto itr = egs->begin(ibx); itr != egs->end(ibx); ++itr ) {
433 het_.at(
EG)->Fill( itr->hwPt() );
434 heta_.at(
EG)->Fill( itr->hwEta() );
435 hphi_.at(
EG)->Fill( itr->hwPhi() );
436 hetaphi_.at(
EG)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
438 text <<
"EG : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
451 for (
int ibx=taus->getFirstBX(); ibx<=taus->getLastBX(); ++ibx) {
453 for (
auto itr = taus->begin(ibx); itr != taus->end(ibx); ++itr ) {
455 het_.at(
Tau)->Fill( itr->hwPt() );
456 heta_.at(
Tau)->Fill( itr->hwEta() );
457 hphi_.at(
Tau)->Fill( itr->hwPhi() );
458 hetaphi_.at(
Tau)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
460 text <<
"Tau : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
473 for (
int ibx=jets->getFirstBX(); ibx<=jets->getLastBX(); ++ibx) {
475 for (
auto itr = jets->begin(ibx); itr != jets->end(ibx); ++itr ) {
477 het_.at(
Jet)->Fill( itr->hwPt() );
478 heta_.at(
Jet)->Fill( itr->hwEta() );
479 hphi_.at(
Jet)->Fill( itr->hwPhi() );
480 hetaphi_.at(
Jet)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
482 text <<
"Jet : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
495 for (
int ibx=sums->getFirstBX(); ibx<=sums->getLastBX(); ++ibx) {
497 for (
auto itr = sums->begin(ibx); itr != sums->end(ibx); ++itr ) {
500 het_.at(
Sum)->Fill( itr->hwPt() );
501 heta_.at(
Sum)->Fill( itr->hwEta() );
502 hphi_.at(
Sum)->Fill( itr->hwPhi() );
503 hetaphi_.at(
Sum)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
504 text <<
"Sum : " <<
" type=" << itr->getType() <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
516 for (
int ibx=algs->getFirstBX(); ibx<=algs->getLastBX(); ++ibx) {
518 for (
auto itr = algs->begin(ibx); itr != algs->end(ibx); ++itr ) {
520 for(
int algBit=0; algBit<128; algBit++) {
521 if(itr->getAlgoDecisionFinal(algBit)) {
523 text <<
"HW Fired Alg Bit : " << algBit << std::endl;
537 for (
int ibx=emulGtAlgs->getFirstBX(); ibx<=emulGtAlgs->getLastBX(); ++ibx) {
539 for (
auto itr = emulGtAlgs->begin(ibx); itr != emulGtAlgs->end(ibx); ++itr ) {
541 for(
int algBit=0; algBit<128; algBit++) {
542 if(itr->getAlgoDecisionFinal(algBit)) {
544 text <<
"Emul w/ GTInput Fired Alg Bit : " << algBit << std::endl;
558 for (
int ibx=emulDxAlgs->getFirstBX(); ibx<=emulDxAlgs->getLastBX(); ++ibx) {
560 for (
auto itr = emulDxAlgs->begin(ibx); itr != emulDxAlgs->end(ibx); ++itr ) {
562 for(
int algBit=0; algBit<128; algBit++) {
563 if(itr->getAlgoDecisionFinal(algBit)) {
565 text <<
"Emul w/ Demux output Fired Alg Bit : " << algBit << std::endl;
583 for (
int ibx=mus->getFirstBX(); ibx<=mus->getLastBX(); ++ibx) {
586 for (
unsigned int igtMU=0; igtMU<mus->size(ibx); igtMU++) {
588 double gtMUEt = mus->at(ibx,igtMU).hwPt();
589 double gmtMUEt = 0.0;
590 if(gmtmus->size(ibx)>igtMU) gmtMUEt = gmtmus->at(ibx,igtMU).hwPt();
593 double gtMUEta = mus->at(ibx,igtMU).hwEtaAtVtx();
594 double gmtMUEta = 0.0;
595 if(gmtmus->size(ibx)>igtMU) gmtMUEta = gmtmus->at(ibx,igtMU).hwEtaAtVtx();
598 double gtMUPhi = mus->at(ibx,igtMU).hwPhiAtVtx();
599 double gmtMUPhi = 0.0;
600 if(gmtmus->size(ibx)>igtMU) gmtMUPhi = gmtmus->at(ibx,igtMU).hwPhiAtVtx();
607 for (
unsigned int igmtMU=mus->size(ibx); igmtMU<gmtmus->size(ibx); igmtMU++) {
611 double gmtMUEt = gmtmus->at(ibx,igmtMU).hwPt();
614 double gtMUEta = 0.0;
615 double gmtMUEta = gmtmus->at(ibx,igmtMU).hwEtaAtVtx();
618 double gtMUPhi = 0.0;
619 double gmtMUPhi = gmtmus->at(ibx,igmtMU).hwPhiAtVtx();
637 for (
int ibx=egs->getFirstBX(); ibx<=egs->getLastBX(); ++ibx) {
640 for (
unsigned int igtEG=0; igtEG<egs->size(ibx); igtEG++) {
642 double gtEGEt = egs->at(ibx,igtEG).hwPt();
643 double dmxEGEt = 0.0;
644 if(dmxegs->size(ibx)>igtEG) dmxEGEt = dmxegs->at(ibx,igtEG).hwPt();
647 double gtEGEta = egs->at(ibx,igtEG).hwEta();
648 double dmxEGEta = 0.0;
649 if(dmxegs->size(ibx)>igtEG) dmxEGEta = dmxegs->at(ibx,igtEG).hwEta();
652 double gtEGPhi = egs->at(ibx,igtEG).hwPhi();
653 double dmxEGPhi = 0.0;
654 if(dmxegs->size(ibx)>igtEG) dmxEGPhi = dmxegs->at(ibx,igtEG).hwPhi();
661 for (
unsigned int idmEG=egs->size(ibx); idmEG<dmxegs->size(ibx); idmEG++) {
665 double dmxEGEt = dmxegs->at(ibx,idmEG).hwPt();
668 double gtEGEta = 0.0;
669 double dmxEGEta = dmxegs->at(ibx,idmEG).hwEta();
672 double gtEGPhi = 0.0;
673 double dmxEGPhi = dmxegs->at(ibx,idmEG).hwPhi();
691 for (
int ibx=taus->getFirstBX(); ibx<=taus->getLastBX(); ++ibx) {
694 for (
unsigned int igtTau=0; igtTau<taus->size(ibx); igtTau++) {
696 double gtTauEt = taus->at(ibx,igtTau).hwPt();
697 double dmxTauEt = 0.0;
698 if(dmxtaus->size(ibx)>igtTau) dmxTauEt = dmxtaus->at(ibx,igtTau).hwPt();
701 double gtTauEta = taus->at(ibx,igtTau).hwEta();
702 double dmxTauEta = 0.0;
703 if(dmxtaus->size(ibx)>igtTau) dmxTauEta = dmxtaus->at(ibx,igtTau).hwEta();
706 double gtTauPhi = taus->at(ibx,igtTau).hwPhi();
707 double dmxTauPhi = 0.0;
708 if(dmxtaus->size(ibx)>igtTau) dmxTauPhi = dmxtaus->at(ibx,igtTau).hwPhi();
715 for (
unsigned int idmTau=taus->size(ibx); idmTau<dmxtaus->size(ibx); idmTau++) {
718 double gtTauEt = 0.0;
719 double dmxTauEt = dmxtaus->at(ibx,idmTau).hwPt();
722 double gtTauEta = 0.0;
723 double dmxTauEta = dmxtaus->at(ibx,idmTau).hwEta();
726 double gtTauPhi = 0.0;
727 double dmxTauPhi = dmxtaus->at(ibx,idmTau).hwPhi();
746 for (
int ibx=jets->getFirstBX(); ibx<=jets->getLastBX(); ++ibx) {
749 for (
unsigned int igtJ=0; igtJ<jets->size(ibx); igtJ++) {
751 double gtJetEt = jets->at(ibx,igtJ).hwPt();
752 double dmxJetEt = 0.0;
753 if(dmxjets->size(ibx)>igtJ) dmxJetEt = dmxjets->at(ibx,igtJ).hwPt();
756 double gtJetEta = jets->at(ibx,igtJ).hwEta();
757 double dmxJetEta = 0.0;
758 if(dmxjets->size(ibx)>igtJ) dmxJetEta = dmxjets->at(ibx,igtJ).hwEta();
761 double gtJetPhi = jets->at(ibx,igtJ).hwPhi();
762 double dmxJetPhi = 0.0;
763 if(dmxjets->size(ibx)>igtJ) dmxJetPhi = dmxjets->at(ibx,igtJ).hwPhi();
770 for (
unsigned int idmJ=jets->size(ibx); idmJ<dmxjets->size(ibx); idmJ++) {
773 double gtJetEt = 0.0;
774 double dmxJetEt = dmxjets->at(ibx,idmJ).hwPt();
777 double gtJetEta = 0.0;
778 double dmxJetEta = dmxjets->at(ibx,idmJ).hwEta();
781 double gtJetPhi = 0.0;
782 double dmxJetPhi = dmxjets->at(ibx,idmJ).hwPhi();
799 for (
int ibx=sums->getFirstBX(); ibx<=sums->getLastBX(); ++ibx) {
802 for (
unsigned int igtS=0; igtS<sums->size(ibx); igtS++) {
804 double gtSumEt = sums->at(ibx,igtS).hwPt();
805 double dmxSumEt = 0.0;
806 if(dmxSums->size(ibx)>igtS) dmxSumEt = dmxSums->at(ibx,igtS).hwPt();
808 double gtSumPhi = sums->at(ibx,igtS).hwPhi();
809 double dmxSumPhi = 0.0;
810 if(dmxSums->size(ibx)>igtS) dmxSumPhi = dmxSums->at(ibx,igtS).hwPhi();
812 if(sums->at(ibx,igtS).getType() == dmxSums->at(ibx,igtS).getType()) {
813 switch(sums->at(ibx,igtS).getType()) {
818 case l1t::EtSum::EtSumType::kTotalEtEm:
830 case l1t::EtSum::EtSumType::kMissingEtHF:
838 case l1t::EtSum::EtSumType::kMinBiasHFP0:
841 case l1t::EtSum::EtSumType::kMinBiasHFM0:
844 case l1t::EtSum::EtSumType::kMinBiasHFP1:
847 case l1t::EtSum::EtSumType::kMinBiasHFM1:
854 text <<
"WARNING: EtSum Types do not line up between DeMux and uGT " << std::endl;
858 for (
unsigned int idmS=sums->size(ibx); idmS<dmxSums->size(ibx); idmS++) {
861 double gtSumEt = -1.0;
862 double dmxSumEt = dmxSums->at(ibx,idmS).hwPt();
864 double gtSumPhi = -1.0;
865 double dmxSumPhi = dmxSums->at(ibx,idmS).hwPhi();
867 switch(dmxSums->at(ibx,idmS).getType()) {
872 case l1t::EtSum::EtSumType::kTotalEtEm:
884 case l1t::EtSum::EtSumType::kMissingEtHF:
915 auto itr = hwalgs->begin(ibx);
916 auto itr_emul = emulAlgs->begin(ibx);
918 for(
int algBit=0; algBit<128; algBit++) {
919 bool hw = itr->getAlgoDecisionFinal(algBit);
920 bool em = itr_emul->getAlgoDecisionFinal(algBit);
925 text <<
"WARNING: HW Fnd Alg Bit " << algBit <<
" but emulation did not " << std::endl;
928 text <<
"WARNING: Emul. Fnd Alg Bit " << algBit <<
" but hardware did not " << std::endl;
948 auto itr = hwalgs->begin(ibx);
949 auto itr_emul = emulAlgs->begin(ibx);
951 for(
int algBit=0; algBit<128; algBit++) {
952 bool hw = itr->getAlgoDecisionFinal(algBit);
953 bool em = itr_emul->getAlgoDecisionFinal(algBit);
983 auto itr =
types_.cbegin();
986 for (; itr!=
types_.end(); ++itr, ++
str ) {
992 dirs_.insert( std::pair< ObjectType, TFileDirectory >(*itr, fs->
mkdir(*
str) ) );
994 het_.insert( std::pair< ObjectType, TH1F* >(*itr,
dirs_.at(*itr).make<TH1F>(
"et",
"", 500, -0.5, etmax) ));
996 hbx_.insert( std::pair< ObjectType, TH1F* >(*itr,
dirs_.at(*itr).make<TH1F>(
"bx",
"", 11, -5.5, 5.5) ));
999 heta_.insert( std::pair< ObjectType, TH1F* >(*itr,
dirs_.at(*itr).make<TH1F>(
"eta",
"", 229, -114.5, 114.5) ));
1000 hphi_.insert( std::pair< ObjectType, TH1F* >(*itr,
dirs_.at(*itr).make<TH1F>(
"phi",
"", 144, -0.5, 143.5) ));
1001 hetaphi_.insert( std::pair< ObjectType, TH2F* >(*itr,
dirs_.at(*itr).make<TH2F>(
"etaphi",
"", 229, -114.5, 114.5, 144, -0.5, 143.5) ));
1002 }
else if( *itr==
MU || *itr==
gMU) {
1003 double etmax = 511.5;
1004 dirs_.insert( std::pair< ObjectType, TFileDirectory >(*itr, fs->
mkdir(*
str) ) );
1006 het_.insert( std::pair< ObjectType, TH1F* >(*itr,
dirs_.at(*itr).make<TH1F>(
"et",
"", 512, -0.5, etmax) ));
1008 hbx_.insert( std::pair< ObjectType, TH1F* >(*itr,
dirs_.at(*itr).make<TH1F>(
"bx",
"", 11, -5.5, 5.5) ));
1011 heta_.insert( std::pair< ObjectType, TH1F* >(*itr,
dirs_.at(*itr).make<TH1F>(
"eta",
"", 549, -224.5, 224.5) ));
1012 hphi_.insert( std::pair< ObjectType, TH1F* >(*itr,
dirs_.at(*itr).make<TH1F>(
"phi",
"", 576, -0.5, 575.5) ));
1013 hetaphi_.insert( std::pair< ObjectType, TH2F* >(*itr,
dirs_.at(*itr).make<TH2F>(
"etaphi",
"", 549, -224.5, 224.5, 576, -0.5, 575.5) ));
1115 using namespace l1t;
TFileDirectory dmxVGtDir_
TH2F * hAlgoBitsEmulGtVsHw_
T getParameter(std::string const &) const
TH2F * hDmxVsGTSumEt_ETMHF_
edm::EDGetToken m_emulDxAlgToken
TFileDirectory evtDispDir_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetToken m_dmxEGToken
TH2F * hDmxVsGTSumEt_HTM_
#define DEFINE_FWK_MODULE(type)
edm::EDGetToken m_egToken
TH2F * hDmxVsGTSumPhi_ETM_
std::map< ObjectType, TH2F * > hetaphi_
edm::EDGetToken m_emulGtAlgToken
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EDGetToken m_muToken
TH2F * hDmxVsGTSumEt_HFP1_
TH2F * hDmxVsGTSumEt_ETT_
void addDefault(ParameterSetDescription const &psetDescription)
std::map< ObjectType, TH1F * > hbx_
std::map< ObjectType, TH1F * > het_
edm::EDGetToken m_gmuToken
TH2F * hDmxVsGTSumPhi_ETMHF_
edm::EDGetToken m_dmxTauToken
T * make(const Args &...args) const
make new ROOT object
edm::EDGetToken m_gtAlgToken
TH2F * hDmxVsGTSumEt_ETM_
L1TGlobalAnalyzer(const edm::ParameterSet &)
edm::EDGetToken m_sumToken
std::vector< std::string > typeStr_
TH2F * hDmxVsGTSumEt_HTT_
TH2F * hAlgoBitsEmulDxVsHw_
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
TH2F * hDmxVsGTSumEt_HFM0_
TH2F * hDmxVsGTSumEt_HFM1_
virtual void beginJob() override
edm::EDGetToken m_dmxSumToken
edm::EDGetToken m_tauToken
std::map< ObjectType, TH1F * > heta_
std::map< ObjectType, TH1F * > hphi_
TH2F * hDmxVsGTSumEt_ETTem_
std::map< ObjectType, TFileDirectory > dirs_
TH2F * hDmxVsGTSumPhi_HTM_
edm::EDGetToken m_jetToken
edm::EDGetToken m_dmxJetToken
std::vector< ObjectType > types_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual void endJob() override
TH2F * hDmxVsGTSumEt_HFP0_