379 {
381
384
385 const int minLogOccupancy = 8;
386 const double minOccupancy =
pow(10.,-minLogOccupancy);
387
388 TH1D* globalOccupancy= new TH1D("occupancy", "Pixel occupancy", minLogOccupancy*10, -minLogOccupancy, 0.);
389 m_tHistSvc->regHist(
"/histfile/occupancy",globalOccupancy).ignore();
390
391 std::map<std::string, TH1D*> h_occupancy;
392
393
394 std::vector<std::string> vcomponent;
395 vcomponent.push_back("Disk1A");
396 vcomponent.push_back("Disk2A");
397 vcomponent.push_back("Disk3A");
398 vcomponent.push_back("Disk1C");
399 vcomponent.push_back("Disk2C");
400 vcomponent.push_back("Disk3C");
401 vcomponent.push_back("IBL");
402 vcomponent.push_back("B-layer");
403 vcomponent.push_back("Layer1");
404 vcomponent.push_back("Layer2");
405 vcomponent.push_back("DBMA");
406 vcomponent.push_back("DBMC");
407
408 for(std::vector<std::string>::const_iterator cit=vcomponent.begin(); cit!=vcomponent.end(); ++cit) {
409 const std::string
comp = (*cit);
410 h_occupancy[
comp] =
new TH1D( (
"occupancy"+comp).c_str(), (
"Pixel occupancy "+comp).c_str(),
411 minLogOccupancy*10, -minLogOccupancy, 0);
412 m_tHistSvc->regHist((
"/histfile/occupancy"+comp).c_str(), h_occupancy[comp]).ignore();
413 }
414 vcomponent.clear();
415
416
417 std::vector<std::string> vtype;
418 vtype.push_back("Normal");
419 vtype.push_back("Ganged");
420 vtype.push_back("InterGanged");
421 vtype.push_back("Long");
422 vtype.push_back("Long-Ganged");
423 vtype.push_back("Long-InterGanged");
424 for(std::vector<std::string>::const_iterator cit=vtype.begin(); cit!=vtype.end(); ++cit){
425 const std::string
type = (*cit);
427 new TH1D( ("occupancy"+type).c_str(), ("Pixel occupancy "+type).c_str(),
428 minLogOccupancy*10, -minLogOccupancy, 0);
429 m_tHistSvc->regHist((
"/histfile/occupancy"+type).c_str(), h_occupancy[type]).ignore();
430 }
431 vtype.clear();
432
433
434
435
436
437
438 TH2F* nhitsPlotBI=
new TH2F(
"nhitsPlotBI",
"Number of hits BI;module_eta;module_phi", 20, -10, 10, 14, -0.5, 13.5);
439 m_tHistSvc->regHist(
"/histfile/nhitsPlotBI",nhitsPlotBI).ignore();
440
441
442 TH2F* nhitsPlotB0=
new TH2F(
"nhitsPlotB0",
"Number of hits B0;module_eta;module_phi", 13, -6.5, 6.5, 22, -0.5, 21.5);
443 m_tHistSvc->regHist(
"/histfile/nhitsPlotB0",nhitsPlotB0).ignore();
444
445
446 TH2F* nhitsPlotB1=
new TH2F(
"nhitsPlotB1",
"Number of hits B1;module_eta;module_phi", 13, -6.5, 6.5, 38, -0.5, 37.5);
447 m_tHistSvc->regHist(
"/histfile/nhitsPlotB1",nhitsPlotB1).ignore();
448
449
450 TH2F* nhitsPlotB2=
new TH2F(
"nhitsPlotB2",
"Number of hits B2;module_eta;module_phi", 13,- 6.5, 6.5, 52, -0.5, 51.5);
451 m_tHistSvc->regHist(
"/histfile/nhitsPlotB2",nhitsPlotB2).ignore();
452
453
454 TH2F* nhitsPlotEC=
new TH2F(
"nhitsPlotEC",
"Number of hits Endcap;Disk;module_phi", 7, -3.5, 3.5, 48, -0.5, 47.5);
455 m_tHistSvc->regHist(
"/histfile/nhitsPlotEC",nhitsPlotEC).ignore();
456
457
458 TH2F* nhitsPlotDBM=
new TH2F(
"nhitsPlotDBM",
"Number of hits DBM;Layer;module_phi",7,-3.5,3.5,4,-0.5,3.5);
459 m_tHistSvc->regHist(
"/histfile/nhitsPlotDBM",nhitsPlotDBM).ignore();
460
461
462
463
464
465
466 TH2F* nhitsNoNoisePlotBI=
new TH2F(
"nhitsNoNoisePlotBI",
"Number of hits without Noise BI;module_eta;module_phi", 20, -10, 10, 14, -0.5, 13.5);
467 m_tHistSvc->regHist(
"/histfile/nhitsNoNoisePlotBI",nhitsNoNoisePlotBI).ignore();
468
469
470 TH2F* nhitsNoNoisePlotB0=
new TH2F(
"nhitsNoNoisePlotB0",
"Number of hits without Noise B0;module_eta;module_phi", 13, -6.5, 6.5, 22, -0.5, 21.5);
471 m_tHistSvc->regHist(
"/histfile/nhitsNoNoisePlotB0",nhitsNoNoisePlotB0).ignore();
472
473
474 TH2F* nhitsNoNoisePlotB1=
new TH2F(
"nhitsNoNoisePlotB1",
"Number of hits without Noise B1;module_eta;module_phi", 13, -6.5, 6.5, 38, -0.5, 37.5);
475 m_tHistSvc->regHist(
"/histfile/nhitsNoNoisePlotB1",nhitsNoNoisePlotB1).ignore();
476
477
478 TH2F* nhitsNoNoisePlotB2=
new TH2F(
"nhitsNoNoisePlotB2",
"Number of hits without Noise B2;module_eta;module_phi", 13, -6.5, 6.5, 52, -0.5, 51.5);
479 m_tHistSvc->regHist(
"/histfile/nhitsNoNoisePlotB2",nhitsNoNoisePlotB2).ignore();
480
481
482
483
484
485
486 TH2F* disablePlotBI=
new TH2F(
"disablePlotBI",
"Disabled pixels BI;module_eta;module_phi", 20, -10, 10, 14, -0.5, 13.5);
487 m_tHistSvc->regHist(
"/histfile/disablePlotBI",disablePlotBI).ignore();
488
489
490 TH2F* disablePlotB0=
new TH2F(
"disablePlotB0",
"Disabled pixels B0;module_eta;module_phi", 13,- 6.5, 6.5, 22, -0.5, 21.5);
491 m_tHistSvc->regHist(
"/histfile/disablePlotB0",disablePlotB0).ignore();
492
493
494 TH2F* disablePlotB1=
new TH2F(
"disablePlotB1",
"Disabled pixels B1;module_eta;module_phi", 13, -6.5, 6.5, 38, -0.5, 37.5);
495 m_tHistSvc->regHist(
"/histfile/disablePlotB1",disablePlotB1).ignore();
496
497
498 TH2F* disablePlotB2=
new TH2F(
"disablePlotB2",
"Disabled pixels B2;module_eta;module_phi", 13, -6.5, 6.5, 52, -0.5, 51.5);
499 m_tHistSvc->regHist(
"/histfile/disablePlotB2",disablePlotB2).ignore();
500
501
502 TH2F* disablePlotEC=
new TH2F(
"disablePlotEC",
"Disabled pixels Endcap;Disk;module_phi", 7, -3.5, 3.5, 48, -0.5, 47.5);
503 m_tHistSvc->regHist(
"/histfile/disablePlotEC",disablePlotEC).ignore();
504
505
506 TH2F* disablePlotDBM=
new TH2F(
"disablePlotDBM",
"Disabled pixels DBM;Layer;module_phi", 7, -3.5, 3.5, 4, -0.5, 3.5);
507 m_tHistSvc->regHist(
"/histfile/disablePlotDBM",disablePlotDBM).ignore();
508
509 TH1D* maskedPlot= new TH1D("maskedPlot","Disabled pixel per module",50,0.5,50.5);
510 m_tHistSvc->regHist(
"/histfile/maskedPlot",maskedPlot).ignore();
511
512 int totalDisabledPixels=0;
513 int totalDisabledModules=0;
514 int modulesWithHits=0;
515 int modulesWithDisabledPixels=0;
516
517 const EventContext& ctx{Gaudi::Hive::currentContext()};
519 Identifier
ident = *wafer_it;
520 if(!
m_pixelID->is_pixel(ident))
continue;
521
524 int modPhi =
m_pixelID->phi_module(ident);
525 int modEta =
m_pixelID->eta_module(ident);
526 int modHash =
m_pixelID->wafer_hash(ident);
527 int phi_max =
m_pixelID->phi_index_max(ident);
528 int eta_max =
m_pixelID->eta_index_max(ident);
529
530 TH2F* nhitsNoNoisePlot=0;
533
534 if(bec != 0) {
535 if(bec == 2) {
539 }
540 else if(bec == -2) {
544 }
547 }
548 else if(bec == 0) {
549 if(layer == 0) {
cut=
m_iblCut; nhitsNoNoisePlot=nhitsNoNoisePlotBI;
comp=
"IBL"; }
550 else if(layer == 1) {
cut=
m_bLayerCut; nhitsNoNoisePlot=nhitsNoNoisePlotB0;
comp=
"B-layer"; }
551 else if(layer == 2) {
cut=
m_layer1Cut; nhitsNoNoisePlot=nhitsNoNoisePlotB1;
comp=
"Layer1"; }
552 else if(layer == 3) {
cut=
m_layer2Cut; nhitsNoNoisePlot=nhitsNoNoisePlotB2;
comp=
"Layer2"; }
553 }
554
556 if(bec == 0) {
557 if(layer == 0) { disablePlotBI->Fill(modEta, modPhi, -1); }
558 else if(layer == 1) { disablePlotB0->Fill(modEta, modPhi, -1); }
559 else if(layer == 2) { disablePlotB1->Fill(modEta, modPhi, -1); }
560 else if(layer == 3) { disablePlotB2->Fill(modEta, modPhi, -1); }
561 }
562 else if(bec == 2) { disablePlotEC->Fill(layer+1, modPhi, -1); }
563 else if(bec == -2) { disablePlotEC->Fill(-(layer+1), modPhi, -1); }
564 else if(bec == 4) { disablePlotDBM->Fill(layer+1, modPhi, -1); }
565 else if(bec == -4) { disablePlotDBM->Fill(-(layer+1), modPhi, -1); }
566
567 totalDisabledModules++;
568 continue;
569 }
571 if(bec == 0) {
573 else if(layer == 1) { nhitsPlotB0->Fill(modEta, modPhi,
m_hitMaps[modHash]->
GetEntries()); }
574 else if(layer == 2) { nhitsPlotB1->Fill(modEta, modPhi,
m_hitMaps[modHash]->
GetEntries()); }
575 else if(layer == 3) { nhitsPlotB2->Fill(modEta, modPhi,
m_hitMaps[modHash]->
GetEntries()); }
576 }
577 else if(bec == 2) { nhitsPlotEC->Fill(layer+1, modPhi,
m_hitMaps[modHash]->
GetEntries()); }
578 else if(bec == -2) { nhitsPlotEC->Fill(-(layer+1), modPhi,
m_hitMaps[modHash]->
GetEntries()); }
579 else if(bec == 4) { nhitsPlotDBM->Fill(layer+1, modPhi,
m_hitMaps[modHash]->
GetEntries()); }
580 else if(bec == -4) { nhitsPlotDBM->Fill(-(layer+1), modPhi,
m_hitMaps[modHash]->
GetEntries()); }
581
582 modulesWithHits++;
583 }
584
585 int thisModuleCut = 0;
586 bool isIBL3D = (
bec==0 &&
layer==0 && (modEta <= -7 || modEta >= 6) ) ?
true : false;
587
588 for(int pixel_eta=0; pixel_eta<=eta_max; pixel_eta++){
589 for(int pixel_phi=0; pixel_phi<=phi_max; pixel_phi++){
590
591
592 int pixel_eta_on_chip = (
bec==0 &&
layer==0) ? pixel_eta % 80 : pixel_eta % 18;
593 int pixel_phi_on_chip = (pixel_phi <= 163) ? pixel_phi : 327 - pixel_phi;
594 if (bec == 0 && layer == 0) pixel_phi_on_chip = pixel_phi;
595 int pixelType = 0;
596
597 if (bec == 0 && layer == 0) {
598 if( !isIBL3D && (pixel_eta_on_chip == 0 || pixel_eta_on_chip == 80 - 1) ){
599 pixelType = 1;
600 }
601 else {
602 pixelType = 0;
603 }
604 } else {
605 if(pixel_eta_on_chip > 0 && pixel_eta_on_chip < 18 - 1){
606 pixelType = 0;
607 for(
int kk = 0;
kk < 3;
kk++){
608
609
610 if(pixel_phi_on_chip == (153 + 2 * kk + 1)){
611 pixelType = 5;
612 break;
613 }
614 if(pixel_phi_on_chip == (153 + 2 * kk) || pixel_phi_on_chip >= 159){
615 pixelType = 2;
616 break;
617 }
618 }
619 }
620 else if(pixel_eta_on_chip == 0 || pixel_eta_on_chip == 18 - 1){
621 pixelType = 1;
622 for(
int kk = 0;
kk < 3;
kk++){
623 if(pixel_phi_on_chip == (153 + 2 * kk + 1)){
624 pixelType = 6;
625 break;
626 }
627 if(pixel_phi_on_chip == (153 + 2 * kk) || pixel_phi_on_chip >= 159){
628 pixelType = 3;
629 break;
630 }
631 }
632 }
633 else
634 pixelType = 8;
635 }
636
637
639
640
641 switch(pixelType) {
642 case 0:
644 break;
645 case 1:
647 break;
648 case 2:
650 break;
651 case 3:
652 type =
"Long-Ganged";
653 break;
654 case 5:
655 type =
"Long-InterGanged";
656 break;
657 case 6:
658 type =
"InterGanged";
659 break;
660 case 8:
661 default:
663 break;
664 }
665
666 double thiscut =
cut;
671
672 if( type != "Invalid" ){
673 double occupancy = 0;
675 occupancy =
static_cast<double>(
m_hitMaps[modHash]->GetBinContent(pixel_eta+1, pixel_phi+1)) /
677
678 if( occupancy < minOccupancy ) occupancy = minOccupancy;
679 globalOccupancy->Fill(log10(occupancy));
680 h_occupancy[
comp]->Fill(log10(occupancy));
681 h_occupancy[
type]->Fill(log10(occupancy));
682
683 if( occupancy > thiscut ) {
684 thisModuleCut++;
685
688 if (comp == "IBL") {
691 }
693 }
694 } else {
695 if(bec == 0) nhitsNoNoisePlot->Fill(modEta, modPhi,
m_hitMaps[modHash]->GetBinContent(pixel_eta+1, pixel_phi+1));
696 }
697 }
698 }
699 }
700
701 if ( thisModuleCut > 0 ) {
702 totalDisabledPixels+=thisModuleCut;
703 maskedPlot->Fill( static_cast<double>(thisModuleCut) );
704 modulesWithDisabledPixels++;
705
706 if(bec == 0) {
707 if(layer == 0) { disablePlotBI->Fill(modEta, modPhi, thisModuleCut); }
708 else if(layer == 1) { disablePlotB0->Fill(modEta, modPhi, thisModuleCut); }
709 else if(layer == 2) { disablePlotB1->Fill(modEta, modPhi, thisModuleCut); }
710 else if(layer == 3) { disablePlotB2->Fill(modEta, modPhi, thisModuleCut); }
711 }
712 else if(bec == 2) { disablePlotEC->Fill(layer+1, modPhi, thisModuleCut); }
713 else if(bec == -2) { disablePlotEC->Fill(-(layer+1), modPhi, thisModuleCut); }
714 }
715 }
716
717 ATH_MSG_INFO(
"Modules disabled = " << totalDisabledModules);
718 ATH_MSG_INFO(
"Modules with hits = " << modulesWithHits);
719 ATH_MSG_INFO(
"Modules with disabled pixels = " << modulesWithDisabledPixels);
720 ATH_MSG_INFO(
"Total disabled pixels = " << totalDisabledPixels);
721
722 return StatusCode::SUCCESS;
723
724}
TGraphErrors * GetEntries(TH2F *histo)
std::vector< TH2C * > m_noiseMaps
std::vector< Identifier >::const_iterator const_id_iterator
TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)