-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Bugfixes in simtrack to GEM/CSC digi and stub matching #30608
Changes from all commits
113d28e
8cb8f5f
0b151bd
4fb9649
aebbfb9
d407429
c75089e
92bf921
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#include "Validation/MuonCSCDigis/interface/CSCStubMatcher.h" | ||
#include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h" | ||
|
||
#include <algorithm> | ||
|
||
using namespace std; | ||
|
@@ -87,12 +86,9 @@ void CSCStubMatcher::matchCLCTsToSimTrack(const CSCCLCTDigiCollection& clcts) { | |
} | ||
|
||
int ring = ch_id.ring(); | ||
if (ring == 4) | ||
ring = 1; //use ME1b id to get CLCTs | ||
CSCDetId ch_id2(ch_id.endcap(), ch_id.station(), ring, ch_id.chamber(), 0); | ||
|
||
// do not consider CSCs with too few hits | ||
if (cscDigiMatcher_->nLayersWithStripInChamber(ch_id2) < minNHitsChamberCLCT_) | ||
if (cscDigiMatcher_->nLayersWithStripInChamber(ch_id) < minNHitsChamberCLCT_) | ||
continue; | ||
|
||
// get the comparator digis in this chamber | ||
|
@@ -104,7 +100,7 @@ void CSCStubMatcher::matchCLCTsToSimTrack(const CSCCLCTDigiCollection& clcts) { | |
|
||
// print out the digis | ||
if (verboseCLCT_) { | ||
cout << "clct: digi_strips " << ch_id2 << endl; | ||
cout << "clct: comparators " << ch_id << endl; | ||
int layer = 0; | ||
for (const auto& p : comps) { | ||
layer++; | ||
|
@@ -115,6 +111,12 @@ void CSCStubMatcher::matchCLCTsToSimTrack(const CSCCLCTDigiCollection& clcts) { | |
} | ||
} | ||
|
||
//use ME1b id to get CLCTs | ||
const bool isME1a(ch_id.station() == 1 and ch_id.ring() == 4); | ||
if (isME1a) | ||
ring = 1; | ||
CSCDetId ch_id2(ch_id.endcap(), ch_id.station(), ring, ch_id.chamber(), 0); | ||
|
||
const auto& clcts_in_det = clcts.get(ch_id2); | ||
|
||
for (auto c = clcts_in_det.first; c != clcts_in_det.second; ++c) { | ||
|
@@ -137,15 +139,28 @@ void CSCStubMatcher::matchCLCTsToSimTrack(const CSCCLCTDigiCollection& clcts) { | |
for (const auto& p : comps) { | ||
layer++; | ||
for (const auto& q : p) { | ||
if (verboseCLCT_) | ||
cout << "L" << layer << " " << q << " " << q.getHalfStrip() << " " << std::endl; | ||
for (const auto& clctComp : (*c).getHits()[layer - 1]) { | ||
if (q.getHalfStrip() == clctComp) { | ||
if (clctComp == 65535) | ||
continue; | ||
if (verboseCLCT_) { | ||
std::cout << "\t" << clctComp << " " << endl; | ||
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. cout is not allowed |
||
} | ||
if (q.getHalfStrip() == clctComp or (isME1a and q.getHalfStrip() + 128 == clctComp)) { | ||
nMatches++; | ||
if (verboseCLCT_) { | ||
cout << "\t\tnMatches " << nMatches << std::endl; | ||
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. cout is not allowed |
||
} | ||
} | ||
} | ||
} | ||
if (verboseCLCT_) { | ||
cout << endl; | ||
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. cout is not allowed |
||
} | ||
} | ||
|
||
// require at least 3 good half-strip matches | ||
// require at least 3 good matches | ||
if (nMatches < 3) | ||
continue; | ||
|
||
|
@@ -257,19 +272,23 @@ void CSCStubMatcher::matchLCTsToSimTrack(const CSCCorrelatedLCTDigiCollection& l | |
for (const auto& lct : lcts_tmp) { | ||
iLct++; | ||
|
||
bool lct_matched(false); | ||
bool lct_clct_match(false); | ||
bool lct_alct_match(false); | ||
bool lct_gem1_match(false); | ||
bool lct_gem2_match(false); | ||
|
||
if (verboseLCT_) | ||
cout << "in LCT, getCLCT " << lct.getCLCT() << " getALCT " << lct.getALCT() << endl; | ||
|
||
if (verboseLCT_) { | ||
cout << ch_id << " " << ch_id2 << endl; | ||
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. cout is not allowed |
||
cout << lct << endl; | ||
cout << "getCLCT " << lct.getCLCT() << "\ngetALCT " << lct.getALCT() << "\ngetGEM1 " << lct.getGEM1() | ||
<< "\ngetGEM2 " << lct.getGEM2() << endl; | ||
} | ||
// Check if matched to an CLCT | ||
for (const auto& p : clctsInChamber(id)) { | ||
if (p == lct.getCLCT()) { | ||
lct_clct_match = true; | ||
if (verboseLCT_) | ||
cout << "\t...lct_clct_match" << endl; | ||
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. cout is not allowed |
||
break; | ||
} | ||
} | ||
|
@@ -278,6 +297,8 @@ void CSCStubMatcher::matchLCTsToSimTrack(const CSCCorrelatedLCTDigiCollection& l | |
for (const auto& p : alctsInChamber(id)) { | ||
if (p == lct.getALCT()) { | ||
lct_alct_match = true; | ||
if (verboseLCT_) | ||
cout << "\t...lct_alct_match" << endl; | ||
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. cout is not allowed |
||
break; | ||
} | ||
} | ||
|
@@ -289,6 +310,8 @@ void CSCStubMatcher::matchLCTsToSimTrack(const CSCCorrelatedLCTDigiCollection& l | |
for (const auto& p : gemDigiMatcher_->padsInChamber(gemDetIdL1.rawId())) { | ||
if (p == lct.getGEM1()) { | ||
lct_gem1_match = true; | ||
if (verboseLCT_) | ||
cout << "\t...lct_gem1_match" << endl; | ||
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. cout is not allowed |
||
break; | ||
} | ||
} | ||
|
@@ -298,17 +321,24 @@ void CSCStubMatcher::matchLCTsToSimTrack(const CSCCorrelatedLCTDigiCollection& l | |
for (const auto& p : gemDigiMatcher_->padsInChamber(gemDetIdL2.rawId())) { | ||
if (p == lct.getGEM2()) { | ||
lct_gem2_match = true; | ||
if (verboseLCT_) | ||
cout << "\t...lct_gem2_match" << endl; | ||
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. cout is not allowed |
||
break; | ||
} | ||
} | ||
} | ||
|
||
lct_matched = ((lct_clct_match and lct_alct_match) or (lct_alct_match and lct_gem1_match and lct_gem2_match) or | ||
(lct_clct_match and lct_gem1_match and lct_gem2_match)); | ||
const bool alct_clct = lct_clct_match and lct_alct_match; | ||
const bool alct_gem = lct_alct_match and lct_gem1_match and lct_gem2_match; | ||
const bool clct_gem = lct_clct_match and lct_gem1_match and lct_gem2_match; | ||
|
||
bool lct_tight_matched = alct_clct or alct_gem or clct_gem; | ||
bool lct_loose_matched = lct_clct_match or lct_alct_match; | ||
bool lct_matched = lct_loose_matched or lct_tight_matched; | ||
|
||
if (lct_matched) { | ||
if (verboseLCT_) | ||
cout << "this LCT matched to simtrack in chamber " << ch_id << endl; | ||
cout << "...was matched" << endl; | ||
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. cout is not allowed |
||
if (std::find(chamber_to_lcts_[id].begin(), chamber_to_lcts_[id].end(), lct) == chamber_to_lcts_[id].end()) { | ||
chamber_to_lcts_[id].emplace_back(lct); | ||
} | ||
|
@@ -331,7 +361,6 @@ void CSCStubMatcher::matchMPLCTsToSimTrack(const CSCCorrelatedLCTDigiCollection& | |
if (!lct->isValid()) | ||
continue; | ||
|
||
// std::cout << "MPC Stub ALL " << *lct << std::endl; | ||
chamber_to_mplcts_all_[id].emplace_back(*lct); | ||
|
||
// check if this stub corresponds with a previously matched stub | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<use name="rootcore"/> | ||
<use name="Validation/MuonHits"/> | ||
<use name="DataFormats/GEMDigi"/> | ||
<use name="SimDataFormats/GEMDigiSimLink"/> | ||
<export> | ||
<lib name="1"/> | ||
</export> |
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.
cout is not allowed, use messagelogger