30 ATH_MSG_INFO(
"########## L0MuonSmearingAlg Configurations are ########## ");
33 ATH_MSG_INFO(
"########## L0MuonSmearingAlg Configurations: That's it. ########## ");
37 m_mySmearer = std::make_unique<TruthTrackSmearer>(rngWrapper);
40 return StatusCode::SUCCESS;
46 return StatusCode::SUCCESS;
57 return StatusCode::FAILURE;
61 ATH_CHECK(outputRoI_handle.
record(std::make_unique<xAOD::MuonRoIContainer>(), std::make_unique<xAOD::MuonRoIAuxContainer>()));
62 auto outputRoIs = outputRoI_handle.
ptr();
65 int n_output_tracks=0;
68 for (
const auto*
part : *inputTruth) {
70 if (
part->pdgId() != 13 &&
part->pdgId() != -13)
continue;
72 if (
part->pt() < 2000.)
continue;
74 if (
part->status() != 1)
continue;
76 if (std::abs(
part->eta()) > 3.0)
continue;
79 <<
" eta=" <<
part->eta()
80 <<
" pT=" <<
part->pt() / 1000.
81 <<
"(GeV) q/pT=" <<
part->charge() * 1000. /
part->pt()
82 <<
"(1/GeV) PDGID=" <<
part->pdgId()
83 <<
" status=" <<
part->status());
94 float qoverPt =
part->charge() /
part->pt();
97 ATH_MSG_DEBUG(
"Killed by the efficiency: q/pt=" << qoverPt * 1000. <<
" (1/GeV)");
104 <<
" eta=" << otrack.
eta()
105 <<
" pT=" << 1. / std::abs(otrack.
invpt() * 1000.)
106 <<
"(GeV) q/pT=" << 1000. * otrack.
invpt() <<
"(1/GeV)");
117 outputRoIs->push_back(std::make_unique<xAOD::MuonRoI>());
127 if (ptword > 0xff) ptword = 0xff;
130 float roi_eta = etaword * ETA_ROISIZE - 2.7;
131 float roi_phi = phiword * PHI_ROISIZE - TMath::Pi();
134 uint32_t roiword = (ptword<<24) | ((otrack.
invpt() > 0)<<23) | (phiword<<14) | etaword;
136 std::string emu_thr_name =
"L0_MUx";
137 float thrvalue = 0.0;
138 outputRoIs->back()->initialize(roiword, roi_eta, roi_phi, emu_thr_name, thrvalue, 0
x1);
140 ATH_MSG_DEBUG(
"L0MuonRoI: phi = " << roi_phi <<
" (0x" << std::hex << phiword << std::dec <<
"), "
141 <<
"eta = " << roi_eta <<
" (0x" << std::hex << etaword << std::dec <<
"), "
142 <<
"pT = " << outputRoIs->back()->pt() <<
" (GeV) (0x" << std::hex << ptword << std::dec <<
"), "
143 <<
"q/pT= " << ((otrack.
invpt() > 0) ? 1. : -1.) / outputRoIs->back()->pt());
149 auto roi_output_curv =
Monitored::Scalar<float>(
"roi_output_curv", (outputRoIs->back()->getCharge() > 0 ? 1. : -1.)/outputRoIs->back()->pt());
154 auto delta_curv =
Monitored::Scalar<float>(
"delta_curv", ((outputRoIs->back()->getCharge() == 1 ? 1. : -1.)/outputRoIs->back()->pt() - (
part->charge()*1000./
part->pt())) / (
part->charge()*1000./
part->pt()));
157 delta_eta,
delta_phi, delta_pt, delta_curv);
161 ATH_MSG_DEBUG (
"Result: Number of input truth muons= " << n_input_tracks <<
" , smeared tracks= "<< n_output_tracks);
163 return StatusCode::SUCCESS;