7 monitorDir(ps.getUntrackedParameter<
std::
string>(
"monitorDir")),
8 muonColl1Title(ps.getUntrackedParameter<
std::
string>(
"regionalMuonCollection1Title")),
9 muonColl2Title(ps.getUntrackedParameter<
std::
string>(
"regionalMuonCollection2Title")),
10 summaryTitle(ps.getUntrackedParameter<
std::
string>(
"summaryTitle")),
11 ignoreBadTrkAddr(ps.getUntrackedParameter<
bool>(
"ignoreBadTrackAddress")),
12 ignoreBin(ps.getUntrackedParameter<
std::vector<
int>>(
"ignoreBin")),
14 isBmtf(ps.getUntrackedParameter<
bool>(
"isBmtf"))
17 for (
unsigned int i = 1;
i <=
RPT2;
i++) {
33 desc.
add<
edm::InputTag>(
"regionalMuonCollection1")->setComment(
"L1T RegionalMuonCand collection 1");
34 desc.
add<
edm::InputTag>(
"regionalMuonCollection2")->setComment(
"L1T RegionalMuonCand collection 2");
35 desc.
addUntracked<
std::string>(
"monitorDir",
"")->setComment(
"Target directory in the DQM file. Will be created if not existing.");
36 desc.
addUntracked<
std::string>(
"regionalMuonCollection1Title",
"Regional muon collection 1")->setComment(
"Histogram title for first collection.");
37 desc.
addUntracked<
std::string>(
"regionalMuonCollection2Title",
"Regional muon collection 2")->setComment(
"Histogram title for second collection.");
39 desc.
addUntracked<
bool>(
"ignoreBadTrackAddress",
false)->setComment(
"Ignore muon track address mismatches.");
40 desc.
addUntracked<std::vector<int>>(
"ignoreBin", std::vector<int>())->
setComment(
"List of bins to ignore");
43 descriptions.
add(
"l1tStage2RegionalMuonCandComp", desc);
53 trkAddrIgnoreText =
" (Bad track addresses ignored)";
218 if (
verbose)
edm::LogInfo(
"L1TStage2RegionalMuonCandComp") <<
"L1TStage2RegionalMuonCandComp: analyze..." << std::endl;
228 if (bxRange1 != bxRange2) {
244 if (iBx < muonBxColl2->getFirstBX() || iBx > muonBxColl2->
getLastBX())
continue;
251 if (muonBxColl1->
size(iBx) != muonBxColl2->
size(iBx)) {
257 if (muonBxColl1->
size(iBx) > muonBxColl2->
size(iBx)) {
258 muonIt1 = muonBxColl1->
begin(iBx) + muonBxColl2->
size(iBx);
259 const std::map<int, int> muon1TrackAddr = muonIt1->trackAddress();
260 for (; muonIt1 != muonBxColl1->
end(iBx); ++muonIt1) {
276 for (std::map<int, int>::const_iterator trIt1 = muon1TrackAddr.begin(); trIt1 != muon1TrackAddr.end(); ++trIt1) {
281 muonIt2 = muonBxColl2->
begin(iBx) + muonBxColl1->
size(iBx);
282 const std::map<int, int> muon2TrackAddr = muonIt2->trackAddress();
283 for (; muonIt2 != muonBxColl2->
end(iBx); ++muonIt2) {
299 for (std::map<int, int>::const_iterator trIt2 = muon2TrackAddr.begin(); trIt2 != muon2TrackAddr.end(); ++trIt2) {
308 muonIt1 = muonBxColl1->
begin(iBx);
309 muonIt2 = muonBxColl2->
begin(iBx);
311 while(muonIt1 != muonBxColl1->
end(iBx) && muonIt2 != muonBxColl2->
end(iBx)) {
325 bool muonMismatch =
false;
326 bool muonSelMismatch =
false;
327 if (muonIt1->hwPt() != muonIt2->hwPt()) {
331 muonSelMismatch =
true;
335 if (muonIt1->hwEta() != muonIt2->hwEta()) {
339 muonSelMismatch =
true;
343 if (muonIt1->hwPhi() != muonIt2->hwPhi()) {
347 muonSelMismatch =
true;
351 if (muonIt1->hwSign() != muonIt2->hwSign()) {
355 muonSelMismatch =
true;
359 if (muonIt1->hwSignValid() != muonIt2->hwSignValid()) {
363 muonSelMismatch =
true;
367 if (muonIt1->hwQual() != muonIt2->hwQual()) {
371 muonSelMismatch =
true;
375 if (muonIt1->hwHF() != muonIt2->hwHF()) {
379 muonSelMismatch =
true;
383 if (muonIt1->link() != muonIt2->link()) {
387 muonSelMismatch =
true;
391 if (muonIt1->processor() != muonIt2->processor()) {
395 muonSelMismatch =
true;
399 if (muonIt1->trackFinderType() != muonIt2->trackFinderType()) {
403 muonSelMismatch =
true;
408 const std::map<int, int> muon1TrackAddr = muonIt1->trackAddress();
409 std::map<int, int> muon2TrackAddr = muonIt2->trackAddress();
410 bool badTrackAddr =
false;
411 if (muon1TrackAddr.size() == muon2TrackAddr.size()) {
412 for (std::map<int, int>::const_iterator trIt1 = muon1TrackAddr.begin(); trIt1 != muon1TrackAddr.end(); ++trIt1) {
413 if (muon2TrackAddr.find(trIt1->first) == muon2TrackAddr.end()) {
416 }
else if (muon2TrackAddr[trIt1->first] != trIt1->second) {
438 if (muonIt1->hwDXY() != muonIt2->hwDXY()) {
442 muonSelMismatch =
true;
446 if (muonIt1->hwPt2() != muonIt2->hwPt2()) {
450 muonSelMismatch =
true;
473 for (std::map<int, int>::const_iterator trIt1 = muon1TrackAddr.begin(); trIt1 != muon1TrackAddr.end(); ++trIt1) {
492 for (std::map<int, int>::const_iterator trIt2 = muon2TrackAddr.begin(); trIt2 != muon2TrackAddr.end(); ++trIt2) {
const_iterator end(int bx) const
void setComment(std::string const &value)
MonitorElement * muColl1hwDXY
MonitorElement * muColl1hwEta
unsigned size(int bx) const
MonitorElement * muColl1nMu
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
MonitorElement * muColl2hwSignValid
MonitorElement * muColl2hwDXY
BXVector< RegionalMuonCand > RegionalMuonCandBxCollection
MonitorElement * muColl1hwPhi
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * muColl1trackFinderType
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * muColl2link
std::string muonColl2Title
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * muColl2hwPhi
std::vector< int > ignoreBin
MonitorElement * muColl2BxRange
L1TStage2RegionalMuonCandComp(const edm::ParameterSet &ps)
void setCurrentFolder(std::string const &fullpath)
MonitorElement * muColl1hwQual
MonitorElement * muColl2nMu
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
MonitorElement * errorSummaryDen
MonitorElement * muColl1hwSignValid
MonitorElement * muColl1link
MonitorElement * book1D(Args &&...args)
MonitorElement * muColl1TrkAddr
MonitorElement * muColl1BxRange
MonitorElement * muColl1processor
ParameterDescriptionBase * add(U const &iLabel, T const &value)
MonitorElement * muColl2hwHF
MonitorElement * muColl1hwHF
MonitorElement * muColl1hwSign
MonitorElement * muColl2hwPt2
~L1TStage2RegionalMuonCandComp() override
MonitorElement * muColl2hwEta
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > muonToken1
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MonitorElement * book2D(Args &&...args)
MonitorElement * muColl1hwPt
MonitorElement * muColl2hwQual
edm::EDGetTokenT< l1t::RegionalMuonCandBxCollection > muonToken2
void add(std::string const &label, ParameterSetDescription const &psetDescription)
MonitorElement * muColl2TrkAddrSize
MonitorElement * errorSummaryNum
MonitorElement * muColl2processor
MonitorElement * muColl1hwPt2
void bookHistograms(DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &) override
MonitorElement * muColl2TrkAddr
int getNbinsX() const
get # of bins in X-axis
const_iterator begin(int bx) const
MonitorElement * muColl2hwSign
MonitorElement * muColl2trackFinderType
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
std::string muonColl1Title
MonitorElement * muColl1TrkAddrSize
MonitorElement * muColl2hwPt
std::vector< RegionalMuonCand >::const_iterator const_iterator