MadAnalysis / madanalysis5

A package for event file analysis and recasting of LHC results
http://madanalysis.irmp.ucl.ac.be
GNU General Public License v3.0
22 stars 18 forks source link

NO values for weights for a histogram #264

Open sarahwarad opened 2 days ago

sarahwarad commented 2 days ago

Question

Hello I hope you are doing well.

I use MA with MG. after generating a process and run MA, in the file bin/ANALYSIS_0/Output/Histos/MadAnalysis5job_0/selection_0.py, there is the code written in python language but all values in y1_M_0_weights are zeros. although the cross section is 3015 pb.

Can you help with this issue, please?

BFuks commented 2 days ago

Hi Sarah,

Could you please provide us information so that we could reproduce the problem?

Regards,

Benjamin

sarahwarad commented 1 day ago

thank you so much for your reply

can you clarify which information you need?

best regards Sarah

BFuks commented 1 day ago

Hi Sarah,

As I wrote, I need to be able to reproduce your problem. I therefore need your version of the code, a small sample of events representative to what you analysed, the MA5 script used, etc.

Regards,

Benjamin

sarahwarad commented 1 day ago

OK that is what I did:

I generated the process

Process p p > l+ l- /a [QCD] ; p p > l+ l- j /a [QCD] ; p p > l+ l- j /a [QCD] Run at p-p collider (6500.0 + 6500.0 GeV) Number of events generated: 10000 Total cross section: 5.603e+03 +- 1.9e+01 pb

Running MadAnalysis5 [arXiv:1206.1599] INFO: Hadron input files considered: INFO: --> /mainfs/scratch/swa1a19/MG5_aMC_v3_3_1/bin/dyjj/Events/run_01/events_PYTHIA8_0.hepmc.gz INFO: MadAnalysis5 now running the reconstruction 'BasicReco'... INFO: Follow Madanalysis5 run with the following command in a separate terminal: INFO: tail -f /mainfs/scratch/swa1a19/MG5_aMC_v3_3_1/bin/dyjj/Events/run_01/tag_1_MA5__reco_BasicReco.log INFO: MadAnalysis5 successfully completed the reconstruction 'BasicReco'. Links to the reconstructed event files are: INFO: --> /mainfs/scratch/swa1a19/MG5_aMC_v3_3_1/bin/dyjj/Events/run_01/events_PYTHIA8_0_BasicReco.lhe.gz INFO: MadAnalysis5 now running the 'analysis2_BasicReco' analysis... INFO: Follow Madanalysis5 run with the following command in a separate terminal: INFO: tail -f /mainfs/scratch/swa1a19/MG5_aMC_v3_3_1/bin/dyjj/Events/run_01/tag_1_MA5_analysis2_BasicReco.log ERROR: MadAnalysis5 failed to create PDF output INFO: MadAnalysis5 successfully completed the analysis 'analysis2_BasicReco'. Reported results are placed in: INFO: --> /mainfs/scratch/swa1a19/MG5_aMC_v3_3_1/bin/dyjj/Events/run_01/tag_1_MA5_hadron_analysis_analysis2_BasicReco.pdf INFO: Finished MA5 analyses.

In MA card

Uncomment the line below to skip this analysis altogether

@MG5aMC skip_analysis

@MG5aMC stdout_lvl=INFO

@MG5aMC inputs = .hepmc, .hep, .stdhep, .lhco, *.fifo

Reconstruction using FastJet

@MG5aMC reconstruction_name = BasicReco @MG5aMC reco_output = lhe

Multiparticle definition

define invisible = 14 -12 -16 16 12 -14 set main.fastsim.package = fastjet set main.fastsim.algorithm = antikt set main.fastsim.radius = 0.4 set main.fastsim.ptmin = 5.0

b-tagging

