Fork me on GitHub

Opened 9 years ago

Closed 8 years ago

#725 closed How to (fixed)

How to add fake rate from jets to lepton in delphes-3.1.2

Reported by: degos Owned by:
Priority: major Milestone:
Component: Delphes code Version: Delphes 3
Keywords: Cc:

Description

Hi,
I want to analyze the signal 3leptons+jet+missing ET, and consider the background Z+jets. Therefore, I need to randomly convert a jet into a fake electron or muon.

In delphes-3.1.2, How to write a module that randomly creates "converts" jets into fake electrons as a function of the jet pt, eta?

Many thanks.
degos

Attachments (9)

test.tcl (21.0 KB ) - added by Michele Selvaggi 9 years ago.
test_v2.tcl (21.0 KB ) - added by Michele Selvaggi 9 years ago.
tag_1_pythia_events.hep.gz (23.0 MB ) - added by degos 9 years ago.
run_03_tag_1_banner.txt (46.8 KB ) - added by degos 9 years ago.
test_v2.2.tcl (21.0 KB ) - added by degos 9 years ago.
test.C (5.4 KB ) - added by Michele Selvaggi 9 years ago.
bb.lhco (351.5 KB ) - added by degos 9 years ago.
bb_ms.lhco (349.7 KB ) - added by Michele Selvaggi 9 years ago.
test_v3.tcl (21.2 KB ) - added by Michele Selvaggi 9 years ago.

Change History (35)

by Michele Selvaggi, 9 years ago

Attachment: test.tcl added

comment:1 by Michele Selvaggi, 9 years ago

Hi Degos,

we have included a module called JetFakeParticle that produces jet fakes to electrons, muons or photons.
In the attached card you'll see an example on how to use it. Make sure you replace the probabilities with the correct parametrisation.

Also, make sure you take the latest version:

git clone https://github.com/delphes/delphes.git

Cheers,
Michele

comment:2 by degos, 9 years ago

Hi Michele,
Thank you for reply. I have some new problems on the test.tcl and Delphes3.2.0:

  1. The test.tcl only contains the rates of jet --> 11, 13. Why not add the corresponding rates of

jet ---> -11 (positron), -13 (muon+)? namely,
add EfficiencyFormula {-11} { (eta <= 2.5) * (pt > 20.0) * (0.30)}

  1. I test on the test.tcl and Delphes3.2.0 using g g > jj process.

I find that the number of e+ is much larger than that of e-, and almost is twice of e-.

The detailed operations are:

  1. I first install Delphes3.2.0, and use the madgraph5 generate gg > jj events.

I completely replace the content of Delphes_card.dat in madgraph5 with test.tcl, and then let the
madgraph5 call Delphes3.2.0 to reconstruct the events. Is this approach of running Delphes-3.2.0 correct?

  1. For simply, we assume the jet only to be misidentified as electron, and modify the rate like the

following:

add EfficiencyFormula {11} { (eta <= 2.5) * (pt > 20.0) * (1.00)}
add EfficiencyFormula {13} { (eta <= 2.5) * (pt > 20.0) * (0.00)}
add EfficiencyFormula {22} { (eta <= 2.5) * (pt > 20.0) * (0.00)}

In the reconstructed level, I find that all jet are misidentified as e+ and e- since rate of j-> e
is taken as 100%. However, the number of e+ is much larger than that of e-, and almost is twice of e-.
How to understand this problem?

Many thanks.

comment:3 by Michele Selvaggi, 9 years ago

Hi Degos,

I have pushed some modification. Could you try and check if the problem you mention is fixed please?

Thanks
Michele

comment:4 by degos, 9 years ago

Hi Michele,

Using the new codes, the numbers of e+ and e- are comparable.

Many thanks.

by Michele Selvaggi, 9 years ago

Attachment: test_v2.tcl added

comment:5 by Michele Selvaggi, 9 years ago

Attached "test_v2.tcl" following discussion on ticket #731.

