{"action":"created","comment":{"url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/pulls/comments/176507602","pull_request_review_id":106224321,"id":176507602,"diff_hunk":"@@ -0,0 +1,130 @@\n+from __future__ import division\n+import numpy as np\n+from cmsl1t.plotting.base import BasePlotter\n+from cmsl1t.hist.hist_collection import HistogramCollection\n+from cmsl1t.hist.factory import HistFactory\n+import cmsl1t.hist.binning as bn\n+from cmsl1t.utils.draw import draw, label_canvas\n+from cmsl1t.recalc.resolution import get_resolution_function\n+\n+from rootpy.context import preserve_current_style\n+from rootpy.plotting import Legend\n+\n+\n+def get_cumulative_hist(hist):\n+    h = hist.clone(hist.name + '_cumul')\n+    arr = np.cumsum(_reverse([bin.value for bin in hist]))\n+    h.set_content(_reverse(arr))\n+    errors_sq = np.cumsum(_reverse([bin.error**2 for bin in hist]))\n+    h.set_error(_reverse(np.sqrt(errors_sq)))\n+\n+    # now scale\n+    bin1 = h.get_bin_content(1)\n+    if bin1 != 0:\n+        h.GetSumw2()\n+        h.Scale(4.0e7 / bin1)\n+    return h\n+\n+\n+def _reverse(a):","path":"cmsl1t/plotting/rates.py","position":29,"original_position":29,"commit_id":"10eaa2748b850385ec3c7a5fd956347e9e797119","original_commit_id":"10eaa2748b850385ec3c7a5fd956347e9e797119","user":{"login":"kreczko","id":1213276,"avatar_url":"https://avatars3.githubusercontent.com/u/1213276?v=4","gravatar_id":"","url":"https://api.github.com/users/kreczko","html_url":"https://github.com/kreczko","followers_url":"https://api.github.com/users/kreczko/followers","following_url":"https://api.github.com/users/kreczko/following{/other_user}","gists_url":"https://api.github.com/users/kreczko/gists{/gist_id}","starred_url":"https://api.github.com/users/kreczko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kreczko/subscriptions","organizations_url":"https://api.github.com/users/kreczko/orgs","repos_url":"https://api.github.com/users/kreczko/repos","events_url":"https://api.github.com/users/kreczko/events{/privacy}","received_events_url":"https://api.github.com/users/kreczko/received_events","type":"User","site_admin":false},"body":"Well, the code would then be\r\n```python\r\narr = np.cumsum(list(reversed([bin.value for bin in hist])))\r\n```\r\nnot convinced that this is better.\r\n","created_at":"2018-03-22T17:31:19Z","updated_at":"2018-03-22T17:31:19Z","html_url":"https://github.com/cms-l1t-offline/cms-l1t-analysis/pull/110#discussion_r176507602","pull_request_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/pulls/110","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/pulls/comments/176507602"},"html":{"href":"https://github.com/cms-l1t-offline/cms-l1t-analysis/pull/110#discussion_r176507602"},"pull_request":{"href":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/pulls/110"}},"in_reply_to_id":175355413},"pull_request":{"url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/pulls/110","id":175080322,"html_url":"https://github.com/cms-l1t-offline/cms-l1t-analysis/pull/110","diff_url":"https://github.com/cms-l1t-offline/cms-l1t-analysis/pull/110.diff","patch_url":"https://github.com/cms-l1t-offline/cms-l1t-analysis/pull/110.patch","issue_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/issues/110","number":110,"state":"open","locked":false,"title":"Plotting updates from #106","user":{"login":"kreczko","id":1213276,"avatar_url":"https://avatars3.githubusercontent.com/u/1213276?v=4","gravatar_id":"","url":"https://api.github.com/users/kreczko","html_url":"https://github.com/kreczko","followers_url":"https://api.github.com/users/kreczko/followers","following_url":"https://api.github.com/users/kreczko/following{/other_user}","gists_url":"https://api.github.com/users/kreczko/gists{/gist_id}","starred_url":"https://api.github.com/users/kreczko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kreczko/subscriptions","organizations_url":"https://api.github.com/users/kreczko/orgs","repos_url":"https://api.github.com/users/kreczko/repos","events_url":"https://api.github.com/users/kreczko/events{/privacy}","received_events_url":"https://api.github.com/users/kreczko/received_events","type":"User","site_admin":false},"body":"This PR adds all plotting related changes from #106.","created_at":"2018-03-14T20:47:35Z","updated_at":"2018-03-22T17:31:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"384fbacb699c910c400b8af7ea909e9b84701c05","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/pulls/110/commits","review_comments_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/pulls/110/comments","review_comment_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/issues/110/comments","statuses_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/statuses/10eaa2748b850385ec3c7a5fd956347e9e797119","head":{"label":"kreczko:kreczko-aaron-alex-plotting","ref":"kreczko-aaron-alex-plotting","sha":"10eaa2748b850385ec3c7a5fd956347e9e797119","user":{"login":"kreczko","id":1213276,"avatar_url":"https://avatars3.githubusercontent.com/u/1213276?v=4","gravatar_id":"","url":"https://api.github.com/users/kreczko","html_url":"https://github.com/kreczko","followers_url":"https://api.github.com/users/kreczko/followers","following_url":"https://api.github.com/users/kreczko/following{/other_user}","gists_url":"https://api.github.com/users/kreczko/gists{/gist_id}","starred_url":"https://api.github.com/users/kreczko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kreczko/subscriptions","organizations_url":"https://api.github.com/users/kreczko/orgs","repos_url":"https://api.github.com/users/kreczko/repos","events_url":"https://api.github.com/users/kreczko/events{/privacy}","received_events_url":"https://api.github.com/users/kreczko/received_events","type":"User","site_admin":false},"repo":{"id":80934105,"name":"cms-l1t-analysis","full_name":"kreczko/cms-l1t-analysis","owner":{"login":"kreczko","id":1213276,"avatar_url":"https://avatars3.githubusercontent.com/u/1213276?v=4","gravatar_id":"","url":"https://api.github.com/users/kreczko","html_url":"https://github.com/kreczko","followers_url":"https://api.github.com/users/kreczko/followers","following_url":"https://api.github.com/users/kreczko/following{/other_user}","gists_url":"https://api.github.com/users/kreczko/gists{/gist_id}","starred_url":"https://api.github.com/users/kreczko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kreczko/subscriptions","organizations_url":"https://api.github.com/users/kreczko/orgs","repos_url":"https://api.github.com/users/kreczko/repos","events_url":"https://api.github.com/users/kreczko/events{/privacy}","received_events_url":"https://api.github.com/users/kreczko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kreczko/cms-l1t-analysis","description":null,"fork":true,"url":"https://api.github.com/repos/kreczko/cms-l1t-analysis","forks_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/forks","keys_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/teams","hooks_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/hooks","issue_events_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/issues/events{/number}","events_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/events","assignees_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/assignees{/user}","branches_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/branches{/branch}","tags_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/tags","blobs_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/git/refs{/sha}","trees_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/statuses/{sha}","languages_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/languages","stargazers_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/stargazers","contributors_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/contributors","subscribers_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/subscribers","subscription_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/subscription","commits_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/commits{/sha}","git_commits_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/git/commits{/sha}","comments_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/comments{/number}","issue_comment_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/issues/comments{/number}","contents_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/contents/{+path}","compare_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/merges","archive_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/downloads","issues_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/issues{/number}","pulls_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/pulls{/number}","milestones_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/milestones{/number}","notifications_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/labels{/name}","releases_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/releases{/id}","deployments_url":"https://api.github.com/repos/kreczko/cms-l1t-analysis/deployments","created_at":"2017-02-04T17:05:33Z","updated_at":"2017-04-25T12:31:11Z","pushed_at":"2018-03-15T17:41:25Z","git_url":"git://github.com/kreczko/cms-l1t-analysis.git","ssh_url":"git@github.com:kreczko/cms-l1t-analysis.git","clone_url":"https://github.com/kreczko/cms-l1t-analysis.git","svn_url":"https://github.com/kreczko/cms-l1t-analysis","homepage":null,"size":554,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cms-l1t-offline:master","ref":"master","sha":"1b13f1284f8a5be6a0fc26f020dfcc3b3ca170cb","user":{"login":"cms-l1t-offline","id":6010982,"avatar_url":"https://avatars1.githubusercontent.com/u/6010982?v=4","gravatar_id":"","url":"https://api.github.com/users/cms-l1t-offline","html_url":"https://github.com/cms-l1t-offline","followers_url":"https://api.github.com/users/cms-l1t-offline/followers","following_url":"https://api.github.com/users/cms-l1t-offline/following{/other_user}","gists_url":"https://api.github.com/users/cms-l1t-offline/gists{/gist_id}","starred_url":"https://api.github.com/users/cms-l1t-offline/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cms-l1t-offline/subscriptions","organizations_url":"https://api.github.com/users/cms-l1t-offline/orgs","repos_url":"https://api.github.com/users/cms-l1t-offline/repos","events_url":"https://api.github.com/users/cms-l1t-offline/events{/privacy}","received_events_url":"https://api.github.com/users/cms-l1t-offline/received_events","type":"Organization","site_admin":false},"repo":{"id":80877637,"name":"cms-l1t-analysis","full_name":"cms-l1t-offline/cms-l1t-analysis","owner":{"login":"cms-l1t-offline","id":6010982,"avatar_url":"https://avatars1.githubusercontent.com/u/6010982?v=4","gravatar_id":"","url":"https://api.github.com/users/cms-l1t-offline","html_url":"https://github.com/cms-l1t-offline","followers_url":"https://api.github.com/users/cms-l1t-offline/followers","following_url":"https://api.github.com/users/cms-l1t-offline/following{/other_user}","gists_url":"https://api.github.com/users/cms-l1t-offline/gists{/gist_id}","starred_url":"https://api.github.com/users/cms-l1t-offline/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cms-l1t-offline/subscriptions","organizations_url":"https://api.github.com/users/cms-l1t-offline/orgs","repos_url":"https://api.github.com/users/cms-l1t-offline/repos","events_url":"https://api.github.com/users/cms-l1t-offline/events{/privacy}","received_events_url":"https://api.github.com/users/cms-l1t-offline/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cms-l1t-offline/cms-l1t-analysis","description":null,"fork":false,"url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis","forks_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/forks","keys_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/teams","hooks_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/hooks","issue_events_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/issues/events{/number}","events_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/events","assignees_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/assignees{/user}","branches_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/branches{/branch}","tags_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/tags","blobs_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/git/refs{/sha}","trees_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/statuses/{sha}","languages_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/languages","stargazers_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/stargazers","contributors_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/contributors","subscribers_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/subscribers","subscription_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/subscription","commits_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/commits{/sha}","git_commits_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/git/commits{/sha}","comments_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/comments{/number}","issue_comment_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/issues/comments{/number}","contents_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/contents/{+path}","compare_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/merges","archive_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/downloads","issues_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/issues{/number}","pulls_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/pulls{/number}","milestones_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/milestones{/number}","notifications_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/labels{/name}","releases_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/releases{/id}","deployments_url":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/deployments","created_at":"2017-02-03T23:17:37Z","updated_at":"2018-03-15T15:01:24Z","pushed_at":"2018-03-15T17:41:27Z","git_url":"git://github.com/cms-l1t-offline/cms-l1t-analysis.git","ssh_url":"git@github.com:cms-l1t-offline/cms-l1t-analysis.git","clone_url":"https://github.com/cms-l1t-offline/cms-l1t-analysis.git","svn_url":"https://github.com/cms-l1t-offline/cms-l1t-analysis","homepage":null,"size":519,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":24,"license":null,"forks":9,"open_issues":24,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/pulls/110"},"html":{"href":"https://github.com/cms-l1t-offline/cms-l1t-analysis/pull/110"},"issue":{"href":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/issues/110"},"comments":{"href":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/issues/110/comments"},"review_comments":{"href":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/pulls/110/comments"},"review_comment":{"href":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/pulls/110/commits"},"statuses":{"href":"https://api.github.com/repos/cms-l1t-offline/cms-l1t-analysis/statuses/10eaa2748b850385ec3c7a5fd956347e9e797119"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"kreczko"}}