64 virtual void endJob()
override;
118 std::map< ObjectType, TFileDirectory >
dirs_;
119 std::map< ObjectType, TH1F* >
het_;
120 std::map< ObjectType, TH1F* >
heta_;
121 std::map< ObjectType, TH1F* >
hphi_;
122 std::map< ObjectType, TH1F* >
hbx_;
151 doText_(iConfig.getUntrackedParameter<bool>(
"doText",
true)),
152 doHistos_(iConfig.getUntrackedParameter<bool>(
"doHistos",
true))
160 m_dmxEGToken = consumes<l1t::EGammaBxCollection>(dmxEGTag);
176 m_egToken = consumes<l1t::EGammaBxCollection>(egTag);
180 m_tauToken = consumes<l1t::TauBxCollection>(tauTag);
184 m_jetToken = consumes<l1t::JetBxCollection>(jetTag);
188 m_sumToken = consumes<l1t::EtSumBxCollection>(sumTag);
192 m_gtAlgToken = consumes<GlobalAlgBlkBxCollection>(gtAlgTag);
243 std::stringstream
text;
245 TH2F* hEvtEG =
new TH2F();
246 TH2F* hEvtTau =
new TH2F();
247 TH2F* hEvtJet =
new TH2F();
248 TH2F* hEvtDmxEG =
new TH2F();
249 TH2F* hEvtDmxTau =
new TH2F();
250 TH2F* hEvtDmxJet =
new TH2F();
253 std::stringstream
ss;
254 ss << iEvent.
run() <<
"-" << iEvent.
id().
event();
256 hEvtEG = dir.
make<TH2F>(
"EG",
"", 83, -41.5, 41.5, 72, .5, 72.5);
257 hEvtTau = dir.
make<TH2F>(
"Tau",
"", 83, -41.5, 41.5, 72, .5, 72.5);
258 hEvtJet = dir.
make<TH2F>(
"Jet",
"", 83, -41.5, 41.5, 72, .5, 72.5);
259 hEvtDmxEG = dir.
make<TH2F>(
"DmxEG",
"", 227, -113.5, 113.5, 144, -0.5, 143.5);
260 hEvtDmxTau = dir.
make<TH2F>(
"DmxTau",
"", 227, -113.5, 113.5, 144, -0.5, 143.5);
261 hEvtDmxJet = dir.
make<TH2F>(
"DmxJet",
"", 227, -113.5, 113.5, 144, -0.5, 143.5);
269 for (
int ibx=dmxegs->getFirstBX(); ibx<=dmxegs->getLastBX(); ++ibx) {
271 for (
auto itr = dmxegs->begin(ibx); itr != dmxegs->end(ibx); ++itr ) {
276 hetaphi_.at(
DmxEG)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
278 text <<
"Dmx EG : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
280 if (
doEvtDisp_) hEvtDmxEG->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
293 for (
int ibx=dmxtaus->getFirstBX(); ibx<=dmxtaus->getLastBX(); ++ibx) {
295 for (
auto itr = dmxtaus->begin(ibx); itr != dmxtaus->end(ibx); ++itr ) {
300 hetaphi_.at(
DmxTau)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
302 text <<
"Dmx Tau : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
304 if (
doEvtDisp_) hEvtDmxTau->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
316 for (
int ibx=dmxjets->getFirstBX(); ibx<=dmxjets->getLastBX(); ++ibx) {
318 for (
auto itr = dmxjets->begin(ibx); itr != dmxjets->end(ibx); ++itr ) {
323 hetaphi_.at(
DmxJet)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
325 text <<
"Dmx Jet : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
327 if (
doEvtDisp_) hEvtDmxJet->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
339 for (
int ibx=dmxsums->getFirstBX(); ibx<=dmxsums->getLastBX(); ++ibx) {
341 for (
auto itr = dmxsums->begin(ibx); itr != dmxsums->end(ibx); ++itr ) {
346 hetaphi_.at(
DmxSum)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
348 text <<
"Dmx Sum : " <<
" type=" << itr->getType() <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
361 for (
int ibx=egs->getFirstBX(); ibx<=egs->getLastBX(); ++ibx) {
363 for (
auto itr = egs->begin(ibx); itr != egs->end(ibx); ++itr ) {
365 het_.at(
EG)->Fill( itr->hwPt() );
366 heta_.at(
EG)->Fill( itr->hwEta() );
367 hphi_.at(
EG)->Fill( itr->hwPhi() );
368 hetaphi_.at(
EG)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
370 text <<
"EG : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
372 if (
doEvtDisp_) hEvtEG->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
384 for (
int ibx=taus->getFirstBX(); ibx<=taus->getLastBX(); ++ibx) {
386 for (
auto itr = taus->begin(ibx); itr != taus->end(ibx); ++itr ) {
388 het_.at(
Tau)->Fill( itr->hwPt() );
389 heta_.at(
Tau)->Fill( itr->hwEta() );
390 hphi_.at(
Tau)->Fill( itr->hwPhi() );
391 hetaphi_.at(
Tau)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
393 text <<
"Tau : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
395 if (
doEvtDisp_) hEvtTau->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
407 for (
int ibx=jets->getFirstBX(); ibx<=jets->getLastBX(); ++ibx) {
409 for (
auto itr = jets->begin(ibx); itr != jets->end(ibx); ++itr ) {
411 het_.at(
Jet)->Fill( itr->hwPt() );
412 heta_.at(
Jet)->Fill( itr->hwEta() );
413 hphi_.at(
Jet)->Fill( itr->hwPhi() );
414 hetaphi_.at(
Jet)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
416 text <<
"Jet : " <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
418 if (
doEvtDisp_) hEvtJet->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
430 for (
int ibx=sums->getFirstBX(); ibx<=sums->getLastBX(); ++ibx) {
432 for (
auto itr = sums->begin(ibx); itr != sums->end(ibx); ++itr ) {
434 het_.at(
Sum)->Fill( itr->hwPt() );
435 heta_.at(
Sum)->Fill( itr->hwEta() );
436 hphi_.at(
Sum)->Fill( itr->hwPhi() );
437 hetaphi_.at(
Sum)->Fill( itr->hwEta(), itr->hwPhi(), itr->hwPt() );
438 text <<
"Sum : " <<
" type=" << itr->getType() <<
" BX=" << ibx <<
" ipt=" << itr->hwPt() <<
" ieta=" << itr->hwEta() <<
" iphi=" << itr->hwPhi() << std::endl;
450 for (
int ibx=algs->getFirstBX(); ibx<=algs->getLastBX(); ++ibx) {
452 for (
auto itr = algs->begin(ibx); itr != algs->end(ibx); ++itr ) {
454 for(
int algBit=0; algBit<128; algBit++) {
455 if(itr->getAlgoDecisionFinal(algBit))
hAlgoBits_->Fill(algBit);
468 for (
int ibx=emulGtAlgs->getFirstBX(); ibx<=emulGtAlgs->getLastBX(); ++ibx) {
470 for (
auto itr = emulGtAlgs->begin(ibx); itr != emulGtAlgs->end(ibx); ++itr ) {
472 for(
int algBit=0; algBit<128; algBit++) {
486 for (
int ibx=emulDxAlgs->getFirstBX(); ibx<=emulDxAlgs->getLastBX(); ++ibx) {
488 for (
auto itr = emulDxAlgs->begin(ibx); itr != emulDxAlgs->end(ibx); ++itr ) {
490 for(
int algBit=0; algBit<128; algBit++) {
510 for (
int ibx=jets->getFirstBX(); ibx<=jets->getLastBX(); ++ibx) {
513 for (
unsigned int igtJ=0; igtJ<jets->size(ibx); igtJ++) {
515 double gtJetEt = jets->at(ibx,igtJ).hwPt();
516 double dmxJetEt = 0.0;
517 if(dmxjets->size(ibx)>igtJ) dmxJetEt = dmxjets->at(ibx,igtJ).hwPt();
520 double gtJetEta = jets->at(ibx,igtJ).hwEta();
521 double dmxJetEta = 0.0;
522 if(dmxjets->size(ibx)>igtJ) dmxJetEta = dmxjets->at(ibx,igtJ).hwEta();
525 double gtJetPhi = jets->at(ibx,igtJ).hwPhi();
526 double dmxJetPhi = 0.0;
527 if(dmxjets->size(ibx)>igtJ) dmxJetPhi = dmxjets->at(ibx,igtJ).hwPhi();
534 for (
unsigned int idmJ=jets->size(ibx); idmJ<dmxjets->size(ibx); idmJ++) {
537 double gtJetEt = 0.0;
538 double dmxJetEt = dmxjets->at(ibx,idmJ).hwPt();
541 double gtJetEta = 0.0;
542 double dmxJetEta = dmxjets->at(ibx,idmJ).hwEta();
545 double gtJetPhi = 0.0;
546 double dmxJetPhi = dmxjets->at(ibx,idmJ).hwPhi();
568 auto itr = hwalgs->begin(ibx);
569 auto itr_emul = emulAlgs->begin(ibx);
571 for(
int algBit=0; algBit<128; algBit++) {
572 bool hw = itr->getAlgoDecisionFinal(algBit);
573 bool em = itr_emul->getAlgoDecisionFinal(algBit);
599 auto itr = hwalgs->begin(ibx);
600 auto itr_emul = emulAlgs->begin(ibx);
602 for(
int algBit=0; algBit<128; algBit++) {
603 bool hw = itr->getAlgoDecisionFinal(algBit);
604 bool em = itr_emul->getAlgoDecisionFinal(algBit);
634 auto itr =
types_.cbegin();
637 for (; itr!=
types_.end(); ++itr, ++str ) {
642 dirs_.insert( std::pair< ObjectType, TFileDirectory >(*itr, fs->
mkdir(*str) ) );
644 het_.insert( std::pair< ObjectType, TH1F* >(*itr,
dirs_.at(*itr).make<TH1F>(
"et",
"", 100, -0.5, etmax) ));
646 hbx_.insert( std::pair< ObjectType, TH1F* >(*itr,
dirs_.at(*itr).make<TH1F>(
"bx",
"", 11, -5.5, 5.5) ));
649 heta_.insert( std::pair< ObjectType, TH1F* >(*itr,
dirs_.at(*itr).make<TH1F>(
"eta",
"", 227, -113.5, 113.5) ));
650 hphi_.insert( std::pair< ObjectType, TH1F* >(*itr,
dirs_.at(*itr).make<TH1F>(
"phi",
"", 144, -0.5, 143.5) ));
651 hetaphi_.insert( std::pair< ObjectType, TH2F* >(*itr,
dirs_.at(*itr).make<TH2F>(
"etaphi",
"", 227, -113.5, 113.5, 144, -0.5, 143.5) ));
TFileDirectory dmxVGtDir_
TH2F * hAlgoBitsEmulGtVsHw_
T getParameter(std::string const &) const
EventNumber_t event() const
edm::EDGetToken m_emulDxAlgToken
TFileDirectory evtDispDir_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetToken m_dmxEGToken
#define DEFINE_FWK_MODULE(type)
edm::EDGetToken m_egToken
std::map< ObjectType, TH2F * > hetaphi_
edm::EDGetToken m_emulGtAlgToken
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
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
L1TGlobalAnalyzer(const edm::ParameterSet &)
edm::EDGetToken m_sumToken
std::vector< std::string > typeStr_
TH2F * hAlgoBitsEmulDxVsHw_
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
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_
edm::EDGetToken m_jetToken
edm::EDGetToken m_dmxJetToken
std::vector< ObjectType > types_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual void endJob() override