{"id":50672582,"url":"https://github.com/gipert/gerda-factory","last_synced_at":"2026-06-08T12:32:51.350Z","repository":{"id":49641487,"uuid":"192625183","full_name":"gipert/gerda-factory","owner":"gipert","description":"GERDA pseudo experiment generation toolbox 🏭","archived":false,"fork":false,"pushed_at":"2022-08-31T09:39:13.000Z","size":616,"stargazers_count":0,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-05T19:04:13.877Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gipert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-18T23:26:16.000Z","updated_at":"2022-08-29T10:19:59.000Z","dependencies_parsed_at":"2023-01-16T21:15:29.261Z","dependency_job_id":null,"html_url":"https://github.com/gipert/gerda-factory","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/gipert/gerda-factory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gipert%2Fgerda-factory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gipert%2Fgerda-factory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gipert%2Fgerda-factory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gipert%2Fgerda-factory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gipert","download_url":"https://codeload.github.com/gipert/gerda-factory/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gipert%2Fgerda-factory/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34063150,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-08T12:32:48.828Z","updated_at":"2026-06-08T12:32:51.336Z","avatar_url":"https://github.com/gipert.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\".github/gerda-logo.png\" align=\"left\"  height=\"80\"/\u003e\n\n# gerda-factory\n\nJSON-configurable set of tools to generate statistical realizations of typical\nGERDA energy spectra. The `gerda-factory` program allows to take into account\n(randomly) generic energy-dependent deformations, and therefore can be useful\nfor studies of systematic uncertainties.\n\n### `gerda-fake-gen`\n\n1. compile the project by running `make` at the top of the directory tree. The\n   only external dependency is [ROOT](https://root.cern.ch/).\n2. acquire the official GERDA PDFs:\n   ```console\n   cd data\n   ./get-pdfs\n   ```\n3. write a JSON config file (examples under `config/`, see last section for a\n   brief explanation of the syntax)\n4. run `gerda-fake-gen \u003cjson-file\u003e` to generate a random experiment\n\n### `gerda-factory`\n\n1. compile the project by running `make` at the top of the directory tree.\n2. acquire the official GERDA PDFs:\n   ```console\n   cd data\n   ./get-pdfs\n   ```\n3. compute distortion functions from the different PDF versions:\n   ```console\n   cd data\n   ./compute-distortions\n   ```\n3. write a JSON config file (examples under `config/*-systematics.json`, see\n   next section for a brief explanation of the syntax)\n4. run `gerda-factory \u003cjson-file\u003e` to generate a set of random experiments with\n   random distortion functions applied\n\n## Config files\n\nThe JSON config file for the `gerda-fake-gen` program begins with some general settings:\n```js\n{\n    \"id\" : \"phIIAfterLAr\",  // model name\n    \"logging\" : \"info\",     // verbosity level, choose between {debug, detail, info, warning, error}\n    \"output\" : {  // output settings\n        \"file\" : \"../results/phIIAfterLAr-exp-pool.root:object_name\",  // output filename (and ROOT object name)\n        \"number-of-bins\" : 8000,\n        \"xaxis-range\" : [0, 8000]\n    },\n    \"range-for-counts\" : [565, 2000],  // histogram range in which the number of counts specified in the following\n                                       // should be considered\n    \"gerda-pdfs\" : \"../data/gerda-pdfs/gerda-pdfs-latest\",  // default value for the location of the GERDA PDFs\n    \"hist-name\" : \"M1_enrBEGe\",  // default name of the histogram to be searched for in the ROOT files\n```\nthen a large section follows to configure the generation model, where\neverything about each component can be specified in a modular fashion:\n```js\n    \"components\" : [  // here you must specify a list of PDFs you want to use\n        { ... }, { ... }, ...\n    ]\n```\nThe `\"components\"` array specifies a list of components (PDFs). The array is\nfilled with JSON objects that can be of multiple types. This special syntax is\nthe same employed in the [gerda-fitter](https://github.com/gipert/gerda-fitter)\nproject.\n\nAs instance, one might want to use the GERDA PDFs distributed within\n[gerda-mage-sim](https://github.com/mppmu/gerda-mage-sim) using the following\nstructure:\n```js\n{  // this is an object in the \"components\" array presented above\n    \"gerda-pdfs\" : \"../data/gerda-pdfs/v1.0\"  // the gerda-pdfs path might be set here to override the global one\n    \"part\": \"cables/cables_all\",\n    \"components\" : { // list of components from the 'cables/cables_all' part\n        \"Th228-cables\" : {  // the key isn't very important, but please choose a unique name!\n            \"isotope\" : { \"Tl208-lar\" : 0.3539, \"Bi212-lar\" : 1 },  // specify a mixture of isotopes\n            \"amount-cts\" : 666  // say here how many counts do you want to sample from the PDF\n                                // (NB: remember the \"range-for-counts\" parameter above\n        },\n        \"Co60-cables\" : {\n            \"isotope\": \"Co60-lar\", // no mixture here\n            ...\n        },\n        ...\n    }\n},\n{  // this is an object in the \"components\" array presented above\n    \"part\": {  // you can also specify a mixture of parts!\n        \"cables/cables_all\" : 0.2,\n        \"cables/hv_cables\"  : 0.8,\n        ...\n    },\n    \"components\" : { ... }\n}\n```\nor even provide manually a ROOT histogram:\n```js\n{\n    \"root-file\" : \"../data/gerda-pdfs/gerda-pdfs-latest/alphas/analytic/pdf-functions.root\",\n    \"components\" : {\n        \"alpha-offset\" : {\n            \"hist-name\" : \"flat\",\n            \"amount-cts\" : 23\n        },\n        ...\n    }\n},\n```\n\n### Additional configs for `gerda-factory`\n\nThe `gerda-factory` program needs distorting functions as input, therefore an\nadditional JSON block `\"pdf-distortions\"` must be present in the config file.\nThe syntax is the following:\n```js\n    \"pdf-distortions\" : {\n        \"prefix\" : \"../data/distortions\",  // global prefix where the files/folders will be searched for\n        \"global\" : {  // category of distortions that should be applied on all the components\n                      // the structure of the folders must be organized in the same way as the GERDA PDFs\n                      // releases and the name of the histogram must match\n            \"distortion-type1\" : {  // set the deformation type (not important)\n                \"pdfs\" : [\n                    \"folder1\",  // list here the folder names\n                    ...\n                ],\n                \"interpolate\": true  // can randomly reduce the magnitude of the distortion\n                                     // by mixing it with the unitary distortion. must be used\n                                     // with care, please see note below\n            },\n            ...\n        },\n        \"specific\" : {  // category of distortions that have to be applied to single components\n            \"component1\"  : { \"pdfs\" : [ \"file1.root\" ] }, // the name of the component must be listed also in the\n                                                           // list of model components above!\n            \"component2\" : {\n                \"pdfs\" : [\n                    \"file2.root:objname\",  // single ROOT file with eventual object name\n                    \"file3.root\",\n                    ...\n                ],\n                \"interpolate\" : true,\n            }\n        }\n    }\n```\n\n**Note:** interpolation is performed with respect to the unitary distortion. In\npractice, after randomly selecting a distortion from a certain group, an\nadditional random number `w` is drawn from a uniform distribution in [0,1].\nThis number is used to weight the distortion `D` together with the unitary\ndistortion `U` according to the following expression:\n```\n    pdf' = pdf * [ w * D + (1-w) * U ]\n```\nAs a raccommendation, use interpolation only when the test statistic\ndistribution assumes unexpected shapes (i.e. peaks), otherwise keep the option\noff.\n\n### Related project\n\n- [gerda-fitter](https://github.com/gipert/gerda-fitter)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgipert%2Fgerda-factory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgipert%2Fgerda-factory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgipert%2Fgerda-factory/lists"}