-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Adding time info to the rpc points extrapolated from the CSC and DT segments #39115
Conversation
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39115/31653
Code check has found code style and quality issues which could be resolved by applying following patch(s)
|
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39115/31654
|
A new Pull Request was created by @ahussein1194 (Ahmed Hussein) for master. It involves the following packages:
@jpata, @cmsbuild, @mandrenguyen, @clacaputo can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@cmsbuild please test |
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 fixed here:
- can you use a more descriptive title for the PR (edit button)?
- do these modules run in any workflow (online or offline), or is it "private code" run on an ad-hoc basis
- fix magic numbers, commented-out code
For the whole subpackage, in a follow-up (#39131):
- cout should be removed from these modules (it looks like this is a common issue for the whole subpackage)
- the config parameters should have default values, defined in a fillDescriptions (see e.g. here: 4eb1ef6)
float myTime = -9999.; | ||
float myTimeErr = -9999.; | ||
int myBx = -99; | ||
|
||
if (debug) | ||
std::cout << "CSC \t loop over all the CSCSegments " << std::endl; |
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 in production code, it's not thread safe.
please switch to LogDebug.
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.
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.
Now "LogDebug" is being used instead of "cout". Also a fillDescriptions has been defined for the default values. They have been implemented in the last commit.
if (debug) | ||
std::cout << "CSC \t loop over all the CSCSegments " << std::endl; | ||
for (segment = allCSCSegments->begin(); segment != allCSCSegments->end(); ++segment) { | ||
CSCDetId CSCId = segment->cscDetId(); | ||
|
||
myTime = segment->time(); | ||
myBx = round(myTime / 25.); |
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.
magic number 25 should be a constexpr. In fact, isn't this number something that should come from the conditions DB?
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.
It is the time difference between bunch crossings. It is now defined as const.
//&& acos(dz)*180/3.1415926 > 45. && acos(dz)*180/3.1415926 < 135.){ | ||
//&& segment->chi2()< ??)Add 3 segmentes in the endcaps??? |
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.
remove
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.
Already removed.
if (debug) | ||
std::cout << "CSC \t \t yes" << std::endl; |
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.
LogDebug here and below
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.
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 replaced "cout" by "LogDebug"
@@ -180,7 +189,6 @@ std::unique_ptr<RPCRecHitCollection> CSCSegtoRPC::thePoints(const CSCSegmentColl | |||
RPCGeomServ rpcsrv(rpcId); | |||
|
|||
if (dr > 200. || fabs(dz) > 55. || dfg > 1.) { | |||
//if(rpcRegion==1&&dfg>1.&&dr>100.){ |
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.
remove
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.
Already removed all lines of code that were commented out.
|
||
if (segment->hasPhi()) { | ||
myPhiTime = segment->phiSegment()->t0(); | ||
myPhiBx = round(segment->phiSegment()->t0() / 25.); |
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.
25 from DB / as constexpr
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.
Now it is defined as const.
if (debug) | ||
std::cout << "segment t0 = " << myPhiTime << "\tround = " << myPhiBx << std::endl; |
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.
LogDebug
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.
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.
Now replaced by "LogDebug"
float myPhiTime = -9999.; | ||
float myPhiTimeErr = -9999.; | ||
int myPhiBx = -99; |
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.
these placeholder magic number are repeating several times. can you define them in a single place?
float myPhiTime = -9999.; | ||
float myPhiTimeErr = -9999.; | ||
int myPhiBx = -99; | ||
|
||
if (segment->hasPhi()) { | ||
myPhiTime = segment->phiSegment()->t0(); | ||
myPhiBx = round(segment->phiSegment()->t0() / 25.); | ||
if (debug) | ||
std::cout << "segment t0 = " << myPhiTime << "\tround = " << myPhiBx << std::endl; | ||
} | ||
if (!(myPhiBx <= maxPhiBX && myPhiBx >= minPhiBX)) //limit only to the RPC readout range | ||
continue; |
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.
looks like this is copy-paste from above. can you simplify with a function?
@@ -33,6 +34,9 @@ class DTSegtoRPC { | |||
double MaxD; | |||
double MaxDrb4; | |||
double MaxDistanceBetweenSegments; | |||
//by @ahussein |
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.
remove
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.
Done.
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-9d6312/26971/summary.html Comparison SummarySummary:
|
Hi @jpata @ahussein1194 will implement the asked changes for this PR. He is working currently on the implementation. |
please test |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39115/31752
|
Pull request #39115 was updated. @jpata, @cmsbuild, @mandrenguyen, @clacaputo can you please check and sign again. |
@cmsbuild please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-9d6312/27043/summary.html Comparison SummarySummary:
|
+reconstruction
|
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy, @rappoccio (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
PR description:
The edited plugins are used by the offline RPC DPG analysis and should not affect any other sw packages. In general the RPCs use the RPCPontProducer to extrapolate segments from the near muon detectors and the extrapolated points are converted to objects of type of RPC Rechits, used in the offline efficiency measurements. In this code we updated the timing information to the extrapolated RPC points.
PR validation:
Tested with runTheMatrix script with:
If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported
@mileva @jhgoh @andresib