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

VBF filters for QCD sample requested by VBF InvHiggs group #12657

Merged
merged 1 commit into from Feb 7, 2016
Merged

VBF filters for QCD sample requested by VBF InvHiggs group #12657

merged 1 commit into from Feb 7, 2016

Conversation

chayanit
Copy link

@chayanit chayanit commented Dec 3, 2015

They have been merged to CMSSW_8_X_X and now I just backported them to CMSSW_7_1_X. Thanks

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 3, 2015

A new Pull Request was created by @chayanit (Chayanit Asawatangtrakuldee) for CMSSW_7_1_X.

It involves the following packages:

GeneratorInterface/GenFilters

@vciulli, @covarell, @thuer, @cmsbuild, @bendavid, @davidlange6, @govoni can you please review it and eventually sign? Thanks.
@mkirsano this is something you requested to watch as well.
@slava77, @Degano, @smuzaffar you are the release manager for this.

Following commands in first line of a comment are recognized

  • +1|approve[d]|sign[ed]: L1/L2's to approve it
  • -1|reject[ed]: L1/L2's to reject it
  • assign <category>[,<category>[,...]]: L1/L2's to request signatures from other categories
  • unassign <category>[,<category>[,...]]: L1/L2's to remove signatures from other categories
  • hold: L1/all L2's/release manager to mark it as on hold
  • unhold: L1/user who put this PR on hold
  • merge: L1/release managers to merge this request
  • [@cmsbuild,] please test: L1/L2 and selected users to start jenkins tests
  • [@cmsbuild,] please test with cms-sw/cmsdist#<PR>: L1/L2 and selected users to start jenkins tests using externals from cmsdist

@govoni
Copy link
Contributor

govoni commented Dec 3, 2015

+1

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 3, 2015

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/10118/console

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 3, 2015

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_1_X IBs after it passes the integration tests. This pull request requires discussion in the ORP meeting before it's merged. @slava77, @davidlange6, @Degano, @smuzaffar

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 3, 2015

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 3, 2015


// ROOT includes
#include "TMath.h"

Copy link
Contributor

Choose a reason for hiding this comment

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

@chayanit - why is this include needed?

Copy link
Author

Choose a reason for hiding this comment

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

There was a usage of "sqrt" before but not anymore. This include can be removed. @davidlange6

@chayanit
Copy link
Author

Hi @davidlange6 could you move this request forward? I think they are all fine right? thanks.

@srimanob
Copy link
Contributor

@davidlange6
Which part of the code do we still have issue? I think we expect to have large QCD production using this filter?
cc @jimbrooke: Here is what filter we expect to use.

@davidlange6
Copy link
Contributor

@chayanit @srimanob - sorry for the delay, I think the ~minimal change that would make me happier is below. Much better would be to simply remove filterGenJets in favor of adding a few lines to the double loop over jets.

[dlange@lxplus0096 GenFilters]$ git diff
diff --git a/GeneratorInterface/GenFilters/interface/VBFGenJetFilter.h b/GeneratorInterface/GenFilters/interface/VBFGenJetFilter.h
index a0dbe69..0b88d5d 100644
--- a/GeneratorInterface/GenFilters/interface/VBFGenJetFilter.h
+++ b/GeneratorInterface/GenFilters/interface/VBFGenJetFilter.h
@@ -41,7 +41,7 @@ private:
void printGenVector(std::vectorHepMC::GenParticle* vec);
double nuMET(std::vectorHepMC::GenParticle* vNu);

  • std::vector<const reco::GenJet*> filterGenJets(const std::vectorreco::GenJet* jets);
  • std::vector<const reco::GenJet*> filterGenJets(const std::vectorreco::GenJet &jets);
    // std::vector<const reco::GenJet*> filterGenJets(const std::vectorreco::GenJet* jets);

//**************************
diff --git a/GeneratorInterface/GenFilters/src/VBFGenJetFilter.cc b/GeneratorInterface/GenFilters/src/VBFGenJetFilter.cc
index 3ff6c21..1a492a8 100644
--- a/GeneratorInterface/GenFilters/src/VBFGenJetFilter.cc
+++ b/GeneratorInterface/GenFilters/src/VBFGenJetFilter.cc
@@ -4,9 +4,6 @@

#include <HepMC/GenVertex.h>

-// ROOT includes

-#include "TMath.h"

// C++ includes
#include

@@ -35,13 +32,13 @@ VBFGenJetFilter::~VBFGenJetFilter(){

}

