ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
GlobalSim::cTauMultiplicity Class Reference

#include <cTauMultiplicity.h>

Collaboration diagram for GlobalSim::cTauMultiplicity:

Public Member Functions

 cTauMultiplicity (const std::string &name, unsigned int nbits, const TrigConf::L1Threshold_cTAU &, const std::map< std::string, int > &isoFW_CTAU, const std::map< std::string, int > &isoFW_CTAU_jTAUCoreScale)
 
virtual ~cTauMultiplicity ()=default
 
StatusCode run (const cTauTOBArray &input, Count &count)
 
std::string toString () const
 
const std::vector< double > & TOB_et () const
 
const std::vector< double > & TOB_eta () const
 
const std::vector< double > & TOB_phi () const
 
const std::vector< double > & TOB_isolation_partial_loose () const
 
const std::vector< double > & TOB_isolation_partial_medium () const
 
const std::vector< double > & TOB_isolation_partial_tight () const
 
const std::vector< double > & TOB_isoScore () const
 
const std::vector< double > & accept_eta () const
 
const std::vector< double > & accept_et () const
 
const std::vector< double > & counts () const
 

Static Public Member Functions

static unsigned int convertIsoToBit (const std::map< std::string, int > &isoFW_CTAU, const std::map< std::string, int > &isoFW_CTAU_jTAUCoreScale, const float jTauCoreEt, const float jTauIso, const float eTauEt)
 

Private Member Functions

unsigned int convertIsoToBit (const TCS::cTauTOB *etauCand, const TCS::cTauTOB *jtauCand) const
 
bool cTauMatching (const TCS::cTauTOB *etauCand, const TCS::cTauTOB *jtauCand) const
 

Private Attributes

std::string m_name {}
 
unsigned int m_nbits {0}
 
unsigned int m_numberOutputBits {0}
 
const TrigConf::L1Threshold_cTAUm_threshold
 
std::vector< double > m_TOB_et {}
 
std::vector< double > m_TOB_eta {}
 
std::vector< double > m_TOB_phi {}
 
std::vector< double > m_TOB_isolation_partial_loose {}
 
std::vector< double > m_TOB_isolation_partial_medium {}
 
std::vector< double > m_TOB_isolation_partial_tight {}
 
std::vector< double > m_TOB_isoScore {}
 
std::vector< double > m_accept_eta {}
 
std::vector< double > m_accept_et {}
 
std::vector< double > m_counts {}
 
std::map< std::string, int > m_isoFW_CTAU
 
std::map< std::string, int > m_isoFW_CTAU_jTAUCoreScale
 

Detailed Description

Definition at line 29 of file Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.h.

Constructor & Destructor Documentation

◆ cTauMultiplicity()

GlobalSim::cTauMultiplicity::cTauMultiplicity ( const std::string &  name,
unsigned int  nbits,
const TrigConf::L1Threshold_cTAU threshold,
const std::map< std::string, int > &  isoFW_CTAU,
const std::map< std::string, int > &  isoFW_CTAU_jTAUCoreScale 
)

Definition at line 20 of file Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.cxx.

26  :
27  m_name{name},
28  m_nbits{nbits},
30  m_isoFW_CTAU{isolationFW_CTAU},
31  m_isoFW_CTAU_jTAUCoreScale{isolationFW_CTAU_jTAUCoreScale}
32  {
33 
34  if (m_nbits == 0) {
35  throw std::runtime_error("cTauMultiplicity m_nbits == 0 ");
36  }
37  }

◆ ~cTauMultiplicity()

virtual GlobalSim::cTauMultiplicity::~cTauMultiplicity ( )
virtualdefault

Member Function Documentation

◆ accept_et()

const std::vector< double > & GlobalSim::cTauMultiplicity::accept_et ( ) const

Definition at line 308 of file Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.cxx.

308  {
309  return m_accept_et;
310  }

◆ accept_eta()

const std::vector< double > & GlobalSim::cTauMultiplicity::accept_eta ( ) const

Definition at line 303 of file Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.cxx.

303  {
304  return m_accept_eta;
305  }

◆ convertIsoToBit() [1/2]

unsigned int GlobalSim::cTauMultiplicity::convertIsoToBit ( const std::map< std::string, int > &  isoFW_CTAU,
const std::map< std::string, int > &  isoFW_CTAU_jTAUCoreScale,
const float  jTauCoreEt,
const float  jTauIso,
const float  eTauEt 
)
static

