Madanalysis not working with interference events

Asked by hprager on 2018-05-03

Hello,

I'm trying to use MA5 to recast a search using an event file I generated with MadGraph with a model featuring an extra vector-like quark T:

define tt = t t~
define bb = b b~
define W = w+ w-
generate p p > W bb j / bp x y QED^2==4 VLQ^2==2

It represents the interference term between the signal and the SM background and sometime gives negative cross section. I'm interested in the influence of the cuts on the events so I fed MA5 with my event file giving a cross section equal to 1 to prevent having problems with the negative cross section, and I want to get the efficiency after the cuts. Yet MA5 crashes and gives me this error message:

+----------------------------------------------------------------------------------------------------------------------+
| LogReport-Warning |
+----------------------------------------------------------------------------------------------------------------------+
| Message NIterations @ File Line |
|----------------------------------------------------------------------------------------------------------------------|
| Filling an histogram with not all SRs surviv 16 RegionSelection/RegionSelectionManager.cpp 136 |
+----------------------------------------------------------------------------------------------------------------------+
    * Goodbye.
MA5: Restoring the PAD located in /home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/PAD
MA5: Compiling the PAD located in /home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/PAD
MA5: How many cores for the compiling? default = max = 12
MA5: => Number of cores used for the compilation = 12
MA5: Calculation of the exclusion CLs
Traceback (most recent call last):
  File "./bin/ma5", line 70, in <module>
    madanalysis.core.launcher.LaunchMA5(version, date, ma5dir)
  File "/home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/madanalysis/core/launcher.py", line 397, in LaunchMA5
    repeat = MainSession(mode,arglist,ma5dir,version,date)
  File "/home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/madanalysis/core/launcher.py", line 302, in MainSession
    interpreter.cmdloop()
  File "/apps/python/2.7.8/lib/python2.7/cmd.py", line 142, in cmdloop
    stop = self.onecmd(line)
  File "/apps/python/2.7.8/lib/python2.7/cmd.py", line 221, in onecmd
    return func(arg)
  File "/home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/madanalysis/interpreter/interpreter.py", line 283, in do_submit
    self.cmd_submit.do(self.split_arg(line),self.history)
  File "/home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/madanalysis/interpreter/cmd_submit.py", line 88, in do
    return self.do_submit(args,history)
  File "/home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/madanalysis/interpreter/cmd_submit.py", line 221, in do_submit
    if not self.submit(filename,history):
  File "/home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/madanalysis/interpreter/cmd_submit.py", line 392, in submit
    if not Recaster.analysis():
  File "/home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/madanalysis/misc/run_recast.py", line 286, in analysis
    if not self.analysis_single(version, card):
  File "/home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/madanalysis/misc/run_recast.py", line 341, in analysis_single
    if not self.compute_cls(analyses,myset):
  File "/home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/madanalysis/misc/run_recast.py", line 518, in compute_cls
    self.write_cls_output(analysis, regions, regiondata, mysummary, xsflag)
  File "/home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/madanalysis/misc/run_recast.py", line 805, in write_cls_output
    stat = (math.sqrt(eff*(1-eff)/regiondata[reg]["N0"]))
ValueError: math domain error

I still get the cutflow that I checked but I am surprised by the results

"Initial number of events" #
3823 6177 # nentries
8.133012e-05 -1.314089e-04 # sum of weights
1.730209e-12 2.795579e-12 # sum of weights^2
</InitialCounter>

<Counter>
"1 electron with pT>40 and eta<2.1"# 1st cut
159 269 # nentries
3.382550e-06 -5.722679e-06 # sum of weights
7.196003e-14 1.217437e-13 # sum of weights^2
</Counter>

[...]

<Counter>
"ST > 500 GeV" # 9st cut
3 5 # nentries
6.382170e-08 -1.063695e-07 # sum of weights
1.357736e-15 2.262894e-15 # sum of weights^2

I am used to have all the events in the first column of the cutflow, and not split between the two first column, what does that mean? Also can I simply add the number of events remaining (here 3+5=8) and divide them by the initial number of events (here 10k) to obtain the efficiency?

Best,
Hugo Prager

Question information

Language:
English Edit question
Status:
Answered
For:
MadAnalysis 5 Edit question
Assignee:
No assignee Edit question
Last query:
2018-05-04
Last reply:
2018-05-04
Benjamin Fuks (fuks) said : #1

Hi Hugo,

The crash comes from the fact that the total number of events is negative. The statistics module has never been planned to handle this.

The two columns in the cutflow table respectively correspond to the contribution of the positively-weighted events and the negatively-weighted events. When one sums these two numbers, we have a total negative number of events.

Regards,

Benjamin

