65 virtual void endJob()
override;
122 std::map< ObjectType, TFileDirectory >
dirs_;
123 std::map< ObjectType, TH1F* >
het_;
124 std::map< ObjectType, TH1F* >
heta_;
125 std::map< ObjectType, TH1F* >
hphi_;
126 std::map< ObjectType, TH1F* >
hbx_;
167 doText_(iConfig.getUntrackedParameter<bool>(
"doText",
true)),
168 doHistos_(iConfig.getUntrackedParameter<bool>(
"doHistos",
true))
176 m_dmxEGToken = consumes<l1t::EGammaBxCollection>(dmxEGTag);
192 m_muToken = consumes<l1t::MuonBxCollection>(muTag);
196 m_egToken = consumes<l1t::EGammaBxCollection>(egTag);
200 m_tauToken = consumes<l1t::TauBxCollection>(tauTag);
204 m_jetToken = consumes<l1t::JetBxCollection>(jetTag);
208 m_sumToken = consumes<l1t::EtSumBxCollection>(sumTag);
212 m_gtAlgToken = consumes<GlobalAlgBlkBxCollection>(gtAlgTag);
265 std::stringstream
text;
273 for (
int ibx=dmxegs->getFirstBX(); ibx<=dmxegs->getLastBX(); ++ibx) {
275 for (
auto itr = dmxegs->begin(ibx); itr != dmxegs->end(ibx); ++itr ) {
280 hetaphi_.at(
DmxEG)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
282 text <<
"Dmx EG : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
297 for (
int ibx=dmxtaus->getFirstBX(); ibx<=dmxtaus->getLastBX(); ++ibx) {
299 for (
auto itr = dmxtaus->begin(ibx); itr != dmxtaus->end(ibx); ++itr ) {
304 hetaphi_.at(
DmxTau)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
306 text <<
"Dmx Tau : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
319 for (
int ibx=dmxjets->getFirstBX(); ibx<=dmxjets->getLastBX(); ++ibx) {
321 for (
auto itr = dmxjets->begin(ibx); itr != dmxjets->end(ibx); ++itr ) {
326 hetaphi_.at(
DmxJet)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
328 text <<
"Dmx Jet : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
341 for (
int ibx=dmxsums->getFirstBX(); ibx<=dmxsums->getLastBX(); ++ibx) {
343 for (
auto itr = dmxsums->begin(ibx); itr != dmxsums->end(ibx); ++itr ) {
348 hetaphi_.at(
DmxSum)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
350 text <<
"Dmx Sum : " <<
" type=" << itr->getType() <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
364 for (
int ibx=muons->getFirstBX(); ibx<=muons->getLastBX(); ++ibx) {
366 for (
auto itr = muons->begin(ibx); itr != muons->end(ibx); ++itr ) {
368 het_.at(
MU)->Fill( itr->hwPt() );
369 heta_.at(
MU)->Fill( itr->hwEta() );
370 hphi_.at(
MU)->Fill( itr->hwPhi() );
371 hetaphi_.at(
MU)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
373 text <<
"Muon : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
388 for (
int ibx=egs->getFirstBX(); ibx<=egs->getLastBX(); ++ibx) {
390 for (
auto itr = egs->begin(ibx); itr != egs->end(ibx); ++itr ) {
392 het_.at(
EG)->Fill( itr->hwPt() );
393 heta_.at(
EG)->Fill( itr->hwEta() );
394 hphi_.at(
EG)->Fill( itr->hwPhi() );
395 hetaphi_.at(
EG)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
397 text <<
"EG : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
410 for (
int ibx=taus->getFirstBX(); ibx<=taus->getLastBX(); ++ibx) {
412 for (
auto itr = taus->begin(ibx); itr != taus->end(ibx); ++itr ) {
414 het_.at(
Tau)->Fill( itr->hwPt() );
415 heta_.at(
Tau)->Fill( itr->hwEta() );
416 hphi_.at(
Tau)->Fill( itr->hwPhi() );
417 hetaphi_.at(
Tau)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
419 text <<
"Tau : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
432 for (
int ibx=jets->getFirstBX(); ibx<=jets->getLastBX(); ++ibx) {
434 for (
auto itr = jets->begin(ibx); itr != jets->end(ibx); ++itr ) {
436 het_.at(
Jet)->Fill( itr->hwPt() );
437 heta_.at(
Jet)->Fill( itr->hwEta() );
438 hphi_.at(
Jet)->Fill( itr->hwPhi() );
439 hetaphi_.at(
Jet)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
441 text <<
"Jet : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
454 for (
int ibx=sums->getFirstBX(); ibx<=sums->getLastBX(); ++ibx) {
456 for (
auto itr = sums->begin(ibx); itr != sums->end(ibx); ++itr ) {
459 het_.at(
Sum)->Fill( itr->hwPt() );
460 heta_.at(
Sum)->Fill( itr->hwEta() );
461 hphi_.at(
Sum)->Fill( itr->hwPhi() );
462 hetaphi_.at(
Sum)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
463 text <<
"Sum : " <<
" type=" << itr->getType() <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
475 for (
int ibx=algs->getFirstBX(); ibx<=algs->getLastBX(); ++ibx) {
477 for (
auto itr = algs->begin(ibx); itr != algs->end(ibx); ++itr ) {
479 for(
int algBit=0; algBit<128; algBit++) {
480 if(itr->getAlgoDecisionFinal(algBit)) {
482 text <<
"HW Fired Alg Bit : " << algBit << std::endl;
496 for (
int ibx=emulGtAlgs->getFirstBX(); ibx<=emulGtAlgs->getLastBX(); ++ibx) {
498 for (
auto itr = emulGtAlgs->begin(ibx); itr != emulGtAlgs->end(ibx); ++itr ) {
500 for(
int algBit=0; algBit<128; algBit++) {
501 if(itr->getAlgoDecisionFinal(algBit)) {
503 text <<
"Emul w/ GTInput Fired Alg Bit : " << algBit << std::endl;
517 for (
int ibx=emulDxAlgs->getFirstBX(); ibx<=emulDxAlgs->getLastBX(); ++ibx) {
519 for (
auto itr = emulDxAlgs->begin(ibx); itr != emulDxAlgs->end(ibx); ++itr ) {
521 for(
int algBit=0; algBit<128; algBit++) {
522 if(itr->getAlgoDecisionFinal(algBit)) {
524 text <<
"Emul w/ Demux output Fired Alg Bit : " << algBit << std::endl;
542 for (
int ibx=egs->getFirstBX(); ibx<=egs->getLastBX(); ++ibx) {
545 for (
unsigned int igtEG=0; igtEG<egs->size(ibx); igtEG++) {
547 double gtEGEt = egs->at(ibx,igtEG).hwPt();
548 double dmxEGEt = 0.0;
549 if(dmxegs->size(ibx)>igtEG) dmxEGEt = dmxegs->at(ibx,igtEG).hwPt();
552 double gtEGEta = egs->at(ibx,igtEG).hwEta();
553 double dmxEGEta = 0.0;
554 if(dmxegs->size(ibx)>igtEG) dmxEGEta = dmxegs->at(ibx,igtEG).hwEta();
557 double gtEGPhi = egs->at(ibx,igtEG).hwPhi();
558 double dmxEGPhi = 0.0;
559 if(dmxegs->size(ibx)>igtEG) dmxEGPhi = dmxegs->at(ibx,igtEG).hwPhi();
566 for (
unsigned int idmEG=egs->size(ibx); idmEG<dmxegs->size(ibx); idmEG++) {
570 double dmxEGEt = dmxegs->at(ibx,idmEG).hwPt();
573 double gtEGEta = 0.0;
574 double dmxEGEta = dmxegs->at(ibx,idmEG).hwEta();
577 double gtEGPhi = 0.0;
578 double dmxEGPhi = dmxegs->at(ibx,idmEG).hwPhi();
596 for (
int ibx=taus->getFirstBX(); ibx<=taus->getLastBX(); ++ibx) {
599 for (
unsigned int igtTau=0; igtTau<taus->size(ibx); igtTau++) {
601 double gtTauEt = taus->at(ibx,igtTau).hwPt();
602 double dmxTauEt = 0.0;
603 if(dmxtaus->size(ibx)>igtTau) dmxTauEt = dmxtaus->at(ibx,igtTau).hwPt();
606 double gtTauEta = taus->at(ibx,igtTau).hwEta();
607 double dmxTauEta = 0.0;
608 if(dmxtaus->size(ibx)>igtTau) dmxTauEta = dmxtaus->at(ibx,igtTau).hwEta();
611 double gtTauPhi = taus->at(ibx,igtTau).hwPhi();
612 double dmxTauPhi = 0.0;
613 if(dmxtaus->size(ibx)>igtTau) dmxTauPhi = dmxtaus->at(ibx,igtTau).hwPhi();
620 for (
unsigned int idmTau=taus->size(ibx); idmTau<dmxtaus->size(ibx); idmTau++) {
623 double gtTauEt = 0.0;
624 double dmxTauEt = dmxtaus->at(ibx,idmTau).hwPt();
627 double gtTauEta = 0.0;
628 double dmxTauEta = dmxtaus->at(ibx,idmTau).hwEta();
631 double gtTauPhi = 0.0;
632 double dmxTauPhi = dmxtaus->at(ibx,idmTau).hwPhi();
651 for (
int ibx=jets->getFirstBX(); ibx<=jets->getLastBX(); ++ibx) {
654 for (
unsigned int igtJ=0; igtJ<jets->size(ibx); igtJ++) {
656 double gtJetEt = jets->at(ibx,igtJ).hwPt();
657 double dmxJetEt = 0.0;
658 if(dmxjets->size(ibx)>igtJ) dmxJetEt = dmxjets->at(ibx,igtJ).hwPt();
661 double gtJetEta = jets->at(ibx,igtJ).hwEta();
662 double dmxJetEta = 0.0;
663 if(dmxjets->size(ibx)>igtJ) dmxJetEta = dmxjets->at(ibx,igtJ).hwEta();
666 double gtJetPhi = jets->at(ibx,igtJ).hwPhi();
667 double dmxJetPhi = 0.0;
668 if(dmxjets->size(ibx)>igtJ) dmxJetPhi = dmxjets->at(ibx,igtJ).hwPhi();
675 for (
unsigned int idmJ=jets->size(ibx); idmJ<dmxjets->size(ibx); idmJ++) {
678 double gtJetEt = 0.0;
679 double dmxJetEt = dmxjets->at(ibx,idmJ).hwPt();
682 double gtJetEta = 0.0;
683 double dmxJetEta = dmxjets->at(ibx,idmJ).hwEta();
686 double gtJetPhi = 0.0;
687 double dmxJetPhi = dmxjets->at(ibx,idmJ).hwPhi();
704 for (
int ibx=sums->getFirstBX(); ibx<=sums->getLastBX(); ++ibx) {
707 for (
unsigned int igtS=0; igtS<sums->size(ibx); igtS++) {
709 double gtSumEt = sums->at(ibx,igtS).hwPt();
710 double dmxSumEt = 0.0;
711 if(dmxSums->size(ibx)>igtS) dmxSumEt = dmxSums->at(ibx,igtS).hwPt();
713 double gtSumPhi = sums->at(ibx,igtS).hwPhi();
714 double dmxSumPhi = 0.0;
715 if(dmxSums->size(ibx)>igtS) dmxSumPhi = dmxSums->at(ibx,igtS).hwPhi();
717 if(sums->at(ibx,igtS).getType() == dmxSums->at(ibx,igtS).getType()) {
718 switch(sums->at(ibx,igtS).getType()) {
739 text <<
"WARNING: EtSum Types do not line up between DeMux and uGT " << std::endl;
743 for (
unsigned int idmS=sums->size(ibx); idmS<dmxSums->size(ibx); idmS++) {
746 double gtSumEt = 0.0;
747 double dmxSumEt = dmxSums->at(ibx,idmS).hwPt();
749 double gtSumPhi = 0.0;
750 double dmxSumPhi = dmxSums->at(ibx,idmS).hwPhi();
752 switch(dmxSums->at(ibx,idmS).getType()) {
792 auto itr = hwalgs->begin(ibx);
793 auto itr_emul = emulAlgs->begin(ibx);
795 for(
int algBit=0; algBit<128; algBit++) {
796 bool hw = itr->getAlgoDecisionFinal(algBit);
797 bool em = itr_emul->getAlgoDecisionFinal(algBit);
802 text <<
"WARNING: HW Fnd Alg Bit " << algBit <<
" but emulation did not " << std::endl;
805 text <<
"WARNING: Emul. Fnd Alg Bit " << algBit <<
" but hardware did not " << std::endl;
825 auto itr = hwalgs->begin(ibx);
826 auto itr_emul = emulAlgs->begin(ibx);
828 for(
int algBit=0; algBit<128; algBit++) {
829 bool hw = itr->getAlgoDecisionFinal(algBit);
830 bool em = itr_emul->getAlgoDecisionFinal(algBit);
860 auto itr =
types_.cbegin();
863 for (; itr!=
types_.end(); ++itr, ++str ) {
869 dirs_.insert( std::pair< ObjectType, TFileDirectory >(*itr, fs->
mkdir(*str) ) );
871 het_.insert( std::pair< ObjectType, TH1F* >(*itr,
dirs_.at(*itr).make<TH1F>(
"et",
"", 500, -0.5, etmax) ));
873 hbx_.insert( std::pair< ObjectType, TH1F* >(*itr,
dirs_.at(*itr).make<TH1F>(
"bx",
"", 11, -5.5, 5.5) ));
876 heta_.insert( std::pair< ObjectType, TH1F* >(*itr,
dirs_.at(*itr).make<TH1F>(
"eta",
"", 229, -114.5, 114.5) ));
877 hphi_.insert( std::pair< ObjectType, TH1F* >(*itr,
dirs_.at(*itr).make<TH1F>(
"phi",
"", 144, -0.5, 143.5) ));
878 hetaphi_.insert( std::pair< ObjectType, TH2F* >(*itr,
dirs_.at(*itr).make<TH2F>(
"etaphi",
"", 229, -114.5, 114.5, 144, -0.5, 143.5) ));
879 }
else if( *itr==
MU) {
880 double etmax = 511.5;
881 dirs_.insert( std::pair< ObjectType, TFileDirectory >(*itr, fs->
mkdir(*str) ) );
883 het_.insert( std::pair< ObjectType, TH1F* >(*itr,
dirs_.at(*itr).make<TH1F>(
"et",
"", 512, -0.5, etmax) ));
885 hbx_.insert( std::pair< ObjectType, TH1F* >(*itr,
dirs_.at(*itr).make<TH1F>(
"bx",
"", 11, -5.5, 5.5) ));
888 heta_.insert( std::pair< ObjectType, TH1F* >(*itr,
dirs_.at(*itr).make<TH1F>(
"eta",
"", 549, -224.5, 224.5) ));
889 hphi_.insert( std::pair< ObjectType, TH1F* >(*itr,
dirs_.at(*itr).make<TH1F>(
"phi",
"", 576, -0.5, 575.5) ));
890 hetaphi_.insert( std::pair< ObjectType, TH2F* >(*itr,
dirs_.at(*itr).make<TH2F>(
"etaphi",
"", 549, -224.5, 224.5, 576, -0.5, 575.5) ));
TFileDirectory dmxVGtDir_
TH2F * hAlgoBitsEmulGtVsHw_
T getParameter(std::string const &) const
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_ETT_
void addDefault(ParameterSetDescription const &psetDescription)
std::map< ObjectType, TH1F * > hbx_
std::map< ObjectType, TH1F * > het_
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
virtual void beginJob() override
edm::EDGetToken m_dmxSumToken
edm::EDGetToken m_tauToken
std::map< ObjectType, TH1F * > heta_
std::map< ObjectType, TH1F * > hphi_
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