comment:6 by degos, 9 years ago

Hi mselvaggi,
Thank you for your reply. The b-jet and tau-jet can be obtained using the test_v2.tcl.
I still have three problems on the codes:

  1. I generate 50000 gg > bb~ events using the Madgraph5 (PT >20). Although the fake rates of jets to electrons, muons, photon and tau lepton are taken as zero, and I still obtain 13 e+ and e-, 7 mu+ and mu-, 59 photons, 211 tau+ and 222 tau-. Maybe these particles are from decay of heavy meson, but I feel that the number of tau-jets seems to be too many.

The fake rates of jets to electrons, muons, photon are taken as 0. The tau-tagging module is set as the follows:
module TauTagging TauTagging {

set ParticleInputArray Delphes/allParticles
set PartonInputArray Delphes/partons
set JetInputArray JetEnergyScale/jets
set DeltaR 0.5
set TauPTMin 1.0
set TauEtaMax 2.5

add EfficiencyFormula {0} {0.000}
add EfficiencyFormula {15} {0.60}

}

  1. If I take a large fake rate of jet to tau, the number of tau+ is much larger than tau-.

For example,
add EfficiencyFormula {0} {0.4},
add EfficiencyFormula {15} {0.60},
I can obtain 13333 tau+ and 9516 tau-.

  1. By the way, does the electric charge sign of faked tau-jet depend on the charge of quark? For example, the minus charge quark is only misidentified as the minus charge tau-jet.

Many thanks.

comment:7 by Michele Selvaggi, 9 years ago

Hi,

  1. leptons should be coming from semi-leptonic b decay and photons from pi0's. I am not sure why you have more taus, but keep in mind that leptons are isolated tau-jets whereas are not. This might explain the difference.
  1. If I set the fake rate to 100% for tau's I get approx. equal amount of (+) and (-). This is because of point 3.
  1. If a tau parton is found within a jet, the jet charge is set to the charge of the tau parton. If the tau is a fake (i.e. , no tau is found), the charge should be simply a flip coin.

Cheers,
Michele

comment:8 by degos, 9 years ago

Hi Michele,
Many thanks for your help. However, I find that the numbers of faked tau+ and tau- are not consistent with your explanations for the second and third points.

I generate 50000 g g > b b~ events using madgraph5, delphes3.2.0 and test_v2.tcl (PT(j) > 20, PT(b) > 20). In the tau-tagging module:

For

add EfficiencyFormula {0} {1.00}
add EfficiencyFormula {15} {0.00}

I obtain 32545 tau+ and 23204 tau-.

For

add EfficiencyFormula {0} {0.00}
add EfficiencyFormula {15} {1.00}

354 tau+ and 333 tau- are obtained.

For

add EfficiencyFormula {0} {1.00}
add EfficiencyFormula {15} {1.00}

I obtain 33063 tau+ and 23619 tau-.

For tau is a fake, the plus charge taus are much more than the minus taus.
Where am I wrong?

Many thanks.

comment:9 by Michele Selvaggi, 9 years ago

Hi,

this is what I am getting, for 10k events:

For

add EfficiencyFormula? {0} {1.00}
add EfficiencyFormula? {15} {0.00}

I obtain 6009 tau+ and 5913 tau-.

For

add EfficiencyFormula? {0} {0.00}
add EfficiencyFormula? {15} {1.00}

82 tau+ and 69 tau- are obtained.

For

add EfficiencyFormula? {0} {1.00}
add EfficiencyFormula? {15} {1.00}

I obtain 6037 tau+ and 6027 tau-.

Can you please re-run with the latest github version by running Delphes on standalone? I suspect you might be using an older version that contains a bug.

Thanks
Michele

by degos, 9 years ago

Attachment: tag_1_pythia_events.hep.gz added

by degos, 9 years ago

Attachment: run_03_tag_1_banner.txt added

by degos, 9 years ago

Attachment: test_v2.2.tcl added