set main.fastsim.bjet_id.matching_dr = 0.4 set main.fastsim.bjet_id.efficiency = 1.0 set main.fastsim.bjet_id.misid_cjet = 0.0 set main.fastsim.bjet_id.misid_ljet = 0.0

tau-tagging

set main.fastsim.tau_id.efficiency = 1.0 set main.fastsim.tau_id.misid_ljet = 0.0

Analysis using the fastjet reco

@MG5aMC analysis_name = analysis2

Uncomment the next line to bypass this analysis

@MG5aMC skip_analysis

@MG5aMC set_reconstructions = ['BasicReco']

plot tunning: dsigma/sigma is plotted.

set main.stacking_method = normalize2one

object definition

define e = e+ e- define mu = mu+ mu- select (j) PT > 20 select (b) PT > 20 select (e) PT > 10 select (mu) PT > 10 select (j) ABSETA < 2.5 select (b) ABSETA < 2.5 select (e) ABSETA < 2.5 select (mu) ABSETA < 2.5

Basic plots

plot MET 40 0 500 plot THT 40 0 500

basic properties of the non-b-tagged jets

plot PT(j[1]) 40 0 500 [logY] plot ETA(j[1]) 40 -10 10 [logY] plot MT_MET(j[1]) 40 0 500 [logY] plot PT(j[2]) 40 0 500 [logY] plot ETA(j[2]) 40 -10 10 [logY] plot MT_MET(j[2]) 40 0 500 [logY]

basic properties of the leptons

plot PT(e[1]) 40 0 500 [logY] plot PT(e[2]) 40 0 500 [logY] plot ETA(e[2]) 40 -10 10 [logY] plot MT_MET(e[2]) 40 0 500 [logY] plot PT(mu[1]) 40 0 500 [logY] plot ETA(mu[1]) 40 -10 10 [logY] plot MT_MET(mu[1]) 40 0 500 [logY] plot PT(mu[2]) 40 0 500 [logY] plot ETA(mu[2]) 40 -10 10 [logY] plot MT_MET(mu[2]) 40 0 500 [logY]

Invariant-mass distributions

plot M(e[1] e[2]) 40 0 500 [logY] plot M(e[1] mu[1]) 40 0 500 [logY] plot M(e[1] mu[2]) 40 0 500 [logY] plot M(e[2] mu[1]) 40 0 500 [logY] plot M(e[2] mu[2]) 40 0 500 [logY] plot M(j[1] e[1]) 40 0 500 [logY] plot M(j[1] e[2]) 40 0 500 [logY] plot M(j[1] j[2]) 40 0 500 [logY] plot M(j[1] mu[1]) 40 0 500 [logY] plot M(j[1] mu[2]) 40 0 500 [logY] plot M(j[2] e[1]) 40 0 500 [logY] plot M(j[2] e[2]) 40 0 500 [logY] plot M(j[2] mu[1]) 40 0 500 [logY] plot M(j[2] mu[2]) 40 0 500 [logY] plot M(mu[1] mu[2]) 40 0 500 [logY]

Angular distance distributions

plot DELTAR(e[1],e[2]) 40 0 10 [logY] plot DELTAR(e[1],mu[1]) 40 0 10 [logY] plot DELTAR(e[1],mu[2]) 40 0 10 [logY] plot DELTAR(e[2],mu[1]) 40 0 10 [logY] plot DELTAR(e[2],mu[2]) 40 0 10 [logY] plot DELTAR(j[1],e[1]) 40 0 10 [logY] plot DELTAR(j[1],e[2]) 40 0 10 [logY] plot DELTAR(j[1],j[2]) 40 0 10 [logY]

muR FxFx merging scale muF1 FxFx merging scale muF2 FxFx merging scale QES H_T/2 := sum_i mT(i)/2, i=final state 1 0.330000E+00 2 0.330000E+00 3 0.500000E+00 4 0.150000E+01 5 0.480000E+01 11 0.510999E-03 13 0.105658E+00 15 0.177682E+01 21 0.000000E+00

