{"action":"created","comment":{"url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/pulls/comments/34516560","id":34516560,"diff_hunk":"@@ -401,8 +401,8 @@ double TChannel::CalibrateENG(double charge) {\n    //integration parameter.\n    if(ENGCoefficients.size()==0)\n       return charge;\n-   double cal_chg = 0.0;\n-   for(int i=0;i<ENGCoefficients.size();i++){","path":"libraries/TGRSIFormat/TChannel.cxx","position":5,"original_position":5,"commit_id":"3ce9800ea36cabf1a49e90392ea34f3857795662","original_commit_id":"3ce9800ea36cabf1a49e90392ea34f3857795662","user":{"login":"pcbend","id":433187,"avatar_url":"https://avatars.githubusercontent.com/u/433187?v=3","gravatar_id":"","url":"https://api.github.com/users/pcbend","html_url":"https://github.com/pcbend","followers_url":"https://api.github.com/users/pcbend/followers","following_url":"https://api.github.com/users/pcbend/following{/other_user}","gists_url":"https://api.github.com/users/pcbend/gists{/gist_id}","starred_url":"https://api.github.com/users/pcbend/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcbend/subscriptions","organizations_url":"https://api.github.com/users/pcbend/orgs","repos_url":"https://api.github.com/users/pcbend/repos","events_url":"https://api.github.com/users/pcbend/events{/privacy}","received_events_url":"https://api.github.com/users/pcbend/received_events","type":"User","site_admin":false},"body":"I am of the same mind set, after all I wrote the first version of the loop!\n  :)\n\nOn Mon, Jul 13, 2015 at 5:51 PM, Ryan Dunlop <notifications@github.com>\nwrote:\n\n> In libraries/TGRSIFormat/TChannel.cxx\n> <https://github.com/GRIFFINCollaboration/GRSISort/pull/387#discussion_r34516424>\n> :\n>\n> > @@ -401,8 +401,8 @@ double TChannel::CalibrateENG(double charge) {\n> >     //integration parameter.\n> >     if(ENGCoefficients.size()==0)\n> >        return charge;\n> > -   double cal_chg = 0.0;\n> > -   for(int i=0;i<ENGCoefficients.size();i++){\n>\n> Fine. If we are looking for efficiency at that level, we may as well\n> change our for loop to ++i instead of i++. i++ must allocate space to\n> remember what i was before adding one while ++i does not. :P\n> … <#14e89668a9a4b8ff_>\n>  On Jul 13, 2015, at 2:49 PM, pcbend <notifications@github.com> wrote: In\n> libraries/TGRSIFormat/TChannel.cxx <\n> https://github.com/GRIFFINCollaboration/GRSISort/pull/387#discussion_r34516230>:\n> > @@ -401,8 +401,8 @@ double TChannel::CalibrateENG(double charge) { >\n> //integration parameter. > if(ENGCoefficients.size()==0) > return charge; >\n> - double cal_chg = 0.0; > - for(int i=0;i<ENGCoefficients.size();i++){ The\n> way Vinzenz changed it to does the same thing, just a bit more efficiently.\n> var = vector.at(0) is slightly faster than variable =vector.at(0)*\n> charge^0. … <x-msg://50/#> — Reply to this email directly or view it on\n> GitHub. <\n> https://github.com/GRIFFINCollaboration/GRSISort/pull/387#discussion_r34515499>\n> <https://github.com/GRIFFINCollaboration/GRSISort/pull/387/files#r34515499>\n> — Reply to this email directly or view it on GitHub <\n> https://github.com/GRIFFINCollaboration/GRSISort/pull/387/files#r34516230>.\n>\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/GRIFFINCollaboration/GRSISort/pull/387/files#r34516424>\n> .\n>\n","created_at":"2015-07-13T21:52:44Z","updated_at":"2015-07-13T21:52:44Z","html_url":"https://github.com/GRIFFINCollaboration/GRSISort/pull/387#discussion_r34516560","pull_request_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/pulls/387","_links":{"self":{"href":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/pulls/comments/34516560"},"html":{"href":"https://github.com/GRIFFINCollaboration/GRSISort/pull/387#discussion_r34516560"},"pull_request":{"href":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/pulls/387"}}},"pull_request":{"url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/pulls/387","id":39853473,"html_url":"https://github.com/GRIFFINCollaboration/GRSISort/pull/387","diff_url":"https://github.com/GRIFFINCollaboration/GRSISort/pull/387.diff","patch_url":"https://github.com/GRIFFINCollaboration/GRSISort/pull/387.patch","issue_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/issues/387","number":387,"state":"open","locked":false,"title":"Bug fixes for addback.","user":{"login":"VinzenzBildstein","id":7277216,"avatar_url":"https://avatars.githubusercontent.com/u/7277216?v=3","gravatar_id":"","url":"https://api.github.com/users/VinzenzBildstein","html_url":"https://github.com/VinzenzBildstein","followers_url":"https://api.github.com/users/VinzenzBildstein/followers","following_url":"https://api.github.com/users/VinzenzBildstein/following{/other_user}","gists_url":"https://api.github.com/users/VinzenzBildstein/gists{/gist_id}","starred_url":"https://api.github.com/users/VinzenzBildstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VinzenzBildstein/subscriptions","organizations_url":"https://api.github.com/users/VinzenzBildstein/orgs","repos_url":"https://api.github.com/users/VinzenzBildstein/repos","events_url":"https://api.github.com/users/VinzenzBildstein/events{/privacy}","received_events_url":"https://api.github.com/users/VinzenzBildstein/received_events","type":"User","site_admin":false},"body":"- added SetEnergy(double) to TGRSIDetectorHit, this function sets the energy directly and also sets is_energy_set to true\r\n- modified TGRSIDetectorHit::GetEnergy so that in case is_energy_set is true, it returns the energy instead of re-calculating it from the charge\r\n- made addback_criterion static\r\n- TChannel::CalibrateENG(double charge): instead of calculating charge^0 the return value is set to ENGCoefficients[0] and then all other coefficients are added inside a loop from 1.","created_at":"2015-07-13T20:36:05Z","updated_at":"2015-07-13T21:52:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b5d027d4f526c398fcda59dfea183c2b5476cae5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/pulls/387/commits","review_comments_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/pulls/387/comments","review_comment_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/issues/387/comments","statuses_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/statuses/3ce9800ea36cabf1a49e90392ea34f3857795662","head":{"label":"VinzenzBildstein:leangrsi","ref":"leangrsi","sha":"3ce9800ea36cabf1a49e90392ea34f3857795662","user":{"login":"VinzenzBildstein","id":7277216,"avatar_url":"https://avatars.githubusercontent.com/u/7277216?v=3","gravatar_id":"","url":"https://api.github.com/users/VinzenzBildstein","html_url":"https://github.com/VinzenzBildstein","followers_url":"https://api.github.com/users/VinzenzBildstein/followers","following_url":"https://api.github.com/users/VinzenzBildstein/following{/other_user}","gists_url":"https://api.github.com/users/VinzenzBildstein/gists{/gist_id}","starred_url":"https://api.github.com/users/VinzenzBildstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VinzenzBildstein/subscriptions","organizations_url":"https://api.github.com/users/VinzenzBildstein/orgs","repos_url":"https://api.github.com/users/VinzenzBildstein/repos","events_url":"https://api.github.com/users/VinzenzBildstein/events{/privacy}","received_events_url":"https://api.github.com/users/VinzenzBildstein/received_events","type":"User","site_admin":false},"repo":{"id":24392259,"name":"GRSISort","full_name":"VinzenzBildstein/GRSISort","owner":{"login":"VinzenzBildstein","id":7277216,"avatar_url":"https://avatars.githubusercontent.com/u/7277216?v=3","gravatar_id":"","url":"https://api.github.com/users/VinzenzBildstein","html_url":"https://github.com/VinzenzBildstein","followers_url":"https://api.github.com/users/VinzenzBildstein/followers","following_url":"https://api.github.com/users/VinzenzBildstein/following{/other_user}","gists_url":"https://api.github.com/users/VinzenzBildstein/gists{/gist_id}","starred_url":"https://api.github.com/users/VinzenzBildstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VinzenzBildstein/subscriptions","organizations_url":"https://api.github.com/users/VinzenzBildstein/orgs","repos_url":"https://api.github.com/users/VinzenzBildstein/repos","events_url":"https://api.github.com/users/VinzenzBildstein/events{/privacy}","received_events_url":"https://api.github.com/users/VinzenzBildstein/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/VinzenzBildstein/GRSISort","description":"A lean, mean, sorting machine. ","fork":true,"url":"https://api.github.com/repos/VinzenzBildstein/GRSISort","forks_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/forks","keys_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/teams","hooks_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/hooks","issue_events_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/issues/events{/number}","events_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/events","assignees_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/assignees{/user}","branches_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/branches{/branch}","tags_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/tags","blobs_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/git/refs{/sha}","trees_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/statuses/{sha}","languages_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/languages","stargazers_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/stargazers","contributors_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/contributors","subscribers_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/subscribers","subscription_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/subscription","commits_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/commits{/sha}","git_commits_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/git/commits{/sha}","comments_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/comments{/number}","issue_comment_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/issues/comments{/number}","contents_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/contents/{+path}","compare_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/merges","archive_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/downloads","issues_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/issues{/number}","pulls_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/pulls{/number}","milestones_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/milestones{/number}","notifications_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/labels{/name}","releases_url":"https://api.github.com/repos/VinzenzBildstein/GRSISort/releases{/id}","created_at":"2014-09-23T22:50:22Z","updated_at":"2015-05-06T22:01:12Z","pushed_at":"2015-07-13T20:32:48Z","git_url":"git://github.com/VinzenzBildstein/GRSISort.git","ssh_url":"git@github.com:VinzenzBildstein/GRSISort.git","clone_url":"https://github.com/VinzenzBildstein/GRSISort.git","svn_url":"https://github.com/VinzenzBildstein/GRSISort","homepage":null,"size":24076,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GRIFFINCollaboration:leangrsi","ref":"leangrsi","sha":"b291e371c43e715fda40cfde29c89afb3ae9680f","user":{"login":"GRIFFINCollaboration","id":5225693,"avatar_url":"https://avatars.githubusercontent.com/u/5225693?v=3","gravatar_id":"","url":"https://api.github.com/users/GRIFFINCollaboration","html_url":"https://github.com/GRIFFINCollaboration","followers_url":"https://api.github.com/users/GRIFFINCollaboration/followers","following_url":"https://api.github.com/users/GRIFFINCollaboration/following{/other_user}","gists_url":"https://api.github.com/users/GRIFFINCollaboration/gists{/gist_id}","starred_url":"https://api.github.com/users/GRIFFINCollaboration/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GRIFFINCollaboration/subscriptions","organizations_url":"https://api.github.com/users/GRIFFINCollaboration/orgs","repos_url":"https://api.github.com/users/GRIFFINCollaboration/repos","events_url":"https://api.github.com/users/GRIFFINCollaboration/events{/privacy}","received_events_url":"https://api.github.com/users/GRIFFINCollaboration/received_events","type":"Organization","site_admin":false},"repo":{"id":22776606,"name":"GRSISort","full_name":"GRIFFINCollaboration/GRSISort","owner":{"login":"GRIFFINCollaboration","id":5225693,"avatar_url":"https://avatars.githubusercontent.com/u/5225693?v=3","gravatar_id":"","url":"https://api.github.com/users/GRIFFINCollaboration","html_url":"https://github.com/GRIFFINCollaboration","followers_url":"https://api.github.com/users/GRIFFINCollaboration/followers","following_url":"https://api.github.com/users/GRIFFINCollaboration/following{/other_user}","gists_url":"https://api.github.com/users/GRIFFINCollaboration/gists{/gist_id}","starred_url":"https://api.github.com/users/GRIFFINCollaboration/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GRIFFINCollaboration/subscriptions","organizations_url":"https://api.github.com/users/GRIFFINCollaboration/orgs","repos_url":"https://api.github.com/users/GRIFFINCollaboration/repos","events_url":"https://api.github.com/users/GRIFFINCollaboration/events{/privacy}","received_events_url":"https://api.github.com/users/GRIFFINCollaboration/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GRIFFINCollaboration/GRSISort","description":"A lean, mean, sorting machine. ","fork":false,"url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort","forks_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/forks","keys_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/teams","hooks_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/hooks","issue_events_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/issues/events{/number}","events_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/events","assignees_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/assignees{/user}","branches_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/branches{/branch}","tags_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/tags","blobs_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/git/refs{/sha}","trees_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/statuses/{sha}","languages_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/languages","stargazers_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/stargazers","contributors_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/contributors","subscribers_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/subscribers","subscription_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/subscription","commits_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/commits{/sha}","git_commits_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/git/commits{/sha}","comments_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/comments{/number}","issue_comment_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/issues/comments{/number}","contents_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/contents/{+path}","compare_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/merges","archive_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/downloads","issues_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/issues{/number}","pulls_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/pulls{/number}","milestones_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/milestones{/number}","notifications_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/labels{/name}","releases_url":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/releases{/id}","created_at":"2014-08-09T02:02:32Z","updated_at":"2015-06-08T21:53:08Z","pushed_at":"2015-07-13T20:36:05Z","git_url":"git://github.com/GRIFFINCollaboration/GRSISort.git","ssh_url":"git@github.com:GRIFFINCollaboration/GRSISort.git","clone_url":"https://github.com/GRIFFINCollaboration/GRSISort.git","svn_url":"https://github.com/GRIFFINCollaboration/GRSISort","homepage":null,"size":579076,"stargazers_count":7,"watchers_count":7,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":43,"forks":16,"open_issues":43,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/pulls/387"},"html":{"href":"https://github.com/GRIFFINCollaboration/GRSISort/pull/387"},"issue":{"href":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/issues/387"},"comments":{"href":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/issues/387/comments"},"review_comments":{"href":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/pulls/387/comments"},"review_comment":{"href":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/pulls/387/commits"},"statuses":{"href":"https://api.github.com/repos/GRIFFINCollaboration/GRSISort/statuses/3ce9800ea36cabf1a49e90392ea34f3857795662"}}}}