23#include <boost/property_tree/ptree.hpp>
24#include <boost/property_tree/xml_parser.hpp>
31 ISvcLocator* pSvcLocator)
57 std::vector<std::string> sectorStr = {
58 "sector1",
"sector2",
"sector3",
"sector4",
"sector5",
"sector6",
59 "sector7",
"sector8",
"sector9",
"sector10",
"sector11",
"sector12",
60 "sector13",
"sector14",
"sector15",
"sector16"};
64 std::vector<std::string> triggerThrs = {
"thr1",
"thr2",
"thr3",
65 "thr4",
"thr5",
"thr6"};
73 return StatusCode::SUCCESS;
82 ATH_MSG_INFO(name() <<
" - RpcTrackAnaAlg::initRpcPanel - start");
84 unsigned int nValidPanel = 0, nTriedPanel{0};
89 ATH_MSG_INFO(
"MuonGM::MuonDetectorManager::RpcDetElMaxHash= "
98 std::vector<int> BMBO_StationNames = {2, 3, 4, 5, 8, 9, 10, 53};
105 const unsigned int ngasgap = 2;
106 const unsigned int doubletZ = readoutEl->
getDoubletZ();
115 if (!std::count(BMBO_StationNames.begin(), BMBO_StationNames.end(),
120 if (!std::count(BMBO_StationNames.begin(), BMBO_StationNames.end(),
125 for (
unsigned doubletPhi = 1; doubletPhi <= 2; ++doubletPhi) {
126 for (
unsigned gasgap = 1; gasgap <= ngasgap; ++gasgap) {
127 std::shared_ptr<GasGapData> gap = std::make_shared<GasGapData>(
130 std::pair<int, int> st_dbR = std::make_pair(stName, gap->doubletR);
133 std::shared_ptr<RpcPanel> rpcPanel_eta = std::make_shared<RpcPanel>(
137 std::shared_ptr<RpcPanel> rpcPanel_phi = std::make_shared<RpcPanel>(
141 if (rpcPanel_eta->panel_valid) {
143 << rpcPanel_eta->stationName
144 <<
" stationEta:" << rpcPanel_eta->stationEta
145 <<
" stationPhi:" << rpcPanel_eta->stationPhi
146 <<
" doubletR:" << rpcPanel_eta->doubletR
147 <<
"doubletZ:" << rpcPanel_eta->doubletZ
148 <<
" doubletPhi:" << rpcPanel_eta->doubletPhi
149 <<
" gasGap:" << rpcPanel_eta->gasGap
150 <<
" measPhi:" << rpcPanel_eta->measPhi);
154 rpcPanel_eta->panelId, rpcPanel_eta));
158 if (rpcPanel_phi->panel_valid) {
160 << rpcPanel_phi->stationName
161 <<
" stationEta:" << rpcPanel_phi->stationEta
162 <<
" stationPhi:" << rpcPanel_phi->stationPhi
163 <<
" doubletR:" << rpcPanel_phi->doubletR
164 <<
"doubletZ:" << rpcPanel_phi->doubletZ
165 <<
" doubletPhi:" << rpcPanel_phi->doubletPhi
166 <<
" gasGap:" << rpcPanel_phi->gasGap
167 <<
" measPhi:" << rpcPanel_phi->measPhi);
171 rpcPanel_phi->panelId, rpcPanel_phi));
175 gap->RpcPanel_eta_phi = std::make_pair(rpcPanel_eta, rpcPanel_phi);
181 ATH_MSG_INFO(
"Number of valid panels = " << nValidPanel <<
" tried panels "
183 return StatusCode::SUCCESS;
191 std::string ele_str = panel->getElementStr();
193 std::map<std::string, int>::iterator it_eleInd =
198 << panel->stationName
199 <<
", stationEta = " << panel->stationEta
200 <<
", stationPhi = " << panel->stationPhi
201 <<
", doubletR = " << panel->doubletR
202 <<
", doubletZ = " << panel->doubletZ);
203 return StatusCode::FAILURE;
206 int ele_index = it_eleInd->second;
207 int panel_index = (ele_index - 1) * 8 + (panel->doubletPhi - 1) * 4 +
208 (panel->gasGap - 1) * 2 + panel->measPhi;
210 panel->SetPanelIndex(panel_index);
212 return StatusCode::SUCCESS;
226 const std::string xml_file =
228 if (xml_file.empty()) {
230 return StatusCode::FAILURE;
233 ATH_MSG_INFO(name() <<
" - read xml file: " << xml_file);
235 boost::property_tree::ptree pt;
236 read_xml(xml_file, pt);
238 for (boost::property_tree::ptree::value_type& child:
239 pt.get_child(
"Elements")) {
240 if (child.first ==
"Element") {
241 int index = child.second.get<
int>(
"<xmlattr>.index");
242 int stName = child.second.get<
int>(
"<xmlattr>.stationName");
243 int stEta = child.second.get<
int>(
"<xmlattr>.stationEta");
244 int stPhi = child.second.get<
int>(
"<xmlattr>.stationPhi");
245 int dbR = child.second.get<
int>(
"<xmlattr>.doubletR");
246 int dbZ = child.second.get<
int>(
"<xmlattr>.doubletZ");
249 <<
", stationEta = " << stEta
250 <<
", stationPhi = " << stPhi
251 <<
", doubletR = " << dbR
252 <<
", doubletZ = " << dbZ);
253 std::ostringstream ele_key;
255 ele_key << stName <<
"_" << stEta <<
"_" << stPhi <<
"_" << dbR
258 std::map<std::string, int>::iterator it_eleInd =
262 ele_key.str(),
index));
272 "Total number of elements: "
274 <<
", should be consistent with the number of elements in xml file!");
276 return StatusCode::SUCCESS;
282 std::unique_ptr<TObjArray> tagList(trigStr.Tokenize(
";"));
285 std::set<TString> alllist;
286 for (
int i = 0; i < tagList->GetEntries(); i++) {
287 TString tagTrig = tagList->At(i)->GetName();
288 if (alllist.find(tagTrig) != alllist.end())
290 alllist.insert(tagTrig);
291 std::unique_ptr<TObjArray> arr(tagTrig.Tokenize(
";"));
292 if (arr->GetEntries() == 0)
295 def.
eventTrig = TString(arr->At(0)->GetName());
297 if (arr->GetEntries() == 2)
298 def.
tagTrig = TString(arr->At(1)->GetName());
302 return StatusCode::SUCCESS;
318 auto evtLB =
Scalar<int>(
"evtLB", ctx.eventID().lumi_block());
322 return StatusCode::SUCCESS;
327 const EventContext& ctx)
const {
338 if (primVtxContainer.
isValid()) {
339 for (
const auto vtx : *primVtxContainer) {
347 const double primaryVertexZ = primVertex ? (primVertex->
z()) : (-999);
356 const float beamPosSigmaX = beamSigmaX(0);
357 const float beamPosSigmaY = beamSigmaY(0);
358 const float beamPosSigmaXY = beamSigmaXY(0);
367 ATH_MSG_ERROR(
"evtStore() does not contain muon Collection with name "
369 return StatusCode::FAILURE;
375 std::vector<std::shared_ptr<MyMuon>> tagmuons;
376 std::vector<std::shared_ptr<MyMuon>> probemuons;
378 if (std::abs(muon->eta()) >
m_maxEta)
381 auto mymuon = std::make_shared<MyMuon>();
383 mymuon->fourvec.SetPtEtaPhiM(muon->pt(), muon->eta(), muon->phi(),
389 if (muon->quality() > xAOD::Muon::Medium)
394 auto track = muon->primaryTrackParticle();
395 const double z0 = track->z0() + track->vz() - primaryVertexZ;
397 double z0sin = z0 * std::sin(track->theta());
399 track, beamPosSigmaX, beamPosSigmaY, beamPosSigmaXY);
402 if (std::abs(z0sin) < 0.5 && std::abs(d0sig) < 3.0) {
403 mymuon->tagProbeOK =
true;
405 probemuons.push_back(mymuon);
408 if (muon->pt() > 27.0e3 && std::abs(z0sin) < 1.0 &&
409 std::abs(d0sig) < 5.0) {
410 tagmuons.push_back(mymuon);
417 for (
const auto& tag_muon : tagmuons) {
418 if (!(tag_muon->tagged))
421 for (
const auto& probe_muon : probemuons) {
422 if (tag_muon->muon == probe_muon->muon)
426 if (!probe_muon->tagProbeOK)
430 if (tag_muon->muon->charge() == probe_muon->muon->charge())
434 float dimuon_mass = (tag_muon->fourvec + probe_muon->fourvec).M();
439 float dr = (tag_muon->fourvec).DeltaR(probe_muon->fourvec);
443 probe_muon->tagProbeAndZmumuOK =
true;
450 std::vector<const xAOD::MuonRoI*> roisBarrel;
457 "evtStore() does not contain muon L1 ROI Collection with name "
459 return StatusCode::FAILURE;
463 std::vector<float> roiEtaVec{}, roiBarrelEtaVec{};
464 std::vector<int> roiBarrelThrVec{};
466 roiEtaVec.reserve(muonRoIs->size());
467 roiBarrelEtaVec.reserve(muonRoIs->size());
468 roiBarrelThrVec.reserve(muonRoIs->size());
469 roisBarrel.reserve(muonRoIs->size());
471 roiEtaVec.push_back(roi->eta());
475 roiBarrelEtaVec.push_back(roi->eta());
476 roiBarrelThrVec.push_back(roi->getThrNumber());
477 roisBarrel.push_back(roi);
480 auto roiEtaCollection =
Collection(
"roiEta", roiEtaVec);
481 auto roiBarrelEtaCollection =
483 auto roiBarrelThrCollection =
485 fill(tool, roiEtaCollection);
486 fill(tool, roiBarrelEtaCollection);
487 fill(tool, roiBarrelThrCollection);
506 std::vector<GasGapResult> results;
507 int nmuon{0}, nmuon_barrel{0};
508 for (
const auto& probe_muon : probemuons) {
510 double pt = probe_muon->muon->pt();
511 double eta = probe_muon->muon->eta();
512 double phi = probe_muon->muon->phi();
521 xAOD::Muon::MuonSpectrometerTrackParticle);
533 fill(tool, i_pt_allMu, i_eta_allMu, i_phi_allMu);
539 if (probe_muon->tagProbeAndZmumuOK) {
542 std::vector<bool> isMatcheds(6, 0);
544 const double dphi = TVector2::Phi_mpi_pi(roi->phi() -
phi);
545 const double deta = roi->eta() -
eta;
546 const double dr = std::hypot(dphi, deta);
551 int thr = std::min(7, roi->getThrNumber());
552 for (
int i_thr = 1; i_thr <= thr; i_thr++) {
553 isMatcheds[i_thr - 1] =
true;
562 auto i_passTrigger =
Scalar<bool>(
"passTrigger",
false);
563 auto i_passTrigger_1 =
Scalar<bool>(
"passTrigger_plateau",
false);
565 for (
int i_thr = 1; i_thr < 7; i_thr++) {
566 i_passTrigger = isMatcheds[i_thr - 1];
567 i_passTrigger_1 = isMatcheds[i_thr - 1];
571 std::to_string(i_thr))],
572 i_pt, i_passTrigger);
577 std::to_string(i_thr))],
578 i_eta, i_phi, i_passTrigger_1);
594 fill(tool, i_pt_zMu, i_eta_zMu, i_phi_zMu);
599 fill(tool, i_eta_zMu_p, i_phi_zMu_p);
605 auto Nmuon_barrel =
Scalar<int>(
"nMuBarrel", nmuon_barrel);
610 fill(tool, Nmuon, Nmuon_barrel);
612 return StatusCode::SUCCESS;
625 const int i_lb = ctx.eventID().lumi_block();
626 std::vector<double> v_prdTime = {};
630 auto prd_sec_1214 =
Scalar<int>(
"prd_sec_1214", 0);
631 auto prd_layer_1214 =
Scalar<int>(
"prd_layer_1214", 0);
633 auto prd_sec_all_eta =
Scalar<int>(
"prd_sec_eta", 0);
634 auto prd_layer_all_eta =
Scalar<int>(
"prd_layer_eta", 0);
635 auto prd_sec_all_phi =
Scalar<int>(
"prd_sec_phi", 0);
636 auto prd_layer_all_phi =
Scalar<int>(
"prd_layer_phi", 0);
644 std::pair<int, int> sec_layer;
658 auto temp_panel = std::make_unique<RpcPanel>(
667 "The panelID corresponding prd hit does NOT link to a "
671 rpcData->detectorElement()->identify())
675 panel_index = i_panel->second->panel_index;
678 sec_layer = temp_panel->getSectorLayer();
679 prd_sec_all = sec_layer.first;
680 prd_layer_all = sec_layer.second;
682 if (std::abs(sec_layer.first) == 12 ||
683 std::abs(sec_layer.first) == 14) {
684 prd_sec_1214 = sec_layer.first;
685 prd_layer_1214 = sec_layer.second;
688 fill(tool, prd_sec_all, prd_layer_all, prd_sec_1214,
692 prd_sec_all_eta = sec_layer.first;
693 prd_layer_all_eta = sec_layer.second;
694 fill(tool, prd_sec_all_eta, prd_layer_all_eta);
696 prd_sec_all_phi = sec_layer.first;
697 prd_layer_all_phi = sec_layer.second;
698 fill(tool, prd_sec_all_phi, prd_layer_all_phi);
701 i_panelIndex = panel_index;
702 fill(tool, i_prd_LB, i_panelIndex);
704 v_prdTime.push_back(rpcData->time());
708 auto prdTimeCollection =
Collection(
"prdTime", v_prdTime);
709 fill(tool, prdTimeCollection);
712 return StatusCode::SUCCESS;
718 const std::vector<TagDef>& list_of_triggers)
const {
720 return StatusCode::SUCCESS;
722 return StatusCode::SUCCESS;
724 muonvec.SetPtEtaPhi(offline_muon->
pt(), offline_muon->
eta(),
725 offline_muon->
phi());
727 for (
const auto& tagTrig : list_of_triggers) {
732 <<
"; tagTrig.tagTrig = "
737 std::vector<TrigCompositeUtils::LinkInfo<xAOD::MuonContainer>>
741 for (
const auto& aaa : features) {
743 auto trigmuon_link = aaa.link;
744 auto trigmuon = *trigmuon_link;
746 trigvec.SetPtEtaPhi(trigmuon->pt(), trigmuon->eta(),
749 return StatusCode::SUCCESS;
752 return StatusCode::FAILURE;
758 std::vector<GasGapResult>& results,
776 if (barrelDL >=
OUT) {
777 return StatusCode::SUCCESS;
778 }
else if (barrelDL ==
BM2 || barrelDL ==
BO2) {
786 return StatusCode::FAILURE;
792 return StatusCode::FAILURE;
795 std::unique_ptr<Trk::TrackParameters> trackParamLayer{};
798 const std::vector<int> dl_vec = dl_vec_it->second;
799 std::vector<int>::const_iterator it_dl = dl_vec.begin();
800 for (; it_dl != dl_vec.end(); ++it_dl) {
802 std::pair<int, int> st_dbR = std::make_pair(stName, doubletR);
803 std::map<std::pair<int, int>,
814 for (
const std::shared_ptr<GasGapData>& gap : gasgapIt->second) {
818 gap->computeTrackDistanceToGasGap(
result, *track);
827 auto trackParamInGap =
830 if (!trackParamInGap) {
834 if (!
result.localTrackPosInBoundsTight) {
838 if (
result.minTrackGasGapDR < minDR) {
839 minDR =
result.minTrackGasGapDR;
842 trackParamLayer = std::move(trackParamInGap);
844 ATH_MSG_DEBUG(name() <<
" extrapolated gasgap: " << gap->gapid_str);
846 results.push_back(std::make_pair(
result, gap));
855 if (trackParamLayer !=
nullptr) {
865std::unique_ptr<Trk::TrackParameters>
868 const std::shared_ptr<GasGapData>& gap)
const {
869 const EventContext& ctx = Gaudi::Hive::currentContext();
879 std::unique_ptr<Trk::TrackParameters> detParameters{};
885 }
else if (track_particle->
track()) {
887 ctx, *(track_particle->
track()), gapSurface,
result.direction,
true,
890 return detParameters;
893 if (!detParameters) {
894 return detParameters;
902 gap->readoutEl->globalToLocalCoords(detParameters->position(),
904 const Amg::Vector2D local2dTrackPosition(local3dTrackPosition.y(),
905 local3dTrackPosition.z());
910 const bool inbounds =
913 const bool inbounds_tight = bounds.
inside(
917 result.localTrackPosInBounds = inbounds;
918 result.localTrackPosInBoundsTight = inbounds_tight;
919 result.localPos = local3dTrackPosition;
920 result.globalPos = detParameters->position();
922 return detParameters;
927 std::unique_ptr<Trk::TrackParameters> trackParam,
946 if (barrelDL >=
OUT) {
947 return StatusCode::SUCCESS;
948 }
else if (barrelDL ==
BM2 || barrelDL ==
BO2) {
956 return StatusCode::FAILURE;
962 return StatusCode::FAILURE;
965 std::unique_ptr<Trk::TrackParameters> trackParamLayer{};
968 const std::vector<int> dl_vec = dl_vec_it->second;
970 std::vector<int>::const_iterator it_dl = dl_vec.begin();
971 for (; it_dl != dl_vec.end(); ++it_dl) {
973 std::pair<int, int> st_dbR = std::make_pair(stName, doubletR);
974 std::map<std::pair<int, int>,
986 for (
const std::shared_ptr<GasGapData>& gap : gasgapIt->second) {
991 gap->computeTrackDistanceToGasGap(
result, trackParam.get());
1002 result, trackParam.get(), gap);
1003 if (trackParamInGap ==
nullptr) {
1007 if (!
result.localTrackPosInBoundsTight) {
1011 ATH_MSG_DEBUG(name() <<
" extrapolated gasgap: " << gap->gapid_str);
1013 if (
result.minTrackGasGapDR < minDR) {
1014 minDR =
result.minTrackGasGapDR;
1017 trackParamLayer = std::move(trackParamInGap);
1020 results.push_back(std::make_pair(
result, gap));
1024 if (trackParamLayer ==
nullptr) {
1025 trackParamLayer = std::move(trackParam);
1029 return extrapolate2RPC(std::move(trackParamLayer), direction, results,
1034std::unique_ptr<Trk::TrackParameters>
1037 const std::shared_ptr<GasGapData>& gap)
const {
1038 const EventContext& ctx = Gaudi::Hive::currentContext();
1051 if (!detParameters) {
1052 return detParameters;
1060 gap->readoutEl->globalToLocalCoords(detParameters->position(),
1062 const Amg::Vector2D local2dTrackPosition(local3dTrackPosition.y(),
1063 local3dTrackPosition.z());
1068 const bool inbounds =
1071 const bool inbounds_tight = bounds.
inside(
1075 result.localTrackPosInBounds = inbounds;
1076 result.localTrackPosInBoundsTight = inbounds_tight;
1077 result.localPos = local3dTrackPosition;
1078 result.globalPos = detParameters->position();
1080 return detParameters;
1085 std::vector<GasGapResult>& results,
1090 int lumiBlock = ctx.eventID().lumi_block();
1095 ATH_MSG_DEBUG(
" RpcPrepDataContainer size = " << rpcContainer->size());
1098 auto i_hitTime_sec =
Scalar<int>(
"hitTime_sec", 0);
1100 auto isOutTime_prd =
Scalar<bool>(
"isOutTime_prd",
false);
1101 auto isOutTime_onTrack =
Scalar<bool>(
"isOutTime_prd_onTrack",
false);
1102 auto i_panelIndex =
Scalar<int>(
"panelInd_prd", -1);
1103 auto i_panelIndex_onTrack =
Scalar<int>(
"panelInd_prd_onTrack", -1);
1107 auto closest_res_eta =
Scalar<int>(
"closest_residual_eta", 0);
1108 auto closest_res_phi =
Scalar<int>(
"closest_residual_phi", 0);
1111 auto i_panelInd_res =
Scalar<int>(
"panelInd_res_inTime", -1);
1114 const std::shared_ptr<GasGapData> gap = exr.second;
1116 int sector = (gap->RpcPanel_eta_phi.first->getSectorLayer()).first;
1118 float clo_res_eta = 1001.;
1119 float clo_res_phi = 1001.;
1120 int NHitwithCut_perMuon_eta = 0;
1121 int NHitwithCut_perMuon_phi = 0;
1122 int NHitnoCut_perMuon_eta = 0;
1123 int NHitnoCut_perMuon_phi = 0;
1124 std::vector<const Muon::RpcPrepData*> view_hits_eta;
1125 std::vector<const Muon::RpcPrepData*> view_hits_phi;
1129 if (!rpcCollection) {
1140 const int stationName = rpcIdHelper.
stationName(
id);
1141 const int stationEta = rpcIdHelper.
stationEta(
id);
1142 const int stationPhi = rpcIdHelper.
stationPhi(
id);
1144 const int doubletR = rpcIdHelper.
doubletR(
id);
1145 const int doubletZ = rpcIdHelper.
doubletZ(
id);
1146 const int doubletPhi = rpcIdHelper.
doubletPhi(
id);
1147 const unsigned gasGap = rpcIdHelper.
gasGap(
id);
1148 const int measuresPhi = rpcIdHelper.
measuresPhi(
id);
1151 if (stationName == gap->stationName &&
1152 stationPhi == gap->stationPhi &&
1153 stationEta == gap->stationEta &&
1154 doubletR == gap->doubletR && gasGap == gap->gasgap &&
1155 doubletPhi == gap->doubletPhi &&
1156 doubletZ == gap->doubletZ) {
1159 i_hitTime_sec = rpcData->time();
1161 "sector" + std::to_string(std::abs(sector)))],
1166 float hit_local_x = rpcData->localPosition().x();
1167 float trackPos_localY = exr.first.localPos.y();
1168 float trackPos_localZ = exr.first.localPos.z();
1170 float residual_phi = trackPos_localY-hit_local_x;
1171 float residual_eta = trackPos_localZ-hit_local_x;
1174 bool isOutTime = (std::abs(i_hitTime_sec+50.) >
m_outtime);
1175 int i_panel = measuresPhi ? gap->RpcPanel_eta_phi.second->panel_index :
1176 gap->RpcPanel_eta_phi.first->panel_index;
1179 if (muon_source ==
ZCand) {
1181 isOutTime_prd = isOutTime;
1182 isOutTime_onTrack = isOutTime;
1185 i_panelIndex = i_panel;
1186 fill(tool, i_panelIndex, isOutTime_prd);
1188 i_panelIndex_onTrack = i_panel;
1189 fill(tool, i_panelIndex_onTrack, isOutTime_onTrack);
1192 i_panelIndex = i_panel;
1193 fill(tool, i_panelIndex, isOutTime_prd);
1195 i_panelIndex_onTrack = i_panel;
1196 fill(tool, i_panelIndex_onTrack, isOutTime_onTrack);
1202 NHitnoCut_perMuon_phi++;
1204 NHitnoCut_perMuon_eta++;
1211 i_panelInd_res = i_panel;
1214 res_phi = residual_phi;
1216 clo_res_phi = std::min(clo_res_phi, residual_phi);
1221 NHitwithCut_perMuon_phi++;
1222 view_hits_phi.push_back(rpcData);
1225 res_eta = residual_eta;
1227 clo_res_eta = std::min(clo_res_eta, residual_eta);
1232 NHitwithCut_perMuon_eta++;
1233 view_hits_eta.push_back(rpcData);
1240 int etaPanel_ind = -1;
1241 int phiPanel_ind = -1;
1243 etaPanel_ind = gap->RpcPanel_eta_phi.first->panel_index;
1244 phiPanel_ind = gap->RpcPanel_eta_phi.second->panel_index;
1247 if (muon_source ==
ZCand) {
1248 auto hitMulti_eta =
Scalar<int>(
"hitMulti_eta", NHitwithCut_perMuon_eta);
1249 auto hitMulti_phi =
Scalar<int>(
"hitMulti_phi", NHitwithCut_perMuon_phi);
1251 auto i_panelIndex =
Scalar<int>(
"panelInd_hM", -1);
1252 auto i_passExtrap =
Scalar<bool>(
"muon_passExtrap",
false);
1253 auto i_passExtrap_or =
Scalar<bool>(
"muon_passExtrap_or",
false);
1254 auto i_passExtrap_and =
Scalar<bool>(
"muon_passExtrap_and",
false);
1255 auto i_passExtrap_sig_or =
Scalar<bool>(
"muon_passExtrap_signalhit_or",
false);
1256 auto i_passExtrap_sig_and =
Scalar<bool>(
"muon_passExtrap_signalhit_and",
false);
1257 auto i_passExtrap_sig =
Scalar<bool>(
"muon_passExtrap_signalhit",
false);
1260 fill(tool, hitMulti_eta, hitMulti_phi);
1264 if (NHitnoCut_perMuon_eta > 0 || NHitnoCut_perMuon_phi > 0)
1265 i_passExtrap_or =
true;
1266 if (NHitwithCut_perMuon_eta > 0 || NHitwithCut_perMuon_phi > 0)
1267 i_passExtrap_sig_or =
true;
1271 if (NHitnoCut_perMuon_eta > 0 && NHitnoCut_perMuon_phi > 0)
1272 i_passExtrap_and =
true;
1273 if (NHitwithCut_perMuon_eta > 0 && NHitwithCut_perMuon_phi > 0)
1274 i_passExtrap_sig_and =
true;
1277 hitMulti = NHitwithCut_perMuon_eta;
1278 i_panelIndex = etaPanel_ind;
1280 if (NHitnoCut_perMuon_eta > 0)
1281 i_passExtrap =
true;
1283 if (NHitwithCut_perMuon_eta > 0)
1284 i_passExtrap_sig =
true;
1286 fill(tool, hitMulti, i_panelIndex, i_passExtrap, i_passExtrap_sig,
1287 i_passExtrap_or, i_passExtrap_and, i_passExtrap_sig_or, i_passExtrap_sig_and, i_LB);
1291 if (clo_res_eta < 1000.) {
1292 closest_res_eta = clo_res_eta;
1293 fill(tool, closest_res_eta);
1298 hitMulti = NHitwithCut_perMuon_phi;
1299 i_panelIndex = phiPanel_ind;
1300 if (NHitnoCut_perMuon_phi > 0)
1301 i_passExtrap =
true;
1303 if (NHitwithCut_perMuon_phi > 0)
1304 i_passExtrap_sig =
true;
1306 fill(tool, hitMulti, i_panelIndex, i_passExtrap, i_passExtrap_sig,
1307 i_passExtrap_or, i_passExtrap_and, i_passExtrap_sig_or, i_passExtrap_sig_and, i_LB);
1311 if (clo_res_phi < 1000.) {
1312 closest_res_phi = clo_res_phi;
1313 fill(tool, closest_res_phi);
1320 auto i_panelIndex_allMu =
Scalar<int>(
"panelInd_hM_allMu", -1);
1321 auto i_passExtrap_allMu =
Scalar<bool>(
"muon_passExtrap_allMu",
false);
1325 i_panelIndex_allMu = etaPanel_ind;
1326 if (NHitwithCut_perMuon_eta > 0)
1327 i_passExtrap_allMu =
true;
1328 fill(tool, i_panelIndex_allMu, i_passExtrap_allMu);
1332 i_panelIndex_allMu = phiPanel_ind;
1333 if (NHitwithCut_perMuon_phi > 0)
1334 i_passExtrap_allMu =
true;
1336 fill(tool, i_panelIndex_allMu, i_passExtrap_allMu);
1339 return StatusCode::SUCCESS;
1344 std::vector<const Muon::RpcPrepData*>& view_hits,
const int panel_index,
1345 int LB,
int phiSector,
int isPhi)
const {
1352 std::vector<const Muon::RpcPrepData*> cluster_hits;
1353 while (!view_hits.empty()) {
1354 cluster_hits.clear();
1357 cluster_hits.push_back(view_hits.back());
1360 view_hits.pop_back();
1364 std::vector<const Muon::RpcPrepData*>::const_iterator hit =
1367 while (hit != view_hits.end()) {
1371 cluster_hits.push_back(*hit);
1372 view_hits.erase(hit);
1376 hit = view_hits.begin();
1382 int cluster_size = cluster_hits.size();
1383 for (
int i_hit = 0; i_hit < cluster_size; i_hit++) {
1384 auto i_phiSector =
Scalar<int>(
"PhiSector", phiSector);
1385 fill(tool, i_LB, i_phiSector);
1388 auto i_panelIndex =
Scalar<int>(
"panelInd_clust", panel_index);
1389 auto i_clusterSize =
Scalar<int>(
"clusterSize", cluster_size);
1390 fill(tool, i_panelIndex, i_clusterSize);
1392 auto i_cs_sec =
Scalar<int>(
"cs_sec", cluster_size);
1394 std::to_string(std::abs(phiSector)))],
1398 auto i_clusterSize_view =
1400 fill(tool, i_clusterSize_view);
1402 auto i_clusterSize_view =
1404 fill(tool, i_clusterSize_view);
1408 return StatusCode::SUCCESS;
1413 const std::vector<const Muon::RpcPrepData*>& cluster_hits,
1419 if (abs(rpcIdHelper.
strip(it_hit->identify()) -
1421 std::abs(it_hit->time() - hit->
time()) < 6.5) {
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Handle class for reading a decoration on an object.
static const Attributes_t empty
const ServiceHandle< StoreGateSvc > & detStore() const
const ToolHandle< GenericMonitoringTool > & getGroup(const std::string &name) const
Get a specific monitoring tool from the tool handle array.
virtual StatusCode initialize() override
initialize
const ToolHandle< Trig::TrigDecisionTool > & getTrigDecisionTool() const
Get the trigger decision tool member.
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
ToolHandleArray< GenericMonitoringTool > m_tools
Array of Generic Monitoring Tools.
Declare a monitored scalar variable.
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
const RpcReadoutElement * getRpcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Identifier identify() const override final
Returns the ATLAS Identifier of the MuonReadOutElement.
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
int getDoubletPhi() const
return DoubletPhi value for the given readout element, be aware that one RE can contain two DoubletPh...
int getDoubletZ() const
return DoubletZ value for the given readout element
int stationEta(const Identifier &id) const
const_id_iterator detectorElement_begin() const
Iterators over full set of ids.
size_type module_hash_max() const
the maximum hash value
int stationPhi(const Identifier &id) const
int stationName(const Identifier &id) const
const_id_iterator detectorElement_end() const
Class to represent RPC measurements.
float time() const
Returns the time.
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)
int gasGap(const Identifier &id) const override
get the hashes
int doubletPhi(const Identifier &id) const
int doubletR(const Identifier &id) const
int strip(const Identifier &id) const
bool measuresPhi(const Identifier &id) const override
int doubletZ(const Identifier &id) const
std::map< std::string, int > m_elementIndex
BooleanProperty m_TagAndProbe
StatusCode initRpcPanel()
BooleanProperty m_plotMuonEff
FloatProperty m_minDRTrackToGasGap
StatusCode fillClusterSize(std::vector< const Muon::RpcPrepData * > &view_hits, const int panel_index, int LB, int phiSector, int isPhi) const
virtual StatusCode initialize() override
initialize
std::map< std::pair< int, int >, std::vector< std::shared_ptr< GasGapData > > > m_gasGapData
FloatProperty m_l1trigMatchWindow
SG::ReadDecorHandleKey< xAOD::EventInfo > m_beamSigmaX
FloatProperty m_diffHitTrackPostion
std::map< std::string, int > m_SectorGroup
StatusCode fillHistPRD(const EventContext &ctx) const
StatusCode triggerMatching(const xAOD::Muon *, const std::vector< TagDef > &) const
StatusCode setPanelIndex(std::shared_ptr< RpcPanel > panel)
std::vector< TagDef > m_trigTagDefs
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
std::pair< ExResult, const std::shared_ptr< GasGapData > > GasGapResult
FloatProperty m_trigMatchWindow
virtual ~RpcTrackAnaAlg()
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
FloatProperty m_barrelMaxEta
RpcPanelMap m_rpcPanelMap
FloatProperty m_barrelMinEta
SG::ReadHandleKey< xAOD::MuonContainer > m_MuonContainerKey
SG::ReadHandleKey< Muon::RpcPrepDataContainer > m_rpcPrdKey
StatusCode readElIndexFromXML()
SG::ReadDecorHandleKey< xAOD::EventInfo > m_beamSigmaXY
FloatProperty m_isolationWindow
FloatProperty m_boundsToleranceReadoutElement
BooleanProperty m_plotPRD
ToolHandle< Trk::IExtrapolator > m_extrapolator
std::map< std::string, int > m_TriggerThrGroup
bool IsNearbyHit(const std::vector< const Muon::RpcPrepData * > &cluster_hits, const Muon::RpcPrepData *hit) const
StringProperty m_elementsFileName
SG::ReadDecorHandleKey< xAOD::EventInfo > m_beamSigmaY
StatusCode fillMuonExtrapolateEff(const EventContext &ctx) const
std::unique_ptr< Trk::TrackParameters > computeTrackIntersectionWithGasGap(ExResult &result, const xAOD::TrackParticle *track_particle, const std::shared_ptr< GasGapData > &gap) const
StatusCode extrapolate2RPC(const xAOD::TrackParticle *track, const Trk::PropDirection direction, std::vector< GasGapResult > &results, BarrelDL barrelDL) const
FloatProperty m_zMass_upLimit
StringProperty m_packageName
SG::ReadHandleKey< xAOD::MuonRoIContainer > m_MuonRoIContainerKey
RpcTrackAnaAlg(const std::string &name, ISvcLocator *pSvcLocator)
std::map< BarrelDL, std::vector< int > > m_StationNames
StatusCode readHitsPerGasgap(const EventContext &ctx, std::vector< GasGapResult > &results, MuonSource muon_source) const
SG::ReadHandleKey< xAOD::VertexContainer > m_PrimaryVertexContainerKey
FloatProperty m_boundsToleranceReadoutElementTight
StringProperty m_trigTagList
BooleanProperty m_useAODParticle
Handle class for reading a decoration on an object.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
Class for a planaer rectangular or trapezoidal surface in the ATLAS detector.
Identifier identify() const
return the identifier
Abstract base class for surface bounds to be specified.
virtual bool inside(const Amg::Vector2D &locpo, double tol1=0., double tol2=0.) const =0
Each Bounds has a method inside, which checks if a LocalPosition is inside the bounds.
@ Barrel
The muon candidate was detected in the barrel region.
virtual double eta() const
The pseudorapidity ( ) of the particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
virtual double pt() const
The transverse momentum ( ) of the particle.
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
const Trk::Track * track() const
Returns a pointer (which can be NULL) to the Trk::Track which was used to make this TrackParticle.
float z() const
Returns the z position.
std::string res_panel[4][6]
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &&variables) const
Fills a vector of variables to a group by reference.
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
Generic monitoring tool for athena components.
std::vector< V > buildToolMap(const ToolHandleArray< GenericMonitoringTool > &tools, const std::string &baseName, int nHist)
Builds an array of indices (base case)
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
MuonPrepDataCollection< RpcPrepData > RpcPrepDataCollection
static const unsigned int Physics
PropDirection
PropDirection, enum for direction of the propagation.
ParametersBase< TrackParametersDim, Charged > TrackParameters
double d0significance(const xAOD::TrackParticle *tp, double d0_uncert_beam_spot_2)
MuonRoIContainer_v1 MuonRoIContainer
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.
Muon_v1 Muon
Reference the current persistent version:
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".