2212 2212 0.65000000E+04 0.65000000E+04 -1 -1 244800 244800 -4 1 0.56028641E+04 0.18525980E+02 0.97657642E+04 0

then from MA I did

import /mainfs/scratch/swa1a19/MG5_aMC_v3_3_1/bin/dyjj/Events/run_01/events_PYTHIA8_0.hepmc.gz define e = e+ e- define mu = mu+ mu- select (j) PT > 20 select (mu) PT > 10 select (e) PT > 15 select (j) ABSETA < 2.4 select (e) ABSETA < 2.5 select (mu) ABSETA < 2.4 select (j) DELTAR(j) = 0.4 select (l) DELTAR(l) = 0.3 select (mu) DELTAR(l) = 0.3 define l+ = mu+ e+ define l- = mu- e- define l= l+ l- select (j) PT > 20 select (mu) PT > 10 select (l) DELTAR(l) = 0.3 plot M(j[1] j[2]) 100 0 1000 submit

then in the file bin/ANALYSIS_0/Output/Histos/MadAnalysis5job_0/selection_0.py

all values of Y axis are zeros

Library import

import numpy
import matplotlib
import matplotlib.pyplot   as plt
import matplotlib.gridspec as gridspec

# Library version
matplotlib_version = matplotlib.__version__
numpy_version      = numpy.__version__

# Histo binning
xBinning = numpy.linspace(0.0,1000.0,101,endpoint=True)

# Creating data sequence: middle of each bin
xData = numpy.array([5.0,15.0,25.0,35.0,45.0,55.0,65.0,75.0,85.0,95.0,105.0,115.0,125.0,135.0,145.0,155.0,165.0,175.0,185.0,195.0,205.0,215.0,225.0,235.0,245.0,255.0,265.0,275.0,285.0,295.0,305.0,315)

# Creating weights for histo: y1_M_0
y1_M_0_weights = numpy.array([0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0)

# Creating a new Canvas
fig   = plt.figure(figsize=(8.75,6.25),dpi=80)
frame = gridspec.GridSpec(1,1)
pad   = fig.add_subplot(frame[0])

# Creating a new Stack
pad.hist(x=xData, bins=xBinning, weights=y1_M_0_weights,\
         label="$defaultset$", rwidth=1.0,\
         color="#5954d8", edgecolor="#5954d8", linewidth=1, linestyle="solid",\
         bottom=None, cumulative=False, density=False, align="mid", orientation="vertical")

# Axis
plt.rc('text',usetex=False)
plt.xlabel(r"$M$ $[ j_{1} j_{2} ]$ $(GeV/c^{2})$ ",\
           fontsize=16,color="black")
plt.ylabel(r"$\mathrm{Events}$ $(\mathcal{L}_{\mathrm{int}} = 10\ \mathrm{fb}^{-1})$ ",\
           fontsize=16,color="black")

# Boundary of y-axis
ymax=(y1_M_0_weights).max()*1.1
ymin=0 # linear scale
#ymin=min([x for x in (y1_M_0_weights) if x])/100. # log scale
plt.gca().set_ylim(ymin,ymax)

# Log/Linear scale for X-axis
plt.gca().set_xscale("linear")
#plt.gca().set_xscale("log",nonpositive="clip")

# Log/Linear scale for Y-axis
plt.gca().set_yscale("linear")
#plt.gca().set_yscale("log",nonpositive="clip")

# Saving the image
plt.savefig('../../HTML/MadAnalysis5job_0/selection_0.png')
plt.savefig('../../PDF/MadAnalysis5job_0/selection_0.png')
plt.savefig('../../DVI/MadAnalysis5job_0/selection_0.eps')
BFuks commented 1 day ago

Hi Sarah,

Please, share an event file with O(10) events, and the MA5 script you use to analyse it as a file. Otherwise, this will be too much of a burden for me...

Cheers,

Benjamin