Open coolalexzb opened 4 years ago
All that is needed to create a model is a valid spec (c.f. pyhf.pdf.Model
API) and a valid spec is anything that passes pyhf inspect
. So while using pyhf.workspace.Workspace
is a very natural and normal way for us to do things it is not explicitly required.
For further reference, the pyhf
model JSON Schema is linked to in the first reference in the Likelihood Specifiaction bibliography (v1.0.0
of the schema that is).
pyhf.workspace.Workspace
doesn't accept a file path though, so all the examples above that pass in a string aren't valid.
Oh, I made an error in Situation 2 and 3. The input should be a Json type. I have modified them
If we initialize workspace in the way like situation 2 and 3 (we don't have a patchset.json in these situations), can we get data by workspace.data(model)
successfully in further steps? Is there any situation that I did not take into consideration? @matthewfeickert
If we initialize workspace in the way like situation 2 and 3 (we don't have a patchset.json in these situations), can we get data by
workspace.data(model)
successfully in further steps?
The patchset just gives the signal contribution to the statistical model. The data (observations + auxiliary data) are not part of the model and so pyhf.workspace.Workspace.data()
doesn't care if the model object does or doesn't have a signal component.
This is maybe made a bit more clear by just looking at the source for pyhf.workspace.Workspace.data
which is very short.
Is there any situation that I did not take into consideration?
I think this is fine. :+1: There are other ways to make models, but for what we're doing this covers all the cases we care about.
Currently, I want to make a summary of loading data. This is important to complete an automatic process.
Situation 1: background + signal (BkgOnly.json + patchset.json) e.g. BkgOnly.json + patchset.json
Situation 2: workspace.json e.g. HVTWZ_3500.json
Situation 3: BkgOnly.json
If there is any problem over the examples I wrote or any situations I ignored, feel free to add notes here. Thank you!