{"action":"created","comment":{"url":"https://api.github.com/repos/cms-sw/cmssw/pulls/comments/37239359","id":37239359,"diff_hunk":"@@ -0,0 +1,515 @@\n+// ------------------------- //\n+// --> ME0SegFit.cc \n+// Created:  11.05.2015\n+// --> Based on CSCSegFit.cc\n+// with last mod: 03.02.2015\n+// as found in 750pre2 rel\n+// ------------------------- //\n+\n+#include \"RecoLocalMuon/GEMSegment/plugins/ME0SegFit.h\"\n+#include \"DataFormats/GeometryVector/interface/GlobalPoint.h\"\n+#include \"Geometry/GEMGeometry/interface/ME0EtaPartition.h\"\n+\n+#include \"FWCore/ParameterSet/interface/ParameterSet.h\"\n+#include \"FWCore/MessageLogger/interface/MessageLogger.h\"\n+\n+\n+void ME0SegFit::fit(void) {\n+  if ( fitdone() ) return; // don't redo fit unnecessarily\n+  short n = nhits();\n+  switch ( n ) {\n+  case 1:\n+    edm::LogVerbatim(\"ME0SegFit\") << \"[ME0SegFit::fit] - cannot fit just 1 hit!!\";\n+    break;\n+  case 2:\n+    fit2();\n+    break;\n+  case 3:\n+  case 4:\n+  case 5:\n+  case 6:\n+    fitlsq();\n+    break;\n+  default:\n+    edm::LogVerbatim(\"ME0SegFit\") << \"[ME0SegFit::fit] - cannot fit more than 6 hits!!\";\n+  }  \n+}\n+\n+void ME0SegFit::fit2(void) {\n+\n+  // Just join the two points\n+  // Equation of straight line between (x1, y1) and (x2, y2) in xy-plane is\n+  //       y = mx + c\n+  // with m = (y2-y1)/(x2-x1)\n+  // and  c = (y1*x2-x2*y1)/(x2-x1)\n+\n+\n+  // 1) Check whether hits are on the same layer\n+  // -------------------------------------------\n+  ME0SetOfHits::const_iterator ih = hits_.begin();\n+\n+  ME0DetId d1 = DetId((*ih)->rawId());\n+  int il1     = d1.layer();\n+  const ME0RecHit& h1 = (**ih);\n+  ++ih;    \n+  ME0DetId d2 = DetId((*ih)->rawId());\n+  int il2     = d2.layer();\n+  const ME0RecHit& h2 = (**ih);\n+    \n+  // Skip if on same layer, but should be impossible :)\n+  if (il1 == il2) {\n+    edm::LogVerbatim(\"ME0SegFit\") << \"[ME0SegFit:fit2] - 2 hits on same layer!!\";\n+    return;\n+  }\n+    \n+\n+  // 2) Global Positions of hit 1 and 2 and\n+  //    Local  Positions of hit 1 and 2 w.r.t. reference ME0 Eta Partition \n+  // ---------------------------------------------------------------------\n+  const ME0EtaPartition* roll1 = me0etapartition(d1);\n+  GlobalPoint h1glopos = roll1->toGlobal(h1.localPosition());\n+  const ME0EtaPartition* roll2 = me0etapartition(d2);\n+  GlobalPoint h2glopos = roll2->toGlobal(h2.localPosition());\n+    \n+  // We want hit wrt first me0 eta partition \n+  // ( = reference m00 eta partition) \n+  // (and local z will be != 0)\n+  LocalPoint h1pos = refme0etapart()->toLocal(h1glopos);  \n+  LocalPoint h2pos = refme0etapart()->toLocal(h2glopos);  \n+    \n+\n+  // 3) Now make straight line between the two points in local coords\n+  // ----------------------------------------------------------------\n+  float dz = h2pos.z()-h1pos.z();","path":"RecoLocalMuon/GEMSegment/plugins/ME0SegFit.cc","position":83,"original_position":83,"commit_id":"a099ac53cb62cbe0efcb05ac7973138e5b76cc94","original_commit_id":"a099ac53cb62cbe0efcb05ac7973138e5b76cc94","user":{"login":"pietverwilligen","id":5398585,"avatar_url":"https://avatars.githubusercontent.com/u/5398585?v=3","gravatar_id":"","url":"https://api.github.com/users/pietverwilligen","html_url":"https://github.com/pietverwilligen","followers_url":"https://api.github.com/users/pietverwilligen/followers","following_url":"https://api.github.com/users/pietverwilligen/following{/other_user}","gists_url":"https://api.github.com/users/pietverwilligen/gists{/gist_id}","starred_url":"https://api.github.com/users/pietverwilligen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pietverwilligen/subscriptions","organizations_url":"https://api.github.com/users/pietverwilligen/orgs","repos_url":"https://api.github.com/users/pietverwilligen/repos","events_url":"https://api.github.com/users/pietverwilligen/events{/privacy}","received_events_url":"https://api.github.com/users/pietverwilligen/received_events","type":"User","site_admin":false},"body":"done","created_at":"2015-08-17T21:30:55Z","updated_at":"2015-08-17T21:30:55Z","html_url":"https://github.com/cms-sw/cmssw/pull/10485#discussion_r37239359","pull_request_url":"https://api.github.com/repos/cms-sw/cmssw/pulls/10485","_links":{"self":{"href":"https://api.github.com/repos/cms-sw/cmssw/pulls/comments/37239359"},"html":{"href":"https://github.com/cms-sw/cmssw/pull/10485#discussion_r37239359"},"pull_request":{"href":"https://api.github.com/repos/cms-sw/cmssw/pulls/10485"}}},"pull_request":{"url":"https://api.github.com/repos/cms-sw/cmssw/pulls/10485","id":41257936,"html_url":"https://github.com/cms-sw/cmssw/pull/10485","diff_url":"https://github.com/cms-sw/cmssw/pull/10485.diff","patch_url":"https://github.com/cms-sw/cmssw/pull/10485.patch","issue_url":"https://api.github.com/repos/cms-sw/cmssw/issues/10485","number":10485,"state":"open","locked":false,"title":"Gem segment 76","user":{"login":"pietverwilligen","id":5398585,"avatar_url":"https://avatars.githubusercontent.com/u/5398585?v=3","gravatar_id":"","url":"https://api.github.com/users/pietverwilligen","html_url":"https://github.com/pietverwilligen","followers_url":"https://api.github.com/users/pietverwilligen/followers","following_url":"https://api.github.com/users/pietverwilligen/following{/other_user}","gists_url":"https://api.github.com/users/pietverwilligen/gists{/gist_id}","starred_url":"https://api.github.com/users/pietverwilligen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pietverwilligen/subscriptions","organizations_url":"https://api.github.com/users/pietverwilligen/orgs","repos_url":"https://api.github.com/users/pietverwilligen/repos","events_url":"https://api.github.com/users/pietverwilligen/events{/privacy}","received_events_url":"https://api.github.com/users/pietverwilligen/received_events","type":"User","site_admin":false},"body":"Pull Request for making segments in ME0. This is one of the last PRs for porting Muon Upgrade code from SLHC to 76X. Last PR to be expected is a PR containing code to reconstruct ME0Muons starting from these ME0 segments. \r\n\r\n@cvuosalo I have tried as much as possible to check for comments you made for the GEMCSC Segment PR #9083 and to comments made earlier to ME0Segment code in PR #8912. \r\n\r\n@slava77 and @cvuosalo please let me know your comments.\r\ngreets\r\nPiet","created_at":"2015-07-30T17:08:07Z","updated_at":"2015-08-17T21:30:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"889a7c75c4c34d44c6dc178c8e55c1d7d71fe1e7","assignee":null,"milestone":{"url":"https://api.github.com/repos/cms-sw/cmssw/milestones/55","html_url":"https://github.com/cms-sw/cmssw/milestones/Next%20CMSSW_7_6_X","labels_url":"https://api.github.com/repos/cms-sw/cmssw/milestones/55/labels","id":1176788,"number":55,"title":"Next CMSSW_7_6_X","description":"","creator":{"login":"smuzaffar","id":4115138,"avatar_url":"https://avatars.githubusercontent.com/u/4115138?v=3","gravatar_id":"","url":"https://api.github.com/users/smuzaffar","html_url":"https://github.com/smuzaffar","followers_url":"https://api.github.com/users/smuzaffar/followers","following_url":"https://api.github.com/users/smuzaffar/following{/other_user}","gists_url":"https://api.github.com/users/smuzaffar/gists{/gist_id}","starred_url":"https://api.github.com/users/smuzaffar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smuzaffar/subscriptions","organizations_url":"https://api.github.com/users/smuzaffar/orgs","repos_url":"https://api.github.com/users/smuzaffar/repos","events_url":"https://api.github.com/users/smuzaffar/events{/privacy}","received_events_url":"https://api.github.com/users/smuzaffar/received_events","type":"User","site_admin":false},"open_issues":82,"closed_issues":415,"state":"open","created_at":"2015-06-23T07:27:04Z","updated_at":"2015-08-17T20:31:14Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/cms-sw/cmssw/pulls/10485/commits","review_comments_url":"https://api.github.com/repos/cms-sw/cmssw/pulls/10485/comments","review_comment_url":"https://api.github.com/repos/cms-sw/cmssw/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cms-sw/cmssw/issues/10485/comments","statuses_url":"https://api.github.com/repos/cms-sw/cmssw/statuses/a099ac53cb62cbe0efcb05ac7973138e5b76cc94","head":{"label":"pietverwilligen:GEMSegment_76X_v1","ref":"GEMSegment_76X_v1","sha":"a099ac53cb62cbe0efcb05ac7973138e5b76cc94","user":{"login":"pietverwilligen","id":5398585,"avatar_url":"https://avatars.githubusercontent.com/u/5398585?v=3","gravatar_id":"","url":"https://api.github.com/users/pietverwilligen","html_url":"https://github.com/pietverwilligen","followers_url":"https://api.github.com/users/pietverwilligen/followers","following_url":"https://api.github.com/users/pietverwilligen/following{/other_user}","gists_url":"https://api.github.com/users/pietverwilligen/gists{/gist_id}","starred_url":"https://api.github.com/users/pietverwilligen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pietverwilligen/subscriptions","organizations_url":"https://api.github.com/users/pietverwilligen/orgs","repos_url":"https://api.github.com/users/pietverwilligen/repos","events_url":"https://api.github.com/users/pietverwilligen/events{/privacy}","received_events_url":"https://api.github.com/users/pietverwilligen/received_events","type":"User","site_admin":false},"repo":{"id":14990646,"name":"cmssw","full_name":"pietverwilligen/cmssw","owner":{"login":"pietverwilligen","id":5398585,"avatar_url":"https://avatars.githubusercontent.com/u/5398585?v=3","gravatar_id":"","url":"https://api.github.com/users/pietverwilligen","html_url":"https://github.com/pietverwilligen","followers_url":"https://api.github.com/users/pietverwilligen/followers","following_url":"https://api.github.com/users/pietverwilligen/following{/other_user}","gists_url":"https://api.github.com/users/pietverwilligen/gists{/gist_id}","starred_url":"https://api.github.com/users/pietverwilligen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pietverwilligen/subscriptions","organizations_url":"https://api.github.com/users/pietverwilligen/orgs","repos_url":"https://api.github.com/users/pietverwilligen/repos","events_url":"https://api.github.com/users/pietverwilligen/events{/privacy}","received_events_url":"https://api.github.com/users/pietverwilligen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pietverwilligen/cmssw","description":"CMS Offline Software","fork":true,"url":"https://api.github.com/repos/pietverwilligen/cmssw","forks_url":"https://api.github.com/repos/pietverwilligen/cmssw/forks","keys_url":"https://api.github.com/repos/pietverwilligen/cmssw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pietverwilligen/cmssw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pietverwilligen/cmssw/teams","hooks_url":"https://api.github.com/repos/pietverwilligen/cmssw/hooks","issue_events_url":"https://api.github.com/repos/pietverwilligen/cmssw/issues/events{/number}","events_url":"https://api.github.com/repos/pietverwilligen/cmssw/events","assignees_url":"https://api.github.com/repos/pietverwilligen/cmssw/assignees{/user}","branches_url":"https://api.github.com/repos/pietverwilligen/cmssw/branches{/branch}","tags_url":"https://api.github.com/repos/pietverwilligen/cmssw/tags","blobs_url":"https://api.github.com/repos/pietverwilligen/cmssw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pietverwilligen/cmssw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pietverwilligen/cmssw/git/refs{/sha}","trees_url":"https://api.github.com/repos/pietverwilligen/cmssw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pietverwilligen/cmssw/statuses/{sha}","languages_url":"https://api.github.com/repos/pietverwilligen/cmssw/languages","stargazers_url":"https://api.github.com/repos/pietverwilligen/cmssw/stargazers","contributors_url":"https://api.github.com/repos/pietverwilligen/cmssw/contributors","subscribers_url":"https://api.github.com/repos/pietverwilligen/cmssw/subscribers","subscription_url":"https://api.github.com/repos/pietverwilligen/cmssw/subscription","commits_url":"https://api.github.com/repos/pietverwilligen/cmssw/commits{/sha}","git_commits_url":"https://api.github.com/repos/pietverwilligen/cmssw/git/commits{/sha}","comments_url":"https://api.github.com/repos/pietverwilligen/cmssw/comments{/number}","issue_comment_url":"https://api.github.com/repos/pietverwilligen/cmssw/issues/comments{/number}","contents_url":"https://api.github.com/repos/pietverwilligen/cmssw/contents/{+path}","compare_url":"https://api.github.com/repos/pietverwilligen/cmssw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pietverwilligen/cmssw/merges","archive_url":"https://api.github.com/repos/pietverwilligen/cmssw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pietverwilligen/cmssw/downloads","issues_url":"https://api.github.com/repos/pietverwilligen/cmssw/issues{/number}","pulls_url":"https://api.github.com/repos/pietverwilligen/cmssw/pulls{/number}","milestones_url":"https://api.github.com/repos/pietverwilligen/cmssw/milestones{/number}","notifications_url":"https://api.github.com/repos/pietverwilligen/cmssw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pietverwilligen/cmssw/labels{/name}","releases_url":"https://api.github.com/repos/pietverwilligen/cmssw/releases{/id}","created_at":"2013-12-06T18:51:47Z","updated_at":"2014-05-16T17:52:42Z","pushed_at":"2015-08-06T15:14:24Z","git_url":"git://github.com/pietverwilligen/cmssw.git","ssh_url":"git@github.com:pietverwilligen/cmssw.git","clone_url":"https://github.com/pietverwilligen/cmssw.git","svn_url":"https://github.com/pietverwilligen/cmssw","homepage":"cms-sw.github.io/cmssw","size":793106,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"CMSSW_6_2_X_SLHC"}},"base":{"label":"cms-sw:CMSSW_7_6_X","ref":"CMSSW_7_6_X","sha":"320f27ccc123ec650cd295edb388688617beb64b","user":{"login":"cms-sw","id":3863500,"avatar_url":"https://avatars.githubusercontent.com/u/3863500?v=3","gravatar_id":"","url":"https://api.github.com/users/cms-sw","html_url":"https://github.com/cms-sw","followers_url":"https://api.github.com/users/cms-sw/followers","following_url":"https://api.github.com/users/cms-sw/following{/other_user}","gists_url":"https://api.github.com/users/cms-sw/gists{/gist_id}","starred_url":"https://api.github.com/users/cms-sw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cms-sw/subscriptions","organizations_url":"https://api.github.com/users/cms-sw/orgs","repos_url":"https://api.github.com/users/cms-sw/repos","events_url":"https://api.github.com/users/cms-sw/events{/privacy}","received_events_url":"https://api.github.com/users/cms-sw/received_events","type":"Organization","site_admin":false},"repo":{"id":10969551,"name":"cmssw","full_name":"cms-sw/cmssw","owner":{"login":"cms-sw","id":3863500,"avatar_url":"https://avatars.githubusercontent.com/u/3863500?v=3","gravatar_id":"","url":"https://api.github.com/users/cms-sw","html_url":"https://github.com/cms-sw","followers_url":"https://api.github.com/users/cms-sw/followers","following_url":"https://api.github.com/users/cms-sw/following{/other_user}","gists_url":"https://api.github.com/users/cms-sw/gists{/gist_id}","starred_url":"https://api.github.com/users/cms-sw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cms-sw/subscriptions","organizations_url":"https://api.github.com/users/cms-sw/orgs","repos_url":"https://api.github.com/users/cms-sw/repos","events_url":"https://api.github.com/users/cms-sw/events{/privacy}","received_events_url":"https://api.github.com/users/cms-sw/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cms-sw/cmssw","description":"CMS Offline Software","fork":false,"url":"https://api.github.com/repos/cms-sw/cmssw","forks_url":"https://api.github.com/repos/cms-sw/cmssw/forks","keys_url":"https://api.github.com/repos/cms-sw/cmssw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cms-sw/cmssw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cms-sw/cmssw/teams","hooks_url":"https://api.github.com/repos/cms-sw/cmssw/hooks","issue_events_url":"https://api.github.com/repos/cms-sw/cmssw/issues/events{/number}","events_url":"https://api.github.com/repos/cms-sw/cmssw/events","assignees_url":"https://api.github.com/repos/cms-sw/cmssw/assignees{/user}","branches_url":"https://api.github.com/repos/cms-sw/cmssw/branches{/branch}","tags_url":"https://api.github.com/repos/cms-sw/cmssw/tags","blobs_url":"https://api.github.com/repos/cms-sw/cmssw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cms-sw/cmssw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cms-sw/cmssw/git/refs{/sha}","trees_url":"https://api.github.com/repos/cms-sw/cmssw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cms-sw/cmssw/statuses/{sha}","languages_url":"https://api.github.com/repos/cms-sw/cmssw/languages","stargazers_url":"https://api.github.com/repos/cms-sw/cmssw/stargazers","contributors_url":"https://api.github.com/repos/cms-sw/cmssw/contributors","subscribers_url":"https://api.github.com/repos/cms-sw/cmssw/subscribers","subscription_url":"https://api.github.com/repos/cms-sw/cmssw/subscription","commits_url":"https://api.github.com/repos/cms-sw/cmssw/commits{/sha}","git_commits_url":"https://api.github.com/repos/cms-sw/cmssw/git/commits{/sha}","comments_url":"https://api.github.com/repos/cms-sw/cmssw/comments{/number}","issue_comment_url":"https://api.github.com/repos/cms-sw/cmssw/issues/comments{/number}","contents_url":"https://api.github.com/repos/cms-sw/cmssw/contents/{+path}","compare_url":"https://api.github.com/repos/cms-sw/cmssw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cms-sw/cmssw/merges","archive_url":"https://api.github.com/repos/cms-sw/cmssw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cms-sw/cmssw/downloads","issues_url":"https://api.github.com/repos/cms-sw/cmssw/issues{/number}","pulls_url":"https://api.github.com/repos/cms-sw/cmssw/pulls{/number}","milestones_url":"https://api.github.com/repos/cms-sw/cmssw/milestones{/number}","notifications_url":"https://api.github.com/repos/cms-sw/cmssw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cms-sw/cmssw/labels{/name}","releases_url":"https://api.github.com/repos/cms-sw/cmssw/releases{/id}","created_at":"2013-06-26T14:09:07Z","updated_at":"2015-08-07T23:46:12Z","pushed_at":"2015-08-17T21:29:19Z","git_url":"git://github.com/cms-sw/cmssw.git","ssh_url":"git@github.com:cms-sw/cmssw.git","clone_url":"https://github.com/cms-sw/cmssw.git","svn_url":"https://github.com/cms-sw/cmssw","homepage":"http://cms-sw.github.io/","size":1273664,"stargazers_count":256,"watchers_count":256,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1530,"mirror_url":null,"open_issues_count":257,"forks":1530,"open_issues":257,"watchers":256,"default_branch":"CMSSW_7_6_X"}},"_links":{"self":{"href":"https://api.github.com/repos/cms-sw/cmssw/pulls/10485"},"html":{"href":"https://github.com/cms-sw/cmssw/pull/10485"},"issue":{"href":"https://api.github.com/repos/cms-sw/cmssw/issues/10485"},"comments":{"href":"https://api.github.com/repos/cms-sw/cmssw/issues/10485/comments"},"review_comments":{"href":"https://api.github.com/repos/cms-sw/cmssw/pulls/10485/comments"},"review_comment":{"href":"https://api.github.com/repos/cms-sw/cmssw/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cms-sw/cmssw/pulls/10485/commits"},"statuses":{"href":"https://api.github.com/repos/cms-sw/cmssw/statuses/a099ac53cb62cbe0efcb05ac7973138e5b76cc94"}}}}