ATLAS Offline Software
TrigBtagEmulationTool.cxx
Go to the documentation of this file.
1 /*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /**********************************************************************
6  * Authors:
7  * Carlo Varni <carlo.varni@cern.ch>
8  * Carlo Schiavi <carlo.schiavi@cern.ch>
9  * Florencia Daneri <maria.florencia.daneri@cern.ch>
10  * Gino Marceca <gino.marceca@cern.ch>
11  * Lars Beemster <lars.beemster@cern.ch>
12  *
13  * Description:
14  * Base tool class for bjet trigger emulation
15  **********************************************************************/
16 
18 
19 namespace Trig {
20 
22  const std::string& name,
23  const IInterface* parent)
24  : base_class(type, name, parent)
25 {}
26 
27 
29  ATH_MSG_INFO( "Initializing " << name() );
30 
31  ATH_CHECK( m_trigDec.retrieve() );
32 
33  ATH_CHECK( m_manager_PFlow_cnt.retrieve() );
34  ATH_CHECK( m_manager_EMTopo_presel.retrieve() );
35 
36  for(const auto& [chain_name, definition] : m_emulatedChainDefinitions) {
37  ATH_CHECK( addEmulatedChain(chain_name, definition) );
38  }
39 
40  m_dl2 = std::make_unique<FlavorTagDiscriminants::DL2HighLevel>("BTagging/20210519r22/dl1d/antikt4empflow/network.json",
42  m_remapping.value());
43 
44  return StatusCode::SUCCESS;
45 }
46 
47 bool TrigBtagEmulationTool::isPassed(const std::string& chain) const
48 {
49  // This will re-compute everything - slow version
50  const auto& emulContext = populateJetManagersTriggerObjects();
51  return isPassed(chain, emulContext);
52 }
53 
54 bool TrigBtagEmulationTool::isPassed(const std::string& chain,
55  const EmulContext& emulCtx) const
56 {
57  auto itr = m_emulatedChains.find(chain);
58  if (itr == m_emulatedChains.end()) {
59  ATH_MSG_WARNING( "Chain " << chain << " requested but not in the list of emulated chains" );
60  return false;
61  }
62  return isPassed(*(itr->second.get()), emulCtx);
63 }
64 
66  const EmulContext& emulCtx) const
67 {
68  return evaluate_L1(chain, emulCtx) and evaluate_HLT(chain, emulCtx);
69 }
70 
72  const EmulContext&) const
73 {
74  // IMPROVE: simulate L1 as well, don't rely on TDT
75  bool res = m_trigDec->isPassed(chain.l1_requirement());
76  ATH_MSG_DEBUG( name() << " passed L1: " << (res ? "YES":"NO") );
77  return res;
78 }
79 
80 
82  const EmulContext& emulCtx) const
83 {
84  for ( const auto& is_chainPart_PFlow : chain.is_PFlow() ) {
85  if ( not is_chainPart_PFlow ) {
86  ATH_MSG_ERROR( "Only PFlow jets are supported at this moment" );
87  return false;
88  }
89  }
90 
91  const std::vector<TrigBtagEmulationJet>& emtopo_presel_jets = m_manager_EMTopo_presel->getSortedPreselJets(emulCtx);
92  // preselection
93  if (not evaluate_preselection(chain, emtopo_presel_jets) ) return false;
94  // dijet mass
95  if (not evaluate_dijetmass(chain, emtopo_presel_jets) ) return false;
96 
97  // computation
98  const int shared_idx = chain.shared_idx();
99  const std::vector<int>& jet_multiplicity = chain.jet_multiplicity();
100  const std::vector<std::string>& chainPartName = chain.chainPartName();
101  const std::vector<TrigBtagEmulationJet>& pflow_jets = m_manager_PFlow_cnt->getJets(emulCtx);
102 
103  int nChainParts = static_cast<int>( jet_multiplicity.size() );
104 
105  bool res = false;
106  if( shared_idx ) {
107  // chain uses the shared operator, we basically have two chains to check
108  std::vector<std::vector<bool>> chainPart_passedjets = evaluate_HLT_chainParts(chain, pflow_jets, 0, shared_idx);
109  std::vector<std::vector<bool>> chainPart_passedjets_btag = evaluate_HLT_chainParts(chain, pflow_jets, shared_idx, nChainParts);
110 
111  std::vector<std::string> chainPartNames_leg1(chainPartName.begin(), chainPartName.begin() + shared_idx);
112  std::vector<int> multiplicities_leg1(jet_multiplicity.begin(), jet_multiplicity.begin() + shared_idx);
113  std::vector<std::string> chainPartNames_leg2(chainPartName.begin() + shared_idx, chainPartName.end());
114  std::vector<int> multiplicities_leg2(jet_multiplicity.begin() + shared_idx, jet_multiplicity.end());
115 
116  res = allocate_jets_to_chainParts(chainPart_passedjets, chainPartNames_leg1, multiplicities_leg1) &&
117  allocate_jets_to_chainParts(chainPart_passedjets_btag, chainPartNames_leg2, multiplicities_leg2);
118  }
119  else {
120  std::vector<std::vector<bool>> chainPart_passedjets = evaluate_HLT_chainParts(chain, pflow_jets, 0, nChainParts);
121 
122  std::vector<std::string> chainPartNames(chainPartName.begin(), chainPartName.end());
123  std::vector<int> multiplicities(jet_multiplicity.begin(), jet_multiplicity.end());
124 
125  res = allocate_jets_to_chainParts(chainPart_passedjets, chainPartNames, multiplicities);
126  }
127 
128  return res;
129 }
130 
131 bool TrigBtagEmulationTool::evaluate_preselection(const TrigBtagEmulationChain& chain,
132  const std::vector<TrigBtagEmulationJet>& preselJets) const
133 {
134  const std::vector<std::string>& jet_presel = chain.jet_presel();
135  if (jet_presel.size() == 0) return true;
136 
137  int presel_multiplicity = 1;
138  double presel_ptcut = 0.;
139  double presel_eta_min = 0.;
140  double presel_eta_max = 0.;
141 
142  bool res = false;
143  if( preselJets.size() == 1 ) {
144  // single preselection cut
145  const std::string presel_part = jet_presel[0];
146  int preseljets_passed = 0;
147 
148  parse_preselection(presel_part, presel_multiplicity, presel_ptcut, presel_eta_min, presel_eta_max);
149 
150  for( const auto& preseljet: preselJets ) {
151  if((preseljet.pt() / Gaudi::Units::GeV) >= presel_ptcut &&
152  presel_eta_min < std::fabs(preseljet.eta()) && std::fabs(preseljet.eta()) < presel_eta_max) {
153 
154  ATH_MSG_DEBUG( " - Preselection jet pt=" << (preseljet.pt() / Gaudi::Units::GeV) << " eta=" << preseljet.eta() << " passed.");
155  preseljets_passed++;
156  }
157  else if((preseljet.pt() / Gaudi::Units::GeV) < presel_ptcut) {
158  // no more Preselection jets left with high enough pt
159  break;
160  }
161 
162  if(preseljets_passed >= presel_multiplicity) {
163  res = true;
164  break;
165  }
166  }
167  }
168  else {
169  // multi-threshold preselection
170  std::vector<std::vector<bool>> chainPart_passedjets(jet_presel.size());
171  size_t chainPart_passedjets_lenmax = 0;
172  std::vector<int> multiplicities;
173 
174  for(size_t chainPart_idx = 0; chainPart_idx < chainPart_passedjets.size(); chainPart_idx++) {
175  parse_preselection(jet_presel[chainPart_idx], presel_multiplicity, presel_ptcut, presel_eta_min, presel_eta_max);
176  multiplicities.push_back(presel_multiplicity);
177 
178  for ( const auto& preseljet : preselJets ) {
179  if((preseljet.pt() / Gaudi::Units::GeV) >= presel_ptcut &&
180  presel_eta_min < std::fabs(preseljet.eta()) && std::fabs(preseljet.eta()) < presel_eta_max) {
181  // flag jet as passed this part of preselection
182  chainPart_passedjets[chainPart_idx].push_back(true);
183  }
184  else {
185  chainPart_passedjets[chainPart_idx].push_back(false);
186  }
187 
188  if((preseljet.pt() / Gaudi::Units::GeV) < presel_ptcut) {
189  // no more Preselection jets left with high enough pt
190  if(chainPart_passedjets[chainPart_idx].size() > chainPart_passedjets_lenmax) {
191  chainPart_passedjets_lenmax = chainPart_passedjets[chainPart_idx].size();
192  }
193  break;
194  }
195  }
196  }
197 
198  for( auto& chainPart_passedjets_row : chainPart_passedjets ) {
199  // make all rows in the chainPart_jet_matrix equal length
200  while(chainPart_passedjets_row.size() < chainPart_passedjets_lenmax) {
201  chainPart_passedjets_row.push_back(false);
202  }
203  }
204 
205  res = allocate_jets_to_chainParts(chainPart_passedjets, jet_presel, multiplicities);
206  }
207 
208  return res;
209 }
210 
211 bool TrigBtagEmulationTool::evaluate_dijetmass(const TrigBtagEmulationChain& chain,
212  const std::vector<TrigBtagEmulationJet>& preselJets) const
213 {
214  const std::string& dijetmass = chain.dijetmass();
215  if ( dijetmass == "None") return true;
216 
217  double dijet_mass = 0.;
218  double dijet_minjetpt = 0.;
219  double dijet_dphi = -1.;
220  double dijet_deta = -1.;
221  parse_dijetmass(dijetmass, dijet_mass, dijet_minjetpt, dijet_dphi, dijet_deta);
222 
223  bool res = false;
224  for( const auto& jet1: preselJets ) {
225  if( (jet1.pt() / Gaudi::Units::GeV) < dijet_minjetpt ) {
226  break;
227  }
228 
229  for( const auto& jet2: preselJets ) {
230  if( (jet2.pt() / Gaudi::Units::GeV) < dijet_minjetpt ) {
231  break;
232  }
233 
234  double mass = (jet1.p4() + jet2.p4()).M(); // MeV, since PreselJet pt is in MeV too
235  double adphi = std::abs(jet1.p4().DeltaPhi(jet2.p4()));
236  double adeta = std::abs(jet1.eta() - jet2.eta());
237 
238  if((mass / Gaudi::Units::GeV) >= dijet_mass &&
239  (dijet_dphi < 0 || adphi < dijet_dphi) &&
240  (dijet_deta < 0 || adeta > dijet_deta) ) {
241  ATH_MSG_DEBUG( " - Dijet system " << (jet1.pt() / Gaudi::Units::GeV) << " and " << (jet2.pt() / Gaudi::Units::GeV) << " passed " << dijetmass );
242  res = true;
243  break;
244  }
245  }
246  }
247 
248  return res;
249 }
250 
251 void TrigBtagEmulationTool::parse_preselection(const std::string& presel_part,
252  int& presel_multiplicity,
253  double& presel_ptcut,
254  double& presel_eta_min,
255  double& presel_eta_max) const
256 {
257  char presel_etarange = '?';
258 
259  presel_multiplicity = 1;
260  int tokenizer_offset = 0;
261  if('0' <= presel_part[0] && presel_part[0] <= '9') {
262  presel_multiplicity = (presel_part[0] - '0');
263  tokenizer_offset = 1;
264  }
265  presel_etarange = presel_part[tokenizer_offset];
266  presel_ptcut = static_cast<double>( std::stoi(&presel_part[1 +tokenizer_offset]) );
267 
268  switch(presel_etarange) {
269  case 'j':
270  presel_eta_max = 3.2;
271  break;
272  case 'a':
273  presel_eta_max = 4.9;
274  break;
275  case 'c':
276  presel_eta_max = 2.4;
277  break;
278  case 'f':
279  presel_eta_min = 3.2;
280  presel_eta_max = 4.9;
281  break;
282  default:
283  ATH_MSG_ERROR( "Unknown eta range in jet preselection cut." );
284  break;
285  }
286 }
287 
288 void TrigBtagEmulationTool::parse_dijetmass(const std::string& dijetmass,
289  double& dijet_mass,
290  double& dijet_minjetpt,
291  double& dijet_dphi,
292  double& dijet_deta) const
293 {
294  // 'DJMASS500j35
295  // 'DJMASS700j35
296  // 'DJMASS1000j35
297  // 'DJMASS900j50
298  // 'DJMASS1000j50
299  // 'DJMASS1000j50dphi240
300  // 'DJMASS1000j50dphi200x400deta
301  dijet_mass = static_cast<double>( std::stoi(dijetmass) ); // stoi just parses until it finds a nonnumeric, provided is something like 1000j50dphi200x400deta
302  dijet_minjetpt = static_cast<double>( std::stoi(dijetmass.substr(dijetmass.find("j") +1)) );
303 
304  if(dijetmass.find("dphi") != std::string::npos) {
305  dijet_dphi = static_cast<double>( (std::stoi(dijetmass.substr(dijetmass.find("dphi") + 4)))) / 1e2 ; // 4 -> strlen("dphi")
306  }
307 
308  if(dijetmass.find("deta") != std::string::npos) {
309  std::string deta_str = dijetmass.substr(dijetmass.find("deta") -6);
310  dijet_deta = static_cast<double>( (std::stoi(dijetmass.substr(dijetmass.find("x") +1)))) / 1e2;
311  }
312 
313  ATH_MSG_DEBUG( "DijetMass parsing result: " << dijetmass << " ->"
314  << " m:" << dijet_mass
315  << " j:" << dijet_minjetpt
316  << " dphi:" << dijet_dphi
317  << " deta:" << dijet_deta);
318 }
319 
320 bool TrigBtagEmulationTool::allocate_jets_to_chainParts(const std::vector<std::vector<bool>>& chainPart_jet_matrix,
321  const std::vector<std::string>& chainPartNames,
322  const std::vector<int>& multiplicities) const
323 {
324  bool res = false;
325  std::vector<bool> chainPart_subset_passed;
326 
327  auto chainPartName_it = chainPartNames.begin();
328  for(const auto& chainPart_passedjets: chainPart_jet_matrix) {
329  std::string passedJets = "";
330  passedJets.reserve(chainPart_passedjets.size());
331  for(bool pass: chainPart_passedjets) {
332  passedJets += pass ? '1' : '0';
333  passedJets += !(passedJets.size() % 5) ? " " : "";
334  }
335  ATH_MSG_DEBUG( passedJets << " " << *(chainPartName_it++) );
336  }
337 
338  if(chainPart_jet_matrix.size() == 1) {
339  // simple single threshold chain
340  chainPart_subset_passed.push_back(false);
341  int njet_passed = 0;
342  for(bool pass: chainPart_jet_matrix[0]) {
343  if(pass) {
344  njet_passed++;
345  if(njet_passed >= multiplicities[0]) {
346  chainPart_subset_passed.back() = true;
347  break;
348  }
349  }
350  }
351  }
352  else {
353  // matrix looks something like this:
354  // chainPart0 (mult 1) | x | pass | x | x | pass | x
355  // chainPart1 (mult 2) | x | pass | pass | pass | x | x
356  // chainPart2 (mult 3) | pass | pass | pass | x | pass | pass
357  // | j0 | j1 | j2 | j3 | j4 | j5
358  //
359  // so it is easy to see that every chain _part_ passed, but not trivial to check if the _whole_ chain passed without checking all combinations
360 
361  // check for every subset in the powerset (chainPart0, ...., chainPartLast) if there are enough jets available that satisfy the subset's chainParts
362  for (int subset_bits = 1; subset_bits < (1 << chainPart_jet_matrix.size()); ++subset_bits) {
363  std::bitset<32> subset(subset_bits); // This limits the number of chain part to 32
364  std::vector<bool> subset_passedJets(chainPart_jet_matrix[0].size(), false);
365  int njets_required_subset = 0;
366 
367  std::string subset_str = "";
368  for(size_t chainPart_idx = 0; chainPart_idx < chainPart_jet_matrix.size(); ++chainPart_idx) {
369  if(subset[chainPart_idx]) {
370  subset_str += std::to_string(chainPart_idx);
371  njets_required_subset += multiplicities[chainPart_idx];
372 
373  for(size_t jet_idx = 0; jet_idx < chainPart_jet_matrix[chainPart_idx].size(); ++jet_idx) {
374  if(chainPart_jet_matrix[chainPart_idx][jet_idx]) {
375  subset_passedJets[jet_idx] = true;
376  }
377  }
378  }
379  }
380 
381  int njets_passed_subset = 0;
382  for(bool pass: subset_passedJets) {
383  if(pass) {
384  njets_passed_subset++;
385  }
386  }
387 
388  ATH_MSG_DEBUG( "Subset {" << subset_str << "} requires " << njets_required_subset << " jets, and has " << njets_passed_subset << " jets passed." );
389 
390  if(njets_passed_subset < njets_required_subset) {
391  chainPart_subset_passed.push_back(false);
392  break;
393  }
394  else {
395  chainPart_subset_passed.push_back(true);
396  }
397  }
398  }
399 
400 
401  if(chainPart_subset_passed.size() == static_cast<size_t>(1 << chainPart_jet_matrix.size()) -1 && // -1 because we don't use the empty subset
402  !chainPart_subset_passed.empty()) {
403  // all chainpart subsets were checked, the result of the last is the overall result
404  res = chainPart_subset_passed.back();
405  }
406  else {
407  ATH_MSG_DEBUG( chainPart_subset_passed.size() << " out of " << (1 << chainPart_jet_matrix.size()) -1 << " chain part subsets checked" );
408  }
409 
410  return res;
411 }
412 
413 std::vector<std::vector<bool>> TrigBtagEmulationTool::evaluate_HLT_chainParts(const TrigBtagEmulationChain& chain,
414  const std::vector<TrigBtagEmulationJet>& jets,
415  int idx_begin,
416  int idx_end) const
417 {
418  const std::vector<double>& jet_pt_vec = chain.jet_pt();
419  const std::vector<double>& jet_eta_min_vec = chain.jet_eta_min();
420  const std::vector<double>& jet_eta_max_vec = chain.jet_eta_max();
421  const std::vector<double>& jvt_vec = chain.jvt();
422  const std::vector<std::string>& tagger_vec = chain.tagger();
423  const std::vector<std::string>& chainPartName_vec = chain.chainPartName();
424 
425  std::vector<std::vector<bool>> chainPart_passedjets(idx_end - idx_begin);
426 
427  for(size_t chainPart_idx = 0; chainPart_idx < chainPart_passedjets.size(); chainPart_idx++) {
428  double jet_pt = jet_pt_vec[chainPart_idx +idx_begin];
429  double jet_eta_min = jet_eta_min_vec[chainPart_idx +idx_begin];
430  double jet_eta_max = jet_eta_max_vec[chainPart_idx +idx_begin];
431  double jvtcut = jvt_vec[chainPart_idx +idx_begin];
432  std::string tagger = tagger_vec[chainPart_idx +idx_begin];
433 
434  ATH_MSG_DEBUG( ">-- " << chainPartName_vec[chainPart_idx +idx_begin] << ":" );
435  for( const auto& jet : jets ) {
436  float jvt = jet.jvt();
437  bool passedJvt = jvt > jvtcut ||
438  jet.pt() / Gaudi::Units::GeV > 120. ||
439  std::fabs(jet.eta()) > 2.5;
440 
441  if (tagger == "ewTagger") tagger = "newTagger";
442  bool is_bjet = isPassedBTagger(jet, tagger);
443 
444  if(jet.pt() > jet_pt &&
445  std::fabs(jet.eta()) > jet_eta_min &&
446  std::fabs(jet.eta()) < jet_eta_max &&
447  passedJvt &&
448  ((tagger != "") ? is_bjet : true) ) {
449  // flag jet as passing current chainPart
450  chainPart_passedjets[chainPart_idx].push_back(true);
451  }
452  else {
453  chainPart_passedjets[chainPart_idx].push_back(false);
454  }
455 
456  ATH_MSG_DEBUG( " - pt:" << (jet.pt() / Gaudi::Units::GeV)
457  << ", eta:" << jet.eta()
458  << ", jvt:" << jvt
459  << ((tagger != "") ? ", btag:" : "") << ((tagger != "") ? (is_bjet?"Y":"N") : "")
460  << ", pass:" << (chainPart_passedjets[chainPart_idx].back()?"Y":"N")
461  );
462  }
463  }
464 
465  return chainPart_passedjets;
466 }
467 
468 
469 //=================================================
470 // Utility functions
471 //=================================================
473  EmulContext *emulCtx = new EmulContext();
474 
475  // Check if input chain exists
476  if ( checkInputChainExists( m_inputChains_PFlow ).isFailure() )
477  return *emulCtx;
478 
479  // Retrieve input container vectors
480  if ( retrieveTriggerObjects( *m_manager_PFlow_cnt, *emulCtx ).isFailure() ) {
481  ATH_MSG_ERROR("Could not retrieve trigger objects from " << m_manager_PFlow_cnt->name());
482  return *emulCtx;
483  }
484 
485  if ( retrieveTriggerObjects( *m_manager_EMTopo_presel, *emulCtx ).isFailure() ) {
486  ATH_MSG_ERROR("Could not retrieve trigger objects from " << m_manager_EMTopo_presel->name());
487  return *emulCtx;
488  }
489 
490  return *emulCtx;
491 }
492 
494  EmulContext& emulCtx) const
495 {
496  const EventContext& ctx = Gaudi::Hive::currentContext();
497  ATH_CHECK(manager.retrieveByContainer(ctx, emulCtx));
498 
499  const std::string& jetContainerName = manager.jetContainerName();
500  const unsigned int jetSize = manager.getJets(emulCtx).size();
501 
502  ATH_MSG_DEBUG( "Size of input containers ['" << jetContainerName << "'] :"
503  << " jet=" << jetSize);
504 
505  return StatusCode::SUCCESS;
506 }
507 
508 StatusCode TrigBtagEmulationTool::checkInputChainExists( const std::string &inputChain ) const
509 {
510  std::vector<std::string> listOfTriggers = m_trigDec->getChainGroup( inputChain )->getListOfTriggers();
511  if ( listOfTriggers.empty() ) {
512  ATH_MSG_ERROR( "Input Chain ('" << inputChain << "') is not in the list of available triggers: {" << m_trigDec->getListOfTriggers(".*") << "}" );
513  return StatusCode::FAILURE;
514  }
515 
516  ATH_MSG_DEBUG( "Triggers in configured ChainGroup " << inputChain << ":" );
517  for (const auto& cname: listOfTriggers) {
518  ATH_MSG_DEBUG( " └ " << cname );
519  }
520 
521  return StatusCode::SUCCESS;
522 }
523 
524 StatusCode TrigBtagEmulationTool::addEmulatedChain(const std::string& triggerName,
525  const std::vector<std::string>& definition)
526 {
527  if (m_emulatedChains.find(triggerName) != m_emulatedChains.end()) {
528  ATH_MSG_ERROR("Chain " << triggerName << " has already been added in the Emulation List.");
529  return StatusCode::FAILURE;
530  }
531  auto chain = std::make_unique<TrigBtagEmulationChain>( triggerName, definition );
532  chain->setLevel(msgLevel());
533  m_emulatedChains.insert( std::make_pair(triggerName, std::move(chain)) );
534 
535  return StatusCode::SUCCESS;
536 }
537 
539  const std::string& btagger) const
540 {
541  if (btagger.empty()) return false;
542  if (btagger == "offperf") return true;
543 
544  const auto& itr = m_tagger_wp.find(btagger);
545  if (itr == m_tagger_wp.end()) return false;
546 
547  double workingPoint = itr->second;
548  bool res = false;
549 
550  if( btagger.substr(0, 4) == "dl1r" ) { // 4 -> strlen("dl1r")
551  res = jet.satisfy("DL1r", workingPoint);
552  } else if( btagger.substr(0, 4) == "dl1d" ) { // 4 -> strlen("dl1d")
553  res = jet.satisfy("DL1d20211216", workingPoint);
554  } else if( btagger == "newTagger" ) {
555  const xAOD::BTagging *btag = jet.btag();
556  if (not btag) return false;
557  m_dl2->decorate(*btag);
558 
559  res = jet.satisfy("DL1dEMUL", workingPoint);
560  } else {
561  ATH_MSG_WARNING( "Tagger " << btagger << " not supported." );
562  }
563 
564  return res;
565 }
566 
567 }
Trig::TrigBtagEmulationTool::populateJetManagersTriggerObjects
virtual const EmulContext & populateJetManagersTriggerObjects() const override
Definition: TrigBtagEmulationTool.cxx:482
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
FlavorTagDiscriminants::FlipTagConfig::STANDARD
@ STANDARD
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Trig
The common trigger namespace for trigger analysis tools.
Definition: CaloTowerVecMon.h:44
Trig::TrigBtagEmulationTool::allocate_jets_to_chainParts
bool allocate_jets_to_chainParts(const std::vector< std::vector< bool >> &chainPart_jet_matrix, const std::vector< std::string > &chainPartNames, const std::vector< int > &multiplicities) const
Definition: TrigBtagEmulationTool.cxx:330
Trig::TrigBtagEmulationTool::m_manager_EMTopo_presel
ToolHandle< Trig::JetManagerTool > m_manager_EMTopo_presel
Definition: TrigBtagEmulationTool.h:88
Trig::TrigBtagEmulationJet
Definition: TrigBtagEmulationJet.h:17
TrigBtagEmulationTool.h
Trig::JetManagerTool
Definition: JetManagerTool.h:30
Trig::TrigBtagEmulationTool::initialize
virtual StatusCode initialize() override
Definition: TrigBtagEmulationTool.cxx:38
dqt_zlumi_pandas.mass
mass
Definition: dqt_zlumi_pandas.py:170
Trig::TrigBtagEmulationChain
Definition: TrigBtagEmulationChain.h:18
Trig::TrigBtagEmulationTool::m_tagger_wp
Gaudi::Property< std::map< std::string, double > > m_tagger_wp
Definition: TrigBtagEmulationTool.h:91
Trig::TrigBtagEmulationTool::parse_dijetmass
void parse_dijetmass(const std::string &dijetmass, double &dijet_mass, double &dijet_minjetpt, double &dijet_dphi, double &dijet_deta) const
Definition: TrigBtagEmulationTool.cxx:298
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Trig::TrigBtagEmulationTool::m_emulatedChains
std::unordered_map< std::string, std::unique_ptr< TrigBtagEmulationChain > > m_emulatedChains
Definition: TrigBtagEmulationTool.h:97
Trig::TrigBtagEmulationTool::m_trigDec
PublicToolHandle< Trig::TrigDecisionTool > m_trigDec
Definition: TrigBtagEmulationTool.h:81
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Trig::TrigBtagEmulationTool::evaluate_preselection
bool evaluate_preselection(const TrigBtagEmulationChain &chain, const std::vector< TrigBtagEmulationJet > &preselJets) const
Definition: TrigBtagEmulationTool.cxx:141
Trig::TrigBtagEmulationTool::parse_preselection
void parse_preselection(const std::string &presel_part, int &presel_multiplicity, double &presel_ptcut, double &presel_eta_min, double &presel_eta_max) const
Definition: TrigBtagEmulationTool.cxx:261
Trig::TrigBtagEmulationTool::m_manager_PFlow_cnt
ToolHandle< Trig::JetManagerTool > m_manager_PFlow_cnt
Definition: TrigBtagEmulationTool.h:87
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Trig::EmulContext
Definition: EmulContext.h:16
xAOD::BTagging_v1
Definition: BTagging_v1.h:39
Trig::TrigBtagEmulationTool::m_dl2
std::unique_ptr< FlavorTagDiscriminants::DL2HighLevel > m_dl2
Definition: TrigBtagEmulationTool.h:98
Trig::TrigBtagEmulationTool::TrigBtagEmulationTool
TrigBtagEmulationTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TrigBtagEmulationTool.cxx:31
ChainNameParser::multiplicities
std::vector< int > multiplicities(const std::string &chain)
Definition: ChainNameParser.cxx:202
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
Trig::TrigBtagEmulationTool::m_inputChains_PFlow
Gaudi::Property< std::string > m_inputChains_PFlow
Definition: TrigBtagEmulationTool.h:84
Trig::TrigBtagEmulationTool::retrieveTriggerObjects
StatusCode retrieveTriggerObjects(const Trig::JetManagerTool &, EmulContext &) const
Definition: TrigBtagEmulationTool.cxx:503
Trig::TrigBtagEmulationTool::m_remapping
Gaudi::Property< std::map< std::string, std::string > > m_remapping
Definition: TrigBtagEmulationTool.h:92
Trig::TrigBtagEmulationTool::isPassedBTagger
bool isPassedBTagger(const TrigBtagEmulationJet &jet, const std::string &btagger) const
Definition: TrigBtagEmulationTool.cxx:548
Trig::TrigBtagEmulationTool::m_emulatedChainDefinitions
Gaudi::Property< std::map< std::string, std::vector< std::string > > > m_emulatedChainDefinitions
Definition: TrigBtagEmulationTool.h:95
Trig::TrigBtagEmulationTool::checkInputChainExists
StatusCode checkInputChainExists(const std::string &) const
Definition: TrigBtagEmulationTool.cxx:518
Trig::TrigBtagEmulationTool::addEmulatedChain
StatusCode addEmulatedChain(const std::string &name, const std::vector< std::string > &definition)
Definition: TrigBtagEmulationTool.cxx:534
egammaEnergyPositionAllSamples::e2
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Trig::TrigBtagEmulationTool::isPassed
virtual bool isPassed(const std::string &chain) const override
Definition: TrigBtagEmulationTool.cxx:57
Trig::TrigBtagEmulationTool::evaluate_HLT_chainParts
std::vector< std::vector< bool > > evaluate_HLT_chainParts(const TrigBtagEmulationChain &chain, const std::vector< TrigBtagEmulationJet > &jets, int idx_begin, int idx_end) const
Definition: TrigBtagEmulationTool.cxx:423
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
python.Logging.manager
manager
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/Logging.py:92
Trig::TrigBtagEmulationTool::evaluate_L1
bool evaluate_L1(const TrigBtagEmulationChain &, const EmulContext &) const
Definition: TrigBtagEmulationTool.cxx:81
GeV
#define GeV
Definition: CaloTransverseBalanceVecMon.cxx:30
Trig::TrigBtagEmulationTool::evaluate_dijetmass
bool evaluate_dijetmass(const TrigBtagEmulationChain &chain, const std::vector< TrigBtagEmulationJet > &preselJets) const
Definition: TrigBtagEmulationTool.cxx:221
Trig::TrigBtagEmulationTool::evaluate_HLT
bool evaluate_HLT(const TrigBtagEmulationChain &, const EmulContext &) const
Definition: TrigBtagEmulationTool.cxx:91