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 #13513
Closed
Closed
EMTF DQM Module #13513
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what are the plans for also adding this unpacker to the tier-0? @mulhearn |
||
|
||
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) | ||
) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why should the output be const for all of these functions? @swang373 @mulhearn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I'm not sure. This appears to be following a similar convention to https://github.com/swang373/cmssw/blob/EMTF_DQM_dev/DataFormats/L1TMuon/interface/RegionalMuonCand.h. Perhaps @abrinke1 would be able to comment on this, as I implemented his fix in order for the EMTF DQM module to compile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why they need to be const, but without it there were compile errors, and with it, it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i understand that the methods should be constant - but not their return types - what were the errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @davidlange6 , @abrinke1 ,
With further updates to the DataFormats for EMTF, we are looking into this comment to make sure we code it right. That the methods should be const is agreed upon. My understanding is that the edm::Handle returned by the call to getByToken() is const, so only const methods may be used to access its members.
That the return types do not have to be const, yes, I see that now. Pardon my confusion. If however, we are returning references or pointers to members, then the return type must be const. Is my understanding correct?