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

Trigger sf #26

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Trigger sf #26

wants to merge 4 commits into from

Conversation

saswatinandan
Copy link
Collaborator

This is related to the issue. I guess we can simply check the filter bits of reco object to decide whether they are matched with trigger objects and if yes, consider only those reco objects to calculate sf. If it is fine, I'll check for 1l_3tau trigger also, currently implemented only for 4tau trigger case

@saswatinandan saswatinandan marked this pull request as ready for review September 14, 2022 09:40
@saswatinandan saswatinandan marked this pull request as draft September 14, 2022 14:42
@saswatinandan saswatinandan marked this pull request as ready for review September 15, 2022 10:52
@saswatinandan
Copy link
Collaborator Author

@ktht , did you miss this pull request by any chance or I made some major mistakes here?

@ktht
Copy link
Member

ktht commented Sep 29, 2022

Please test the code. I sense that there will be segfaults.

@saswatinandan
Copy link
Collaborator Author

I guess there is no option to test it, as the corresponding channel is missing now, I belive

@ktht
Copy link
Member

ktht commented Sep 29, 2022

But you can change the config minimally such that the relevant piece of code will be executed.

@saswatinandan
Copy link
Collaborator Author

I tried to check this but it is not possible to do by minimal changes as there is error not coming from trigger but before that. I don't see any such thing in cfg file https://github.com/HEP-KBFI/TallinnNtupleProducer/blob/main/EvtWeightTools/src/HadTauFakeRateInterface.cc#L86 I need one old cfg file to see how it works.

@saswatinandan
Copy link
Collaborator Author

But you can change the config minimally such that the relevant piece of code will be executed.

checked on 4tau samples for 1k events, didn't encounter any error

Copy link
Member

@ktht ktht left a comment

Choose a reason for hiding this comment

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

I got to say that a compiling code that does not produce any runtime errors should be the baseline, but not the only sufficient condition for merging this PR. Here are my comments and questions:

  • have you checked how to implement the same logic in 0l+2tau? We have a dedicated class for estimating trigger SF in that channel;
  • did you compare average trigger SF before and after implementing the changes?
  • have you considered the possibility that there may be more than two hadronic taus that could be matched to a trigger object? How often does that happen (if it happens at all)? If so, wouldn't it make sense to implement a logic that averages over the trigger SF probabilities that are computed from all possible pairs of hadronic taus? Or reduce the cone size that is used in trigger object matching?
  • please run over more than 1k events when testing, just for spotting pathological cases or possible errors in the code.

There were other issues in the code, which I have now highlighted.

eff_2tau_tauLeg4_mc = tau_leg_efficiency(hadTau4_pt_, hadTau4_decayMode_, "ditau", wp_str_, "eff_mc", sys);
//can we use 64, 128 filterbits only as they are related to di-tau trigger
//https://cmssdt.cern.ch/lxr/source/PhysicsTools/NanoAOD/python/triggerObjects_cff.py?v=CMSSW_12_6_X_2022-09-08-2300 #Line-0122
if ( hadTau_recObj->filterBits() ) matched_hadTaus.push_back(hadTau_recObj);
Copy link
Member

Choose a reason for hiding this comment

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

You're not actually testing against the bitmask (64) here. Please remove the link to lxr and refer to this instead for self-consistency (plus we're not using NanoAOD Ntuples produced in CMSSW 12_6_x). I recommend that you import the necessary bitmask(s) from triggers_cfi.py, so that they would be implemented in just one place.

Comment on lines +52 to +53
double prob_data(1);
double prob_mc(1);
Copy link
Member

Choose a reason for hiding this comment

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

Why this syntax? Please keep the assignment notation since people are more familiar with it.

Comment on lines +60 to +61
if ( isDEBUG_ )
std::cout << "prob_data: " << prob_data << "\t prob_mc: " << prob_mc << std::endl;
Copy link
Member

Choose a reason for hiding this comment

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

If you don't want to use curly braces, then I recommend that you put them on a single line, otherwise please use curly braces like in other places of this codebase. Also, std::endl is computationally expensive because it forces to flush the stream. Consider using just the newline character ('\n') instead.

Comment on lines +80 to +81
if ( isDEBUG_ )
std::cout << "hadTau pt: " << hadTau->pt() << "\t eta: " << hadTau->eta() << "\t decayMode: " << hadTau->decayMode() << std::endl;
Copy link
Member

Choose a reason for hiding this comment

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

Same comment again about the curly braces.

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.

2 participants