286{
287
288 char selectionA[500];
289 sprintf(selectionA,
"%s*(det==1)",
variable.c_str());
290 char selectionC[500];
291 sprintf(selectionC,
"%s*(det==-1)",
variable.c_str());
292 if (variable == "nt0")
294 TFile *
file =
new TFile(infile);
295 cout <<
"In XYMaps infile: " <<
infile <<
" variable " <<
variable << endl;
297 TNtuple *Chiptuple = nullptr;
298 TNtuple *Boardtuple = nullptr;
299 TNtuple *Moduletuple = nullptr;
300
301 if (!isAr)
302 {
303 Chiptuple = (TNtuple *)
file->Get(
"Chiptuple");
304 Boardtuple = (TNtuple *)
file->Get(
"Boardtuple");
305 Moduletuple = (TNtuple *)
file->Get(
"Moduletuple");
306 }
307 else
308 {
309 Chiptuple = (TNtuple *)
file->Get(
"Chip_Artuple");
310 Boardtuple = (TNtuple *)
file->Get(
"Board_Artuple");
311 Moduletuple = (TNtuple *)
file->Get(
"Module_Artuple");
312 }
313
314 this->SetName("c1");
316 this->Divide(3, 2, 0.01, 0.01);
317 ((TPad *)this->GetPrimitive("c1_1"))->SetFrameFillColor(1);
318 ((TPad *)this->GetPrimitive("c1_2"))->SetFrameFillColor(1);
319 ((TPad *)this->GetPrimitive("c1_3"))->SetFrameFillColor(1);
320 ((TPad *)this->GetPrimitive("c1_4"))->SetFrameFillColor(1);
321 ((TPad *)this->GetPrimitive("c1_5"))->SetFrameFillColor(1);
322 ((TPad *)this->GetPrimitive("c1_6"))->SetFrameFillColor(1);
323
324 gStyle->SetPalette(1);
325
327 Moduletuple->Draw("y:x>>reshist10(40,-1200,1200,40,-1200,1200)", selectionA, "colz");
328 TH2F *reshist10 = (
TH2F *)gPad->GetPrimitive(
"reshist10");
329 if (!reshist10)
330 throw string("Variable not found!");
331 if (variable == "res")
332 {
333 reshist10->GetZaxis()->SetRangeUser(0.12, 0.19);
334 }
335 else if (variable == "abs(resMean)")
336 {
337 reshist10->GetZaxis()->SetRangeUser(0.0, 0.01);
338 }
339 else if (variable == "t0")
340 {
341 reshist10->GetZaxis()->SetRangeUser(1.0, 7.0);
342 }
343 else if (variable == "abs(t0-oldt0)")
344 {
345 reshist10->GetZaxis()->SetRangeUser(0, .4);
346 }
347 else if (variable == "(tres)")
348 {
349 reshist10->GetZaxis()->SetRangeUser(2.0, 4.0);
350 }
351 this->Update();
352 if (reshist10->GetEntries() > 1)
354
355 char title1[500];
356 sprintf(title1,
"Module %s (barrel side A)",
variable.c_str());
357 if (isAr)
358 sprintf(title1,
"Argon Module %s (barrel side A)",
variable.c_str());
359 reshist10->SetTitle(title1);
360 reshist10->SetStats(0);
361 reshist10->GetXaxis()->SetLabelOffset(1000);
362 reshist10->GetYaxis()->SetLabelOffset(1000);
363
365 Boardtuple->Draw("y:x>>reshist0(100,-1200,1200,100,-1200,1200)", selectionA, "colz");
366 TH2F *reshist0 = (
TH2F *)gPad->GetPrimitive(
"reshist0");
367 if (!reshist0)
368 throw string("Variable not found!");
369
370 if (variable == "res")
371 {
372 reshist0->GetZaxis()->SetRangeUser(0.12, 0.19);
373 }
374 else if (variable == "abs(resMean)")
375 {
376 reshist0->GetZaxis()->SetRangeUser(0.0, 0.01);
377 }
378 else if (variable == "t0")
379 {
380 reshist0->GetZaxis()->SetRangeUser(1.0, 7.0);
381 }
382 else if (variable == "abs(t0-oldt0)")
383 {
384 reshist0->GetZaxis()->SetRangeUser(0, .4);
385 }
386 else if (variable == "(tres)")
387 {
388 reshist0->GetZaxis()->SetRangeUser(2.0, 4.0);
389 }
390 this->Update();
391 if (reshist0->GetEntries() > 1)
393
394 char title2[500];
395 sprintf(title2,
"Board %s (barrel side A)",
variable.c_str());
396 if (isAr)
397 sprintf(title2,
"Argon Board %s (barrel side A)",
variable.c_str());
398 reshist0->SetTitle(title2);
399 reshist0->SetStats(0);
400 reshist0->GetXaxis()->SetLabelOffset(1000);
401 reshist0->GetYaxis()->SetLabelOffset(1000);
402
404 Chiptuple->Draw("y:x>>t0hist0(300,-1200,1200,300,-1200,1200)", selectionA, "colz");
405 TH2F *t0hist0 = (
TH2F *)gPad->GetPrimitive(
"t0hist0");
406 if (!t0hist0)
407 throw string("Variable not found!");
408 char title3[500];
409 sprintf(title3,
"Chip %s (barrel side A)",
variable.c_str());
410 if (isAr)
411 sprintf(title3,
"Argon Chip %s (barrel side A)",
variable.c_str());
412 t0hist0->SetTitle(title3);
413
414 if (variable == "res")
415 {
416 t0hist0->GetZaxis()->SetRangeUser(0.12, 0.19);
417 }
418 else if (variable == "abs(resMean)")
419 {
420 t0hist0->GetZaxis()->SetRangeUser(0.0, 0.01);
421 }
422 else if (variable == "t0")
423 {
424 t0hist0->GetZaxis()->SetRangeUser(1.0, 7.0);
425 }
426 else if (variable == "abs(t0-oldt0)")
427 {
428 t0hist0->GetZaxis()->SetRangeUser(0, .4);
429 }
430 else if (variable == "(tres)")
431 {
432 t0hist0->GetZaxis()->SetRangeUser(2.0, 4.0);
433 }
434 this->Update();
435 if (t0hist0->GetEntries() > 1)
437
438 t0hist0->SetStats(0);
439 t0hist0->GetXaxis()->SetLabelOffset(1000);
440 t0hist0->GetYaxis()->SetLabelOffset(1000);
441
443 Moduletuple->Draw("y:x>>reshist11(40,-1200,1200,40,-1200,1200)", selectionC, "colz");
444 TH2F *reshist11 = (
TH2F *)gPad->GetPrimitive(
"reshist11");
445 if (!reshist11)
446 throw string("Variable not found!");
447 if (variable == "res")
448 {
449 reshist11->GetZaxis()->SetRangeUser(0.12, 0.19);
450 }
451 else if (variable == "abs(resMean)")
452 {
453 reshist11->GetZaxis()->SetRangeUser(0.0, 0.01);
454 }
455 else if (variable == "t0")
456 {
457 reshist11->GetZaxis()->SetRangeUser(1.0, 7.0);
458 }
459 else if (variable == "abs(t0-oldt0)")
460 {
461 reshist11->GetZaxis()->SetRangeUser(0, .4);
462 }
463 else if (variable == "(tres)")
464 {
465 reshist11->GetZaxis()->SetRangeUser(2.0, 4.0);
466 }
467 this->Update();
468 if (reshist11->GetEntries() > 1)
470
471 char title4[500];
472 sprintf(title4,
"Module %s (barrel side C)",
variable.c_str());
473 if (isAr)
474 sprintf(title4,
"Argon Module %s (barrel side C)",
variable.c_str());
475 reshist11->SetTitle(title4);
476 reshist11->SetStats(0);
477 reshist11->GetXaxis()->SetLabelOffset(1000);
478 reshist11->GetYaxis()->SetLabelOffset(1000);
479
481 Boardtuple->Draw("y:x>>reshist1(100,-1200,1200,100,-1200,1200)", selectionC, "colz");
482 TH2F *reshist1 = (
TH2F *)gPad->GetPrimitive(
"reshist1");
483 if (!reshist1)
484 throw string("Variable not found!");
485 if (variable == "res")
486 {
487 reshist1->GetZaxis()->SetRangeUser(0.12, 0.19);
488 }
489 else if (variable == "abs(resMean)")
490 {
491 reshist1->GetZaxis()->SetRangeUser(0.0, 0.01);
492 }
493 else if (variable == "t0")
494 {
495 reshist1->GetZaxis()->SetRangeUser(1.0, 7.0);
496 }
497 else if (variable == "abs(t0-oldt0)")
498 {
499 reshist1->GetZaxis()->SetRangeUser(0, .4);
500 }
501 else if (variable == "(tres)")
502 {
503 reshist1->GetZaxis()->SetRangeUser(2.0, 4.0);
504 }
505 this->Update();
506 if (reshist1->GetEntries() > 1)
508
509 char title5[500];
510 sprintf(title5,
"Board %s (barrel side C)",
variable.c_str());
511 if (isAr)
512 sprintf(title5,
"Argon Board %s (barrel side C)",
variable.c_str());
513 reshist1->SetTitle(title5);
514 reshist1->SetStats(0);
515 reshist1->GetXaxis()->SetLabelOffset(1000);
516 reshist1->GetYaxis()->SetLabelOffset(1000);
517
519 Chiptuple->Draw("y:x>>t0hist1(300,-1200,1200,300,-1200,1200)", selectionC, "colz");
520 TH2F *t0hist1 = (
TH2F *)gPad->GetPrimitive(
"t0hist1");
521 if (!t0hist1)
522 throw string("Variable not found!");
523 if (variable == "res")
524 {
525 t0hist1->GetZaxis()->SetRangeUser(0.12, 0.19);
526 }
527 else if (variable == "abs(resMean)")
528 {
529 t0hist1->GetZaxis()->SetRangeUser(0.0, 0.01);
530 }
531 else if (variable == "t0")
532 {
533 t0hist1->GetZaxis()->SetRangeUser(1.0, 7.0);
534 }
535 else if (variable == "abs(t0-oldt0)")
536 {
537 t0hist1->GetZaxis()->SetRangeUser(0, .4);
538 }
539 else if (variable == "(tres)")
540 {
541 t0hist1->GetZaxis()->SetRangeUser(2.0, 4.0);
542 }
543 this->Update();
544 if (t0hist1->GetEntries() > 1)
546
547 char title6[500];
548 sprintf(title6,
"Chip %s (barrel side C)",
variable.c_str());
549 if (isAr)
550 sprintf(title6,
"Argon Chip %s (barrel side C)",
variable.c_str());
551 t0hist1->SetTitle(title6);
552 t0hist1->SetStats(0);
553 t0hist1->GetXaxis()->SetLabelOffset(1000);
554 t0hist1->GetYaxis()->SetLabelOffset(1000);
555}
void ResizePalette(TH2 *hist)
TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)