18 #define MUONMASS 105.65837
24 m_trigDecTool(
"Trig::TrigDecisionTool/TrigDecisionTool")
38 return StatusCode::SUCCESS;
42 const std::string &
chain,
43 const double mindelR)
const
49 const std::string &l1item,
50 const double DelR)
const
56 const std::string &
chain,
57 const double mindelR)
const
59 Double_t delmin = mindelR;
65 const std::string &l1item,
66 const double DelR)
const
72 ATH_MSG_ERROR(
"TrigMuonMatching::matchL1 : could not retrieve LVL1MuonRoIs");
78 for( ; muroi_itr != muroi_end; ++muroi_itr ) {
79 if((*muroi_itr)->thrValue() >=
threshold*1000){
91 const std::string&
chain,
92 std::pair<Bool_t, Bool_t>& result1,
93 std::pair<Bool_t, Bool_t>& result2,
94 const Double_t& mindelR)
96 TLorentzVector mu_1, mu_2;
105 const std::string &
chain,
106 const double mindelR)
const
111 Double_t delmin = mindelR;
120 const std::string &l1item,
121 const double DelR)
const
126 Double_t l1dr = DelR;
130 ATH_MSG_ERROR(
"TrigMuonMatching::matchL1 : could not retrieve LVL1MuonRoIs");
136 for( ; muroi_itr != muroi_end; ++muroi_itr ) {
137 if((*muroi_itr)->thrValue() >=
threshold*1000){
148 const std::string &l1item,
149 const std::string &
chain,
150 const double DelR)
const
158 ATH_MSG_ERROR(
"TrigMuonMatching::matchL1 : could not retrieve LVL1MuonRoIs");
164 unsigned int ROI = 0;
165 for( ; muroi_itr != muroi_end; ++muroi_itr ) {
166 if(!((*muroi_itr)->thrValue() >=
threshold*1000))
continue;
167 ROI = (*muroi_itr)->getRoI();
168 const std::string eventTrigger =
chain;
171 auto fc = cg->features(TrigDefs::alsoDeactivateTEs);
172 #if defined(XAOD_STANDALONE) || defined(XAOD_ANALYSIS)
177 for(
auto mucont : MuFeatureContainers){
178 for(
auto muon : *mucont.cptr()){
179 if(
muon->roiNumber() == ROI){
181 if(
dR < DelR)
return true;
191 const std::string &
chain,
192 const double DelR)
const
194 const std::string eventTrigger =
chain;
197 auto fc = cg->features(TrigDefs::alsoDeactivateTEs);
198 #if defined(XAOD_STANDALONE) || defined(XAOD_ANALYSIS)
201 const std::vector< Trig::Feature<xAOD::L2CombinedMuonContainer> > MuFeatureContainers = fc.
get<
xAOD::L2CombinedMuonContainer>(
"", TrigDefs::alsoDeactivateTEs);
204 for(
auto mucont : MuFeatureContainers){
205 for(
auto muon : *mucont.cptr()){
207 if(
dR < DelR)
return true;
214 const TLorentzVector& muon2,
215 const std::string&
chain,
216 std::pair<Bool_t, Bool_t>& result1,
217 std::pair<Bool_t, Bool_t>& result2,
218 const Double_t& mindelR)
220 Double_t delmin = mindelR;
223 ATH_MSG_ERROR(
"TrigMuonMatching : Failed to decode chain " <<
chain <<
" matchDimuon can accept only chains named HLT_2muXX and HLT_muXX_mu8noL1.");
227 std::pair<Bool_t, Bool_t> rc12, rc21;
228 rc12 =
matchDimuon(muon1, muon2, chainInfo, delmin);
230 rc21.first = rc12.second; rc21.second = rc12.first;
234 rc21 =
matchDimuon(muon2, muon1, chainInfo, delmin);
237 result1.first = rc12.first; result1.second = rc21.second;
238 result2.first = rc21.first; result2.second = rc12.second;
244 const unsigned int bits =
m_trigDecTool->isPassedBits(trigger);
245 if( (bits & TrigDefs::EF_passedRaw) && ! ( bits & TrigDefs::EF_passThrough) && ( bits & TrigDefs::EF_resurrected)){
252 const TLorentzVector& muon2,
254 const double mindelR)
276 return std::pair<Bool_t, Bool_t> (trkId1.
valid, trkId2.
valid);
284 const double phi2)
const
287 double dphi = fabs(phi1 - phi2) < TMath::Pi() ? fabs(phi1 - phi2) : 2*TMath:: \
288 Pi() - fabs(phi1 - phi2);
289 return sqrt(deta*deta + dphi*dphi);
297 std::vector<std::string>
tokens;
303 }
else if ((
tokens.size() == 2 ) and (
tokens.at(0) ==
"L1")) {
307 ATH_MSG_ERROR(
"TrigMuonMatching::getL1pt : cannot parse " << l1item);
311 const size_t index =
pt.find(
"MU");
312 if (
index != std::string::npos) {
313 std::istringstream iss(
pt.substr(
index + 2));
316 ATH_MSG_ERROR(
"TrigMuonMatching::getL1pt : cannot parse " << l1item);
324 std::vector<std::string>&
tokens,
325 const std::string& delimiters)
const
328 std::string::size_type lastPos =
str.find_first_not_of(delimiters, 0);
329 std::string::size_type
pos =
str.find_first_of(delimiters, lastPos);
331 while ((std::string::npos !=
pos) or (std::string::npos != lastPos)) {
333 lastPos =
str.find_first_not_of(delimiters,
pos);
334 pos =
str.find_first_of(delimiters, lastPos);
340 const EFmuon& usedEFMuonId,
343 const double mindelR,
344 const std::string& chainForEventTrigger)
const
346 efMuonId.
valid =
false;
347 Double_t drmin = mindelR;
349 const std::string eventTrigger = chainForEventTrigger;
352 auto fc = cg->features();
354 #if defined(XAOD_STANDALONE) || defined(XAOD_ANALYSIS)
357 const std::vector< Trig::Feature<xAOD::MuonContainer> > MuFeatureContainers = fc.
get<
xAOD::MuonContainer>();
360 for(
auto mucont : MuFeatureContainers){
361 for(
auto mu : *mucont.cptr()){
369 Double_t
dr =
dR(eta,phi,
mu->eta(),
mu->phi());
372 efMuonId.
pt =
mu->pt();
373 efMuonId.
eta =
mu->eta();
374 efMuonId.
phi =
mu->phi();
375 efMuonId.
valid =
true;
412 chainInfo =
p->second;
415 std::vector<std::string>
tokens;
417 if (
tokens.size() < 2)
return false;
418 if (
tokens[0] !=
"HLT")
return false;
429 if(
tokens.size() != 3)
return false;
431 std::string high = std::string(
"HLT_" +
tokens[1]);
443 const double y)
const
445 if (fabs(
x -
y) < std::numeric_limits<float>::epsilon())
return true;