220 {
221
223 if(
object.
IsA()->InheritsFrom(
"TH1"))
224 {
227 throw dqm_core::BadConfig( ERS_HERE,
m_name,
"called with histogram of dimension > 2" );
228 }
229 }
230 else
231 throw dqm_core::BadConfig( ERS_HERE,
m_name,
"called with object that does not inherit from TH1" );
232
233
238 } else {
239 throw dqm_core::BadConfig( ERS_HERE,
m_name,
"called with histogram with no bins");
240 }
241
242 else {
243 const TH1*
proj =
static_cast<const TH2*
>(
histogram)->ProjectionY(
"", 0, 0);
244 if (
proj->GetNbinsX() >= 1) {
246 } else {
247 throw dqm_core::BadConfig( ERS_HERE,
m_name,
"called with histogram with no bins");
248 }
249 }
250 #ifdef PARAM_IS_AREA
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);
252 #else
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);
254 #endif
256 m_gaus3_fn->SetParName(1,
"Mean_offzero_gaus");
261
262 Double_t resolutionAll, meanZeroPeak, meanNonzeroPeaks, minEvents;
264
269
270
272
273
275 m_gaus3_fn->SetParLimits(0, meanZeroPeak-5, meanZeroPeak+5);
276 }
277 else
279
281 m_gaus3_fn->SetParameter(1, meanNonzeroPeaks);
282 m_gaus3_fn->SetParLimits(1, meanNonzeroPeaks-10, meanNonzeroPeaks+10);
283 }
284 else
285 m_gaus3_fn->FixParameter(1, meanNonzeroPeaks);
286
290 }
291 else {
293
294 }
295
296
297 dqm_core::Result*
result =
new dqm_core::Result();
298
301
302 try {
303
306 for (err_map::const_iterator peit = paramErrors.begin(); peit != paramErrors.end(); ++peit) {
307 result->tags_[(*peit).first +
" Error"] = (*peit).second;
308 }
309
310 }
311 catch ( dqm_core::Exception & ex) {
312 throw dqm_core::BadConfig( ERS_HERE,
m_name, ex.what(), ex);
313 }
314 }
315 else {
316
319
321
322
323 unsigned int psz = (
unsigned int) std::log10(nxbin)+1;
324
325 std::vector<int> goodLB;
327 const std::string sig_str = "SIG_LB_";
328
329 for (
int lb = 0;
lb < nxbin;
lb++) {
330
331 sprintf(buf,
fmt, psz,
lb);
333 Double_t good_entries =
proj->GetEntries() -
proj->GetBinContent(0) -
proj->GetBinContent(
proj->GetNbinsX()+1);
334 if (good_entries < minEvents) {
335 if (writeSig)
337 continue;
338 }
339
340
343
345 m_gaus3_fn->SetParameter(1, meanNonzeroPeaks);
346
349
351
352#ifdef TC_WORKBENCH
353 result->histos_.push_back((TH1D*)
proj->Clone());
354#endif
355
357 if (writeSig)
359 continue;
360 }
362 if (writeSig)
364
365 if (sig > minsig)
366 goodLB.push_back(
lb);
367
368
369 }
370
371 if (goodLB.size() != 0)
373
374 }
376 }
std::map< std::string, double > err_map
void multLB_writeTags(std::vector< int > *goodLB, dqm_core::Result *result, const TH1 *thehist)
std::map< std::string, double > param_map
void fitSingle(TH1 *hist1D)
#define IsA
Declare the TObject style functions.