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

Preparations for future trainings of the MVA tauID #18430

Merged

Conversation

roger-wolf
Copy link
Contributor

Dear colleagues,

this is a PR by @anehrkor in preparation of new trainings of the MVA tauID. The new 3prong+1pi0 is added to the readout of the MVA and input variables of the MVA are changed. I'm citing the original comments by Alex below (*). We expect changes in the performance of the MVA tauID that Alex will be able to comment on. Apart from such changes our standard tests are inconspicuous.

Cheers,
Roger

(*)
This PR fixes a bug where the decay mode 11 (3-prong+1Pi0) was not considered when reading the BDT output.

Moreover, new training options are added to the readout for upcoming trainings that include the Gottfried-Jackson angle as a variable, and no longer use the leading track chi2.

anehrkor and others added 4 commits April 6, 2017 11:40
…eading out BDT value for new decay modes

- Addition of read out for new training options: these include the Gottfried-Jackson angle and remove the leading track chi2, which has no discrimination power
Bug fix and addition of new training options for BDT readout
@cmsbuild
Copy link
Contributor

A new Pull Request was created by @roger-wolf (Roger Wolf) for master.

It involves the following packages:

RecoTauTag/RecoTau

@perrotta, @cmsbuild, @slava77, @davidlange6 can you please review it and eventually sign? Thanks.
@Muzaffar, @davidlange6, @smuzaffar you are the release manager for this.

cms-bot commands are listed here #13028

@slava77
Copy link
Contributor

slava77 commented Apr 20, 2017

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 20, 2017

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/19311/console Started: 2017/04/21 01:44

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-18430/19311/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 1684 differences found in the comparisons
  • DQMHistoTests: Total files compared: 23
  • DQMHistoTests: Total histograms compared: 1826273
  • DQMHistoTests: Total failures: 25508
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 1800592
  • DQMHistoTests: Total skipped: 173
  • DQMHistoTests: Total Missing objects: 0
  • Checked 94 log files, 14 edm output root files, 23 DQM output files

double mAOne = tau->p4().M();
double pAOneMag = tau->p();
double thetaGJmax = TMath::ASin( (TMath::Power(mTau,2) - TMath::Power(mAOne,2) ) / ( 2 * mTau * pAOneMag ) );
double thetaGJmeasured = TMath::ACos( ( tau->p4().px() * decayDistX + tau->p4().py() * decayDistY + tau->p4().pz() * decayDistZ ) / ( pAOneMag * decayDistMag ) );
Copy link
Contributor

Choose a reason for hiding this comment

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

please use native c++ methods where available.
std::pow, std::acos, std::asin etc)

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm missing what by construction restricts the argument of asin to have an absolute value less or equal 1.0?
It looks like there should be a protection.

Copy link
Contributor

Choose a reason for hiding this comment

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

Dear Slava,

the valua of mAOne can only be between 0.8 and 1.5 GeV. This cut is placed on 3-prong taus during the tau reconstruction by HPS. Thus, there is no need for protection.

Cheers,
Alex

Copy link
Contributor

Choose a reason for hiding this comment

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

asin( (1.77682**2 - 0.8**2)/2/1.77682/pAOneMag)) ~ asin(0.71/pAOneMag)
Does it mean that tau->p() can not possibly be below 0.71 ?

Copy link
Contributor

Choose a reason for hiding this comment

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

For that to happen, the transverse momentum of the tau would have to be below 0.71 GeV. In MiniAOD, only taus with pt greater than 18 GeV are saved.
However, in AOD there is no such cut and the minimum pt of the tracks used to reconstruct the tau is 0.5 GeV, I believe. So there it might be necessary.
I will add a statement requiring tau->p() to be greater than 1 although in typical analyses, this will never not be true since typically taus with pt greater than 20 GeV are required.

