{"action":"created","comment":{"url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/pulls/comments/41287774","id":41287774,"diff_hunk":"@@ -99,12 +101,20 @@ static inline double sign(double x)\n \n void PHG4HoughTransform::projectToRadius(const SvtxTrack* track, double B, double radius, vector<double>& intersection)\n {\n+  assert(radius>0);\n \n-  float phi  = atan2(track->get_y(),track->get_x());\n+  float phi  = atan2(track->get_py(),track->get_px());\n   float d    = track->get_dca2d();\n-  float k    = B / 333.6 / track->get_pt();\n+  float k    = - B / 333.6 / track->get_pt() * track->get_charge();\n   float z0   = track->get_z();","path":"simulation/g4simulation/g4hough/PHG4HoughTransform.C","position":24,"original_position":24,"commit_id":"63a9bda531c05a7aa83b761d127028dc2e25b353","original_commit_id":"63a9bda531c05a7aa83b761d127028dc2e25b353","user":{"login":"blackcathj","id":7947083,"avatar_url":"https://avatars.githubusercontent.com/u/7947083?v=3","gravatar_id":"","url":"https://api.github.com/users/blackcathj","html_url":"https://github.com/blackcathj","followers_url":"https://api.github.com/users/blackcathj/followers","following_url":"https://api.github.com/users/blackcathj/following{/other_user}","gists_url":"https://api.github.com/users/blackcathj/gists{/gist_id}","starred_url":"https://api.github.com/users/blackcathj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blackcathj/subscriptions","organizations_url":"https://api.github.com/users/blackcathj/orgs","repos_url":"https://api.github.com/users/blackcathj/repos","events_url":"https://api.github.com/users/blackcathj/events{/privacy}","received_events_url":"https://api.github.com/users/blackcathj/received_events","type":"User","site_admin":false},"body":"This seems to be DCA_z rather than abs. z location of the track? Then the track projection need to be further offset by vertex z in the user code. ","created_at":"2015-10-06T16:27:58Z","updated_at":"2015-10-06T16:27:58Z","html_url":"https://github.com/sPHENIX-Collaboration/coresoftware/pull/69#discussion_r41287774","pull_request_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/pulls/69","_links":{"self":{"href":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/pulls/comments/41287774"},"html":{"href":"https://github.com/sPHENIX-Collaboration/coresoftware/pull/69#discussion_r41287774"},"pull_request":{"href":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/pulls/69"}}},"pull_request":{"url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/pulls/69","id":46925614,"html_url":"https://github.com/sPHENIX-Collaboration/coresoftware/pull/69","diff_url":"https://github.com/sPHENIX-Collaboration/coresoftware/pull/69.diff","patch_url":"https://github.com/sPHENIX-Collaboration/coresoftware/pull/69.patch","issue_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/issues/69","number":69,"state":"open","locked":false,"title":"Problem with projection of track to calorimeter","user":{"login":"blackcathj","id":7947083,"avatar_url":"https://avatars.githubusercontent.com/u/7947083?v=3","gravatar_id":"","url":"https://api.github.com/users/blackcathj","html_url":"https://github.com/blackcathj","followers_url":"https://api.github.com/users/blackcathj/followers","following_url":"https://api.github.com/users/blackcathj/following{/other_user}","gists_url":"https://api.github.com/users/blackcathj/gists{/gist_id}","starred_url":"https://api.github.com/users/blackcathj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blackcathj/subscriptions","organizations_url":"https://api.github.com/users/blackcathj/orgs","repos_url":"https://api.github.com/users/blackcathj/repos","events_url":"https://api.github.com/users/blackcathj/events{/privacy}","received_events_url":"https://api.github.com/users/blackcathj/received_events","type":"User","site_admin":false},"body":"This is for discussion rather than merging immediately. \r\n\r\nI have quite some problem on projecting the track to the calorimeter using the default tool: PHG4HoughTransform::projectToRadius. First of all, it use a mix of track state and vertex state to start the projection. Then I couldn't figure out how it use the charge sign to determine the bending direction of the track. Most importantly, it do not seem to work at the current stage. \r\n\r\nHere is projection of one 8 GeV track to 10, 20, ... 80 cm radius. Note the coordinate jump sign around R=20 cm:\r\n```\r\nvoid EMCalAna::eval_trk(PHG4Particle*, EMCalTrk&, PHCompositeNode*) - info - handling track track p= (3.91465, 6.79369, 0.218141) GeV/c, size_states = 1\r\nvoid EMCalAna::eval_trk(PHG4Particle*, EMCalTrk&, PHCompositeNode*) - info - track projection : v=1.2296e-05, -7.08519e-06 p = 3.91465, 6.79369\r\nvoid EMCalAna::eval_trk(PHG4Particle*, EMCalTrk&, PHCompositeNode*) - info - handling track proj. (5.01748, 8.65014, 0.278212), eta 0.0278176, phi1.04518\r\nvoid EMCalAna::eval_trk(PHG4Particle*, EMCalTrk&, PHCompositeNode*) - info - handling track proj. (-9.88573, -17.386, 0.556427), eta 0.0278178, phi-2.08781\r\nvoid EMCalAna::eval_trk(PHG4Particle*, EMCalTrk&, PHCompositeNode*) - info - handling track proj. (-14.7538, -26.1214, 0.834646), eta 0.0278179, phi-2.08494\r\nvoid EMCalAna::eval_trk(PHG4Particle*, EMCalTrk&, PHCompositeNode*) - info - handling track proj. (-19.5717, -34.8848, 1.11287), eta 0.0278182, phi-2.08208\r\nvoid EMCalAna::eval_trk(PHG4Particle*, EMCalTrk&, PHCompositeNode*) - info - handling track proj. (-24.3395, -43.6759, 1.39111), eta 0.0278185, phi-2.07921\r\nvoid EMCalAna::eval_trk(PHG4Particle*, EMCalTrk&, PHCompositeNode*) - info - handling track proj. (-29.057, -52.4947, 1.66935), eta 0.027819, phi-2.07634\r\nvoid EMCalAna::eval_trk(PHG4Particle*, EMCalTrk&, PHCompositeNode*) - info - handling track proj. (-33.7241, -61.3407, 1.94761), eta 0.0278195, phi-2.07347\r\nvoid EMCalAna::eval_trk(PHG4Particle*, EMCalTrk&, PHCompositeNode*) - info - handling track proj. (-38.3406, -70.2139, 2.22589), eta 0.02782, phi-2.0706\r\nvoid EMCalAna::eval_trk(PHG4Particle*, EMCalTrk&, PHCompositeNode*) - info - handling track proj. (-47.4215, -88.0409, 2.7825), eta 0.0278214, phi-2.06487\r\nvoid EMCalAna::eval_trk(PHG4Particle*, EMCalTrk&, PHCompositeNode*) - info - handling track proj. (1547.89, 872.793, 51.8743), eta 0.0291879, phi0.513422\r\n```\r\n\r\n## Quick fix\r\n\r\nAs a quick fix, this pull request carry one suggested algorithm. It is simple in the sense that it assumes the track come near x,y = 0 cm. Then does a helical projection through a homogeneous Bz field towards a cylinder of given radius.  For calorimeter analysis, where only process of cm is needed, this looks sufficient. But this is not a long term solution. \r\n\r\nHere is one projection check towards EMCal and inner HCal (inner HCal seems have a +1 phi bin offset which require additional fix in calorimeter code):\r\n\r\n![g4hits_sphenix_e-_eta0_8gev-all root_ana root_drawecal_pdst_trackprojection_checks_cut_all_event](https://cloud.githubusercontent.com/assets/7947083/10314949/6e0a698c-6c25-11e5-9162-de5205fb4f9e.png)\r\n\r\n\r\n\r\n\r\n","created_at":"2015-10-06T16:27:02Z","updated_at":"2015-10-06T16:27:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d9580bfc9df6cee6f83d537a64609e957af8178","assignee":{"login":"mccumbermike","id":12105552,"avatar_url":"https://avatars.githubusercontent.com/u/12105552?v=3","gravatar_id":"","url":"https://api.github.com/users/mccumbermike","html_url":"https://github.com/mccumbermike","followers_url":"https://api.github.com/users/mccumbermike/followers","following_url":"https://api.github.com/users/mccumbermike/following{/other_user}","gists_url":"https://api.github.com/users/mccumbermike/gists{/gist_id}","starred_url":"https://api.github.com/users/mccumbermike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mccumbermike/subscriptions","organizations_url":"https://api.github.com/users/mccumbermike/orgs","repos_url":"https://api.github.com/users/mccumbermike/repos","events_url":"https://api.github.com/users/mccumbermike/events{/privacy}","received_events_url":"https://api.github.com/users/mccumbermike/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/pulls/69/commits","review_comments_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/pulls/69/comments","review_comment_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/issues/69/comments","statuses_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/statuses/63a9bda531c05a7aa83b761d127028dc2e25b353","head":{"label":"blackcathj:TestTrackProjectionToRadius","ref":"TestTrackProjectionToRadius","sha":"63a9bda531c05a7aa83b761d127028dc2e25b353","user":{"login":"blackcathj","id":7947083,"avatar_url":"https://avatars.githubusercontent.com/u/7947083?v=3","gravatar_id":"","url":"https://api.github.com/users/blackcathj","html_url":"https://github.com/blackcathj","followers_url":"https://api.github.com/users/blackcathj/followers","following_url":"https://api.github.com/users/blackcathj/following{/other_user}","gists_url":"https://api.github.com/users/blackcathj/gists{/gist_id}","starred_url":"https://api.github.com/users/blackcathj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blackcathj/subscriptions","organizations_url":"https://api.github.com/users/blackcathj/orgs","repos_url":"https://api.github.com/users/blackcathj/repos","events_url":"https://api.github.com/users/blackcathj/events{/privacy}","received_events_url":"https://api.github.com/users/blackcathj/received_events","type":"User","site_admin":false},"repo":{"id":37891570,"name":"coresoftware","full_name":"blackcathj/coresoftware","owner":{"login":"blackcathj","id":7947083,"avatar_url":"https://avatars.githubusercontent.com/u/7947083?v=3","gravatar_id":"","url":"https://api.github.com/users/blackcathj","html_url":"https://github.com/blackcathj","followers_url":"https://api.github.com/users/blackcathj/followers","following_url":"https://api.github.com/users/blackcathj/following{/other_user}","gists_url":"https://api.github.com/users/blackcathj/gists{/gist_id}","starred_url":"https://api.github.com/users/blackcathj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blackcathj/subscriptions","organizations_url":"https://api.github.com/users/blackcathj/orgs","repos_url":"https://api.github.com/users/blackcathj/repos","events_url":"https://api.github.com/users/blackcathj/events{/privacy}","received_events_url":"https://api.github.com/users/blackcathj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/blackcathj/coresoftware","description":"Our big core software repository","fork":true,"url":"https://api.github.com/repos/blackcathj/coresoftware","forks_url":"https://api.github.com/repos/blackcathj/coresoftware/forks","keys_url":"https://api.github.com/repos/blackcathj/coresoftware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blackcathj/coresoftware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blackcathj/coresoftware/teams","hooks_url":"https://api.github.com/repos/blackcathj/coresoftware/hooks","issue_events_url":"https://api.github.com/repos/blackcathj/coresoftware/issues/events{/number}","events_url":"https://api.github.com/repos/blackcathj/coresoftware/events","assignees_url":"https://api.github.com/repos/blackcathj/coresoftware/assignees{/user}","branches_url":"https://api.github.com/repos/blackcathj/coresoftware/branches{/branch}","tags_url":"https://api.github.com/repos/blackcathj/coresoftware/tags","blobs_url":"https://api.github.com/repos/blackcathj/coresoftware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blackcathj/coresoftware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blackcathj/coresoftware/git/refs{/sha}","trees_url":"https://api.github.com/repos/blackcathj/coresoftware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blackcathj/coresoftware/statuses/{sha}","languages_url":"https://api.github.com/repos/blackcathj/coresoftware/languages","stargazers_url":"https://api.github.com/repos/blackcathj/coresoftware/stargazers","contributors_url":"https://api.github.com/repos/blackcathj/coresoftware/contributors","subscribers_url":"https://api.github.com/repos/blackcathj/coresoftware/subscribers","subscription_url":"https://api.github.com/repos/blackcathj/coresoftware/subscription","commits_url":"https://api.github.com/repos/blackcathj/coresoftware/commits{/sha}","git_commits_url":"https://api.github.com/repos/blackcathj/coresoftware/git/commits{/sha}","comments_url":"https://api.github.com/repos/blackcathj/coresoftware/comments{/number}","issue_comment_url":"https://api.github.com/repos/blackcathj/coresoftware/issues/comments{/number}","contents_url":"https://api.github.com/repos/blackcathj/coresoftware/contents/{+path}","compare_url":"https://api.github.com/repos/blackcathj/coresoftware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blackcathj/coresoftware/merges","archive_url":"https://api.github.com/repos/blackcathj/coresoftware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blackcathj/coresoftware/downloads","issues_url":"https://api.github.com/repos/blackcathj/coresoftware/issues{/number}","pulls_url":"https://api.github.com/repos/blackcathj/coresoftware/pulls{/number}","milestones_url":"https://api.github.com/repos/blackcathj/coresoftware/milestones{/number}","notifications_url":"https://api.github.com/repos/blackcathj/coresoftware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blackcathj/coresoftware/labels{/name}","releases_url":"https://api.github.com/repos/blackcathj/coresoftware/releases{/id}","created_at":"2015-06-23T02:03:54Z","updated_at":"2015-06-23T02:03:56Z","pushed_at":"2015-10-06T16:09:27Z","git_url":"git://github.com/blackcathj/coresoftware.git","ssh_url":"git@github.com:blackcathj/coresoftware.git","clone_url":"https://github.com/blackcathj/coresoftware.git","svn_url":"https://github.com/blackcathj/coresoftware","homepage":null,"size":3081,"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":"sPHENIX-Collaboration:master","ref":"master","sha":"1b868289d3067f31d3c63855f4e95ab1b34274f9","user":{"login":"sPHENIX-Collaboration","id":12069843,"avatar_url":"https://avatars.githubusercontent.com/u/12069843?v=3","gravatar_id":"","url":"https://api.github.com/users/sPHENIX-Collaboration","html_url":"https://github.com/sPHENIX-Collaboration","followers_url":"https://api.github.com/users/sPHENIX-Collaboration/followers","following_url":"https://api.github.com/users/sPHENIX-Collaboration/following{/other_user}","gists_url":"https://api.github.com/users/sPHENIX-Collaboration/gists{/gist_id}","starred_url":"https://api.github.com/users/sPHENIX-Collaboration/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sPHENIX-Collaboration/subscriptions","organizations_url":"https://api.github.com/users/sPHENIX-Collaboration/orgs","repos_url":"https://api.github.com/users/sPHENIX-Collaboration/repos","events_url":"https://api.github.com/users/sPHENIX-Collaboration/events{/privacy}","received_events_url":"https://api.github.com/users/sPHENIX-Collaboration/received_events","type":"Organization","site_admin":false},"repo":{"id":34742432,"name":"coresoftware","full_name":"sPHENIX-Collaboration/coresoftware","owner":{"login":"sPHENIX-Collaboration","id":12069843,"avatar_url":"https://avatars.githubusercontent.com/u/12069843?v=3","gravatar_id":"","url":"https://api.github.com/users/sPHENIX-Collaboration","html_url":"https://github.com/sPHENIX-Collaboration","followers_url":"https://api.github.com/users/sPHENIX-Collaboration/followers","following_url":"https://api.github.com/users/sPHENIX-Collaboration/following{/other_user}","gists_url":"https://api.github.com/users/sPHENIX-Collaboration/gists{/gist_id}","starred_url":"https://api.github.com/users/sPHENIX-Collaboration/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sPHENIX-Collaboration/subscriptions","organizations_url":"https://api.github.com/users/sPHENIX-Collaboration/orgs","repos_url":"https://api.github.com/users/sPHENIX-Collaboration/repos","events_url":"https://api.github.com/users/sPHENIX-Collaboration/events{/privacy}","received_events_url":"https://api.github.com/users/sPHENIX-Collaboration/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sPHENIX-Collaboration/coresoftware","description":"Our big core software repository","fork":false,"url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware","forks_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/forks","keys_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/teams","hooks_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/hooks","issue_events_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/issues/events{/number}","events_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/events","assignees_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/assignees{/user}","branches_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/branches{/branch}","tags_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/tags","blobs_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/git/refs{/sha}","trees_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/statuses/{sha}","languages_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/languages","stargazers_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/stargazers","contributors_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/contributors","subscribers_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/subscribers","subscription_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/subscription","commits_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/commits{/sha}","git_commits_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/git/commits{/sha}","comments_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/comments{/number}","issue_comment_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/issues/comments{/number}","contents_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/contents/{+path}","compare_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/merges","archive_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/downloads","issues_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/issues{/number}","pulls_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/pulls{/number}","milestones_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/milestones{/number}","notifications_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/labels{/name}","releases_url":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/releases{/id}","created_at":"2015-04-28T16:29:55Z","updated_at":"2015-09-22T14:48:05Z","pushed_at":"2015-10-06T16:27:04Z","git_url":"git://github.com/sPHENIX-Collaboration/coresoftware.git","ssh_url":"git@github.com:sPHENIX-Collaboration/coresoftware.git","clone_url":"https://github.com/sPHENIX-Collaboration/coresoftware.git","svn_url":"https://github.com/sPHENIX-Collaboration/coresoftware","homepage":"https://wiki.bnl.gov/sPHENIX/index.php/Main_Page","size":4020,"stargazers_count":4,"watchers_count":4,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":3,"forks":10,"open_issues":3,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/pulls/69"},"html":{"href":"https://github.com/sPHENIX-Collaboration/coresoftware/pull/69"},"issue":{"href":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/issues/69"},"comments":{"href":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/issues/69/comments"},"review_comments":{"href":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/pulls/69/comments"},"review_comment":{"href":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/pulls/69/commits"},"statuses":{"href":"https://api.github.com/repos/sPHENIX-Collaboration/coresoftware/statuses/63a9bda531c05a7aa83b761d127028dc2e25b353"}}}}