Skip to content

Adding upper momentum cut in FilterStepPointMomentum to be used in co…#46

Merged
brownd1978 merged 3 commits into
Mu2e:masterfrom
oksuzian:master
Nov 12, 2019
Merged

Adding upper momentum cut in FilterStepPointMomentum to be used in co…#46
brownd1978 merged 3 commits into
Mu2e:masterfrom
oksuzian:master

Conversation

@oksuzian

@oksuzian oksuzian commented Nov 5, 2019

Copy link
Copy Markdown
Collaborator

Addition of the upper momentum cut in FilterStepPointMomentum to be used in cosmic resampling jobs.
Addition of new variables in Analyses/src/StepPointMC1stHitDumper_module.cc
Other minor changes.

@brownd1978 brownd1978 requested a review from gaponenko November 5, 2019 14:00
@brownd1978 brownd1978 self-assigned this Nov 5, 2019
// }
if (stepPoints.size()) {
hit_ = VDHit(toff_, stepPoints.at(0));
hit_ = VDHit(toff_, event, stepPoints.at(0));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The event info seems unrelated to the momentum cutoff: what is it used for? Just diagnostics?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hi Dave,

The StepPointMC1stHitDumper module is just an analyzer module that makes a simple ntuple from the first step point MC. I found it handy to make simple plots for diagnostics purposes.
The upper momentum cutoff is done in the filter module: FilterStepPointMomentum.
The upper momentum cut of 0.5 GeV removes all the straight tracks and it reduces the size of the files by about a factor 10. It will be useful to have this functionality for a large scale cosmics MC production.

I've submitted these changes in one commit, and they are completely unrelated.
Sorry, if it adds confusion.
Would it help to separate commits in the future?

@brownd1978

brownd1978 commented Nov 5, 2019 via email

Copy link
Copy Markdown
Collaborator

@gaponenko gaponenko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi Yuri, can you please give a use case example for upper momentum cut?

@gaponenko

Copy link
Copy Markdown
Contributor

Hi Yuri, can you please give a use case example for upper momentum cut?

I found this explanation in another post to this thread:

The upper momentum cut of 0.5 GeV removes all the straight tracks and it reduces the size of the files by about a factor 

A particle above 0.5 GeV can create a CE-like delta ray, how is this handled with the cut? Does not seem to be safe for physics.

@gaponenko gaponenko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi Yuri, we are migrating Offline to validated fhicl. As Rob announced in a Software meeting some time ago, newly merged code should use the Config pattern rather than ParameterSet. Please update the filter module to use validation. There is some info here
https://mu2ewiki.fnal.gov/wiki/FclIntro#The_C.2B.2B_API_.28Validated_FHiCL.29
More at https://cdcvs.fnal.gov/redmine/projects/art/wiki/Configuration_validation_and_description
and https://cdcvs.fnal.gov/redmine/projects/fhicl-cpp/wiki/Configuration_validation_and_fhiclcpp_types
we also have multiple examples of Offline modules that are already migrated.

@oksuzian

oksuzian commented Nov 5, 2019

Copy link
Copy Markdown
Collaborator Author

Hi Andrei,

The use case is described in:
JobConfig/cosmic/dsstops_resampler.fcl

The configuration in the fcl file above only saves events that have a track below 0.5 GeV in the tracker volume.
As Dave pointed out, it's similar to the momentum cut we already use 'physics.filters.DigiFilter.MaxParticleMom'. There we actually cut at 200 MeV:
JobConfig/mixing/CRY-cosmicMix.fcl:physics.filters.DigiFilter.MaxParticleMom : 200.0
JobConfig/mixing/DS-cosmicMix.fcl:physics.filters.DigiFilter.MaxParticleMom : 200.0

@brownd1978

brownd1978 commented Nov 5, 2019 via email

Copy link
Copy Markdown
Collaborator

@oksuzian

oksuzian commented Nov 5, 2019

Copy link
Copy Markdown
Collaborator Author

Just to make sure, do you look at all the StepPoints or just the first? the first could be above threshold, then the particle interacts and a later one is below threshold.

Dave,

The FilterStepPointMomentum module Andrei originally wrote looks at all the step points, not the very first one.
Please see below.

  auto ih = event.getValidHandle<StepPointMCCollection>(cn);
  for(const auto& hit : *ih) {
    if(hit.momentum().mag() > cutMomentumMin_ && hit.momentum().mag() < cutMomentumMax_) {
      passed = true;
      break;
    }
  }

@oksuzian

oksuzian commented Nov 5, 2019

Copy link
Copy Markdown
Collaborator Author

Andrei,

I've updated

Hi Yuri, we are migrating Offline to validated fhicl. As Rob announced in a Software meeting some time ago, newly merged code should use the Config pattern rather than ParameterSet. Please update the filter module to use validation. There is some info here
https://mu2ewiki.fnal.gov/wiki/FclIntro#The_C.2B.2B_API_.28Validated_FHiCL.29
More at https://cdcvs.fnal.gov/redmine/projects/art/wiki/Configuration_validation_and_description
and https://cdcvs.fnal.gov/redmine/projects/fhicl-cpp/wiki/Configuration_validation_and_fhiclcpp_types
we also have multiple examples of Offline modules that are already migrated.

I've changed the code to use Config pattern per your request.

@gaponenko gaponenko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yuri, thank you.

@brownd1978 brownd1978 merged commit 04e475d into Mu2e:master Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants