19 #define MUONMASS ParticleConstants::muonMassInMeV
25 m_trigDecTool(
"Trig::TrigDecisionTool/TrigDecisionTool")
39 return StatusCode::SUCCESS;
43 const std::string &
chain,
44 const double mindelR)
const
50 const std::string &l1item,
51 const double DelR)
const
57 const std::string &
chain,
58 const double mindelR)
const
60 Double_t delmin = mindelR;
66 const std::string &l1item,
67 const double DelR)
const
73 ATH_MSG_ERROR(
"TrigMuonMatching::matchL1 : could not retrieve LVL1MuonRoIs");
79 for( ; muroi_itr != muroi_end; ++muroi_itr ) {
80 if((*muroi_itr)->thrValue() >=
threshold*1000){
92 const std::string&
chain,
93 std::pair<Bool_t, Bool_t>& result1,
94 std::pair<Bool_t, Bool_t>& result2,
95 const Double_t& mindelR)
97 TLorentzVector mu_1, mu_2;
106 const std::string &
chain,
107 const double mindelR)
const
112 Double_t delmin = mindelR;
121 const std::string &l1item,
122 const double DelR)
const
127 Double_t l1dr = DelR;
131 ATH_MSG_ERROR(
"TrigMuonMatching::matchL1 : could not retrieve LVL1MuonRoIs");
137 for( ; muroi_itr != muroi_end; ++muroi_itr ) {
138 if((*muroi_itr)->thrValue() >=
threshold*1000){
149 const std::string &l1item,
150 const std::string &
chain,
151 const double DelR)
const
159 ATH_MSG_ERROR(
"TrigMuonMatching::matchL1 : could not retrieve LVL1MuonRoIs");
165 unsigned int ROI = 0;
166 for( ; muroi_itr != muroi_end; ++muroi_itr ) {
167 if(!((*muroi_itr)->thrValue() >=
threshold*1000))
continue;
168 ROI = (*muroi_itr)->getRoI();
169 const std::string eventTrigger =
chain;
172 auto fc = cg->features(TrigDefs::alsoDeactivateTEs);
173 #if defined(XAOD_STANDALONE) || defined(XAOD_ANALYSIS)
178 for(
auto mucont : MuFeatureContainers){
179 for(
auto muon : *mucont.cptr()){
180 if(
muon->roiNumber() == ROI){
182 if(
dR < DelR)
return true;
192 const std::string &
chain,
193 const double DelR)
const
195 const std::string eventTrigger =
chain;
198 auto fc = cg->features(TrigDefs::alsoDeactivateTEs);
199 #if defined(XAOD_STANDALONE) || defined(XAOD_ANALYSIS)
202 const std::vector< Trig::Feature<xAOD::L2CombinedMuonContainer> > MuFeatureContainers = fc.
get<
xAOD::L2CombinedMuonContainer>(
"", TrigDefs::alsoDeactivateTEs);
205 for(
auto mucont : MuFeatureContainers){
206 for(
auto muon : *mucont.cptr()){
208 if(
dR < DelR)
return true;
215 const TLorentzVector& muon2,
216 const std::string&
chain,
217 std::pair<Bool_t, Bool_t>& result1,
218 std::pair<Bool_t, Bool_t>& result2,
219 const Double_t& mindelR)
221 Double_t delmin = mindelR;
224 ATH_MSG_ERROR(
"TrigMuonMatching : Failed to decode chain " <<
chain <<
" matchDimuon can accept only chains named HLT_2muXX and HLT_muXX_mu8noL1.");
228 std::pair<Bool_t, Bool_t> rc12, rc21;
229 rc12 =
matchDimuon(muon1, muon2, chainInfo, delmin);
231 rc21.first = rc12.second; rc21.second = rc12.first;
235 rc21 =
matchDimuon(muon2, muon1, chainInfo, delmin);
238 result1.first = rc12.first; result1.second = rc21.second;
239 result2.first = rc21.first; result2.second = rc12.second;
245 const unsigned int bits =
m_trigDecTool->isPassedBits(trigger);
246 if( (bits & TrigDefs::EF_passedRaw) && ! ( bits & TrigDefs::EF_passThrough) && ( bits & TrigDefs::EF_resurrected)){
253 const TLorentzVector& muon2,
255 const double mindelR)
277 return std::pair<Bool_t, Bool_t> (trkId1.
valid, trkId2.
valid);
285 const double phi2)
const
288 double dphi = fabs(phi1 - phi2) < TMath::Pi() ? fabs(phi1 - phi2) : 2*TMath:: \
289 Pi() - fabs(phi1 - phi2);
290 return sqrt(deta*deta + dphi*dphi);
298 std::vector<std::string>
tokens;
304 }
else if ((
tokens.size() == 2 ) and (
tokens.at(0) ==
"L1")) {
308 ATH_MSG_ERROR(
"TrigMuonMatching::getL1pt : cannot parse " << l1item);
312 const size_t index =
pt.find(
"MU");
313 if (
index != std::string::npos) {
314 std::istringstream iss(
pt.substr(
index + 2));
317 ATH_MSG_ERROR(
"TrigMuonMatching::getL1pt : cannot parse " << l1item);
325 std::vector<std::string>&
tokens,
326 const std::string& delimiters)
const
329 std::string::size_type lastPos =
str.find_first_not_of(delimiters, 0);
330 std::string::size_type
pos =
str.find_first_of(delimiters, lastPos);
332 while ((std::string::npos !=
pos) or (std::string::npos != lastPos)) {
334 lastPos =
str.find_first_not_of(delimiters,
pos);
335 pos =
str.find_first_of(delimiters, lastPos);
341 const EFmuon& usedEFMuonId,
344 const double mindelR,
345 const std::string& chainForEventTrigger)
const
347 efMuonId.
valid =
false;
348 Double_t drmin = mindelR;
350 const std::string eventTrigger = chainForEventTrigger;
353 auto fc = cg->features();
355 #if defined(XAOD_STANDALONE) || defined(XAOD_ANALYSIS)
358 const std::vector< Trig::Feature<xAOD::MuonContainer> > MuFeatureContainers = fc.
get<
xAOD::MuonContainer>();
361 for(
auto mucont : MuFeatureContainers){
362 for(
auto mu : *mucont.cptr()){
370 Double_t
dr =
dR(eta,phi,
mu->eta(),
mu->phi());
373 efMuonId.
pt =
mu->pt();
374 efMuonId.
eta =
mu->eta();
375 efMuonId.
phi =
mu->phi();
376 efMuonId.
valid =
true;
413 chainInfo =
p->second;
416 std::vector<std::string>
tokens;
418 if (
tokens.size() < 2)
return false;
419 if (
tokens[0] !=
"HLT")
return false;
430 if(
tokens.size() != 3)
return false;
432 std::string high = std::string(
"HLT_" +
tokens[1]);
444 const double y)
const
446 if (fabs(
x -
y) < std::numeric_limits<float>::epsilon())
return true;