{"action":"closed","issue":{"url":"https://api.github.com/repos/psi46/pxar/issues/248","labels_url":"https://api.github.com/repos/psi46/pxar/issues/248/labels{/name}","comments_url":"https://api.github.com/repos/psi46/pxar/issues/248/comments","events_url":"https://api.github.com/repos/psi46/pxar/issues/248/events","html_url":"https://github.com/psi46/pxar/issues/248","id":47156281,"number":248,"title":"TanH fit","user":{"login":"rslu","id":5728495,"avatar_url":"https://avatars.githubusercontent.com/u/5728495?v=3","gravatar_id":"","url":"https://api.github.com/users/rslu","html_url":"https://github.com/rslu","followers_url":"https://api.github.com/users/rslu/followers","following_url":"https://api.github.com/users/rslu/following{/other_user}","gists_url":"https://api.github.com/users/rslu/gists{/gist_id}","starred_url":"https://api.github.com/users/rslu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rslu/subscriptions","organizations_url":"https://api.github.com/users/rslu/orgs","repos_url":"https://api.github.com/users/rslu/repos","events_url":"https://api.github.com/users/rslu/events{/privacy}","received_events_url":"https://api.github.com/users/rslu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/psi46/pxar/labels/enhancement","name":"enhancement","color":"207de5"},{"url":"https://api.github.com/repos/psi46/pxar/labels/Tests","name":"Tests","color":"bfd4f2"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2014-10-29T14:43:31Z","updated_at":"2015-04-16T07:35:22Z","closed_at":"2015-04-16T07:35:22Z","body":"I pull from git again this morning for Urs update of initialize tanH for every pixels but the fits are not very good still.\r\nI traced down to two issues.\r\n- in code ana/PixInitFunc.cc\r\n<pre>\r\n158   f->SetParLimits(0, 1.e-3, 2.e-3);\r\n</pre>\r\nthis bondary is too tight. lots of pixels hit 2e-3 boundary\r\nwhich result bad fits.\r\nCan we either remove this or set to much wider?\r\nIf I comment it out, fits are much more stable.\r\n\r\n- secondly, not critical, in hte same code\r\n<pre>\r\n163  double middle = h->GetMaximum() - h->GetMinimum();\r\n164  double step = h->GetMaximum() - middle; \r\n</pre>\r\nThese are basically constants for all pixels as max/min of histograms are always 260./0.\r\nThe more correct one will be like \r\n<pre>\r\n\r\n   double hmax = h->GetBinContent(h->GetMaximumBin());\r\n   double hmin = hmax;\r\n   for(int ii=1; ii<=h->GetNbinsX(); ii++) \r\n     if(h->GetBinContent(ii)>0 && h->GetBinContent(ii)<hmin) hmin=h->GetBinContent(ii);\r\n   double middle =  ( hmax - hmin )/2.;\r\n   double step = hmax - middle; \r\n</pre>\r\nBut even without these, with 1st correction, the fits can be performed.\r\n"}}