Definition at line 240 of file Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.cxx.

244  {
245  unsigned int bit = 0;
246  // Assign the tightest accept WP as default bit
247  if( jTauIso*1024 + jTauCore*isoFW_CTAU_jTAUCoreScale.at("Loose") <
248  eTauEt*isoFW_CTAU.at("Loose") ) bit = 1;
249 
250  if( jTauIso*1024 + jTauCore*isoFW_CTAU_jTAUCoreScale.at("Medium") <
251  eTauEt*isoFW_CTAU.at("Medium") ) bit = 2;
252 
253  if( jTauIso*1024 + jTauCore*isoFW_CTAU_jTAUCoreScale.at("Tight") <
254  eTauEt*isoFW_CTAU.at("Tight") ) bit = 3;
255 
256  return bit;
257  }

◆ convertIsoToBit() [2/2]

unsigned int GlobalSim::cTauMultiplicity::convertIsoToBit ( const TCS::cTauTOB etauCand,
const TCS::cTauTOB jtauCand 
) const
private

Definition at line 179 of file Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.cxx.

180  {
181  unsigned int bit = 0;
182 
183  // Assign the tightest accept WP as default bit
184  if( jtauCand->EtIso()*1024 +
185  jtauCand->Et()*m_isoFW_CTAU_jTAUCoreScale.at("Loose") <
186  etauCand->Et()*m_isoFW_CTAU.at("Loose") ) bit = 1;
187 
188  if( jtauCand->EtIso()*1024 +
189  jtauCand->Et()*m_isoFW_CTAU_jTAUCoreScale.at("Medium") <
190  etauCand->Et()*m_isoFW_CTAU.at("Medium") ) bit = 2;
191 
192  if( jtauCand->EtIso()*1024 +
193  jtauCand->Et()*m_isoFW_CTAU_jTAUCoreScale.at("Tight") <
194  etauCand->Et()*m_isoFW_CTAU.at("Tight") ) bit = 3;
195 
196  return bit;
197  }

◆ counts()

const std::vector< double > & GlobalSim::cTauMultiplicity::counts ( ) const

Definition at line 313 of file Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.cxx.

313  {
314  return m_counts;
315  }

◆ cTauMatching()

bool GlobalSim::cTauMultiplicity::cTauMatching ( const TCS::cTauTOB etauCand,
const TCS::cTauTOB jtauCand 
) const
private

Definition at line 201 of file Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.cxx.

202  {
203 
204  bool matching = false;
205 
206  // Matching is done comparing eta_tower and phi_tower (granularity = 0.1)
207  // These coordinates represent the lower edge of the towers
208  // (both for eFEX and jFEX)
209 
210  // eTau eta = 4*eta_tower + seed, eta from -25 to 24
211  int eTauEtaTower;
212  if (etauCand->eta()%4 >= 0 ) {
213  eTauEtaTower = etauCand->eta() - etauCand->eta()%4;
214  } else {
215  eTauEtaTower = etauCand->eta() - etauCand->eta()%4 - 4;
216  }
217 
218  int jTauEtaTower;
219  if (jtauCand->eta()%4 >= 0 ) {
220  jTauEtaTower = jtauCand->eta() - jtauCand->eta()%4;
221  } else {
222  jTauEtaTower = jtauCand->eta() - jtauCand->eta()%4 - 4;
223  }
224 
225  //int jTauEtaTower = jtauCand->eta();
226  // jTau eta = 4*eta_tower
227 
228  // eTau phi = 2*phi_tower
229  unsigned int eTauPhiTower = etauCand->phi() >> 1;
230  unsigned int jTauPhiTower = jtauCand->phi() >> 1;
231  // jTau phi = 2*phi_tower + 1 (jTau coordinates are at center of tower)
232 
233  matching = (eTauEtaTower == jTauEtaTower) && (eTauPhiTower == jTauPhiTower);
234 
235  return matching;
236 
237  }

◆ run()

StatusCode GlobalSim::cTauMultiplicity::run ( const cTauTOBArray input,
Count count 
)

Definition at line 40 of file Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.cxx.

