Acceptance calculation
I am using the following command to calculate the acceptance weights to add to the candidates in a given sample:
from analysis.efficiency import get_acceptance
df = ...
acc = get_acceptance({'variables':['q2','ctl','ctk','phi'],'generation':{'name':genConf,'rename-vars':{'q2_MC':'q2'}},'reconstruction':{'name':recConf,'rename-vars':{'q2_PVandBDTF':'q2'}}})
w = acc.get_fit_weights(df)
where genConf
and recConf
are the strings corresponding to the YAML files with the Legendre coefficients describing the gen-level and rec-level distributions.
I see that this requires a huge amount of time, do you know if there is a better way to achieve the same result? Essentially I would like to add a column with the acceptance weights to the sample.