comment:10 by degos, 9 years ago

Hi Michele,

Thank you for your reply. I stil find that tau+ is much more than tau-.
My detailed operations are as follows:

  1. git clone https://github.com/delphes/delphes.git

cd delphes
make

  1. Using Madgraph5 generate 10K gg > b b~ events, and Madgraph5 calls pythia to perform parton shower and hadronization.
  1. Copy "tag_1_pythia_events.hep.gz" generated by Madgraph5 to the delphes folder.
  1. cd delphes

gunzip tag_1_pythia_events.hep.gz
./DelphesSTDHEP cards/test_v2.tcl bb.root tag_1_pythia_events.hep
./root2lhco bb.root bb.lhco

I keep all the default set of files in delphes. For the test_v2.tcl, the fake rate of jet to electron, muon and photon are taken as 0.
For the tau-tagging module,

add EfficiencyFormula {0} {1.00}
add EfficiencyFormula {15} {0.00}

I obtain 6561 tau+ and 4619 tau-. In fact, the results are consistent with those of Madgraph5 calling the delphes directly.

Attached please find the "hep.gz", test_v2.tcl, banner.txt file which is for the 1800 gg > bb~ events. Using the above approaches, I obtain 1202 tau+ and 840 tau- for 1800 gg > bb~.

I am really confused on this problem.
Many thanks.

comment:11 by degos, 9 years ago

Hi,
In addition, I use the user-friendly framework of Madanalysis5 to analyze the data. For each running of delphes, amount of tau+ and tau- has small deviation, respectively. But tau+ is always much more than tau-.

Best.

by Michele Selvaggi, 9 years ago

Attachment: test.C added

comment:12 by Michele Selvaggi, 9 years ago

Hi,

in the file you attached the number of events is 1.8k.

By running test.C (attached), I get

root -b -q test.C'("bb.root")'

tau + : 979
tau - : 1047

I get the same by running on the lhco.

Cheers,
Michele

comment:13 by degos, 9 years ago

Hi Michele,
Are your results by running on the lhco the same as your results of "bb.root", or my results?

I obtain the same results as yours using Madananlysis5 and root to analyze the "bb.root". However, for the corresponding lhco file, Madanalysis5 still gives the much more tau+. I suspect that there is something wrong with lhco or madanalysis5.

How do you produce the "lhco file" from "hep file" and analyze the "lhco file" with root? (I am not familiar with root.)

Could you give me your "bb.lhco file"? I want to use it to check the Madanalysis5?

Attached please find my "lhco file".

Many thanks.

by degos, 9 years ago

Attachment: bb.lhco added

by Michele Selvaggi, 9 years ago

Attachment: bb_ms.lhco added

comment:14 by Michele Selvaggi, 9 years ago

I have attached the lhco file.
I simply analyse root file with root.
The lhco file I simply read charges value as i fill it with the root2lhco macro.

There is either a problem with the root2lhco converter, either with mad analysis as you say.

Cheers,
Michele

comment:15 by degos, 9 years ago

Hi,
Using your "bb_ms.lhco" file, Madanalysis5 gives 1165 tau+ and 861 tau-.

Do I determine that the problem is from Madanalysis5?

Many thanks.

comment:16 by Michele Selvaggi, 9 years ago

It is possible.

Maybe it expects for tau a charge value of 1 or 3 or something related to this.

See:

http://madgraph.phys.ucl.ac.be/Manual/lhco.html

Good luck,
Michele

comment:17 by degos, 9 years ago

Hi Michele,

After the discussions with author of Madanalysis5, we find that some taus have ntrk=0 in the LHCO file.
Madanalysis5 cannot handle them.

Is the tau with ntrk=0 in the LHCO file produced by the bug of delphes?

Best

comment:18 by Michele Selvaggi, 9 years ago

Hi, this should be fixed now, please fetch latest github version.

Michele

comment:19 by degos, 9 years ago

Hi Michele,

Many thanks for your help. The problem is well solved.