> On 3 May 2018, at 17:12 , hprager <email address hidden> wrote:
>
> New question #668556 on MadAnalysis 5:
> https://answers.launchpad.net/madanalysis5/+question/668556
>
> Hello,
>
> I'm trying to use MA5 to recast a search using an event file I generated with MadGraph with a model featuring an extra vector-like quark T:
>
> define tt = t t~
> define bb = b b~
> define W = w+ w-
> generate p p > W bb j / bp x y QED^2==4 VLQ^2==2
>
> It represents the interference term between the signal and the SM background and sometime gives negative cross section. I'm interested in the influence of the cuts on the events so I fed MA5 with my event file giving a cross section equal to 1 to prevent having problems with the negative cross section, and I want to get the efficiency after the cuts. Yet MA5 crashes and gives me this error message:
>
>
> +----------------------------------------------------------------------------------------------------------------------+
> | LogReport-Warning |
> +----------------------------------------------------------------------------------------------------------------------+
> | Message NIterations @ File Line |
> |----------------------------------------------------------------------------------------------------------------------|
> | Filling an histogram with not all SRs surviv 16 RegionSelection/RegionSelectionManager.cpp 136 |
> +----------------------------------------------------------------------------------------------------------------------+
> * Goodbye.
> MA5: Restoring the PAD located in /home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/PAD
> MA5: Compiling the PAD located in /home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/PAD
> MA5: How many cores for the compiling? default = max = 12
> MA5: => Number of cores used for the compilation = 12
> MA5: Calculation of the exclusion CLs
> Traceback (most recent call last):
> File "./bin/ma5", line 70, in <module>
> madanalysis.core.launcher.LaunchMA5(version, date, ma5dir)
> File "/home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/madanalysis/core/launcher.py", line 397, in LaunchMA5
> repeat = MainSession(mode,arglist,ma5dir,version,date)
> File "/home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/madanalysis/core/launcher.py", line 302, in MainSession
> interpreter.cmdloop()
> File "/apps/python/2.7.8/lib/python2.7/cmd.py", line 142, in cmdloop
> stop = self.onecmd(line)
> File "/apps/python/2.7.8/lib/python2.7/cmd.py", line 221, in onecmd
> return func(arg)
> File "/home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/madanalysis/interpreter/interpreter.py", line 283, in do_submit
> self.cmd_submit.do(self.split_arg(line),self.history)
> File "/home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/madanalysis/interpreter/cmd_submit.py", line 88, in do
> return self.do_submit(args,history)
> File "/home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/madanalysis/interpreter/cmd_submit.py", line 221, in do_submit
> if not self.submit(filename,history):
> File "/home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/madanalysis/interpreter/cmd_submit.py", line 392, in submit
> if not Recaster.analysis():
> File "/home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/madanalysis/misc/run_recast.py", line 286, in analysis
> if not self.analysis_single(version, card):
> File "/home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/madanalysis/misc/run_recast.py", line 341, in analysis_single
> if not self.compute_cls(analyses,myset):
> File "/home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/madanalysis/misc/run_recast.py", line 518, in compute_cls
> self.write_cls_output(analysis, regions, regiondata, mysummary, xsflag)
> File "/home/soton/eisst051/madanalysis5_v1.6beta_13Rwbj_test/madanalysis/misc/run_recast.py", line 805, in write_cls_output
> stat = (math.sqrt(eff*(1-eff)/regiondata[reg]["N0"]))
> ValueError: math domain error
>
> I still get the cutflow that I checked but I am surprised by the results
>
> "Initial number of events" #
> 3823 6177 # nentries
> 8.133012e-05 -1.314089e-04 # sum of weights
> 1.730209e-12 2.795579e-12 # sum of weights^2
> </InitialCounter>
>
> <Counter>
> "1 electron with pT>40 and eta<2.1"# 1st cut
> 159 269 # nentries
> 3.382550e-06 -5.722679e-06 # sum of weights
> 7.196003e-14 1.217437e-13 # sum of weights^2
> </Counter>
>
> [...]
>
> <Counter>
> "ST > 500 GeV" # 9st cut
> 3 5 # nentries
> 6.382170e-08 -1.063695e-07 # sum of weights
> 1.357736e-15 2.262894e-15 # sum of weights^2
>
>
> I am used to have all the events in the first column of the cutflow, and not split between the two first column, what does that mean? Also can I simply add the number of events remaining (here 3+5=8) and divide them by the initial number of events (here 10k) to obtain the efficiency?
>
> Best,
> Hugo Prager
>
> --
> You received this question notification because you are an answer
> contact for MadAnalysis 5.
>

hprager (prager-hugo) said : #2

Thanks for your answer. Then does is make sense to add the number of positive and negative events remaining after the cuts to get a selection efficiency?

Benjamin Fuks (fuks) said : #3

Hi Hugo,

This is what needs to be done. Positive and negative weigths must be summed to get the full number of events. In your case, this sum is negative, which leads to the crash.

Cheers,

B>

> On 4 May 2018, at 15:27 , hprager <email address hidden> wrote:
>
> Question #668556 on MadAnalysis 5 changed:
> https://answers.launchpad.net/madanalysis5/+question/668556
>
> Status: Answered => Open
>
> hprager is still having a problem:
> Thanks for your answer. Then does is make sense to add the number of
> positive and negative events remaining after the cuts to get a selection
> efficiency?
>
> --
> You received this question notification because you are an answer
> contact for MadAnalysis 5.
>

Can you help with this problem?

Provide an answer of your own, or ask hprager for more information if necessary.

To post a message you must log in.