GitHub PullRequestReviewCommentEvent at 2014-08-04 13:06:00
Repository: cmssw
Actor: StoyanStoynev
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/cms-sw/cmssw/pulls/comments/15753608","id":15753608,"diff_hunk":"@@ -0,0 +1,77 @@\n+#include \"PhysicsTools/SelectorUtils/interface/CutApplicatorWithEventContentBase.h\"\n+#include \"DataFormats/EgammaCandidates/interface/GsfElectron.h\"\n+#include \"DataFormats/EgammaCandidates/interface/ConversionFwd.h\"\n+#include \"DataFormats/EgammaCandidates/interface/Conversion.h\"\n+#include \"RecoEgamma/EgammaTools/interface/ConversionTools.h\"\n+\n+\n+class GsfEleDeltaBetaIsoCut : public CutApplicatorWithEventContentBase {\n+public:\n+  GsfEleDeltaBetaIsoCut(const edm::ParameterSet& c);\n+  \n+  result_type operator()(const reco::GsfElectronRef&) const override final;\n+\n+  void setConsumes(edm::ConsumesCollector&) override final;\n+  void getEventContent(const edm::EventBase&) override final;\n+\n+  CandidateType candidateType() const override final { \n+    return ELECTRON; \n+  }\n+\n+private:\n+  float _deltaBetaConstant;\n+  bool _relativeIso;\n+  edm::Handle<edm::ValueMap<float> > _chad_iso,_nhad_iso,_ph_iso,_PUchad_iso;\n+};\n+\n+DEFINE_EDM_PLUGIN(CutApplicatorFactory,\n+\t\t  GsfEleDeltaBetaIsoCut,\n+\t\t  \"GsfEleDeltaBetaIsoCut\");\n+\n+GsfEleDeltaBetaIsoCut::GsfEleDeltaBetaIsoCut(const edm::ParameterSet& c) :\n+  CutApplicatorWithEventContentBase(c),\n+  _deltaBetaConstant(c.getParameter<double>(\"deltaBetaConstant\")),\n+  _relativeIso(c.getParameter<bool>(\"isRelativeIso\")) {  \n+  edm::InputTag chadtag = c.getParameter<edm::InputTag>(\"chargedHadronIsoDR03Src\");\n+  edm::InputTag nhadtag = c.getParameter<edm::InputTag>(\"neutralHadronIsoDR03Src\");\n+  edm::InputTag phtag = c.getParameter<edm::InputTag>(\"photonIsoDR03Src\");\n+  edm::InputTag PUchadtag = c.getParameter<edm::InputTag>(\"puChargedHadronIsoDR03Src\");\n+  contentTags_.emplace(\"chad\",chadtag);\n+  contentTags_.emplace(\"nhad\",nhadtag);\n+  contentTags_.emplace(\"pho\",phtag);\n+  contentTags_.emplace(\"puchad\",PUchadtag);\n+}\n+\n+void GsfEleDeltaBetaIsoCut::setConsumes(edm::ConsumesCollector& cc) {\n+  auto chad = \n+    cc.consumes<edm::ValueMap<float> >(contentTags_[\"chad\"]);\n+  contentTokens_.emplace(\"chad\",chad);\n+  auto nhad = \n+    cc.consumes<edm::ValueMap<float> >(contentTags_[\"nhad\"]);\n+  contentTokens_.emplace(\"nhad\",nhad);\n+  auto pho = \n+    cc.consumes<edm::ValueMap<float> >(contentTags_[\"pho\"]);\n+  contentTokens_.emplace(\"pho\",pho);\n+  auto puchad = \n+    cc.consumes<edm::ValueMap<float> >(contentTags_[\"puchad\"]);\n+  contentTokens_.emplace(\"puchad\",puchad);\n+}\n+\n+void GsfEleDeltaBetaIsoCut::getEventContent(const edm::EventBase& ev) {  \n+  ev.getByLabel(contentTags_[\"chad\"],_chad_iso);\n+  ev.getByLabel(contentTags_[\"nhad\"],_nhad_iso);\n+  ev.getByLabel(contentTags_[\"pho\"],_ph_iso);\n+  ev.getByLabel(contentTags_[\"puchad\"],_PUchad_iso);\n+}\n+\n+CutApplicatorBase::result_type \n+GsfEleDeltaBetaIsoCut::\n+operator()(const reco::GsfElectronRef& cand) const{  \n+  const float chad = (*_chad_iso)[cand];\n+  const float nhad = (*_nhad_iso)[cand];\n+  const float pho = (*_ph_iso)[cand];\n+  const float puchad = (*_PUchad_iso)[cand];\n+  float iso = chad + std::max(0.0f, nhad + pho - _deltaBetaConstant*puchad);\n+  if( _relativeIso ) iso /= cand->p4().pt();","path":"EgammaAnalysis/ElectronTools/plugins/cuts/GsfEleDeltaBetaIsoCut.cc","position":75,"original_position":75,"commit_id":"e36b2c4847c863eaa983cd5301471d3244c01c8a","original_commit_id":"e36b2c4847c863eaa983cd5301471d3244c01c8a","user":{"login":"StoyanStoynev","id":5399712,"avatar_url":"https://avatars.githubusercontent.com/u/5399712?v=1","gravatar_id":"8ca6cfc1b025c05781206a826a149727","url":"https://api.github.com/users/StoyanStoynev","html_url":"https://github.com/StoyanStoynev","followers_url":"https://api.github.com/users/StoyanStoynev/followers","following_url":"https://api.github.com/users/StoyanStoynev/following{/other_user}","gists_url":"https://api.github.com/users/StoyanStoynev/gists{/gist_id}","starred_url":"https://api.github.com/users/StoyanStoynev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StoyanStoynev/subscriptions","organizations_url":"https://api.github.com/users/StoyanStoynev/orgs","repos_url":"https://api.github.com/users/StoyanStoynev/repos","events_url":"https://api.github.com/users/StoyanStoynev/events{/privacy}","received_events_url":"https://api.github.com/users/StoyanStoynev/received_events","type":"User","site_admin":false},"body":"Don't we need a protection against pt == 0 (or actually a very  small number I'd argue)?","created_at":"2014-08-04T13:06:00Z","updated_at":"2014-08-04T13:06:00Z","html_url":"https://github.com/cms-sw/cmssw/pull/4685#discussion_r15753608","pull_request_url":"https://api.github.com/repos/cms-sw/cmssw/pulls/4685","_links":{"self":{"href":"https://api.github.com/repos/cms-sw/cmssw/pulls/comments/15753608"},"html":{"href":"https://github.com/cms-sw/cmssw/pull/4685#discussion_r15753608"},"pull_request":{"href":"https://api.github.com/repos/cms-sw/cmssw/pulls/4685"}}},"pull_request":{"url":"https://api.github.com/repos/cms-sw/cmssw/pulls/4685","id":18488674,"html_url":"https://github.com/cms-sw/cmssw/pull/4685","diff_url":"https://github.com/cms-sw/cmssw/pull/4685.diff","patch_url":"https://github.com/cms-sw/cmssw/pull/4685.patch","issue_url":"https://api.github.com/repos/cms-sw/cmssw/issues/4685","number":4685,"state":"open","title":"Baseline of Common Isolation & ID Framework 70X Edition","user":{"login":"lgray","id":1068089,"avatar_url":"https://avatars.githubusercontent.com/u/1068089?v=1","gravatar_id":"a33f887fe2ee02381e1a214148fb0124","url":"https://api.github.com/users/lgray","html_url":"https://github.com/lgray","followers_url":"https://api.github.com/users/lgray/followers","following_url":"https://api.github.com/users/lgray/following{/other_user}","gists_url":"https://api.github.com/users/lgray/gists{/gist_id}","starred_url":"https://api.github.com/users/lgray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgray/subscriptions","organizations_url":"https://api.github.com/users/lgray/orgs","repos_url":"https://api.github.com/users/lgray/repos","events_url":"https://api.github.com/users/lgray/events{/privacy}","received_events_url":"https://api.github.com/users/lgray/received_events","type":"User","site_admin":false},"body":"@vadler @monttj\r\n\r\nThis is meant for this week's analysis release.\r\n\r\nThis is the baseline version of a common framework for calculating isolation sums and processing ID cutflows.\r\nPresently only an example for electrons is given for both ID and isolation.\r\n\r\nThe base classes of the framework for both ID and Iso are able to take inputs from Electron/Photon/Tau/Muon analysis objects (both PAT and standard reco) and can deal with the packed PF Candidates of miniAOD by using RefToBase. \r\n\r\nThe configuration of the IDs is done through python, defining a human-readable cutflow that is then turned into functions that are kept track of centrally in POG-managed packages. Python workflows are versioned and kept track of with MD5-sums + a human readable name. The version tracking needs significant improvement. If someone can help it would be great! I've taken some care to make sure that the ID functions can be configured and used within FWLite, I am working on making this functionality available in FWLite-python so that it can be used many levels of the analysis chain.\r\n\r\nThis framework needs to have significant content filled from more than electrons in before it becomes viable, but it's a start.\r\n","created_at":"2014-07-16T19:14:56Z","updated_at":"2014-08-04T13:06:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d7dd8553219271d45dc7149abd5f7f821046a3c4","assignee":null,"milestone":{"url":"https://api.github.com/repos/cms-sw/cmssw/milestones/38","labels_url":"https://api.github.com/repos/cms-sw/cmssw/milestones/38/labels","id":570902,"number":38,"title":"Next CMSSW_7_0_X","description":"","creator":{"login":"ktf","id":10544,"avatar_url":"https://avatars.githubusercontent.com/u/10544?v=1","gravatar_id":"7a6c8f49981d093b41b365a4b522378d","url":"https://api.github.com/users/ktf","html_url":"https://github.com/ktf","followers_url":"https://api.github.com/users/ktf/followers","following_url":"https://api.github.com/users/ktf/following{/other_user}","gists_url":"https://api.github.com/users/ktf/gists{/gist_id}","starred_url":"https://api.github.com/users/ktf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktf/subscriptions","organizations_url":"https://api.github.com/users/ktf/orgs","repos_url":"https://api.github.com/users/ktf/repos","events_url":"https://api.github.com/users/ktf/events{/privacy}","received_events_url":"https://api.github.com/users/ktf/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":142,"state":"open","created_at":"2014-02-16T18:44:49Z","updated_at":"2014-08-04T07:19:22Z","due_on":"2014-07-14T07:00:00Z"},"commits_url":"https://api.github.com/repos/cms-sw/cmssw/pulls/4685/commits","review_comments_url":"https://api.github.com/repos/cms-sw/cmssw/pulls/4685/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/4685/comments","statuses_url":"https://api.github.com/repos/cms-sw/cmssw/statuses/e36b2c4847c863eaa983cd5301471d3244c01c8a","head":{"label":"lgray:common_isolation_selection_70X","ref":"common_isolation_selection_70X","sha":"e36b2c4847c863eaa983cd5301471d3244c01c8a","user":{"login":"lgray","id":1068089,"avatar_url":"https://avatars.githubusercontent.com/u/1068089?v=1","gravatar_id":"a33f887fe2ee02381e1a214148fb0124","url":"https://api.github.com/users/lgray","html_url":"https://github.com/lgray","followers_url":"https://api.github.com/users/lgray/followers","following_url":"https://api.github.com/users/lgray/following{/other_user}","gists_url":"https://api.github.com/users/lgray/gists{/gist_id}","starred_url":"https://api.github.com/users/lgray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgray/subscriptions","organizations_url":"https://api.github.com/users/lgray/orgs","repos_url":"https://api.github.com/users/lgray/repos","events_url":"https://api.github.com/users/lgray/events{/privacy}","received_events_url":"https://api.github.com/users/lgray/received_events","type":"User","site_admin":false},"repo":{"id":11345764,"name":"cmssw","full_name":"lgray/cmssw","owner":{"login":"lgray","id":1068089,"avatar_url":"https://avatars.githubusercontent.com/u/1068089?v=1","gravatar_id":"a33f887fe2ee02381e1a214148fb0124","url":"https://api.github.com/users/lgray","html_url":"https://github.com/lgray","followers_url":"https://api.github.com/users/lgray/followers","following_url":"https://api.github.com/users/lgray/following{/other_user}","gists_url":"https://api.github.com/users/lgray/gists{/gist_id}","starred_url":"https://api.github.com/users/lgray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgray/subscriptions","organizations_url":"https://api.github.com/users/lgray/orgs","repos_url":"https://api.github.com/users/lgray/repos","events_url":"https://api.github.com/users/lgray/events{/privacy}","received_events_url":"https://api.github.com/users/lgray/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lgray/cmssw","description":"CMS Offline Software","fork":true,"url":"https://api.github.com/repos/lgray/cmssw","forks_url":"https://api.github.com/repos/lgray/cmssw/forks","keys_url":"https://api.github.com/repos/lgray/cmssw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lgray/cmssw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lgray/cmssw/teams","hooks_url":"https://api.github.com/repos/lgray/cmssw/hooks","issue_events_url":"https://api.github.com/repos/lgray/cmssw/issues/events{/number}","events_url":"https://api.github.com/repos/lgray/cmssw/events","assignees_url":"https://api.github.com/repos/lgray/cmssw/assignees{/user}","branches_url":"https://api.github.com/repos/lgray/cmssw/branches{/branch}","tags_url":"https://api.github.com/repos/lgray/cmssw/tags","blobs_url":"https://api.github.com/repos/lgray/cmssw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lgray/cmssw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lgray/cmssw/git/refs{/sha}","trees_url":"https://api.github.com/repos/lgray/cmssw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lgray/cmssw/statuses/{sha}","languages_url":"https://api.github.com/repos/lgray/cmssw/languages","stargazers_url":"https://api.github.com/repos/lgray/cmssw/stargazers","contributors_url":"https://api.github.com/repos/lgray/cmssw/contributors","subscribers_url":"https://api.github.com/repos/lgray/cmssw/subscribers","subscription_url":"https://api.github.com/repos/lgray/cmssw/subscription","commits_url":"https://api.github.com/repos/lgray/cmssw/commits{/sha}","git_commits_url":"https://api.github.com/repos/lgray/cmssw/git/commits{/sha}","comments_url":"https://api.github.com/repos/lgray/cmssw/comments{/number}","issue_comment_url":"https://api.github.com/repos/lgray/cmssw/issues/comments/{number}","contents_url":"https://api.github.com/repos/lgray/cmssw/contents/{+path}","compare_url":"https://api.github.com/repos/lgray/cmssw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lgray/cmssw/merges","archive_url":"https://api.github.com/repos/lgray/cmssw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lgray/cmssw/downloads","issues_url":"https://api.github.com/repos/lgray/cmssw/issues{/number}","pulls_url":"https://api.github.com/repos/lgray/cmssw/pulls{/number}","milestones_url":"https://api.github.com/repos/lgray/cmssw/milestones{/number}","notifications_url":"https://api.github.com/repos/lgray/cmssw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lgray/cmssw/labels{/name}","releases_url":"https://api.github.com/repos/lgray/cmssw/releases{/id}","created_at":"2013-07-11T15:38:46Z","updated_at":"2014-06-25T06:00:50Z","pushed_at":"2014-08-04T11:01:55Z","git_url":"git://github.com/lgray/cmssw.git","ssh_url":"git@github.com:lgray/cmssw.git","clone_url":"https://github.com/lgray/cmssw.git","svn_url":"https://github.com/lgray/cmssw","homepage":"cms-sw.github.io/cmssw","size":529630,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"CMSSW_7_0_X"}},"base":{"label":"cms-sw:CMSSW_7_0_X","ref":"CMSSW_7_0_X","sha":"20159aa9cce4b8da6ecd0d4cd6b1d576c67b1e34","user":{"login":"cms-sw","id":3863500,"avatar_url":"https://avatars.githubusercontent.com/u/3863500?v=1","gravatar_id":"d5b5dd8d1e3a16502b38562e08e0635c","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=1","gravatar_id":"d5b5dd8d1e3a16502b38562e08e0635c","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":"2014-07-30T03:50:49Z","pushed_at":"2014-08-04T12:10:36Z","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":"cms-sw.github.io/cmssw","size":681067,"stargazers_count":356,"watchers_count":356,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":927,"mirror_url":null,"open_issues_count":71,"forks":927,"open_issues":71,"watchers":356,"default_branch":"CMSSW_7_2_X"}},"_links":{"self":{"href":"https://api.github.com/repos/cms-sw/cmssw/pulls/4685"},"html":{"href":"https://github.com/cms-sw/cmssw/pull/4685"},"issue":{"href":"https://api.github.com/repos/cms-sw/cmssw/issues/4685"},"comments":{"href":"https://api.github.com/repos/cms-sw/cmssw/issues/4685/comments"},"review_comments":{"href":"https://api.github.com/repos/cms-sw/cmssw/pulls/4685/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/4685/commits"},"statuses":{"href":"https://api.github.com/repos/cms-sw/cmssw/statuses/e36b2c4847c863eaa983cd5301471d3244c01c8a"}}}}