Best

comment:20 by degos, 9 years ago

Hi Michele,
I find that many results of test_v2.tcl and delphes3.2.0 are much different from that delphes3.1.0. Some of them are bugs. For all the following processes, the fake rates of jet to lepton and photon are taken as zero.

  1. For 10000 p p > z, z > e+ e-, test_v2.tcl and delphes3.2.0 only give several hundreds of e+ and e-. This should be a bug.
  1. For 10000 p p > z z, z > vl vl~, z > mu+ mu-, distributions of MET given by the test_v2.tcl and delphes3.2.0 are much different from delphes3.1.2. The peak of the former appears at the very small energy, not near Z mass. This also should be a bug.
  1. For 10000 p p > z, z > b b~, ignoring the misidentified rate from light jets and c-quark. For the same flat efficiency of b-tagging, 0.7, I obtain 5131 b-jets from test_v2.tcl and delphes3.2.0, but 6655 b-jets from delphes3.1.2.
  1. For 10000 p p > z, z > ta+ ta-, tau-tagging mudule is set as

add EfficiencyFormula {0} {0.00}
add EfficiencyFormula {15} {1.00}

I obtain 3484 tau+ and 3541 tau- from test_v2.tcl and delphes3.2.0, but 3321 tau+ and 3374 tau- from delphes3.1.2.

In fact, my original motivation is analysis of z + jets where jet is misidentified as lepton. Is there a safe
approache of adding the fake lepton to delphes and keeping the other functions unaffected simultaneously?

Many thanks.

Version 0, edited 9 years ago by degos (next)

comment:21 by Michele Selvaggi, 9 years ago

Hi Degos,

sorry for the very late reply. Most of your findings actually are the results of some bug we introduced during a recent commit of last week.
We are working on it and hopefully we'll sort this out soon.

Thanks for pointing this to us. I'll update this ticket when things are fixed.

Michele

by Michele Selvaggi, 9 years ago

Attachment: test_v3.tcl added

comment:22 by Michele Selvaggi, 9 years ago

Hi,

can you try now with the new card I have attached and by pulling the HEAD version from git?
All the points you mentioned should be fixed now.

Please note that probably tomorrow we will release a new version which contains the changes in HEAD.
Also, concerning point 3, we will update the btagging efficiencies and mistag rates to recent ATLAS and CMS publications.

Let us know if everything works properly now.

Thanks,
Michele

comment:23 by degos, 9 years ago

Hi Michele,

Many thanks for your reply.
For the 4th point, more taus are obtained: 3892 tau+ and 3981 tau-. The other points are well solved.

Best

comment:24 by S. Niyogi, 8 years ago

Hello,

I reopen old thread as my question is related to jet faking as leptons.

I see the two test.tcl file (v2 and v3). I can see the faking was present in v2, but absent in v3.
In v3 line 522

add EfficiencyFormula {11} { (eta <= 2.5) * (pt > 20.0) * (0.00)}
add EfficiencyFormula {13} { (eta <= 2.5) * (pt > 20.0) * (0.00)}
add EfficiencyFormula {22} { (eta <= 2.5) * (pt > 20.0) * (0.00)}

In v2 line 508

add EfficiencyFormula {11} { (eta <= 2.5) * (pt > 20.0) * (0.30)}
add EfficiencyFormula {13} { (eta <= 2.5) * (pt > 20.0) * (0.30)}
add EfficiencyFormula {22} { (eta <= 2.5) * (pt > 20.0) * (0.30)}

So, if I want the fake rate as 1%, then just replace 0.30 by 0.01. Is that correct ? Also,
the PID for electron 11 is used, not for positron (i.e. -11). Does delphes automatically
understand that 11 is for both e- and e+ ?

Thanks for sharing tcl files.

Regards,
Saurabh

comment:25 by Michele Selvaggi, 8 years ago

Please see answer to ticket #1026.

comment:26 by Michele Selvaggi, 8 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.