22 #include "GaudiKernel/MsgStream.h"
160 ATH_MSG_DEBUG(
"Processing configuration for layouts with BMG chambers.");
169 if (!MuonDetMgrDS->getMuonStation(
"BMG",
side *
eta,
phi))
continue;
170 for (
int roe = 1; roe <= (MuonDetMgrDS->getMuonStation(
"BMG",
side *
eta,
phi))->nMuonReadoutElements();
173 (MuonDetMgrDS->getMuonStation(
"BMG",
side *
eta,
phi))->getMuonReadoutElement(roe));
188 std::string
s{
""}, xAxis{
""};
191 std::vector<std::string> ecap{
"BA",
"BC",
"EA",
"EC"};
192 std::vector<std::string>
layer{
"Inner",
"Middle",
"Outer",
"Extra"};
193 std::vector<std::unique_ptr<TH2F>> mdtHitsPerMultiLayerLumi;
194 mdtHitsPerMultiLayerLumi.reserve(ecap.size() *
layer.size());
196 for (
const auto& iecap : ecap) {
197 for (
const auto& ilayer :
layer) {
198 s =
"NumberOfHitsIn" + iecap + ilayer +
"PerMultiLayer_ADCCut";
199 mdtHitsPerMultiLayerLumi.push_back(std::make_unique<TH2F>(
s.c_str(),
s.c_str(), 1, 0, 1, 1, 0, 1));
200 xAxis = iecap.substr(0, 1) + ilayer.substr(0, 1) + iecap.substr(1, 1);
208 std::vector<std::string> mdtHitsBE{
"Barrel",
"EndCap"};
209 std::vector<std::unique_ptr<TH2F>> mdtHitsPerChamberIMOLumi;
210 mdtHitsPerChamberIMOLumi.reserve(mdtHitsBE.size());
212 for (
const auto& imdt : mdtHitsBE) {
213 s =
"NumberOfHits" + imdt;
214 mdtHitsPerChamberIMOLumi.push_back(std::make_unique<TH2F>(
s.c_str(),
s.c_str(), 1, 0, 1, 1, 0, 1));
221 std::vector<std::unique_ptr<TH2F>> mdtHitsPerMLByLayer;
222 mdtHitsPerMLByLayer.reserve(
layer.size() - 1);
224 for (
const auto& ilayer :
layer) {
225 if (ilayer ==
"Extra")
continue;
226 s =
"NumberOfHitsInMDT" + ilayer +
"_ADCCut";
227 mdtHitsPerMLByLayer.push_back(std::make_unique<TH2F>(
s.c_str(),
s.c_str(), 1, 0, 1, 1, 0, 1));
232 std::string hardware_name =
236 if (hardware_name ==
"BML6A13" || hardware_name ==
"BML6C13")
continue;
238 chamber = std::make_unique<MDTChamber>(hardware_name);
240 chamber->SetMDTHitsPerChamber_IMO_Bin(mdtHitsPerChamberIMOLumi[
chamber->GetBarrelEndcapEnum()].get());
241 chamber->SetMDTHitsPerML_byLayer_Bins(
242 mdtHitsPerMultiLayerLumi[
chamber->GetRegionEnum() *
layer.size() +
chamber->GetLayerEnum()].get(),
243 mdtHitsPerMLByLayer[(
chamber->GetLayerEnum() < 3 ?
chamber->GetLayerEnum() : 0)].get());
260 ATH_MSG_DEBUG(
"MdtRawDataMonAlg::MDT RawData Monitoring Histograms being filled");
265 fill(
"MdtMonitor", run3geo, firstEvent);
269 bool trig_BARREL =
false;
270 bool trig_ENDCAP =
false;
271 if (!m_l1RoiKey.empty()) {
273 if (!muonRoIs.
isValid()) {
ATH_MSG_ERROR(
"evtStore() does not contain muon L1 ROI Collection with name " << m_l1RoiKey); }
276 ATH_MSG_VERBOSE(
"Retrieved LVL1MuonRoIs object with key: " << m_l1RoiKey.key());
277 trig_BARREL = std::any_of(muonRoIs->
begin(), muonRoIs->
end(),
278 [](
const auto&
i) { return i->getSource() == xAOD::MuonRoI::RoISource::Barrel; });
279 trig_ENDCAP = std::any_of(muonRoIs->
begin(), muonRoIs->
end(),
280 [](
const auto&
i) { return i->getSource() == xAOD::MuonRoI::RoISource::Endcap; });
286 if (!mdt_container.
isValid()) {
287 ATH_MSG_ERROR(
"evtStore() does not contain mdt prd Collection with name " << m_key_mdt);
288 return StatusCode::FAILURE;
294 int nColl_ADCCut = 0;
300 if (!rpc_container.
isValid()) {
301 ATH_MSG_ERROR(
"evtStore() does not contain rpc prd Collection with name " << m_key_rpc);
302 return StatusCode::FAILURE;
311 for (containerIt = rpc_container->
begin(); containerIt != rpc_container->
end(); ++containerIt) {
317 bool isNoiseBurstCandidate =
false;
319 for (MdtcontainerIt = mdt_container->
begin(); MdtcontainerIt != mdt_container->
end(); ++MdtcontainerIt) {
321 mdtCollection != (*MdtcontainerIt)->end(); ++mdtCollection) {
326 if (Nhitsmdt > m_HighOccThreshold) isNoiseBurstCandidate =
true;
327 std::string
type =
"MDT";
328 std::string hardware_name;
330 std::map<std::string, int> evnt_hitsperchamber_map;
331 std::set<std::string> chambers_from_tracks;
333 if (m_doMdtESD ==
true) {
346 for (
const auto*
const mu : *muons) {
357 if (ntri_eta + n_phi == 0)
continue;
361 if (!rot_from_track)
continue;
363 if (!m_idHelperSvc->isMdt(rotId))
continue;
366 m_idHelperSvc->mdtIdHelper().get_module_hash(rotId, mdt_idHash);
367 ATH_CHECK(getChamber(mdt_idHash, mdt_chamber));
368 std::string mdt_chambername = mdt_chamber->
getName();
369 chambers_from_tracks.insert(mdt_chambername);
375 auto summaryPlots = std::make_unique<std::array<MDTSummaryHistogramStruct, 4096>>();
377 std::vector<std::string> v_hit_in_chamber_allphi;
378 std::map<std::string, std::vector<std::string>> v_hit_in_chamber;
381 if (containerIt == mdt_container->
end() || containerIt->empty())
continue;
384 bool isHit_above_ADCCut =
false;
386 for (
const auto* mdtCollection : **containerIt) {
389 float adc = mdtCollection->adc();
390 hardware_name = getChamberName(mdtCollection);
392 if (hardware_name.substr(0, 3) ==
"BMG")
adc /= m_adcScale;
393 if (
adc > m_ADCCut) {
395 isHit_above_ADCCut =
true;
396 if (m_do_mdtchamberstatphislice) {
397 std::string
phi = hardware_name.substr(hardware_name.length() - 2);
398 v_hit_in_chamber[
phi].push_back(hardware_name);
400 v_hit_in_chamber_allphi.push_back(hardware_name);
402 fillMDTOverviewVects(mdtCollection, isNoiseBurstCandidate, overviewPlots);
406 ATH_CHECK(fillMDTSummaryVects(mdtCollection, chambers_from_tracks, isNoiseBurstCandidate, trig_BARREL, trig_ENDCAP,
407 summaryPlots.get()));
411 if (m_doChamberHists) {
ATH_CHECK(fillMDTHistograms(mdtCollection)); }
414 if (iter_hitsperchamber == evnt_hitsperchamber_map.end()) {
415 evnt_hitsperchamber_map.insert(make_pair(hardware_name, 1));
417 iter_hitsperchamber->second += 1;
421 nColl_ADCCut += isHit_above_ADCCut;
423 if (m_do_mdtchamberstatphislice) {
424 for (
const auto& phiitem : v_hit_in_chamber) {
426 fill(
"MdtMonitor", hit_in_chamber);
430 fill(
"MdtMonitor", hit_in_chamber_allphi);
432 fillMDTOverviewHistograms(overviewPlots);
435 int nHighOccChambers = 0;
436 for (
const auto& iterstat : evnt_hitsperchamber_map) {
437 const auto iter_tubesperchamber = m_tubesperchamber_map.find(iterstat.first);
438 if (
ATH_UNLIKELY(iter_tubesperchamber == m_tubesperchamber_map.end())) {
442 float nTubes = iter_tubesperchamber->second;
443 float hits = iterstat.second;
444 float occ =
hits / nTubes;
445 if (occ > 0.1) nHighOccChambers++;
456 fill(
"MdtMonitor", nHighOccChambers_mon, nPrd_mon, Nhitsrpc_mon, nPrdcut_mon, nColl_mon, nColl_ADCCut_mon);
463 for (
const auto&
key : m_segm_type) {
466 ATH_MSG_ERROR(
"evtStore() does not contain mdt segms Collection with name " <<
key);
467 return StatusCode::FAILURE;
472 ATH_CHECK(handleEvent_effCalc_fillVects(segms.
cptr(), segsPlots));
474 ATH_CHECK(fillMDTSegmentHistograms(segsPlots));
476 return StatusCode::SUCCESS;
491 ATH_MSG_ERROR(
"Null pointer to the read MuonDetectorManager conditions object");
497 float mdt_tube_eta = mdtgPos.eta();
499 float tdc = mdtCollection->
tdc() * 25.0 / 32.0;
501 if (hardware_name.substr(0, 3) ==
"BMG") tdc = mdtCollection->
tdc() * 0.2;
503 float adc = mdtCollection->
adc();
508 if (std::abs(mdt_tube_eta) > 0. && std::abs(mdt_tube_eta) < 0.9) {
515 if (std::abs(mdt_tube_eta) > 0.9 && std::abs(mdt_tube_eta) < 1.2) {
522 if (std::abs(mdt_tube_eta) > 1.2 && std::abs(mdt_tube_eta) < 2.7) {
532 if (!isNoisy &&
adc > 0) {
537 vects.
noiseBurst.push_back((
int)isNoiseBurstCandidate);
538 if (isNoiseBurstCandidate) {
553 fill(
"MdtMonitor", mdt_tube_z_barrel, mdt_tube_perp_barrel, mdt_tube_x_barrel, mdt_tube_y_barrel);
559 fill(
"MdtMonitor", mdt_tube_z_ovl, mdt_tube_perp_ovl, mdt_tube_x_ovl, mdt_tube_y_ovl);
565 fill(
"MdtMonitor", mdt_tube_z_endcap, mdt_tube_perp_endcap, mdt_tube_x_endcap, mdt_tube_y_endcap);
570 fill(
"MdtMonitor", adc_mon_nosel, tdc_mon_nosel, noiseBurst);
574 fill(
"MdtMonitor", tdc_mon, adc_mon);
577 fill(
"MdtMonitor", adc_mon_noiseBurst_notNoisy);
580 fill(
"MdtMonitor", tdc_mon_noiseBurst_adcCut);
583 fill(
"MdtMonitor", tdc_mon_adcCut);
587 bool& isNoiseBurstCandidate,
bool trig_barrel,
bool trig_endcap,
588 std::array<MDTSummaryHistogramStruct, 4096>* vects)
const {
591 IdentifierHash digcoll_idHash = (mdtCollection)->collectionHash();
597 std::string region[4] = {
"BA",
"BC",
"EA",
"EC"};
598 std::string
layer[4] = {
"Inner",
"Middle",
"Outer",
"Extra"};
599 std::string crate[4] = {
"01",
"02",
"03",
"04"};
603 int iregion =
chamber->GetRegionEnum();
604 int ilayer =
chamber->GetLayerEnum();
605 int icrate =
chamber->GetCrate();
608 std::string chambername =
chamber->getName();
609 int thisStationEta =
chamber->GetStationEta();
611 int crate_region = iregion;
613 if (chambername.substr(0, 3) ==
"BEE" || (chambername.substr(0, 3) ==
"BIS" && (thisStationEta == 7 || thisStationEta == 8))) {
614 if (iregion == 0) crate_region = 2;
615 if (iregion == 1) crate_region = 3;
619 std::array<MDTSummaryHistogramStruct, 4096>&
array = *(vects);
620 auto& thisVects =
array[
v];
622 bool is_on_track =
false;
623 for (
const auto&
ch : chambers_from_tracks) {
624 if (chambername ==
ch) is_on_track =
true;
627 bool isBIM = (chambername.at(2) ==
'M');
628 float tdc = mdtCollection->
tdc() * 25.0 / 32.0;
630 if (chambername.substr(0, 3) ==
"BMG") tdc = mdtCollection->
tdc() * 0.2;
631 float adc = mdtCollection->
adc();
634 thisVects.sector.push_back(
stationPhi + iregion * 16);
643 int mlayer_n =
m_idHelperSvc->mdtIdHelper().multilayer(digcoll_id);
645 if (!isNoisy &&
adc > 0) {
646 thisVects.adc_mon.push_back(
adc);
647 thisVects.tdc_mon.push_back(tdc);
648 if (isNoiseBurstCandidate) {
649 thisVects.tdc_mon_nb2.push_back(tdc);
650 thisVects.adc_mon_nb2.push_back(
adc);
656 if (isNoiseBurstCandidate) {
657 thisVects.tdc_mon_nb1.push_back(tdc);
658 thisVects.adc_mon_nb1.push_back(
adc);
662 thisVects.adc_mon_adccut.push_back(
adc);
663 thisVects.tdc_mon_adccut.push_back(tdc);
664 int thisStationEta =
chamber->GetStationEta();
665 thisVects.stationEta.push_back(thisStationEta);
667 int binx =
chamber->GetMDTHitsPerChamber_IMO_BinX();
672 int biny =
chamber->GetMDTHitsPerChamber_IMO_BinY();
674 std::string varx =
" ";
675 std::string vary =
" ";
676 std::string varx_noise =
" ";
677 std::string vary_noise =
" ";
679 varx =
"x_mon_barrel";
680 vary =
"y_mon_barrel";
681 varx_noise =
"x_mon_barrel_noise";
682 vary_noise =
"y_mon_barrel_noise";
684 varx =
"x_mon_endcap";
685 vary =
"y_mon_endcap";
686 varx_noise =
"x_mon_endcap_noise";
687 vary_noise =
"y_mon_endcap_noise";
690 thisVects.x_mon.push_back(binx);
691 thisVects.y_mon.push_back(biny - 1);
692 if (isNoiseBurstCandidate) {
693 thisVects.x_mon_noise.push_back(binx);
694 thisVects.y_mon_noise.push_back(biny - 1);
695 thisVects.tdc_mon_nb3.push_back(tdc);
698 thisVects.x_bin_perML.push_back(
chamber->GetMDTHitsPerML_Binx() - 1);
701 biny_ml =
chamber->GetMDTHitsPerML_m1_Biny();
702 else if (mlayer_n == 2)
703 biny_ml =
chamber->GetMDTHitsPerML_m2_Biny();
704 thisVects.y_bin_perML.push_back(biny_ml - 1);
706 if (
layer[ilayer] !=
"Extra") {
707 thisVects.bin_byLayer_x.push_back(
chamber->GetMDTHitsPerML_byLayer_BinX() - 1);
708 thisVects.bin_byLayer_y.push_back(
chamber->GetMDTHitsPerML_byLayer_BinY(mlayer_n) - 1);
710 if (trig_barrel) { thisVects.tdc_mon_rpc.push_back(tdc); }
711 if (trig_endcap) { thisVects.tdc_mon_tgc.push_back(tdc); }
715 if (chambername.substr(0, 3) ==
"BEE" || (chambername.substr(0, 3) ==
"BIS" && (thisStationEta == 7 || thisStationEta == 8))) {
716 thisVects.biny_vslb_bycrate_bis_bee.push_back(
719 thisVects.biny_vslb_bycrate.push_back(
724 if (chambername.substr(0, 3) ==
"BEE" || (chambername.substr(0, 3) ==
"BIS" && (thisStationEta == 7 || thisStationEta == 8))) {
725 thisVects.biny_vslb_bycrate_bis_bee_ontrack.push_back(
728 thisVects.biny_vslb_bycrate_ontrack.push_back(
738 std::string region[4] = {
"BA",
"BC",
"EA",
"EC"};
739 std::string
layer[4] = {
"Inner",
"Middle",
"Outer",
"Extra"};
740 std::string crate[4] = {
"01",
"02",
"03",
"04"};
745 for (
int iregion = 0; iregion < 4; ++iregion) {
746 std::string MDT_regionGroup =
"MDT_regionGroup" + region[iregion];
747 for (
int crate_region = 0; crate_region < 4; ++crate_region) {
748 std::string MDT_regionGroup_bycrate =
"MDT_regionGroup_bycrate" + region[crate_region];
749 for (
int ilayer = 0; ilayer < 4; ++ilayer) {
751 for (
int icrate = 0; icrate < 4; ++icrate) {
754 std::array<MDTSummaryHistogramStruct, 4096>&
array = *(vects);
755 auto& thisVects =
array[
v];
759 fill(
"MdtMonitor", lb_mon, sector);
763 thisVects.stationEta);
780 std::string varx = iregion < 2 ?
"x_mon_barrel" :
"x_mon_endcap";
781 std::string vary = iregion < 2 ?
"y_mon_barrel" :
"y_mon_endcap";
782 std::string varx_noise = iregion < 2 ?
"x_mon_barrel_noise" :
"x_mon_endcap_noise";
783 std::string vary_noise = iregion < 2 ?
"y_mon_barrel_noise" :
"y_mon_endcap_noise";
789 fill(
"MdtMonitor", x_mon, y_mon, x_mon_noise, y_mon_noise);
792 varx =
"x_mon_" + region[iregion] +
"_" +
layer[ilayer];
793 vary =
"y_mon_" + region[iregion] +
"_" +
layer[ilayer];
798 if (
layer[ilayer] !=
"Extra") {
799 varx =
"x_mon_" +
layer[ilayer];
800 vary =
"y_mon_" +
layer[ilayer];
804 fill(
"MdtMonitor", bin_byLayer_x, bin_byLayer_y);
810 auto biny_name =
"y_mon_bin_" + region[iregion] +
"_" +
layer[ilayer];
811 if (
layer[ilayer] ==
"Extra" ||
layer[ilayer] ==
"Outer")
812 biny_name =
"y_mon_bin_" + region[iregion] +
"_OuterPlusExtra";
816 std::vector<int> sum_biny_vslb_bycrate;
817 sum_biny_vslb_bycrate.reserve(thisVects.biny_vslb_bycrate.size() + thisVects.biny_vslb_bycrate_bis_bee.size());
818 sum_biny_vslb_bycrate.insert(sum_biny_vslb_bycrate.end(), thisVects.biny_vslb_bycrate_bis_bee.begin(),
819 thisVects.biny_vslb_bycrate_bis_bee.end());
820 sum_biny_vslb_bycrate.insert(sum_biny_vslb_bycrate.end(), thisVects.biny_vslb_bycrate.begin(),
821 thisVects.biny_vslb_bycrate.end());
823 auto biny_name_bycrate =
"y_mon_bin_bycrate_" + region[crate_region] +
"_" + crate[icrate];
826 std::vector<int> sum_biny_vslb_bycrate_ontrack;
827 sum_biny_vslb_bycrate_ontrack.reserve(thisVects.biny_vslb_bycrate_ontrack.size() +
828 thisVects.biny_vslb_bycrate_bis_bee_ontrack.size());
829 sum_biny_vslb_bycrate_ontrack.insert(sum_biny_vslb_bycrate_ontrack.end(),
830 thisVects.biny_vslb_bycrate_bis_bee_ontrack.begin(),
831 thisVects.biny_vslb_bycrate_bis_bee_ontrack.end());
832 sum_biny_vslb_bycrate_ontrack.insert(sum_biny_vslb_bycrate_ontrack.end(),
833 thisVects.biny_vslb_bycrate_ontrack.begin(),
834 thisVects.biny_vslb_bycrate_ontrack.end());
836 auto biny_name_bycrate_ontrack =
"y_mon_bin_bycrate_ontrack_" + region[crate_region] +
"_" + crate[icrate];
837 auto biny_var_bycrate_ontrack =
Monitored::Collection(biny_name_bycrate_ontrack, sum_biny_vslb_bycrate_ontrack);
839 fill(MDT_regionGroup, adc_mon, tdc_mon, tdc_mon_nb2, adc_mon_nb2, tdc_mon_adccut, adc_mon_adccut, tdc_mon_adccut,
840 adc_mon_adccut, tdc_mon_nb3, x_bin_perML, y_bin_perML, tdc_mon_rpc, tdc_mon_tgc, biny_var, lb_mon, biny_var);
842 fill(MDT_regionGroup_bycrate, lb_mon, biny_var_bycrate, biny_var_bycrate_ontrack);
849 return StatusCode::SUCCESS;
856 IdentifierHash digcoll_idHash = (mdtCollection)->collectionHash();
861 std::string hardware_name =
chamber->getName();
867 int mdtlayer =
m_idHelperSvc->mdtIdHelper().tubeLayer(digcoll_id);
868 if (
m_idHelperSvc->mdtIdHelper().multilayer(digcoll_id) == 2) {
869 if (hardware_name.at(1) ==
'I' && hardware_name.at(3) !=
'8')
880 float tdc = mdtCollection->
tdc() * 25.0 / 32.0;
882 if (hardware_name.substr(0, 3) ==
"BMG") tdc = mdtCollection->
tdc() * 0.2;
883 float adc = mdtCollection->
adc();
886 int iregion =
chamber->GetRegionEnum();
888 int mezz =
mezzmdt(digcoll_id);
890 std::string monPerCh =
"MdtMonPerChamber";
891 if (iregion == 0) monPerCh +=
"BA";
892 if (iregion == 1) monPerCh +=
"BC";
893 if (iregion == 2) monPerCh +=
"EA";
894 if (iregion == 3) monPerCh +=
"EC";
896 int mdtMultLayer =
m_idHelperSvc->mdtIdHelper().multilayer(digcoll_id);
908 fill(monPerCh, tdc_perch, adc_perch, layer_perch, tube_perch, mezz_perch, ml1_adccut, ml2_adccut, adccut_nonoise, adccut);
928 std::string
type =
"MDT";
930 std::set<monAlg::TubeTraversedBySegment, monAlg::TubeTraversedBySegment_cmp> store_effTubes;
931 std::set<Identifier> store_ROTs;
938 ATH_MSG_ERROR(
"Null pointer to the read MuonDetectorManager conditions object");
939 return StatusCode::FAILURE;
954 std::vector<Identifier> ROTs_chamber;
955 std::vector<int> ROTs_tube;
956 std::vector<int> ROTs_L;
957 std::vector<int> ROTs_ML;
958 for (
unsigned int irot = 0; irot <
segment->numberOfContainedROTs(); irot++) {
970 const std::string& chambername =
chamber->getName();
975 if (store_ROTs.count(tmpid)) {
continue; }
976 store_ROTs.insert(tmpid);
981 int iregion =
chamber->GetRegionEnum();
982 int ilayer =
chamber->GetLayerEnum();
983 int statphi =
chamber->GetStationPhi();
985 auto& thisVects = vects[iregion][ilayer][statphi];
986 thisVects.adc_segs_mon.push_back(
adc);
990 thisVects.tdc_segs_mon.push_back(tdc);
992 int binx =
chamber->GetMDTHitsPerChamber_IMO_BinX();
997 int biny =
chamber->GetMDTHitsPerChamber_IMO_BinY();
998 thisVects.x_segs_mon.push_back(binx);
999 thisVects.y_segs_mon.push_back(biny - 1);
1003 int mdtMultLayer =
m_idHelperSvc->mdtIdHelper().multilayer(tmpid);
1008 std::string monPerCh =
"MdtMonPerChamber";
1011 else if (iregion == 1)
1013 else if (iregion == 2)
1015 else if (iregion == 3)
1018 ROTs_chamber.push_back(tmpid);
1019 ROTs_ML.push_back(mdtMultLayer);
1020 ROTs_tube.push_back(
m_idHelperSvc->mdtIdHelper().tube(tmpid));
1021 ROTs_L.push_back(
m_idHelperSvc->mdtIdHelper().tubeLayer(tmpid));
1024 fill(monPerCh, adc_perch, adc_ml1, adc_ml2);
1031 std::vector<Identifier> unique_chambers;
1032 std::vector<std::vector<int>> unique_chambers_ML;
1034 for (
unsigned i = 0;
i < ROTs_chamber.size();
i++) {
1035 bool isUnique =
true;
1036 for (
unsigned j = 0; j < unique_chambers.size(); j++) {
1039 if (!
AinB(ROTs_ML.at(
i), unique_chambers_ML.at(j))) unique_chambers_ML.at(j).push_back(ROTs_ML.at(
i));
1044 unique_chambers.push_back(ROTs_chamber.at(
i));
1045 std::vector<int> tmp_ML;
1046 tmp_ML.push_back(ROTs_ML.at(
i));
1047 unique_chambers_ML.push_back(tmp_ML);
1053 std::vector<Identifier> traversed_station_id;
1054 std::vector<int> traversed_tube;
1055 std::vector<int> traversed_L;
1056 std::vector<int> traversed_ML;
1058 for (
const Identifier& station_id : unique_chambers) {
1069 for (
int ML : {1, 2}) {
1078 int tubeMin = id_helper.
tubeMin(newId);
1080 for (
int i_tube = tubeMin; i_tube <=
tubeMax; ++i_tube) {
1081 for (
int i_layer = tubeLayerMin; i_layer <= tubeLayerMax; ++i_layer) {
1085 std::map<Identifier, std::set<Identifier>>::const_iterator myIt =
m_DeadChannels.find(MdtRoEl->
identify());
1087 if (myIt->second.count(tubeId)) {
1102 traversed_tube.push_back(i_tube);
1103 traversed_L.push_back(i_layer);
1104 traversed_ML.push_back(ML);
1105 traversed_station_id.push_back(station_id);
1117 if (traversed_tube.size() < 20) {
1120 for (
unsigned k = 0;
k < traversed_tube.size();
k++) {
1122 std::string hardware_name =
getChamberName(traversed_station_id.at(
k));
1131 bool hit_flag =
false;
1132 for (
unsigned j = 0; j < ROTs_tube.size(); j++) {
1133 if ((
getChamberName(ROTs_chamber.at(j)) == hardware_name) && (traversed_tube.at(
k) == ROTs_tube.at(j)) &&
1134 (traversed_L.at(
k) == ROTs_L.at(j)) &&
1135 (traversed_ML.at(
k) == ROTs_ML.at(j))) {
1141 const Identifier& trav_id = traversed_station_id.at(
k);
1150 int mdtlayer = ((traversed_L.at(
k) - 1) + (traversed_ML.at(
k) - 1) * tubeLayerMax);
1151 int ibin = traversed_tube.at(
k) + mdtlayer *
cachedTubeMax(newId);
1161 it = store_effTubes.find(tmp_effTube_Hit);
1162 if (hit_flag || (
it == store_effTubes.end()))
1163 store_effTubes.insert(tmp_effTube);
1165 it = store_effTubes.find(tmp_effTube_noHit);
1166 if (hit_flag && (
it != store_effTubes.end()))
1167 store_effTubes.erase(
it);
1181 int tubebin =
it.tubeBin;
1183 int iregion =
chamber->GetRegionEnum();
1184 std::string monPerCh =
"MdtMonPerChamber";
1185 if (iregion == 0) monPerCh +=
"BA";
1186 if (iregion == 1) monPerCh +=
"BC";
1187 if (iregion == 2) monPerCh +=
"EA";
1188 if (iregion == 3) monPerCh +=
"EC";
1190 std::string chambername =
chamber->getName();
1194 fill(monPerCh, tube_perch_segs, hitcut);
1197 return StatusCode::SUCCESS;
1202 std::string region[4] = {
"BA",
"BC",
"EA",
"EC"};
1203 std::string
layer[4] = {
"Inner",
"Middle",
"Outer",
"Extra"};
1205 for (
int iregion = 0; iregion < 4; ++iregion) {
1206 std::string MDT_regionGroup =
"MDT_regionGroup" + region[iregion];
1207 for (
int ilayer = 0; ilayer < 4; ++ilayer) {
1209 const auto& thisVects = vects[iregion][ilayer][
stationPhi];
1220 fill(MDT_regionGroup, adc_segs_mon, tdc_segs_region_mon);
1222 std::string varx = iregion < 2 ?
"x_segs_mon_barrel" :
"x_segs_mon_endcap";
1223 std::string vary = iregion < 2 ?
"y_segs_mon_barrel" :
"y_segs_mon_endcap";
1227 fill(
"MdtMonitor", tdc_segs_overall_mon, adc_segs_overall_mon, x_segs_mon, y_segs_mon);
1231 return StatusCode::SUCCESS;
1235 PVConstLink cv = mydetEl->getMaterialGeom();
1236 int nGrandchildren = cv->getNChildVols();
1237 if (nGrandchildren <= 0)
return;
1245 bool tubefound =
false;
1246 for (
unsigned int kk = 0;
kk < cv->getNChildVols(); ++
kk) {
1247 int tubegeo = cv->getIdOfChildVol(
kk) % maxNTubesPerLayer;
1248 int layergeo = (cv->getIdOfChildVol(
kk) - tubegeo) / maxNTubesPerLayer;
1249 if (tubegeo ==
tube && layergeo ==
layer) {
1253 if (layergeo >
layer)
break;
1257 deadTubes.insert(deadTubeId);