forked from cms-sw/cmssw
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
158 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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), | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
) | ||
|