forked from jpata/particleflow
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CMS dataset relabel, generate v2.1.0 with more stats, separate binary…
… classifier (jpata#340) * dataset relabeling
- Loading branch information
Showing
20 changed files
with
442 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
"""CMS PF TTbar dataset.""" | ||
import cms_utils | ||
import tensorflow as tf | ||
|
||
import tensorflow_datasets as tfds | ||
|
||
X_FEATURES = cms_utils.X_FEATURES | ||
Y_FEATURES = cms_utils.Y_FEATURES | ||
|
||
_DESCRIPTION = """ | ||
Dataset generated with CMSSW and full detector sim. | ||
VBF events with PU 55-75 in a Run3 setup. | ||
""" | ||
|
||
# TODO(cms_pf): BibTeX citation | ||
_CITATION = """ | ||
""" | ||
|
||
|
||
class CmsPfVbf(tfds.core.GeneratorBasedBuilder): | ||
"""DatasetBuilder for cms_pf_vbf dataset.""" | ||
|
||
VERSION = tfds.core.Version("2.1.0") | ||
RELEASE_NOTES = { | ||
"1.7.1": "First version", | ||
"1.8.0": "Add ispu, genjets, genmet; disable genjet_idx; improved merging", | ||
"2.0.0": "New truth def based primarily on CaloParticles", | ||
"2.1.0": "Additional statistics", | ||
} | ||
MANUAL_DOWNLOAD_INSTRUCTIONS = """ | ||
rsync -r --progress lxplus.cern.ch:/eos/user/j/jpata/mlpf/tensorflow_datasets/cms/cms_pf_vbf ~/tensorflow_datasets/ | ||
""" | ||
|
||
def __init__(self, *args, **kwargs): | ||
kwargs["file_format"] = tfds.core.FileFormat.ARRAY_RECORD | ||
super(CmsPfVbf, self).__init__(*args, **kwargs) | ||
|
||
def _info(self) -> tfds.core.DatasetInfo: | ||
"""Returns the dataset metadata.""" | ||
return tfds.core.DatasetInfo( | ||
builder=self, | ||
description=_DESCRIPTION, | ||
features=tfds.features.FeaturesDict( | ||
{ | ||
"X": tfds.features.Tensor(shape=(None, len(X_FEATURES)), dtype=tf.float32), | ||
"ygen": tfds.features.Tensor(shape=(None, len(Y_FEATURES)), dtype=tf.float32), | ||
"ycand": tfds.features.Tensor(shape=(None, len(Y_FEATURES)), dtype=tf.float32), | ||
"genmet": tfds.features.Scalar(dtype=tf.float32), | ||
"genjets": tfds.features.Tensor(shape=(None, 4), dtype=tf.float32), | ||
} | ||
), | ||
supervised_keys=("X", "ygen"), | ||
homepage="", | ||
citation=_CITATION, | ||
metadata=tfds.core.MetadataDict(x_features=X_FEATURES, y_features=Y_FEATURES), | ||
) | ||
|
||
def _split_generators(self, dl_manager: tfds.download.DownloadManager): | ||
"""Returns SplitGenerators.""" | ||
path = dl_manager.manual_dir | ||
sample_dir = "VBF_TuneCP5_14TeV_pythia8_cfi" | ||
return cms_utils.split_sample(path / sample_dir / "raw") | ||
|
||
def _generate_examples(self, files): | ||
return cms_utils.generate_examples(files) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.