-vector<const reco::GenJet*> VBFGenJetFilter::filterGenJets(const vectorreco::GenJet* jets){
+vector<const reco::GenJet*> VBFGenJetFilter::filterGenJets(const vectorreco::GenJet &jets){

vector<const reco::GenJet*> out;

  • for(unsigned i=0; isize(); i++){
  • for(unsigned i=0; i<jets.size(); i++){
  • const reco::GenJet* j = &((*jets)[i]);
  • const reco::GenJet* j = &(jets[i]);

if(j->p4().pt() >ptMin && j->p4().eta()>etaMin && j->p4().eta()<etaMax)
{
@@ -60,7 +57,7 @@ bool VBFGenJetFilter::filter(edm::Event& iEvent, const edm::EventSetup& iSetup)

Handle< vectorreco::GenJet > handleGenJets;
iEvent.getByToken(m_inputTag_GenJetCollection, handleGenJets);

  • const vectorreco::GenJet* genJets = handleGenJets.product();
  • const vectorreco::GenJet &genJets = *(handleGenJets.product());

// Getting filtered generator jets
vector<const reco::GenJet*> filGenJets = filterGenJets(genJets);
@@ -74,17 +71,10 @@ bool VBFGenJetFilter::filter(edm::Event& iEvent, const edm::EventSetup& iSetup)
const reco::GenJet* pA = filGenJets[a];
const reco::GenJet* pB = filGenJets[b];

  •  // Getting the dijet vector
    

- math::XYZTLorentzVector diJet = pA->p4() + pB->p4();

   // Testing opposite hemispheres
   double dijetProd = pA->p4().eta()*pB->p4().eta();
   if(oppositeHemisphere && dijetProd>=0){continue;}
  •  // Testing dijet mass
    
  •  double invMass = diJet.mass();
    

- if(invMass<=minInvMass || invMass>maxInvMass){continue;}

  • // Testing dijet delta eta
    double dEta = fabs(pA->p4().eta()-pB->p4().eta());
    if(dEta<=minDeltaEta || dEta>maxDeltaEta){continue;}
    @@ -92,6 +82,14 @@ bool VBFGenJetFilter::filter(edm::Event& iEvent, const edm::EventSetup& iSetup)
    // Testing dijet delta phi
    double dPhi = fabs(reco::deltaPhi(pA->p4().phi(),pB->p4().phi()));
    if(dPhi<=minDeltaPhi || dPhi>maxDeltaPhi){continue;}
    +
  •  // Getting the dijet vector
    
  •  math::XYZTLorentzVector diJet = pA->p4() + pB->p4();
    
  •  // Testing dijet mass
    
  •  double invMass = diJet.mass();
    
  •  if(invMass<=minInvMass || invMass>maxInvMass){continue;}
    
  • return true;
    }

@chayanit
Copy link
Author

chayanit commented Jan 6, 2016

Hi @davidlange6,

Thanks for your reply. Let me link you to @joaopela who is the owner of these codes. He has some questions about your comments.

Best,
Chayanit

@joaopela
Copy link
Contributor

joaopela commented Jan 6, 2016

I agree with the removing of the TMath.h and the inclusion of " a<filGenJets.size()-1". But i do not understand the rest of the requests.

  1. Why, would I want to remove the cut on the dijet invariant mass? This is exactly one of the cuts that we want to require on sample generation/filtering.

  2. The presence of a separated filterGenJets optimises the number of operations per event. Lets look at the example with 20 genJets with only 3 that pass pT and eta requirements:

=> with filterGenJets filtering operations:
20x compare pTmin, etaMinm etaMax (with filterGenJets)
3x mjj calc and dijet var compare (over selected jets only, since combinations of 2 over 3 is 3 possible pairs)

=> without filterGenJets filtering operations (Conbinations of 2 over 20 is 190 possible pairs):
190x (2x one per jet) compare pTmin, etaMinm etaMax
190x mjj calc and dijet var compare

Clearly, pre filtering the generator jets reduces event-per-event computation time.

@joaopela
Copy link
Contributor

I forgot to tag @davidlange6 in the last post.

@davidlange6
Copy link
Contributor

@chayanit @joaopela - sorry for the delay - I'll clarify so that this can be iterated on in the development release while this PR is approved since I have not had time to follow up.

  1. Why, would I want to remove the cut on the dijet invariant mass? This is exactly one of the cuts that >we want to require on sample generation/filtering.

its not - just moved lower as its the expensive calc to make

  1. The presence of a separated filterGenJets optimises the number of operations per event. Lets look at >the example with 20 genJets with only 3 that pass pT and eta requirements:

Right,but function calls are also expensive. anyway a detail.

davidlange6 added a commit that referenced this pull request Feb 7, 2016
VBF filters for QCD sample requested by VBF InvHiggs group
@davidlange6 davidlange6 merged commit c865f65 into cms-sw:CMSSW_7_1_X Feb 7, 2016
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.

None yet

6 participants