73 int minidx = thehist->FindBin(minx), maxidx = thehist->FindBin(maxx);
74 for (
int idx = minidx; idx <= maxidx; idx++) {
75 Double_t val = thehist->GetBinContent(idx);
91 std::string lb_str =
"LB_";
92 int firstLB = (*goodLB)[0], offset = 1;
93 unsigned int c = 1,
sz = goodLB->size(), psz =
static_cast<unsigned int>( std::log10(
sz))+1;
97 if ((*goodLB)[c] == firstLB + offset)
104 lo = thehist->GetXaxis()->GetBinLowEdge(firstLB);
106 if (lo == std::floor(lo))
107 sprintf(buf,
fmt, psz,
static_cast<Int_t
>(lo));
109 sprintf(buf,
fmt, psz,
static_cast<Int_t
>(std::floor(lo))+1);
114 hi = thehist->GetXaxis()->GetBinUpEdge(firstLB+offset-1);
116 if (hi == std::floor(hi))
117 sprintf(buf,
fmt, psz,
static_cast<Int_t
>(std::floor(hi))-1);
119 sprintf(buf,
fmt, psz,
static_cast<Int_t
>(std::floor(hi)));
123 firstLB = (*goodLB)[c];
130 lo = thehist->GetXaxis()->GetBinLowEdge(firstLB);
132 if (lo == std::floor(lo))
133 sprintf(buf,
fmt, psz,
static_cast<Int_t
>(lo));
135 sprintf(buf,
fmt, psz,
static_cast<Int_t
>(std::floor(lo))+1);
139 hi = thehist->GetXaxis()->GetBinUpEdge(firstLB+offset-1);
140 if (hi == std::floor(hi))
141 sprintf(buf,
fmt, psz,
static_cast<Int_t
>(std::floor(hi))-1);
143 sprintf(buf,
fmt, psz,
static_cast<Int_t
>(std::floor(hi)));
145 result->tags_ [lb_str] = 1.0;
223 if(
object.
IsA()->InheritsFrom(
"TH1"))
227 throw dqm_core::BadConfig( ERS_HERE,
m_name,
"called with histogram of dimension > 2" );
231 throw dqm_core::BadConfig( ERS_HERE,
m_name,
"called with object that does not inherit from TH1" );
239 throw dqm_core::BadConfig( ERS_HERE,
m_name,
"called with histogram with no bins");
243 const TH1* proj =
static_cast<const TH2*
>(
histogram)->ProjectionY(
"", 0, 0);
244 if (proj->GetNbinsX() >= 1) {
247 throw dqm_core::BadConfig( ERS_HERE,
m_name,
"called with histogram with no bins");
251 m_gaus3_fn =
new TF1(
"gaus3", Form(
"[3]/[2]/2.5066*%f*exp(-0.5*((x-[0]+[1])/[2])**2) + [4]/[2]/2.5066*%f*exp(-0.5*((x-[0])/[2])**2) + [5]/[2]/2.5066*%f*exp(-0.5*((x-[0]-[1])/[2])**2)",
binwidth,
binwidth,
binwidth), -100, 100);
253 m_gaus3_fn =
new TF1(
"gaus3",
"[3]*exp(-0.5*((x-[0]+[1])/[2])**2) + [4]*exp(-0.5*((x-[0])/[2])**2) + [5]*exp(-0.5*((x-[0]-[1])/[2])**2)", -100, 100);
256 m_gaus3_fn->SetParName(1,
"Mean_offzero_gaus");
262 Double_t resolutionAll, meanZeroPeak, meanNonzeroPeaks, minEvents;
275 m_gaus3_fn->SetParLimits(0, meanZeroPeak-5, meanZeroPeak+5);
281 m_gaus3_fn->SetParameter(1, meanNonzeroPeaks);
282 m_gaus3_fn->SetParLimits(1, meanNonzeroPeaks-10, meanNonzeroPeaks+10);
285 m_gaus3_fn->FixParameter(1, meanNonzeroPeaks);
297 dqm_core::Result*
result =
new dqm_core::Result();
306 for (err_map::const_iterator peit = paramErrors.begin(); peit != paramErrors.end(); ++peit) {
307 result->tags_[(*peit).first +
" Error"] = (*peit).second;
311 catch ( dqm_core::Exception & ex) {
312 throw dqm_core::BadConfig( ERS_HERE,
m_name, ex.what(), ex);
323 unsigned int psz = (
unsigned int) std::log10(nxbin)+1;
325 std::vector<int> goodLB;
327 const std::string sig_str =
"SIG_LB_";
329 for (
int lb = 0;
lb < nxbin;
lb++) {
331 sprintf(buf,
fmt, psz,
lb);
332 TH1D* proj =
static_cast<const TH2*
>(
histogram)->ProjectionY(buf,
lb,
lb);
333 Double_t good_entries = proj->GetEntries() - proj->GetBinContent(0) - proj->GetBinContent(proj->GetNbinsX()+1);
334 if (good_entries < minEvents) {
336 result->tags_[sig_str+buf] = 0;
345 m_gaus3_fn->SetParameter(1, meanNonzeroPeaks);
353 result->histos_.push_back((TH1D*)proj->Clone());
358 result->tags_[sig_str+buf] = 0;
363 result->tags_[sig_str+buf] = sig;
366 goodLB.push_back(
lb);
371 if (goodLB.size() != 0)
388 const Double_t window = 5.0;
390 Double_t offset_all =
m_gaus3_fn->GetParameter(0);
391 Double_t offset_nz =
m_gaus3_fn->GetParameter(1);