{"action":"created","comment":{"url":"https://api.github.com/repos/cbernet/heppy/pulls/comments/69092576","id":69092576,"diff_hunk":"@@ -114,11 +126,78 @@ def distquad (time):\n         minim_answer = opti.bracket(distquad, xa = -0.5e-14, xb = 0.5e-14)\n         self.closest_t = minim_answer[1]\n         vector_IP = self.point_at_time(minim_answer[1]) - vertex\n-        self.signIP= vector_IP.Dot(self.p4.Vect().Unit())\n-        self.IP = minim_answer[4]**(1.0/2)*sign(self.signIP)\n-        #self.closest=TVector3(self.fx(t), self.fy(t), self.fz(t))\n+        Pj = jet.p4().Vect().Unit()\n+        signIP  = vector_IP.Dot(Pj)\n+        self.IP = minim_answer[4]**(1.0/2)*sign(signIP)\n+        \n+        x,y,z = self.coord_at_time(minim_answer[1])\n+        self.IPx, self.IPy, self.IPz = (x-vertex.x()),  (y-vertex.y()), (z-vertex.z())\n+       \n+    def compute_theta_0(self):\n+        '''Computes the square root of the variance, sigma, of the multiple\n+        scattering angle due to matter interactions, using the formula in PDG\n+        paper. The values for the beam pipe are set'''\n+        # for the beam pipe,  X_0 = 1.72e-2, width = 1.5e-3\n+        P = self.p4.Vect().Dot(self.udir)\n+        PT= self.p4.Perp()\n+        x = abs( epaisseur_beampipe * 1.0* P/PT)\n+        X_0 = X_0_beampipe\n+        # distance and radiation length, linked to the dectector properties\n+        # and the particle's direction\n+        self.theta_0 = 1.0*13.6e-3/(1.0*self.speed/constants.c*P)\n+        self.theta_0 *= abs(self.charge)*(1.0*x/X_0)**(1.0/2)*(1+0.038*math.log(1.0*x/X_0))\n+        self.xX_0 = 1.0*x/X_0\n+    \n+    def compute_IP_signif(self, IP, theta_0, scat_point):\n+        # ! are we sure sigma_IP_due_IP_algo_precise isnt overestimated ?\n+        delta_t = 1e-15\n+        delta_s = delta_t * self.speed *1.0\n+        sigma_s = delta_s\n+        sigma_IP_due_IP_algo_precise = IP*1.0/(math.cos(math.atan(sigma_s/IP)))-IP\n+        \n+        if theta_0 == None or scat_point == None:\n+            self.IP_signif = IP*1.0/sigma_IP_due_IP_algo_precise\n+        else :        \n+            phi_t_scat = self.phi( scat_point.X(), scat_point.Y())\n+            t_scat = self.time_at_phi(phi_t_scat)\n+            fly_distance = self.speed * 1.0 * t_scat\n+            # for the IP significance : estimation \n+            sigma_IP_due_scattering = fly_distance*math.tan((2)**0.5*theta_0)\n+            ","path":"papas/path.py","position":93,"original_position":93,"commit_id":"9fc3655be6d32f9e7c8a8de36a79889c1d619ab3","original_commit_id":"9fc3655be6d32f9e7c8a8de36a79889c1d619ab3","user":{"login":"cbernet","id":4138171,"avatar_url":"https://avatars.githubusercontent.com/u/4138171?v=3","gravatar_id":"","url":"https://api.github.com/users/cbernet","html_url":"https://github.com/cbernet","followers_url":"https://api.github.com/users/cbernet/followers","following_url":"https://api.github.com/users/cbernet/following{/other_user}","gists_url":"https://api.github.com/users/cbernet/gists{/gist_id}","starred_url":"https://api.github.com/users/cbernet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbernet/subscriptions","organizations_url":"https://api.github.com/users/cbernet/orgs","repos_url":"https://api.github.com/users/cbernet/repos","events_url":"https://api.github.com/users/cbernet/events{/privacy}","received_events_url":"https://api.github.com/users/cbernet/received_events","type":"User","site_admin":false},"body":"e.g. here there should be no space","created_at":"2016-06-30T08:31:04Z","updated_at":"2016-06-30T08:31:04Z","html_url":"https://github.com/cbernet/heppy/pull/15#discussion_r69092576","pull_request_url":"https://api.github.com/repos/cbernet/heppy/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/cbernet/heppy/pulls/comments/69092576"},"html":{"href":"https://github.com/cbernet/heppy/pull/15#discussion_r69092576"},"pull_request":{"href":"https://api.github.com/repos/cbernet/heppy/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/cbernet/heppy/pulls/15","id":75335697,"html_url":"https://github.com/cbernet/heppy/pull/15","diff_url":"https://github.com/cbernet/heppy/pull/15.diff","patch_url":"https://github.com/cbernet/heppy/pull/15.patch","issue_url":"https://api.github.com/repos/cbernet/heppy/issues/15","number":15,"state":"open","locked":false,"title":"b-tagging first improvements -- need to check","user":{"login":"lucastorterotot","id":19221936,"avatar_url":"https://avatars.githubusercontent.com/u/19221936?v=3","gravatar_id":"","url":"https://api.github.com/users/lucastorterotot","html_url":"https://github.com/lucastorterotot","followers_url":"https://api.github.com/users/lucastorterotot/followers","following_url":"https://api.github.com/users/lucastorterotot/following{/other_user}","gists_url":"https://api.github.com/users/lucastorterotot/gists{/gist_id}","starred_url":"https://api.github.com/users/lucastorterotot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucastorterotot/subscriptions","organizations_url":"https://api.github.com/users/lucastorterotot/orgs","repos_url":"https://api.github.com/users/lucastorterotot/repos","events_url":"https://api.github.com/users/lucastorterotot/events{/privacy}","received_events_url":"https://api.github.com/users/lucastorterotot/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-27T15:54:55Z","updated_at":"2016-06-30T08:31:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e6684285dc126a1bd2b91b653a1e1309f04695c9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cbernet/heppy/pulls/15/commits","review_comments_url":"https://api.github.com/repos/cbernet/heppy/pulls/15/comments","review_comment_url":"https://api.github.com/repos/cbernet/heppy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cbernet/heppy/issues/15/comments","statuses_url":"https://api.github.com/repos/cbernet/heppy/statuses/9fc3655be6d32f9e7c8a8de36a79889c1d619ab3","head":{"label":"lucastorterotot:master","ref":"master","sha":"9fc3655be6d32f9e7c8a8de36a79889c1d619ab3","user":{"login":"lucastorterotot","id":19221936,"avatar_url":"https://avatars.githubusercontent.com/u/19221936?v=3","gravatar_id":"","url":"https://api.github.com/users/lucastorterotot","html_url":"https://github.com/lucastorterotot","followers_url":"https://api.github.com/users/lucastorterotot/followers","following_url":"https://api.github.com/users/lucastorterotot/following{/other_user}","gists_url":"https://api.github.com/users/lucastorterotot/gists{/gist_id}","starred_url":"https://api.github.com/users/lucastorterotot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucastorterotot/subscriptions","organizations_url":"https://api.github.com/users/lucastorterotot/orgs","repos_url":"https://api.github.com/users/lucastorterotot/repos","events_url":"https://api.github.com/users/lucastorterotot/events{/privacy}","received_events_url":"https://api.github.com/users/lucastorterotot/received_events","type":"User","site_admin":false},"repo":{"id":58357599,"name":"heppy","full_name":"lucastorterotot/heppy","owner":{"login":"lucastorterotot","id":19221936,"avatar_url":"https://avatars.githubusercontent.com/u/19221936?v=3","gravatar_id":"","url":"https://api.github.com/users/lucastorterotot","html_url":"https://github.com/lucastorterotot","followers_url":"https://api.github.com/users/lucastorterotot/followers","following_url":"https://api.github.com/users/lucastorterotot/following{/other_user}","gists_url":"https://api.github.com/users/lucastorterotot/gists{/gist_id}","starred_url":"https://api.github.com/users/lucastorterotot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucastorterotot/subscriptions","organizations_url":"https://api.github.com/users/lucastorterotot/orgs","repos_url":"https://api.github.com/users/lucastorterotot/repos","events_url":"https://api.github.com/users/lucastorterotot/events{/privacy}","received_events_url":"https://api.github.com/users/lucastorterotot/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lucastorterotot/heppy","description":"A python event processing framework for high energy physics based on ROOT","fork":true,"url":"https://api.github.com/repos/lucastorterotot/heppy","forks_url":"https://api.github.com/repos/lucastorterotot/heppy/forks","keys_url":"https://api.github.com/repos/lucastorterotot/heppy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lucastorterotot/heppy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lucastorterotot/heppy/teams","hooks_url":"https://api.github.com/repos/lucastorterotot/heppy/hooks","issue_events_url":"https://api.github.com/repos/lucastorterotot/heppy/issues/events{/number}","events_url":"https://api.github.com/repos/lucastorterotot/heppy/events","assignees_url":"https://api.github.com/repos/lucastorterotot/heppy/assignees{/user}","branches_url":"https://api.github.com/repos/lucastorterotot/heppy/branches{/branch}","tags_url":"https://api.github.com/repos/lucastorterotot/heppy/tags","blobs_url":"https://api.github.com/repos/lucastorterotot/heppy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lucastorterotot/heppy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lucastorterotot/heppy/git/refs{/sha}","trees_url":"https://api.github.com/repos/lucastorterotot/heppy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lucastorterotot/heppy/statuses/{sha}","languages_url":"https://api.github.com/repos/lucastorterotot/heppy/languages","stargazers_url":"https://api.github.com/repos/lucastorterotot/heppy/stargazers","contributors_url":"https://api.github.com/repos/lucastorterotot/heppy/contributors","subscribers_url":"https://api.github.com/repos/lucastorterotot/heppy/subscribers","subscription_url":"https://api.github.com/repos/lucastorterotot/heppy/subscription","commits_url":"https://api.github.com/repos/lucastorterotot/heppy/commits{/sha}","git_commits_url":"https://api.github.com/repos/lucastorterotot/heppy/git/commits{/sha}","comments_url":"https://api.github.com/repos/lucastorterotot/heppy/comments{/number}","issue_comment_url":"https://api.github.com/repos/lucastorterotot/heppy/issues/comments{/number}","contents_url":"https://api.github.com/repos/lucastorterotot/heppy/contents/{+path}","compare_url":"https://api.github.com/repos/lucastorterotot/heppy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lucastorterotot/heppy/merges","archive_url":"https://api.github.com/repos/lucastorterotot/heppy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lucastorterotot/heppy/downloads","issues_url":"https://api.github.com/repos/lucastorterotot/heppy/issues{/number}","pulls_url":"https://api.github.com/repos/lucastorterotot/heppy/pulls{/number}","milestones_url":"https://api.github.com/repos/lucastorterotot/heppy/milestones{/number}","notifications_url":"https://api.github.com/repos/lucastorterotot/heppy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lucastorterotot/heppy/labels{/name}","releases_url":"https://api.github.com/repos/lucastorterotot/heppy/releases{/id}","deployments_url":"https://api.github.com/repos/lucastorterotot/heppy/deployments","created_at":"2016-05-09T07:35:09Z","updated_at":"2016-05-09T07:35:11Z","pushed_at":"2016-06-29T13:52:27Z","git_url":"git://github.com/lucastorterotot/heppy.git","ssh_url":"git@github.com:lucastorterotot/heppy.git","clone_url":"https://github.com/lucastorterotot/heppy.git","svn_url":"https://github.com/lucastorterotot/heppy","homepage":"","size":587,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"cbernet:master","ref":"master","sha":"d76fdc0c750bae85e500d6670425e59ea2459ab1","user":{"login":"cbernet","id":4138171,"avatar_url":"https://avatars.githubusercontent.com/u/4138171?v=3","gravatar_id":"","url":"https://api.github.com/users/cbernet","html_url":"https://github.com/cbernet","followers_url":"https://api.github.com/users/cbernet/followers","following_url":"https://api.github.com/users/cbernet/following{/other_user}","gists_url":"https://api.github.com/users/cbernet/gists{/gist_id}","starred_url":"https://api.github.com/users/cbernet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbernet/subscriptions","organizations_url":"https://api.github.com/users/cbernet/orgs","repos_url":"https://api.github.com/users/cbernet/repos","events_url":"https://api.github.com/users/cbernet/events{/privacy}","received_events_url":"https://api.github.com/users/cbernet/received_events","type":"User","site_admin":false},"repo":{"id":20684927,"name":"heppy","full_name":"cbernet/heppy","owner":{"login":"cbernet","id":4138171,"avatar_url":"https://avatars.githubusercontent.com/u/4138171?v=3","gravatar_id":"","url":"https://api.github.com/users/cbernet","html_url":"https://github.com/cbernet","followers_url":"https://api.github.com/users/cbernet/followers","following_url":"https://api.github.com/users/cbernet/following{/other_user}","gists_url":"https://api.github.com/users/cbernet/gists{/gist_id}","starred_url":"https://api.github.com/users/cbernet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbernet/subscriptions","organizations_url":"https://api.github.com/users/cbernet/orgs","repos_url":"https://api.github.com/users/cbernet/repos","events_url":"https://api.github.com/users/cbernet/events{/privacy}","received_events_url":"https://api.github.com/users/cbernet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cbernet/heppy","description":"A python event processing framework for high energy physics based on ROOT","fork":false,"url":"https://api.github.com/repos/cbernet/heppy","forks_url":"https://api.github.com/repos/cbernet/heppy/forks","keys_url":"https://api.github.com/repos/cbernet/heppy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cbernet/heppy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cbernet/heppy/teams","hooks_url":"https://api.github.com/repos/cbernet/heppy/hooks","issue_events_url":"https://api.github.com/repos/cbernet/heppy/issues/events{/number}","events_url":"https://api.github.com/repos/cbernet/heppy/events","assignees_url":"https://api.github.com/repos/cbernet/heppy/assignees{/user}","branches_url":"https://api.github.com/repos/cbernet/heppy/branches{/branch}","tags_url":"https://api.github.com/repos/cbernet/heppy/tags","blobs_url":"https://api.github.com/repos/cbernet/heppy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cbernet/heppy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cbernet/heppy/git/refs{/sha}","trees_url":"https://api.github.com/repos/cbernet/heppy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cbernet/heppy/statuses/{sha}","languages_url":"https://api.github.com/repos/cbernet/heppy/languages","stargazers_url":"https://api.github.com/repos/cbernet/heppy/stargazers","contributors_url":"https://api.github.com/repos/cbernet/heppy/contributors","subscribers_url":"https://api.github.com/repos/cbernet/heppy/subscribers","subscription_url":"https://api.github.com/repos/cbernet/heppy/subscription","commits_url":"https://api.github.com/repos/cbernet/heppy/commits{/sha}","git_commits_url":"https://api.github.com/repos/cbernet/heppy/git/commits{/sha}","comments_url":"https://api.github.com/repos/cbernet/heppy/comments{/number}","issue_comment_url":"https://api.github.com/repos/cbernet/heppy/issues/comments{/number}","contents_url":"https://api.github.com/repos/cbernet/heppy/contents/{+path}","compare_url":"https://api.github.com/repos/cbernet/heppy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cbernet/heppy/merges","archive_url":"https://api.github.com/repos/cbernet/heppy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cbernet/heppy/downloads","issues_url":"https://api.github.com/repos/cbernet/heppy/issues{/number}","pulls_url":"https://api.github.com/repos/cbernet/heppy/pulls{/number}","milestones_url":"https://api.github.com/repos/cbernet/heppy/milestones{/number}","notifications_url":"https://api.github.com/repos/cbernet/heppy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cbernet/heppy/labels{/name}","releases_url":"https://api.github.com/repos/cbernet/heppy/releases{/id}","deployments_url":"https://api.github.com/repos/cbernet/heppy/deployments","created_at":"2014-06-10T12:51:12Z","updated_at":"2016-02-08T14:39:46Z","pushed_at":"2016-06-29T13:52:28Z","git_url":"git://github.com/cbernet/heppy.git","ssh_url":"git@github.com:cbernet/heppy.git","clone_url":"https://github.com/cbernet/heppy.git","svn_url":"https://github.com/cbernet/heppy","homepage":"","size":557,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":3,"forks":16,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cbernet/heppy/pulls/15"},"html":{"href":"https://github.com/cbernet/heppy/pull/15"},"issue":{"href":"https://api.github.com/repos/cbernet/heppy/issues/15"},"comments":{"href":"https://api.github.com/repos/cbernet/heppy/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/cbernet/heppy/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/cbernet/heppy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cbernet/heppy/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/cbernet/heppy/statuses/9fc3655be6d32f9e7c8a8de36a79889c1d619ab3"}}}}
{"actor":{"display_login":"cbernet"}}