41  {
42 
43  // candidate for being moved to the base class
44  count.setNBits(m_nbits);
45 
46  int counting = 0;
47  // Loop over eTau candidates
48  for (const auto& etauCand : cTaus) {
49  if(etauCand->tobType() != TCS::ETAU) continue;
50 
51  // accept = true if:
52  // (isMatched==true && isIsolated==true) || (isMatched==false)
53  bool accept = false;
54 
55  // Is the eTau matched to a jTau?
56  bool isMatched = false;
57 
58  // If matched: does the resulting cTau pass the isolation cut?
59  bool isIsolated = false;
60 
61  // cTau Loose partial isolation (0 if no match is found)
62  float isolation_partial_loose = 0;
63 
64  // cTau Medium partial isolation (0 if no match is found)
65  float isolation_partial_medium = 0;
66 
67  // cTau Tight partial isolation (0 if no match is found)
68  float isolation_partial_tight = 0;
69 
70  // cTau isolation score (0 if no match is found)
71  unsigned int isoScore = 0;
72 
73  // Loop over jTau candidates
74  for (const auto& jtauCand : cTaus) {
75 
76  if(jtauCand->tobType() != TCS::JTAU) continue;
77 
78  isMatched = cTauMatching(etauCand, jtauCand);
79 
80  if (isMatched) {
81  // Updated isolation condition, WP-dependent (ATR-28641)
82  // "Partial" isolation formula:
83  // I = (E_T^{jTAU Iso} + jTAUCoreScale * E_T^{jTAU Core}) / E_T^{eTAU}
84  // This formula is missing the eTAU Core substraction from
85  //the numerator, grouped with the isolation cut value
86 
87  // variables to be monitored
88  float denominator = static_cast<float>(etauCand->Et());
89 
90 
91  float numerator = static_cast<float>(jtauCand->EtIso()) +
92  m_isoFW_CTAU_jTAUCoreScale.at("Loose")/1024.0 *
93  static_cast<float>(jtauCand->Et());
94 
95  m_TOB_isolation_partial_loose.push_back(numerator/denominator);
96 
97 
98  numerator = static_cast<float>(jtauCand->EtIso()) +
99  m_isoFW_CTAU_jTAUCoreScale.at("Medium")/1024.0 *
100  static_cast<float>(jtauCand->Et());
101 
102  m_TOB_isolation_partial_medium.push_back(numerator/denominator);
103 
104  numerator = static_cast<float>(jtauCand->EtIso()) +
105  m_isoFW_CTAU_jTAUCoreScale.at("Tight")/1024.0 *
106  static_cast<float>(jtauCand->Et());
107 
108  m_TOB_isolation_partial_tight.push_back(numerator/denominator);
109 
110  // Old isolation condition coded as in firmware:
111  // https://indico.cern.ch/event/1079697/contributions/4541419/
112  // attachments/2315137/3940824/cTAU_FirmwareAlgoProposal.pdf page 8
113 
114  isoScore = convertIsoToBit(etauCand, jtauCand);
115  isIsolated =
117  isoScore );
118  break; // Break loop when a match is found
119  }
120 
121  } // End of jTau loop
122 
123  // Fill cTau TOB histograms before threshold cuts (matched cTaus only)
124  if (isMatched) {
125  m_TOB_et.push_back(etauCand->EtDouble());
126  m_TOB_eta.push_back(etauCand->eta());
127  m_TOB_phi.push_back(etauCand->phi());
128 
129  m_TOB_isolation_partial_loose.push_back(isolation_partial_loose);
130  m_TOB_isolation_partial_medium.push_back(isolation_partial_medium);
131  m_TOB_isolation_partial_tight.push_back(isolation_partial_tight);
132  m_TOB_isoScore.push_back(isoScore);
133 
134  }
135 
136  // This is a good cTau
137  if ( isMatched && isIsolated ) { accept = true; }
138 
139  // This is a non-matched eTau
140  if ( not isMatched ) { accept = true; }
141 
142  // 6/2024 there have been updates to the L1TopoSimulation code
143  // not included here.
144 
145  // Menu threshold uses 0.1 eta granularity but eFex objects
146  // have 0.025 eta granularity
147  // eFex eta is calculated as
148  // 4*eta_tower (0.1 gran.) + seed (0.025 gran.), eta from -25 to 24
149  int eta_thr;
150  if ( etauCand->eta()%4 >= 0 ) {
151  eta_thr = etauCand->eta() - etauCand->eta()%4;
152  } else {
153  eta_thr = etauCand->eta() - etauCand->eta()%4 - 4;
154  }
155 
156  // Convert eta_thr to units of 0.1 to pass as an argument
157  accept = accept && etauCand->Et() > m_threshold.thrValue100MeV(eta_thr/4);
158  if (accept) {
159  counting++;
160 
161  m_accept_eta.push_back(etauCand->eta());
162  m_accept_et.push_back(etauCand->EtDouble());
163 
164  }
165 
166  } // End of eTau loop
167 
168  m_counts.push_back(counting);
169 
170 
171  // Pass counting to TCS::Count object - output bits are composed there
172  count.setSizeCount(counting);
173 
174  return StatusCode::SUCCESS;
175  }