@@ -278,6 +292,30 @@ double PATTauDiscriminationByMVAIsolationRun2::discriminate(const TauRef& tau) c
mvaInput_[20] = ( tau->hasSecondaryVertex() ) ? 1. : 0.;
mvaInput_[21] = std::sqrt(decayDistMag);
mvaInput_[22] = std::min((float)10., tau->flightLengthSig());
} else if ( mvaOpt_ == kDBoldDMwLTwGJ || mvaOpt_ == kDBnewDMwLTwGJ ) {
mvaInput_[0] = std::log(std::max((float)1., (float)tau->pt()));
Copy link
Contributor

Choose a reason for hiding this comment

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

1.f literal is shorter than (float)1.
same applies to all values below

mvaInput_[10] = std::min((float)0.5, ptWeightedDrSignal);
mvaInput_[11] = std::min((float)0.5, ptWeightedDrIsolation);
mvaInput_[12] = std::min((float)1., eRatio);
mvaInput_[13] = TMath::Sign((float)+1., tau->dxy());
Copy link
Contributor

Choose a reason for hiding this comment

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

std::copysign(1.f, tau->dxy());

double mTau = 1.77682;
double mAOne = tau->p4().M();
double pAOneMag = tau->p();
double thetaGJmax = TMath::ASin( (TMath::Power(mTau,2) - TMath::Power(mAOne,2) ) / ( 2 * mTau * pAOneMag ) );
Copy link
Contributor

Choose a reason for hiding this comment

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

same comments as in PAT tau apply here.

@slava77
Copy link
Contributor

slava77 commented Apr 25, 2017

It seems like RecoTauTag/RecoTau/plugins/PFRecoTauDiscriminationByMVAIsolationRun2.cc and PATTauDiscriminationByMVAIsolationRun2.cc are badly in need of a good templated helper method to reduce essentially duplicate implementation in two places.

@anehrkor
Copy link
Contributor

We actually tried doing this when we first developed the code for taus from PAT. However, it is not trivial at all because many variables are accessed differently in reco::PFTau and pat::Tau effectively leading to duplicate code once more via template specialization.

@slava77
Copy link
Contributor

slava77 commented Apr 28, 2017 via email

@cmsbuild
Copy link
Contributor

-1

Tested at: 5be50cb

The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:
5be50cb
You can see more details here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-18430/19453/git-log-recent-commits
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-18430/19453/git-merge-result

You can see the results of the tests here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-18430/19453/summary.html

I found follow errors while testing this PR

Failed tests: RelVals

  • RelVals:

When I ran the RelVals I found an error in the following worklfows:
140.53 step2

runTheMatrix-results/140.53_RunHI2011+RunHI2011+RECOHID11+HARVESTDHI/step2_RunHI2011+RunHI2011+RECOHID11+HARVESTDHI.log

The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic:
5be50cb
You can see more details here:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-18430/19453/git-log-recent-commits
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-18430/19453/git-merge-result

@cmsbuild
Copy link
Contributor

Comparison not run due to runTheMatrix errors (RelVals and Igprof tests were also skipped)

@slava77
Copy link
Contributor

slava77 commented Apr 28, 2017

@cmsbuild please test

[3] XrdAdaptor::ClientRequest::HandleResponse() failure while running connection recovery was hopefully transient

@cmsbuild
Copy link
Contributor

cmsbuild commented Apr 28, 2017

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/19458/console Started: 2017/04/28 13:51

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-18430/19458/summary.html

Comparison Summary:

  • You potentially added 20 lines to the logs
  • Reco comparison results: 1712 differences found in the comparisons
  • DQMHistoTests: Total files compared: 23
  • DQMHistoTests: Total histograms compared: 1778687
  • DQMHistoTests: Total failures: 42397
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 1736117
  • DQMHistoTests: Total skipped: 173
  • DQMHistoTests: Total Missing objects: 0
  • Checked 94 log files, 14 edm output root files, 23 DQM output files

@slava77
Copy link
Contributor

slava77 commented Apr 28, 2017

+1

for #18430 5be50cb
See notes in #18430 (comment)

@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 requires discussion in the ORP meeting before it's merged. @davidlange6, @smuzaffar

@davidlange6 davidlange6 merged commit 608905b into cms-sw:master Apr 29, 2017
@roger-wolf roger-wolf deleted the CMSSW_9_1_X_tau-pog_tauID-GJangle branch November 17, 2017 10:02
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.

6 participants