Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EMTF DQM Module for CMSSW_8_1_X #13630

Merged
merged 1 commit into from Mar 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -52,7 +52,10 @@

process.gtDigis.DaqGtFedId = cms.untracked.int32(813)

process.stage2UnpackPath = cms.Path(process.caloStage2Digis+process.gmtStage2Digis)
process.stage2UnpackPath = cms.Path(process.caloStage2Digis +
process.gmtStage2Digis +
process.emtfStage2Digis
)

process.l1tMonitorPath = cms.Path(process.l1tStage2online)

Expand Down
43 changes: 43 additions & 0 deletions DQM/L1TMonitor/interface/L1TStage2EMTF.h
@@ -0,0 +1,43 @@
#ifndef DQM_L1TMonitor_L1TStage2EMTF_h
#define DQM_L1TMonitor_L1TStage2EMTF_h

#include "DataFormats/L1TMuon/interface/EMTFOutput.h"

#include "DQMServices/Core/interface/DQMEDAnalyzer.h"
#include "DQMServices/Core/interface/MonitorElement.h"

#include "FWCore/Framework/interface/Event.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"


class L1TStage2EMTF : public DQMEDAnalyzer {

public:

L1TStage2EMTF(const edm::ParameterSet& ps);
virtual ~L1TStage2EMTF();

protected:

virtual void dqmBeginRun(const edm::Run&, const edm::EventSetup&);
virtual void beginLuminosityBlock(const edm::LuminosityBlock&, const edm::EventSetup&);
virtual void bookHistograms(DQMStore::IBooker&, const edm::Run&, const edm::EventSetup&) override;
virtual void analyze(const edm::Event&, const edm::EventSetup&) override;

private:

edm::EDGetTokenT<l1t::EMTFOutputCollection> emtfToken;
std::string monitorDir;
bool verbose;

MonitorElement* emtfnTracks;
MonitorElement* emtfTrackBX;
MonitorElement* emtfTrackPt;
MonitorElement* emtfTrackEta;
MonitorElement* emtfTrackPhi;
MonitorElement* emtfTrackPhiFull;
MonitorElement* emtfTrackOccupancy;
};

#endif
9 changes: 9 additions & 0 deletions DQM/L1TMonitor/python/L1TStage2EMTF_cfi.py
@@ -0,0 +1,9 @@
import FWCore.ParameterSet.Config as cms

l1tStage2Emtf = cms.EDAnalyzer(
'L1TStage2EMTF',
emtfSource = cms.InputTag('emtfStage2Digis'),
monitorDir = cms.untracked.string('L1T2016/L1TStage2EMTF'),
verbose = cms.untracked.bool(False),
)

8 changes: 5 additions & 3 deletions DQM/L1TMonitor/python/L1TStage2_cff.py
Expand Up @@ -2,12 +2,14 @@

from DQM.L1TMonitor.L1TStage2CaloLayer2_cfi import *
from DQM.L1TMonitor.L1TStage2mGMT_cfi import *

from DQM.L1TMonitor.L1TStage2EMTF_cfi import *

from EventFilter.L1TRawToDigi.caloStage2Digis_cfi import *
from EventFilter.L1TRawToDigi.gmtStage2Digis_cfi import *
from EventFilter.L1TRawToDigi.emtfStage2Digis_cfi import *

l1tStage2online = cms.Sequence(
l1tStage2CaloLayer2+
l1tStage2mGMT
l1tStage2CaloLayer2 +
l1tStage2mGMT +
l1tStage2Emtf
)
61 changes: 61 additions & 0 deletions DQM/L1TMonitor/src/L1TStage2EMTF.cc
@@ -0,0 +1,61 @@
#include "DQM/L1TMonitor/interface/L1TStage2EMTF.h"


L1TStage2EMTF::L1TStage2EMTF(const edm::ParameterSet& ps)
: emtfToken(consumes<l1t::EMTFOutputCollection>(ps.getParameter<edm::InputTag>("emtfSource"))),
monitorDir(ps.getUntrackedParameter<std::string>("monitorDir", "")),
verbose(ps.getUntrackedParameter<bool>("verbose", false)) {}

L1TStage2EMTF::~L1TStage2EMTF() {}

void L1TStage2EMTF::dqmBeginRun(const edm::Run& r, const edm::EventSetup& c) {}

void L1TStage2EMTF::beginLuminosityBlock(const edm::LuminosityBlock&, const edm::EventSetup&) {}

void L1TStage2EMTF::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run&, const edm::EventSetup&) {

ibooker.setCurrentFolder(monitorDir);

emtfnTracks = ibooker.book1D("emtfnTracks", "Number of EMTF Tracks per Event", 4, 0, 4);

emtfTrackPt = ibooker.book1D("emtfTrackPt", "EMTF Track p_{T}", 512, 0, 512);
emtfTrackPt->setAxisTitle("Track p_{T} [GeV]", 1);

emtfTrackEta = ibooker.book1D("emtfTrackEta", "EMTF Track #eta", 460, -230, 230);
emtfTrackEta->setAxisTitle("Track #eta", 1);

emtfTrackPhi = ibooker.book1D("emtfTrackPhi", "EMTF Track #phi", 116, -16, 100);
emtfTrackPhi->setAxisTitle("Track #phi", 1);

emtfTrackPhiFull = ibooker.book1D("emtfTrackPhiFull", "EMTF Full Precision Track #phi", 4096, 0, 4096);
emtfTrackPhiFull->setAxisTitle("Full Precision Track #phi", 1);

emtfTrackBX = ibooker.book1D("emtfTrackBX", "EMTF Track Bunch Crossings", 4, 0, 4);
emtfTrackBX->setAxisTitle("Track BX", 1);
}

void L1TStage2EMTF::analyze(const edm::Event& e, const edm::EventSetup& c) {

if (verbose) edm::LogInfo("L1TStage2EMTF") << "L1TStage2EMTF: analyze..." << std::endl;

int nTracks = 0;

edm::Handle<l1t::EMTFOutputCollection> EMTF;
e.getByToken(emtfToken, EMTF);

for (std::vector<l1t::EMTFOutput>::const_iterator itEMTF = EMTF->begin(); itEMTF != EMTF->end(); ++itEMTF) {

l1t::emtf::SPCollection SP = itEMTF->GetSPCollection();

for (std::vector<l1t::emtf::SP>::const_iterator itSP = SP.begin(); itSP != SP.end(); ++itSP) {
emtfTrackBX->Fill(itSP->BX());
emtfTrackPt->Fill(itSP->Pt());
emtfTrackEta->Fill(itSP->Eta_GMT());
emtfTrackPhi->Fill(itSP->Phi_GMT());
emtfTrackPhiFull->Fill(itSP->Phi_full());
nTracks++;
}
}
emtfnTracks->Fill(nTracks);
}

3 changes: 3 additions & 0 deletions DQM/L1TMonitor/src/SealModule.cc
Expand Up @@ -35,6 +35,9 @@ DEFINE_FWK_MODULE(L1TStage2mGMT);
#include <DQM/L1TMonitor/interface/L1TStage2BMTF.h>
DEFINE_FWK_MODULE(L1TStage2BMTF);

#include <DQM/L1TMonitor/interface/L1TStage2EMTF.h>
DEFINE_FWK_MODULE(L1TStage2EMTF);

#include <DQM/L1TMonitor/interface/L1TGCT.h>
DEFINE_FWK_MODULE(L1TGCT);

Expand Down
42 changes: 21 additions & 21 deletions DataFormats/L1TMuon/interface/EMTFOutput.h
Expand Up @@ -50,27 +50,27 @@ namespace l1t {
void set_AMC13Trailer(emtf::AMC13Trailer bits) { AMC13Trailer = bits; hasAMC13Trailer = true; };
void set_dataword(uint64_t bits) { dataword = bits; };

bool HasAMC13Header() { return hasAMC13Header; };
bool HasMTF7Header() { return hasMTF7Header; };
bool HasEventHeader() { return hasEventHeader; };
bool HasCounters() { return hasCounters; };
int NumSP() { return numSP; };
int NumRPC() { return numRPC; };
int NumME() { return numME; };
bool HasAMC13Trailer() { return hasAMC13Trailer; };
bool HasMTF7Trailer() { return hasMTF7Trailer; };
bool HasEventTrailer() { return hasEventTrailer; };
emtf::AMC13Header GetAMC13Header() { return AMC13Header; };
emtf::MTF7Header GetMTF7Header() { return MTF7Header; };
emtf::EventHeader GetEventHeader() { return EventHeader; };
emtf::Counters GetCounters() { return Counters; };
emtf::MECollection GetMECollection() { return MECollection; };
emtf::RPCCollection GetRPCCollection() { return RPCCollection; };
emtf::SPCollection GetSPCollection() { return SPCollection; };
emtf::EventTrailer GetEventTrailer() { return EventTrailer; };
emtf::MTF7Trailer GetMTF7Trailer() { return MTF7Trailer; };
emtf::AMC13Trailer GetAMC13Trailer() { return AMC13Trailer; };
const uint64_t Dataword() const { return dataword; };
const bool HasAMC13Header() const { return hasAMC13Header; };
const bool HasMTF7Header() const { return hasMTF7Header; };
const bool HasEventHeader() const { return hasEventHeader; };
const bool HasCounters() const { return hasCounters; };
const int NumSP() const { return numSP; };
const int NumRPC() const { return numRPC; };
const int NumME() const { return numME; };
const bool HasAMC13Trailer() const { return hasAMC13Trailer; };
const bool HasMTF7Trailer() const { return hasMTF7Trailer; };
const bool HasEventTrailer() const { return hasEventTrailer; };
const emtf::AMC13Header GetAMC13Header() const { return AMC13Header; };
const emtf::MTF7Header GetMTF7Header() const { return MTF7Header; };
const emtf::EventHeader GetEventHeader() const { return EventHeader; };
const emtf::Counters GetCounters() const { return Counters; };
const emtf::MECollection GetMECollection() const { return MECollection; };
const emtf::RPCCollection GetRPCCollection() const { return RPCCollection; };
const emtf::SPCollection GetSPCollection() const { return SPCollection; };
const emtf::EventTrailer GetEventTrailer() const { return EventTrailer; };
const emtf::MTF7Trailer GetMTF7Trailer() const { return MTF7Trailer; };
const emtf::AMC13Trailer GetAMC13Trailer() const { return AMC13Trailer; };
const uint64_t Dataword() const { return dataword; };

private:
bool hasAMC13Header;
Expand Down
12 changes: 12 additions & 0 deletions EventFilter/L1TRawToDigi/python/emtfStage2Digis_cfi.py
@@ -0,0 +1,12 @@
import FWCore.ParameterSet.Config as cms

emtfStage2Digis = cms.EDProducer(
"L1TRawToDigi",
Setup = cms.string("stage2::EMTFSetup"),
InputLabel = cms.InputTag("rawDataCollector"),
FedIds = cms.vint32(1384, 1385),
FWId = cms.uint32(0), ## Need to implement properly - AWB 23.02.16
debug = cms.untracked.bool(False),
MTF7 = cms.untracked.bool(True)
)