Skip to content
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

Merged
merged 7 commits into from
Aug 24, 2022

Conversation

ahussein1194
Copy link
Contributor

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:

  • 1001.3 RunSingleMuon2022B+TIER0EXPRUN3+ALCAEXPRUN3+ALCAHARVDEXPRUN3
  • 1044.0 RunRawPPS2022B+TIER0EXPPPSCALRUN3+ALCASPLITPPSCALRUN3+ALCAHARVDPPSCALRUN3
  • 140.002 RunZeroBias2022B+HLTRUN3+RECONANORUN3+HARVESTRUN3

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

  • No backport is needed.

@mileva @jhgoh @andresib

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39115/31653

  • This PR adds an extra 20KB to repository

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39115/31654

  • This PR adds an extra 20KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @ahussein1194 (Ahmed Hussein) for master.

It involves the following packages:

  • RecoLocalMuon/RPCRecHit (reconstruction)

@jpata, @cmsbuild, @mandrenguyen, @clacaputo can you please review it and eventually sign? Thanks.
@bellan, @jhgoh this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy, @rappoccio you are the release manager for this.

cms-bot commands are listed here

@jpata
Copy link
Contributor

jpata commented Aug 22, 2022

@cmsbuild please test

Copy link
Contributor

@jpata jpata left a 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;
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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.);
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Comment on lines -90 to -91
//&& acos(dz)*180/3.1415926 > 45. && acos(dz)*180/3.1415926 < 135.){
//&& segment->chi2()< ??)Add 3 segmentes in the endcaps???
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already removed.

Comment on lines 102 to 103
if (debug)
std::cout << "CSC \t \t yes" << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LogDebug here and below

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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.){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Copy link
Contributor Author

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.);
Copy link
Contributor

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

Copy link
Contributor Author

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.

Comment on lines 133 to 134
if (debug)
std::cout << "segment t0 = " << myPhiTime << "\tround = " << myPhiBx << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LogDebug

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now replaced by "LogDebug"

Comment on lines +126 to +128
float myPhiTime = -9999.;
float myPhiTimeErr = -9999.;
int myPhiBx = -99;
Copy link
Contributor

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?

Comment on lines 285 to 296
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;
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@ahussein1194 ahussein1194 changed the title updated some plugins in RecoLocalMuon/RPCRecHit/ updated some plugins in RecoLocalMuon/RPCRecHit/ and added some timing information to the extrapolated RPC points Aug 22, 2022
@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-9d6312/26971/summary.html
COMMIT: fe55343
CMSSW: CMSSW_12_5_X_2022-08-21-2300/el8_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/39115/26971/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 6 differences found in the comparisons
  • DQMHistoTests: Total files compared: 51
  • DQMHistoTests: Total histograms compared: 3693040
  • DQMHistoTests: Total failures: 13
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 3693004
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.004 KiB( 50 files compared)
  • DQMHistoSizes: changed ( 312.0 ): 0.004 KiB MessageLogger/Warnings
  • Checked 212 log files, 49 edm output root files, 51 DQM output files
  • TriggerResults: no differences found

@mileva
Copy link
Contributor

mileva commented Aug 22, 2022

  • do these modules run in any workflow (online or offline), or is it "private code" run on an ad-hoc basis

Hi @jpata
I don't think those are called by some workflow. The modules are called by our "private" offline analysis code. But the aim is to update it step by step and align with the recent cmssw requirements ...

@ahussein1194 will implement the asked changes for this PR. He is working currently on the implementation.
Thanks!
Roumyana

@ahussein1194 ahussein1194 changed the title updated some plugins in RecoLocalMuon/RPCRecHit/ and added some timing information to the extrapolated RPC points Adding time info to the rpc points extrapolated from the CSC and DT segments Aug 22, 2022
@perrotta
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39115/31752

  • This PR adds an extra 24KB to repository

@cmsbuild
Copy link
Contributor

Pull request #39115 was updated. @jpata, @cmsbuild, @mandrenguyen, @clacaputo can you please check and sign again.

@jpata
Copy link
Contributor

jpata commented Aug 24, 2022

@cmsbuild please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-9d6312/27043/summary.html
COMMIT: e4be1ca
CMSSW: CMSSW_12_5_X_2022-08-23-2300/el8_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/39115/27043/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 4 differences found in the comparisons
  • DQMHistoTests: Total files compared: 51
  • DQMHistoTests: Total histograms compared: 3693084
  • DQMHistoTests: Total failures: 8
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3693054
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 50 files compared)
  • Checked 212 log files, 49 edm output root files, 51 DQM output files
  • TriggerResults: no differences found

@jpata
Copy link
Contributor

jpata commented Aug 24, 2022

+reconstruction

@cmsbuild
Copy link
Contributor

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)

@perrotta
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 0a8b6ea into cms-sw:master Aug 24, 2022
@mileva
Copy link
Contributor

mileva commented Aug 24, 2022

Thanks a lot for the help @perrotta and @jpata !
Roumyana

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants