27StatusCode TrigMuonTruthMon :: fillVariablesPerChain(
const EventContext &ctx,
const std::string &chain)
const {
28 ATH_MSG_DEBUG(
"Filling muon truth monitoring histograms for " << name() <<
"...");
35 return StatusCode::FAILURE;
58 bool passed_EF =
false;
59 bool passed_L1 =
false;
63 std::size_t index_i = chain.find(
"mu")+2;
64 std::size_t index_f = chain.find(
"_", index_i+1);
65 if (index_f < chain.length()) {
66 pT_cut = std::stod(chain.substr(index_i, index_f - index_i));
69 pT_cut = std::stod(chain.substr(index_i, chain.length()-1));
71 pT_cut = pT_cut + 1.0;
73 for (
const auto truthMu : *truthMuons) {
78 if(std::abs(
eta) > 2.5)
continue;
80 truthPt = truthMu->pt()/1e3;
82 if(std::abs(
eta) < 1.05){
83 truthBarrelPt = truthMu->pt()/1e3;
87 truthEndcapPt = truthMu->pt()/1e3;
90 if (pT_cut < truthPt){
91 truthEta = truthMu->eta();
92 truthPhi = truthMu->phi();
93 truthIntPerBC = eventInfo->actualInteractionsPerCrossing();
94 fill(
m_group+
"_"+chain, truthEta, truthPhi, truthIntPerBC);
98 std::string msonly =
"msonly";
100 if(chain.find(msonly) != std::string::npos){
101 efmuon =
m_matchTool->matchEFSA(truthMu, chain, passed_EF);
104 efmuon =
m_matchTool->matchEFCB(truthMu, chain, passed_EF);
108 if(efmuon && passed_EF){
109 MatchedEFCBtruthPt = truthMu->pt()/1e3;
111 if(std::abs(
eta) < 1.05){
112 MatchedEFCBtruthBarrelPt = truthMu->pt()/1e3;
116 MatchedEFCBtruthEndcapPt = truthMu->pt()/1e3;
119 if (pT_cut < truthPt){
120 MatchedEFCBtruthEta = truthMu->eta();
121 MatchedEFCBtruthPhi = truthMu->phi();
122 MatchedEFCBtruthIntPerBC = eventInfo->actualInteractionsPerCrossing();
123 fill(
m_group+
"_"+chain, MatchedEFCBtruthEta, MatchedEFCBtruthPhi, MatchedEFCBtruthIntPerBC);
127 if(l1muon && passed_L1){
128 MatchedL1truthPt = truthMu->pt()/1e3;
130 if(std::abs(
eta) < 1.05){
131 MatchedL1truthBarrelPt = truthMu->pt()/1e3;
135 MatchedL1truthEndcapPt = truthMu->pt()/1e3;
138 if (pT_cut < truthPt){
139 MatchedL1truthEta = truthMu->eta();
140 MatchedL1truthPhi = truthMu->phi();
141 MatchedL1truthIntPerBC = eventInfo->actualInteractionsPerCrossing();
142 fill(
m_group+
"_"+chain, MatchedL1truthEta, MatchedL1truthPhi, MatchedL1truthIntPerBC);
146 if((l1muon && passed_L1) && !(passed_EF && efmuon)){
150 if(!(passed_L1 && l1muon) && (passed_EF && efmuon)){
159 return StatusCode::SUCCESS;