◆ TOB_et()

const std::vector< double > & GlobalSim::cTauMultiplicity::TOB_et ( ) const

Definition at line 269 of file Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.cxx.

269  {
270  return m_TOB_et;
271  }

◆ TOB_eta()

const std::vector< double > & GlobalSim::cTauMultiplicity::TOB_eta ( ) const

Definition at line 273 of file Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.cxx.

273  {
274  return m_TOB_eta;
275  }

◆ TOB_isolation_partial_loose()

const std::vector< double > & GlobalSim::cTauMultiplicity::TOB_isolation_partial_loose ( ) const

Definition at line 283 of file Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.cxx.

283  {
285  }

◆ TOB_isolation_partial_medium()

const std::vector< double > & GlobalSim::cTauMultiplicity::TOB_isolation_partial_medium ( ) const

Definition at line 288 of file Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.cxx.

288  {
290  }

◆ TOB_isolation_partial_tight()

const std::vector< double > & GlobalSim::cTauMultiplicity::TOB_isolation_partial_tight ( ) const

Definition at line 293 of file Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.cxx.

293  {
295  }

◆ TOB_isoScore()

const std::vector< double > & GlobalSim::cTauMultiplicity::TOB_isoScore ( ) const

Definition at line 298 of file Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.cxx.

298  {
299  return m_TOB_isoScore;
300  }

◆ TOB_phi()

const std::vector< double > & GlobalSim::cTauMultiplicity::TOB_phi ( ) const

Definition at line 278 of file Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.cxx.

278  {
279  return m_TOB_phi;
280  }

◆ toString()

std::string GlobalSim::cTauMultiplicity::toString ( ) const

Definition at line 259 of file Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.cxx.

259  {
260  std::stringstream ss;
261  ss << "cTauMultiplicity. name: " << m_name << '\n'
262  << "numberOfBits: " << m_nbits;
263 
264  return ss.str();
265 
266  }

Member Data Documentation

◆ m_accept_et

std::vector<double> GlobalSim::cTauMultiplicity::m_accept_et {}
private

◆ m_accept_eta

std::vector<double> GlobalSim::cTauMultiplicity::m_accept_eta {}
private

◆ m_counts

std::vector<double> GlobalSim::cTauMultiplicity::m_counts {}
private

◆ m_isoFW_CTAU

std::map<std::string, int> GlobalSim::cTauMultiplicity::m_isoFW_CTAU
private

◆ m_isoFW_CTAU_jTAUCoreScale

std::map<std::string, int> GlobalSim::cTauMultiplicity::m_isoFW_CTAU_jTAUCoreScale
private

◆ m_name

std::string GlobalSim::cTauMultiplicity::m_name {}
private

◆ m_nbits

unsigned int GlobalSim::cTauMultiplicity::m_nbits {0}
private

◆ m_numberOutputBits

unsigned int GlobalSim::cTauMultiplicity::m_numberOutputBits {0}
private

◆ m_threshold

const TrigConf::L1Threshold_cTAU& GlobalSim::cTauMultiplicity::m_threshold
private

◆ m_TOB_et

std::vector<double> GlobalSim::cTauMultiplicity::m_TOB_et {}
private

◆ m_TOB_eta

std::vector<double> GlobalSim::cTauMultiplicity::m_TOB_eta {}
private

◆ m_TOB_isolation_partial_loose

std::vector<double> GlobalSim::cTauMultiplicity::m_TOB_isolation_partial_loose {}
private

◆ m_TOB_isolation_partial_medium

std::vector<double> GlobalSim::cTauMultiplicity::m_TOB_isolation_partial_medium {}
private

◆ m_TOB_isolation_partial_tight

std::vector<double> GlobalSim::cTauMultiplicity::m_TOB_isolation_partial_tight {}
private

◆ m_TOB_isoScore

std::vector<double> GlobalSim::cTauMultiplicity::m_TOB_isoScore {}
private

◆ m_TOB_phi

