{"id":44933572,"url":"https://github.com/go-hep/croot","last_synced_at":"2026-02-18T06:33:27.304Z","repository":{"id":8770973,"uuid":"10456646","full_name":"go-hep/croot","owner":"go-hep","description":"Go bindings to the C-API of ROOT (CRoot).","archived":false,"fork":false,"pushed_at":"2018-05-30T15:02:23.000Z","size":227,"stargazers_count":7,"open_issues_count":5,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-14T21:23:57.316Z","etag":null,"topics":["cgo","croot","go","go-hep","golang","hep","root-cern"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/go-hep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-03T14:41:00.000Z","updated_at":"2018-05-30T15:02:19.000Z","dependencies_parsed_at":"2022-09-02T10:02:38.708Z","dependency_job_id":null,"html_url":"https://github.com/go-hep/croot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/go-hep/croot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-hep%2Fcroot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-hep%2Fcroot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-hep%2Fcroot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-hep%2Fcroot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-hep","download_url":"https://codeload.github.com/go-hep/croot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-hep%2Fcroot/sbom","scorecard":{"id":431946,"data":{"date":"2025-08-11","repo":{"name":"github.com/go-hep/croot","commit":"2dce8cdaab80a9638a2c81f5fe4e0a3106101c68"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/19 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 13 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T03:34:58.236Z","repository_id":8770973,"created_at":"2025-08-19T03:34:58.236Z","updated_at":"2025-08-19T03:34:58.236Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29570359,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T06:19:27.422Z","status":"ssl_error","status_checked_at":"2026-02-18T06:18:44.348Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cgo","croot","go","go-hep","golang","hep","root-cern"],"created_at":"2026-02-18T06:33:26.467Z","updated_at":"2026-02-18T06:33:27.299Z","avatar_url":"https://github.com/go-hep.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"croot\n=====\n\n[![GoDoc](https://godoc.org/github.com/go-hep/croot?status.svg)](https://godoc.org/github.com/go-hep/croot)\n\nGo bindings to the C-API of ROOT (CRoot).\n\n`croot` supports now both `ROOT-5` and `ROOT-6`.\n\n## Installation\n\nUnfortunately, ``go-hep/croot`` isn't completely ``go-get`` able.\nYou **NEED** to run `go generate` (or `make gen`) once the code has been retrieved from github:\n\n```sh\n$ go get -d github.com/go-hep/croot\n$ cd $GOPATH/src/github.com/go-hep/croot\n$ make clean gen install\n$ make test\nok  \tgithub.com/go-hep/croot\t2.862s\n```    \n\n\n## Documentation\n\n http://godoc.org/github.com/go-hep/croot\n\n\n## ``TTree`` Limitations/Status\n\n- read/write of C-builtins: **WORKS**\n- read/write of arrays: **WORKS**\n- read/write of slices: **WORKS**\n- read/write of structs: **WORKS**\n- read/write of strings: **WORKS**\n\n## Example\n\n`croot` can now (correctly) write and read `go` structs which have\nan equivalent `C` representation.\n**Except** for structs embedding pointers.\n\nA typical write program would look like:\n\n``` go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"flag\"\n\t\"math/rand\"\n\n\t\"github.com/go-hep/croot\"\n)\n\ntype Det struct {\n\tE float64\n\tT float64\n}\n\ntype Event struct {\n\tA Det\n\tB Det\n}\n\nvar evtmax *int = flag.Int(\"evtmax\", 10000, \"number of events to generate\")\nvar fname *string = flag.String(\"fname\", \"event.root\", \"file to create\")\n\nfunc main() {\n\tflag.Parse()\n\tf, err := croot.OpenFile(*fname, \"recreate\", \"my event file\", 1, 0)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer f.Close(\"\")\n\ttree0(f)\n}\n\nfunc tree0(f croot.File) {\n\t// create a tree\n\ttree := croot.NewTree(\"tree\", \"tree\", 32)\n\te := Event{}\n\tconst bufsiz = 32000\n\n\t_, err := tree.Branch(\"evt\", \u0026e, bufsiz, 0)\n\tif err != nil {\n\t   panic(err)\n\t}\n\n\t// fill some events with random numbers\n\tnevents := *evtmax\n\tfor iev := 0; iev != nevents; iev++ {\n\t\tif iev%1000 == 0 {\n\t\t\tfmt.Printf(\":: processing event %d...\\n\", iev)\n\t\t}\n\n\n\t\t// the two energies follow a gaussian distribution\n\t\te.A.E = rand.NormFloat64() //ea\n\t\te.B.E = rand.NormFloat64() //eb\n\n\t\te.A.T = croot.GRandom.Rndm(1)\n\t\te.B.T = e.A.T * croot.GRandom.Gaus(0., 1.)\n\t\tif iev%1000 == 0 {\n\t\t\tfmt.Printf(\"ievt: %d\\n\", iev)\n\t\t\tfmt.Printf(\"evt.a.e= %8.3f\\n\", e.A.E)\n\t\t\tfmt.Printf(\"evt.a.t= %8.3f\\n\", e.A.T)\n\t\t\tfmt.Printf(\"evt.b.e= %8.3f\\n\", e.B.E)\n\t\t\tfmt.Printf(\"evt.b.t= %8.3f\\n\", e.B.T)\n\t\t}\n\t\t_, err = tree.Fill()\n\t\tif err != nil {\n\t\t   panic(err)\n        }\n\t}\n\tf.Write(\"\", 0, 0)\n}\n// EOF\n```\n\nand a typical reading program:\n``` go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"flag\"\n\n\t\"github.com/go-hep/croot\"\n)\n\ntype Det struct {\n\tE float64\n\tT float64\n}\n\ntype Event struct {\n\tA Det\n\tB Det\n}\n\nvar evtmax *int64 = flag.Int64(\"evtmax\", 10000, \"number of events to read\")\nvar fname *string = flag.String(\"fname\", \"event.root\", \"file to read back\")\n\nfunc main() {\n\tflag.Parse()\n\t\n\tcroot.RegisterType(\u0026Event{})\n\n\tfmt.Printf(\":: opening [%s]...\\n\", *fname)\n\tf, err := croot.OpenFile(*fname, \"read\", \"my event file\", 1, 0)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer f.Close(\"\")\n\ttree0(f)\n\n}\n\nfunc tree0(f croot.File) {\n\tt := f.Get(\"tree\").(croot.Tree)\n\te := Event{}\n\n\tt.SetBranchAddress(\"evt\", \u0026e)\n\n\t// fill some events with random numbers\n\tnevents := int64(*evtmax)\n\tif nevents \u003c 0 || nevents \u003e int64(t.GetEntries()) {\n\t\tnevents = int64(t.GetEntries())\n\t}\n\tfor iev := int64(0); iev != nevents; iev++ {\n\t\tif iev%1000 == 0 {\n\t\t\tfmt.Printf(\":: processing event %d...\\n\", iev)\n\t\t}\n\t\tif t.GetEntry(iev, 1) \u003c= 0 {\n\t\t\tpanic(\"error\")\n\t\t}\n\t\tif iev%1000 == 0 {\n\t\t\tfmt.Printf(\"ievt: %d\\n\", iev)\n\t\t\tfmt.Printf(\"evt.a.e= %8.3f\\n\", e.A.E)\n\t\t\tfmt.Printf(\"evt.a.t= %8.3f\\n\", e.A.T)\n\t\t\tfmt.Printf(\"evt.b.e= %8.3f\\n\", e.B.E)\n\t\t\tfmt.Printf(\"evt.b.t= %8.3f\\n\", e.B.T)\n\t\t}\n\t}\n}\n\n// EOF\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-hep%2Fcroot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-hep%2Fcroot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-hep%2Fcroot/lists"}