ATLAS Offline Software
TruthTagResults.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ANALYSISTRUTHTAGRESULTS_H
6 #define ANALYSISTRUTHTAGRESULTS_H
7 
8 #include <map>
9 #include <vector>
10 #include <string>
11 
12 namespace Analysis {
13 
15 
16  public:
17 
18  //map from systematic name to vector of event weights for different number of tagged jets
19  // for examples: map_trf_weight_ex["Nominal"].at(3) is the event weight for exactly 3 tagged jets
20  // map_trf_weight_in["Nominal"].at(2) is the event weight for 2 or more tagged jets
21  std::map<std::string,std::vector<float> > map_trf_weight_ex;
22  std::map<std::string,std::vector<float> > map_trf_weight_in;
23 
24  //map from systematic name to vector of SF weights for different number of tagged jets
25  // for examples: map_SF_ex["Nominal"].at(3) is the SF event weight for exactly 3 tagged jets
26  // map_SF_ex["Nominal"].at(2) is the SF event weight for 2 or more tagged jets
27  std::map<std::string,std::vector<float> > map_SF_ex;
28  std::map<std::string,std::vector<float> > map_SF_in;
29 
30  //chosen permutation (does not depend on the systematic variation)
31  // trf_chosen_perm_ex.at(3) is the chosen permutation for exactly 3 tagged jets
32  std::vector<std::vector<bool> > trf_chosen_perm_ex;
33  std::vector<std::vector<bool> > trf_chosen_perm_in;
34 
35  //the tag weight bin, similar configuration to the chosen permutation vectors.
36  std::vector<std::vector<int> > trf_bin_ex;
37  std::vector<std::vector<int> > trf_bin_in;
38 
39  //random tag weights generated for the chosen quantiles.
40  std::vector<std::vector<float> > trf_bin_score_ex;
41  std::vector<std::vector<float> > trf_bin_score_in;
42 
43  //random c-tag weights generated for the chosen quantiles.
44  std::vector<std::vector<float> > trf_ctag_bin_score_ex;
45  std::vector<std::vector<float> > trf_ctag_bin_score_in;
46 
47  //direct tagging results
48  std::vector<bool> is_tagged;
49  std::map<std::string,float > map_SF;
50 
51  std::vector<std::string> syst_names;
52 
53  void clear(){
54 
55  map_trf_weight_ex.clear();
56  map_trf_weight_in.clear();
57  trf_chosen_perm_ex.clear();
58  trf_chosen_perm_in.clear();
59  trf_bin_ex.clear();
60  trf_bin_in.clear();
61 
62  }
63 
64  float getEvtDirectTagSF(std::string syst_name="Nominal")
65  {
66  return(map_SF[syst_name]);
67  }
68 
69  std::vector<bool> getDirectTaggedJets()
70  {
71  return(is_tagged);
72 
73  }
74 
75  float getEventWeight(int nbtag,bool Ex,std::string syst_name="Nominal")
76  {
77  if(Ex)
78  {
79  return map_trf_weight_ex[syst_name].at(nbtag);
80  }
81  else
82  {
83  return map_trf_weight_in[syst_name].at(nbtag);
84  }
85  }
86 
87  std::vector<bool> getEventPermutation(int nbtag,bool Ex )
88  {
89  if(Ex)
90  {
91  return(trf_chosen_perm_ex.at(nbtag));
92  }
93 
94  else
95  {
96  return(trf_chosen_perm_in.at(nbtag));
97  }
98  }
99 
100  std::vector<int> getEventQuantiles(int nbtag,bool Ex )
101  {
102  if(Ex)
103  {
104  return(trf_bin_ex.at(nbtag));
105  }
106 
107  else
108  {
109  return(trf_bin_in.at(nbtag));
110  }
111  }
112 
113 
114  std::vector<float> getRandomTaggerScores(int nbtag,bool Ex )
115  {
116  if(Ex)
117  {
118  return(trf_bin_score_ex.at(nbtag));
119  }
120  else
121  {
122  return(trf_bin_score_in.at(nbtag));
123  }
124  }
125 
126 
127  };
128 
129 
130 }
131 
132 #endif // ANALYSISTRUTHTAGRESULTS_H
133 
Analysis::TruthTagResults::getEventPermutation
std::vector< bool > getEventPermutation(int nbtag, bool Ex)
Definition: TruthTagResults.h:87
Analysis::TruthTagResults::map_SF_in
std::map< std::string, std::vector< float > > map_SF_in
Definition: TruthTagResults.h:28
Analysis::TruthTagResults::getRandomTaggerScores
std::vector< float > getRandomTaggerScores(int nbtag, bool Ex)
Definition: TruthTagResults.h:114
Analysis::TruthTagResults::trf_chosen_perm_ex
std::vector< std::vector< bool > > trf_chosen_perm_ex
Definition: TruthTagResults.h:32
Analysis::TruthTagResults::getEvtDirectTagSF
float getEvtDirectTagSF(std::string syst_name="Nominal")
Definition: TruthTagResults.h:64
Analysis::TruthTagResults::trf_ctag_bin_score_ex
std::vector< std::vector< float > > trf_ctag_bin_score_ex
Definition: TruthTagResults.h:44
Analysis::TruthTagResults::map_trf_weight_in
std::map< std::string, std::vector< float > > map_trf_weight_in
Definition: TruthTagResults.h:22
Analysis::TruthTagResults::trf_bin_ex
std::vector< std::vector< int > > trf_bin_ex
Definition: TruthTagResults.h:36
Analysis::TruthTagResults::trf_ctag_bin_score_in
std::vector< std::vector< float > > trf_ctag_bin_score_in
Definition: TruthTagResults.h:45
Analysis::TruthTagResults::map_SF_ex
std::map< std::string, std::vector< float > > map_SF_ex
Definition: TruthTagResults.h:27
Analysis::TruthTagResults::trf_bin_score_in
std::vector< std::vector< float > > trf_bin_score_in
Definition: TruthTagResults.h:41
Analysis::TruthTagResults::map_trf_weight_ex
std::map< std::string, std::vector< float > > map_trf_weight_ex
Definition: TruthTagResults.h:21
Analysis::TruthTagResults
Definition: TruthTagResults.h:14
Analysis::TruthTagResults::trf_bin_score_ex
std::vector< std::vector< float > > trf_bin_score_ex
Definition: TruthTagResults.h:40
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition: BTaggingCnvAlg.h:20
Analysis::TruthTagResults::clear
void clear()
Definition: TruthTagResults.h:53
Analysis::TruthTagResults::syst_names
std::vector< std::string > syst_names
Definition: TruthTagResults.h:51
Analysis::TruthTagResults::trf_chosen_perm_in
std::vector< std::vector< bool > > trf_chosen_perm_in
Definition: TruthTagResults.h:33
Analysis::TruthTagResults::trf_bin_in
std::vector< std::vector< int > > trf_bin_in
Definition: TruthTagResults.h:37
Analysis::TruthTagResults::getEventWeight
float getEventWeight(int nbtag, bool Ex, std::string syst_name="Nominal")
Definition: TruthTagResults.h:75
Analysis::TruthTagResults::map_SF
std::map< std::string, float > map_SF
Definition: TruthTagResults.h:49
Analysis::TruthTagResults::is_tagged
std::vector< bool > is_tagged
Definition: TruthTagResults.h:48
Analysis::TruthTagResults::getDirectTaggedJets
std::vector< bool > getDirectTaggedJets()
Definition: TruthTagResults.h:69
Analysis::TruthTagResults::getEventQuantiles
std::vector< int > getEventQuantiles(int nbtag, bool Ex)
Definition: TruthTagResults.h:100