ATLAS Offline Software
AnomalyDetectionBDT.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************
6 
7  * AnomalyDetectionBDT.cxx
8  * Created by Santiago Cane 4/15/2025
9  *
10  * @brief Algorithm is a Boosted Decision Tree for regression.
11  * It uses the Pt, Eta and Phi of 3 muons to regress an anomaly score of a
12  * previously trained Variational Autoencoder and compares it to a threshold value.
13  *
14  *
15  *@param ScoreThreshold
16  *
17  ***************************/
18 
21 #include "L1TopoCommon/Exception.h"
23 #ifndef TRIGCONF_STANDALONE
25 #endif
26 #include <fstream>
27 
28 REGISTER_ALG_TCS(AnomalyDetectionBDT)
29 
30 template <typename T>
31 std::string
32 vectorToString(const std::vector<T>& vec) {
33  std::ostringstream oss;
34  oss << "[";
35  bool first = true;
36  for (const auto& val : vec) {
37  if (!first) {
38  oss << ", ";
39  }
40  oss << val;
41  first = false;
42  }
43  oss << "]";
44  return oss.str();
45 }
46 
47 namespace TCS {
48  std::ostream&
49  operator<<(std::ostream& os, const TCS::Bin& bin) {
50  os << "Bin(score=" << bin.score << ", nVar=" << bin.nVar
51  << ", minVals=" << vectorToString(bin.minVals)
52  << ", maxVals=" << vectorToString(bin.maxVals) << ")";
53  return os;
54  }
55 }
56 
57 namespace {
58 
59  int scale(float val,float min, float max, int bits=7) {
60  float arrRange = max - min;
61  int nPoints = (1 << bits) - 1;
62  float resolution = arrRange / nPoints;
63  int out = static_cast<int>((val - min) / resolution);
64 
65  // Staying within a valid range
66  if (out < 0) out = 0;
67  if (out > nPoints) out = nPoints;
68 
69  return out;
70  }
71 
72 }
73 
74 namespace {
75  int mapval(int value, const std::string & vartype){
76 
77  static const std::map<int,int> eta_LUT = {
79  //Add eta LUT here
80  {-100,4},
81  {-99,5},
82  {-98,5},
83  {-97,6},
84  {-96,7},
85  {-95,7},
86  {-94,8},
87  {-93,8},
88  {-92,9},
89  {-91,9},
90  {-90,10},
91  {-89,11},
92  {-88,11},
93  {-87,12},
94  {-86,12},
95  {-85,13},
96  {-84,14},
97  {-83,14},
98  {-82,15},
99  {-81,15},
100  {-80,16},
101  {-79,17},
102  {-78,17},
103  {-77,18},
104  {-76,18},
105  {-75,19},
106  {-74,19},
107  {-73,20},
108  {-72,21},
109  {-71,21},
110  {-70,22},
111  {-69,22},
112  {-68,23},
113  {-67,24},
114  {-66,24},
115  {-65,25},
116  {-64,25},
117  {-63,26},
118  {-62,27},
119  {-61,27},
120  {-60,28},
121  {-59,28},
122  {-58,29},
123  {-57,29},
124  {-56,30},
125  {-55,31},
126  {-54,31},
127  {-53,32},
128  {-52,32},
129  {-51,33},
130  {-50,34},
131  {-49,34},
132  {-48,35},
133  {-47,35},
134  {-46,36},
135  {-45,37},
136  {-44,37},
137  {-43,38},
138  {-42,38},
139  {-41,39},
140  {-40,39},
141  {-39,40},
142  {-38,41},
143  {-37,41},
144  {-36,42},
145  {-35,42},
146  {-34,43},
147  {-33,44},
148  {-32,44},
149  {-31,45},
150  {-30,45},
151  {-29,46},
152  {-28,47},
153  {-27,47},
154  {-26,48},
155  {-25,48},
156  {-24,49},
157  {-23,49},
158  {-22,50},
159  {-21,51},
160  {-20,51},
161  {-19,52},
162  {-18,52},
163  {-17,53},
164  {-16,54},
165  {-15,54},
166  {-14,55},
167  {-13,55},
168  {-12,56},
169  {-11,57},
170  {-10,57},
171  {-9,58},
172  {-8,58},
173  {-7,59},
174  {-6,59},
175  {-5,60},
176  {-4,61},
177  {-3,61},
178  {-2,62},
179  {-1,62},
180  {0,63},
181  {1,64},
182  {2,64},
183  {3,65},
184  {4,65},
185  {5,66},
186  {6,67},
187  {7,67},
188  {8,68},
189  {9,68},
190  {10,69},
191  {11,69},
192  {12,70},
193  {13,71},
194  {14,71},
195  {15,72},
196  {16,72},
197  {17,73},
198  {18,74},
199  {19,74},
200  {20,75},
201  {21,75},
202  {22,76},
203  {23,77},
204  {24,77},
205  {25,78},
206  {26,78},
207  {27,79},
208  {28,79},
209  {29,80},
210  {30,81},
211  {31,81},
212  {32,82},
213  {33,82},
214  {34,83},
215  {35,84},
216  {36,84},
217  {37,85},
218  {38,85},
219  {39,86},
220  {40,87},
221  {41,87},
222  {42,88},
223  {43,88},
224  {44,89},
225  {45,89},
226  {46,90},
227  {47,91},
228  {48,91},
229  {49,92},
230  {50,92},
231  {51,93},
232  {52,94},
233  {53,94},
234  {54,95},
235  {55,95},
236  {56,96},
237  {57,97},
238  {58,97},
239  {59,98},
240  {60,98},
241  {61,99},
242  {62,99},
243  {63,100},
244  {64,101},
245  {65,101},
246  {66,102},
247  {67,102},
248  {68,103},
249  {69,104},
250  {70,104},
251  {71,105},
252  {72,105},
253  {73,106},
254  {74,107},
255  {75,107},
256  {76,108},
257  {77,108},
258  {78,109},
259  {79,109},
260  {80,110},
261  {81,111},
262  {82,111},
263  {83,112},
264  {84,112},
265  {85,113},
266  {86,114},
267  {87,114},
268  {88,115},
269  {89,115},
270  {90,116},
271  {91,117},
272  {92,117},
273  {93,118},
274  {94,118},
275  {95,119},
276  {96,119},
277  {97,120},
278  {98,121},
279  {99,121},
280  {100,122}
282  };
283 
284  static const std::map<int,int> phi_LUT = []{
285  std::map<int,int> m;
286  for (int i = 0; i <= 125; ++i) m.emplace(i,i);
287  m.emplace(126,127);
288  m.emplace(127,127);
289  return m;
290  }();
291 
292  static const std::map<int,int> pt_LUT = {
294  //Add pt LUT here
295  {30,0},
296  {40,8},
297  {50,15},
298  {60,22},
299  {70,30},
300  {80,37},
301  {90,45},
302  {100,52},
303  {110,59},
304  {120,67},
305  {130,74},
306  {140,81},
307  {150,89},
308  {160,96},
309  {170,104},
310  {180,111},
311  {190,118},
312  {200,126}
314  };
315 
316  //If a transformation is not found in the provided LUT, the function will return the original input
317 
318  if(vartype=="eta"){
319  auto it_eta = eta_LUT.find(value);
320  return it_eta != eta_LUT.end() ? it_eta->second : value;
321  }
322 
323  else if (vartype=="phi"){
324  auto it_phi = phi_LUT.find(value);
325  return it_phi != phi_LUT.end() ? it_phi->second : value;
326  }
327 
328  else if(vartype =="pt"){
329  auto it_pt = pt_LUT.find(value);
330  return it_pt != pt_LUT.end() ? it_pt->second : value;
331  }
332 
333  else{
334  return value;
335  }
336  }
337 }
338 
339 TCS::Bin::Bin(const nlohmann::json& obj, int nVars)
340 : score(obj["score"]), nVar(nVars) {
341  for (auto &[name, val] : obj["ranges"]["min"].items()) {
342  // this works for vectors [a,b,c] and dictionary values {"0": a, "1": b, "2": c}
343  minVals.push_back(val);
344  }
345  for (auto &[name, val] : obj["ranges"]["max"].items()) {
346  maxVals.push_back(val);
347  }
348 }
349 
350 bool
351 TCS::Bin::isInside(const std::vector<int64_t>& inputEvent) const {
352  for (size_t i = 0; i < inputEvent.size(); ++i) {
353  if (inputEvent[i] <= minVals[i]) {
354  return false;
355  }
356  else if (inputEvent[i] > maxVals[i]) {
357  return false;
358  }
359  }
360  return true;
361 }
362 
363 
364 TCS::Tree::Tree(const nlohmann::json& obj, int nVars) {
365  for (auto &[binName, bin] : obj["bins"].items()) {
366  bins.push_back(Bin(bin, nVars));
367  }
368 }
369 
370 int64_t
371 TCS::Tree::getTreeScore(const std::vector<int64_t>& inputEvent) const {
372  for(const Bin& bin : bins) {
373  if(bin.isInside(inputEvent)) {
374  return bin.score;
375  }
376  }
377  return 0;
378  //throw std::runtime_error("AnomalyDetection: the code has reached an unreachable state");
379 }
380 
381 
382 // constructor
384 : DecisionAlg(name) {
385  defineParameter("MinET1",0);
386  defineParameter("MinET2",0);
387  defineParameter("ScoreThreshold", 1, 0);
388  defineParameter("ScoreThreshold", 1, 1);
389  defineParameter("MaxTob",3);
390  defineParameter("NumResultBits",2);
391  setNumberOutputBits(2); // 2 decision bits for 2 different score thresholds
392  // (BDT Regression score is calculated internally)
393 }
394 
395 // destructor
397 {}
398 
401 
402  p_MaxTob = parameter("MaxTob").value();
403  p_minEt1 = parameter("MinET1").value();
404  p_minEt2 = parameter("MinET2").value();
405  for (size_t i=0; i <numberOutputBits(); ++i) {
406  p_ScoreThreshold[i] = parameter("ScoreThreshold", i).value();
407  }
408  TRG_MSG_INFO("ADBDT: Threshold set to " << p_ScoreThreshold);
409  const std::string bdtfn = "TrigAnomalyDetectionBDT/2025-06-18/fwX-config_nomAD_Jun3_2pi200t20d.json";
410 
411  std::string fileLocation;
412 
413  #ifndef TRIGCONF_STANDALONE
414  fileLocation = PathResolver::find_calib_file(bdtfn);
415  #else
416  return StatusCode::SUCCESS;
417  #endif
418  // Reading in the config
419  std::ifstream configFile(fileLocation);
420 
421  if (!configFile.is_open()) {
422  TRG_MSG_ERROR("Unable to open BDT configuration file." << fileLocation);
423  return StatusCode::FAILURE;
424  }
425 
426  nlohmann::json bdt_config; // BDT configuration
428  m_nVar = bdt_config["nDim"];
429  m_mu1_ptmin = bdt_config["variable_float_ranges"]["flat_dimu_mu1_pt_100MeV"]["min"];
430  m_mu1_ptmax = bdt_config["variable_float_ranges"]["flat_dimu_mu1_pt_100MeV"]["max"];
431  m_mu1_etamin = bdt_config["variable_float_ranges"]["flat_dimu_mu1_eta"]["min"];
432  m_mu1_etamax = bdt_config["variable_float_ranges"]["flat_dimu_mu1_eta"]["max"];
433  m_mu1_phimin = bdt_config["variable_float_ranges"]["flat_dimu_mu1_phi_2pi"]["min"];
434  m_mu1_phimax = bdt_config["variable_float_ranges"]["flat_dimu_mu1_phi_2pi"]["max"];
435  m_mu2_ptmin = bdt_config["variable_float_ranges"]["flat_dimu_mu2_pt_100MeV"]["min"];
436  m_mu2_ptmax = bdt_config["variable_float_ranges"]["flat_dimu_mu2_pt_100MeV"]["max"];
437  m_mu2_etamin = bdt_config["variable_float_ranges"]["flat_dimu_mu2_eta"]["min"];
438  m_mu2_etamax = bdt_config["variable_float_ranges"]["flat_dimu_mu2_eta"]["max"];
439  m_mu2_phimin = bdt_config["variable_float_ranges"]["flat_dimu_mu2_phi_2pi"]["min"];
440  m_mu2_phimax = bdt_config["variable_float_ranges"]["flat_dimu_mu2_phi_2pi"]["max"];
441 
442  for (auto& [treeName, tree] : bdt_config["trees"].items()) {
443  Tree t = Tree(tree, m_nVar);
444  m_trees.push_back(t);
445  }
446 
447  TRG_MSG_DEBUG("In initialize. There are " << m_trees.size() << " trees for AnomalyDetectionBDT.");
448 
449  //Setting simulation mode.
450  //This can be set to "lut" or to "math"
451  //"lut" mimics exactly what is done in firmware
452  m_sim_mode = "lut";
453  TRG_MSG_INFO("The sim_mode is " << m_sim_mode);
454 
455  //Booking histograms
456  for (size_t i=0; i<numberOutputBits(); ++i) {
457  std::string hname_accept = "hAnomalyDetecionBDT_accept_bit"+std::to_string((int)i);
458  std::string hname_reject = "hAnomalyDetecionBDT_reject_bit"+std::to_string((int)i);
459 
460  bookHist(m_histAccept, hname_accept, "AnomalyScore", 100, 0, 128);
461  bookHist(m_histReject, hname_reject, "AnomalyScore", 100, 0, 128);
462  }
463  return StatusCode::SUCCESS;
464 }
465 
467 TCS::AnomalyDetectionBDT::processBitCorrect(const std::vector<TCS::TOBArray const *> & input,
468  const std::vector<TCS::TOBArray *> & output,
469  Decision & decision) {
470 
471  if (input.size() != 1){
472  TCS_EXCEPTION("ADBDT algorithm expects only one TOBArray input (muons), but got " << input.size());
473  }
474 
475  const TCS::TOBArray* muons = input[0];
476 
477  //Reading in number of muons:
478  TRG_MSG_DEBUG("There are " << muons->size() << " muons.");
479 
480  if (muons->size() < 2) {
481  TRG_MSG_DEBUG("There are less than 2 muons. Skipping event.");
482  m_totalScore = 0;
483  return StatusCode::SUCCESS;
484  }
485 
486  bool hasAmbiguousInputs = TSU::isAmbiguousAnywhere(muons, p_MaxTob, std::min(p_minEt1, p_minEt2));
487 
488  int64_t maxScore = 0;
489 
490  size_t nMuons = p_MaxTob > 0 ? std::min(muons->size(), p_MaxTob) : muons->size();
491  //We define muon pairs based on the 2-3 leading muons
492  std::vector<std::pair<int, int>> muonPairs;
493  for (size_t i = 0; i < nMuons; ++i) {
494  for (size_t j = i+1; j < nMuons; ++j) {
495  muonPairs.emplace_back(i, j);
496  }
497  }
498 
499  for (const auto& [i,j] : muonPairs) {
500 
501  std::vector<int64_t> eventValues;
502 
503  const auto& mu1 = (*muons)[i];
504  const auto& mu2 = (*muons)[j];
505 
506  //ignore combinations failing minET cuts
507  if ( parType_t( mu1.Et() ) <= p_minEt1 ) continue;
508  if ( parType_t( mu2.Et() ) <= p_minEt2 ) continue;
509 
510  if (scale(mu1.Et(),m_mu1_ptmin, m_mu1_ptmax) != mapval(mu1.Et(), "pt")
511  || scale(mu1.eta()/40.0, m_mu1_etamin, m_mu1_etamax) != mapval(mu1.eta(), "eta")
512  || scale(mu1.phi()/20.0, m_mu1_phimin, m_mu1_phimax) != mapval(mu1.phi(), "phi")
513  || scale(mu2.Et(),m_mu2_ptmin, m_mu2_ptmax) != mapval(mu2.Et(), "pt")
514  || scale(mu2.eta()/40.0, m_mu2_etamin, m_mu2_etamax) != mapval(mu2.eta(), "eta")
515  || scale(mu2.phi()/20.0, m_mu2_phimin, m_mu2_phimax) != mapval(mu2.phi(), "phi")){
516 
517  TRG_MSG_WARNING("The math function for the mapping of Muon pt,eta,or phi does not match the LUT mapping. Check LUT, 'scale' function, or if illegal vartype was given to 'mapval' function");
518 
519  }
520 
521  if (mapval(mu1.Et(), "pt") == int(mu1.Et()) || mapval(mu2.Et(), "pt") == int(mu2.Et())) {
522 
523  TRG_MSG_WARNING("No input transformation done by LUT for muon ET");
524 
525  }
526 
527  if (mapval(mu1.eta(), "eta") == mu1.eta() || mapval(mu2.eta(), "eta") == mu2.eta()) {
528 
529  TRG_MSG_WARNING("No input transformation done by LUT for muon Eta");
530 
531  }
532 
533  if (mapval(mu1.phi(), "phi") == mu1.phi() || mapval(mu2.phi(), "phi") == mu2.phi()) {
534 
535 
536  TRG_MSG_DEBUG("No input transformation done by LUT for muon Phi"); //Not a warning, since current transformation for phi
537  //does not change the value except for one input number
538  }
539 
540  if (m_sim_mode == "math"){
541  eventValues.push_back(scale(mu1.Et(), m_mu1_ptmin, m_mu1_ptmax)); // muon pT (100MeV)
542  eventValues.push_back(scale(mu1.eta()/40.0, m_mu1_etamin, m_mu1_etamax)); // muon eta (25mrad)
543  eventValues.push_back(scale(mu1.phi()/20.0, m_mu1_phimin, m_mu1_phimax)); // muon phi (50mrad)
544 
545  eventValues.push_back(scale(mu2.Et(), m_mu2_ptmin, m_mu2_ptmax)); // muon pT (100MeV)
546  eventValues.push_back(scale(mu2.eta()/40.0, m_mu2_etamin, m_mu2_etamax)); // muon eta (25mrad)
547  eventValues.push_back(scale(mu2.phi()/20.0, m_mu2_phimin, m_mu2_phimax)); // muon phi (50mrad)
548  }
549 
550  else if(m_sim_mode == "lut"){
551  eventValues.push_back(mapval(mu1.Et(), "pt"));
552  eventValues.push_back(mapval(mu1.eta(), "eta"));
553  eventValues.push_back(mapval(mu1.phi(), "phi"));
554 
555  eventValues.push_back(mapval(mu2.Et(), "pt"));
556  eventValues.push_back(mapval(mu2.eta(), "eta"));
557  eventValues.push_back(mapval(mu2.phi(), "phi"));
558  }
559 
560  else{
561  eventValues.push_back(scale(mu1.Et(), m_mu1_ptmin, m_mu1_ptmax)); // muon pT (100MeV)
562  eventValues.push_back(scale(mu1.eta()/40.0, m_mu1_etamin, m_mu1_etamax)); // muon eta (25mrad)
563  eventValues.push_back(scale(mu1.phi()/20.0, m_mu1_phimin, m_mu1_phimax)); // muon phi (50mrad)
564 
565  eventValues.push_back(scale(mu2.Et(), m_mu2_ptmin, m_mu2_ptmax)); // muon pT (100MeV)
566  eventValues.push_back(scale(mu2.eta()/40.0, m_mu2_etamin, m_mu2_etamax)); // muon eta (25mrad)
567  eventValues.push_back(scale(mu2.phi()/20.0, m_mu2_phimin, m_mu2_phimax)); // muon phi (50mrad)
568  }
569 
570  // calculate the score as sum of score from all trees
571  int64_t score = 0;
572  for (Tree tree : m_trees) {
573  score += tree.getTreeScore(eventValues);
574  }
575 
576  // from all muon combinations keep the highest score
577  if (score > maxScore) {
578  maxScore = score;
579  }
580  }
581 
582  m_totalScore = maxScore;
583  TRG_MSG_DEBUG("Anomaly Score = " << m_totalScore);
584 
585  //Now, we compare and set the decision bit:
586  for (size_t i=0; i<numberOutputBits(); ++i){
587  bool accept = false;
588  // const bool fillAccept = fillHistos() && (fillHistosBasedOnHardware() ? getDecisionHardwareBit(i) : accept);
589  // const bool fillReject = fillHistos() && !fillAccept;
590  // const bool alreadyFilled = decision.bit(i);
591 
592  if (m_totalScore > p_ScoreThreshold[i]) {
593  accept = true;
594  decision.setBit(i,true);
595  for (size_t k = 0; k < 3 && k < muons->size(); ++k){
596  output[i]->push_back((*muons)[k]);
597  }
598  }
599 
600  output[i]->setAmbiguityFlag(hasAmbiguousInputs);
601 
602  if(fillHistos()) {
603  const bool fillAccept = fillHistosBasedOnHardware() ? getDecisionHardwareBit(i) : accept;
604  if (fillAccept) {
605  fillHist1D(m_histAccept[i], m_totalScore);
606  } else {
607  fillHist1D(m_histReject[i], m_totalScore);
608  }
609  }
610 
611  TRG_MSG_DEBUG("Decision for bit " << i << ": " <<(accept?"pass":"fail") << "with an anomaly score = " << m_totalScore << std::endl);
612  }
613  return StatusCode::SUCCESS;
614 }
615 
616 TCS::StatusCode TCS::AnomalyDetectionBDT::process(const std::vector<TCS::TOBArray const *> & input,
617  const std::vector<TCS::TOBArray *> & output,
618  Decision & decision) {
619 #ifdef TRIGCONF_STANDALONE
620  return StatusCode::SUCCESS;
621 #endif
622  TCS::StatusCode status = processBitCorrect(input,output,decision);
623  if (!status.isSuccess()){
624  return status;
625  }
626 
627  // Check if totalScore exceeds the bits that we expect
628  if (m_totalScore >= (1L << 8)) {
629  TRG_MSG_WARNING("ADBDT:The calculated anomaly score exceeds the allowed number of bits.");
630  }
631 
633 }
TRG_MSG_ERROR
#define TRG_MSG_ERROR(x)
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStreamMacros.h:29
PathResolver::find_calib_file
static std::string find_calib_file(const std::string &logical_file_name)
Definition: PathResolver.cxx:235
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
taskman.configFile
configFile
Definition: taskman.py:310
TCS::parType_t
uint32_t parType_t
Definition: Parameter.h:22
TCS::Bin::maxVals
std::vector< int64_t > maxVals
Definition: AnomalyDetectionBDT.h:33
AnomalyDetectionBDT.h
TCS::StatusCode::FAILURE
@ FAILURE
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
json
nlohmann::json json
Definition: HistogramDef.cxx:9
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
TCS::Bin::isInside
bool isInside(const std::vector< int64_t > &inputEvent) const
Definition: AnomalyDetectionBDT.cxx:351
CutsMETMaker::accept
StatusCode accept(const xAOD::Muon *mu)
Definition: CutsMETMaker.cxx:18
tree
TChain * tree
Definition: tile_monitor.h:30
TCS::AnomalyDetectionBDT::~AnomalyDetectionBDT
virtual ~AnomalyDetectionBDT()
Definition: AnomalyDetectionBDT.cxx:396
TCS::Bin::Bin
Bin(const nlohmann::json &obj, int nVars)
Definition: AnomalyDetectionBDT.cxx:339
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:70
bin
Definition: BinsDiffFromStripMedian.h:43
athena.value
value
Definition: athena.py:124
TCS::Bin
Definition: AnomalyDetectionBDT.h:17
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:9
Decision.h
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
Dedxcorrection::resolution
double resolution[nGasTypes][nParametersResolution]
Definition: TRT_ToT_Corrections.h:46
TCS::Tree
Definition: AnomalyDetectionBDT.h:36
TCS::DecisionAlg
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h:22
TCS::Decision::setBit
void setBit(unsigned int index, bool value)
Definition: L1Topo/L1TopoInterfaces/Root/Decision.cxx:12
TCS::Tree::getTreeScore
int64_t getTreeScore(const std::vector< int64_t > &inputEvent) const
Definition: AnomalyDetectionBDT.cxx:371
TCS::AnomalyDetectionBDT::processBitCorrect
virtual StatusCode processBitCorrect(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decision)
Definition: AnomalyDetectionBDT.cxx:467
TCS::AnomalyDetectionBDT::process
virtual StatusCode process(const std::vector< TCS::TOBArray const * > &input, const std::vector< TCS::TOBArray * > &output, Decision &decision)
Definition: AnomalyDetectionBDT.cxx:616
lumiFormat.i
int i
Definition: lumiFormat.py:85
TCS::DataArrayImpl::size
size_t size() const
Definition: DataArrayImpl.h:30
TCS::ConfigurableAlg::defineParameter
void defineParameter(const std::string &name, TCS::parType_t value)
Definition: ConfigurableAlg.cxx:201
TCS::operator<<
std::ostream & operator<<(std::ostream &os, const TCS::Bin &bin)
Definition: AnomalyDetectionBDT.cxx:49
dumpFileToPlots.treeName
string treeName
Definition: dumpFileToPlots.py:19
TCS::Bin::minVals
std::vector< int64_t > minVals
Definition: AnomalyDetectionBDT.h:32
plotting.yearwise_luminosity_vs_mu.bins
bins
Definition: yearwise_luminosity_vs_mu.py:30
TCS_EXCEPTION
#define TCS_EXCEPTION(MSG)
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Exception.h:14
TCS::TOBArray
Definition: TOBArray.h:24
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
TCS::Decision
Definition: L1Topo/L1TopoInterfaces/L1TopoInterfaces/Decision.h:19
MakeTH3DFromTH2Ds.maxVals
maxVals
Definition: MakeTH3DFromTH2Ds.py:74
TRG_MSG_INFO
#define TRG_MSG_INFO(x)
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStreamMacros.h:27
TRG_MSG_WARNING
#define TRG_MSG_WARNING(x)
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStreamMacros.h:28
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition: AlgFactory.h:62
PathResolver.h
TCS::AnomalyDetectionBDT::initialize
virtual StatusCode initialize()
Definition: AnomalyDetectionBDT.cxx:400
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
vectorToString
std::string vectorToString(const std::vector< T > &vec)
Definition: AnomalyDetectionBDT.cxx:32
TrigJetMonitorAlgorithm.items
items
Definition: TrigJetMonitorAlgorithm.py:71
xAOD::score
@ score
Definition: TrackingPrimitives.h:514
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
DeMoScan.first
bool first
Definition: DeMoScan.py:534
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
validateBDTTau.bdt_config
bdt_config
Definition: validateBDTTau.py:50
TCS::Tree::Tree
Tree(const nlohmann::json &obj, int nVars)
Definition: AnomalyDetectionBDT.cxx:364
TSU::isAmbiguousAnywhere
bool isAmbiguousAnywhere(TCS::TOBArray const *tobs, size_t pos, unsigned minEt=0)
Definition: Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Helpers.cxx:37
TCS::DecisionAlg::setNumberOutputBits
void setNumberOutputBits(unsigned int numberOutputBits)
Definition: Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h:40
merge.status
status
Definition: merge.py:16
MakeTH3DFromTH2Ds.minVals
minVals
Definition: MakeTH3DFromTH2Ds.py:73
Helpers.h
python.PyAthena.obj
obj
Definition: PyAthena.py:132
Exception.h
TCS::AnomalyDetectionBDT::AnomalyDetectionBDT
AnomalyDetectionBDT(const std::string &name)
Definition: AnomalyDetectionBDT.cxx:383
TRG_MSG_DEBUG
#define TRG_MSG_DEBUG(x)
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStreamMacros.h:25
fitman.k
k
Definition: fitman.py:528
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15
python.SystemOfUnits.m
float m
Definition: SystemOfUnits.py:106
python.SystemOfUnits.L
float L
Definition: SystemOfUnits.py:92