std::vector<double> GlobalSim::cTauMultiplicity::m_TOB_phi {}
private

The documentation for this class was generated from the following files:
GlobalSim::cTauMultiplicity::m_name
std::string m_name
Definition: Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.h:76
TCS::cTauTOB::EtIso
unsigned int EtIso() const
Definition: cTauTOB.h:44
GlobalSim::cTauMultiplicity::m_TOB_et
std::vector< double > m_TOB_et
Definition: Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.h:83
GlobalSim::cTauMultiplicity::m_TOB_eta
std::vector< double > m_TOB_eta
Definition: Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.h:84
GlobalSim::cTauMultiplicity::m_accept_eta
std::vector< double > m_accept_eta
Definition: Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.h:90
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
CutsMETMaker::accept
StatusCode accept(const xAOD::Muon *mu)
Definition: CutsMETMaker.cxx:18
TrigConf::Selection::wpToString
static std::string wpToString(WP)
Definition: L1ThresholdBase.cxx:347
GlobalSim::cTauMultiplicity::m_counts
std::vector< double > m_counts
Definition: Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.h:92
InDetSecVtxTruthMatchUtils::isMatched
bool isMatched(int matchInfo)
Definition: InDetSecVtxTruthMatchTool.h:48
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
GlobalSim::cTauMultiplicity::m_accept_et
std::vector< double > m_accept_et
Definition: Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.h:91
TrigConf::L1Threshold_Calo::thrValue100MeV
virtual unsigned int thrValue100MeV(int eta=0) const
as above above but in 100 MeV
Definition: L1ThresholdBase.cxx:284
GlobalSim::cTauMultiplicity::m_TOB_phi
std::vector< double > m_TOB_phi
Definition: Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.h:85
GlobalSim::cTauMultiplicity::m_TOB_isolation_partial_tight
std::vector< double > m_TOB_isolation_partial_tight
Definition: Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.h:88
GlobalSim::cTauMultiplicity::m_TOB_isolation_partial_loose
std::vector< double > m_TOB_isolation_partial_loose
Definition: Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.h:86
TCS::cTauTOB::phi
unsigned int phi() const
Definition: cTauTOB.h:35
GlobalSim::cTauMultiplicity::cTauMatching
bool cTauMatching(const TCS::cTauTOB *etauCand, const TCS::cTauTOB *jtauCand) const
Definition: Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.cxx:201
ReadTripsProbsFromCool.denominator
denominator
Definition: ReadTripsProbsFromCool.py:96
GlobalSim::cTauMultiplicity::m_isoFW_CTAU_jTAUCoreScale
std::map< std::string, int > m_isoFW_CTAU_jTAUCoreScale
Definition: Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.h:95
TCS::cTauTOB::eta
int eta() const
Definition: cTauTOB.h:34
GlobalSim::cTauMultiplicity::convertIsoToBit
static unsigned int convertIsoToBit(const std::map< std::string, int > &isoFW_CTAU, const std::map< std::string, int > &isoFW_CTAU_jTAUCoreScale, const float jTauCoreEt, const float jTauIso, const float eTauEt)
Definition: Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.cxx:240
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
threshold
Definition: chainparser.cxx:74
GlobalSim::cTauMultiplicity::m_threshold
const TrigConf::L1Threshold_cTAU & m_threshold
Definition: Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.h:80
TCS::cTauTOB::Et
unsigned int Et() const
Definition: cTauTOB.h:33
GlobalSim::cTauMultiplicity::m_isoFW_CTAU
std::map< std::string, int > m_isoFW_CTAU
Definition: Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.h:94
GlobalSim::cTauMultiplicity::m_TOB_isolation_partial_medium
std::vector< double > m_TOB_isolation_partial_medium
Definition: Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.h:87
TCS::ETAU
@ ETAU
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Types.h:22
TCS::JTAU
@ JTAU
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Types.h:13
GlobalSim::cTauMultiplicity::m_nbits
unsigned int m_nbits
Definition: Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.h:77
TrigConf::L1Threshold_cTAU::isolation
Selection::WP isolation() const
Definition: L1Threshold.h:262
GlobalSim::isocut
bool isocut(const std::string &threshold, const unsigned int bit)
Definition: isocut.cxx:10
GlobalSim::cTauMultiplicity::m_TOB_isoScore
std::vector< double > m_TOB_isoScore
Definition: Global/GlobalSimulation/src/L1TopoAlgs/cTauMultiplicity.h:89