ATLAS Offline Software
Tool_FeatureExtractor.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 #include "xAODTau/TauJet.h"
6 #include "xAODTracking/Vertex.h"
8 
9 #include "TLorentzVector.h"
10 #include "TVector3.h"
11 
12 #include <cmath>
13 #include <map>
14 #include <vector>
15 
19 #include "PanTauAlgs/PanTauSeed.h"
20 #include "PanTauAlgs/TauFeature.h"
22 
23 
25  return u->getBDTValue() > v->getBDTValue();
26 }
27 
28 
30  return u->p4().Et() > v->p4().Et();
31 }
32 
33 
35  asg::AsgTool(name),
36  m_Tool_InformationStore("PanTau::Tool_InformationStore/Tool_InformationStore"){
37 
38  declareProperty("Tool_InformationStore", m_Tool_InformationStore, "Tool handle to the information store tool");
39  declareProperty("Tool_InformationStoreName", m_Tool_InformationStoreName, "Tool handle to the information store tool");
40 
41 }
42 
43 
45 
46  ATH_MSG_INFO(" initialize()");
47  m_init=true;
48 
49  ATH_CHECK( HelperFunctions::bindToolHandle( m_Tool_InformationStore, m_Tool_InformationStoreName ) );
50  ATH_CHECK( m_Tool_InformationStore.retrieve() );
51 
52  ATH_CHECK( m_Tool_InformationStore->getInfo_String("FeatureExtractor_VarTypeName_varTypeName_Sum", m_varTypeName_Sum) );
53  ATH_CHECK( m_Tool_InformationStore->getInfo_String("FeatureExtractor_VarTypeName_varTypeName_Ratio", m_varTypeName_Ratio) );
54  ATH_CHECK( m_Tool_InformationStore->getInfo_String("FeatureExtractor_VarTypeName_varTypeName_EtInRing", m_varTypeName_EtInRing) );
55  ATH_CHECK( m_Tool_InformationStore->getInfo_String("FeatureExtractor_VarTypeName_varTypeName_Isolation", m_varTypeName_Isolation) );
56  ATH_CHECK( m_Tool_InformationStore->getInfo_String("FeatureExtractor_VarTypeName_varTypeName_Num", m_varTypeName_Num) );
57  ATH_CHECK( m_Tool_InformationStore->getInfo_String("FeatureExtractor_VarTypeName_varTypeName_Mean", m_varTypeName_Mean) );
58  ATH_CHECK( m_Tool_InformationStore->getInfo_String("FeatureExtractor_VarTypeName_varTypeName_StdDev", m_varTypeName_StdDev) );
59  ATH_CHECK( m_Tool_InformationStore->getInfo_String("FeatureExtractor_VarTypeName_varTypeName_HLV", m_varTypeName_HLV) );
60  ATH_CHECK( m_Tool_InformationStore->getInfo_String("FeatureExtractor_VarTypeName_varTypeName_Angle", m_varTypeName_Angle) );
61  ATH_CHECK( m_Tool_InformationStore->getInfo_String("FeatureExtractor_VarTypeName_varTypeName_DeltaR", m_varTypeName_DeltaR) );
62  ATH_CHECK( m_Tool_InformationStore->getInfo_String("FeatureExtractor_VarTypeName_varTypeName_JetMoment", m_varTypeName_JetMoment) );
63  ATH_CHECK( m_Tool_InformationStore->getInfo_String("FeatureExtractor_VarTypeName_varTypeName_Combined", m_varTypeName_Combined) );
64  ATH_CHECK( m_Tool_InformationStore->getInfo_String("FeatureExtractor_VarTypeName_varTypeName_JetShape", m_varTypeName_JetShape) );
65  ATH_CHECK( m_Tool_InformationStore->getInfo_String("FeatureExtractor_VarTypeName_varTypeName_ImpactParams", m_varTypeName_ImpactParams) );
66  ATH_CHECK( m_Tool_InformationStore->getInfo_String("FeatureExtractor_VarTypeName_varTypeName_Basic", m_varTypeName_Basic) );
67  ATH_CHECK( m_Tool_InformationStore->getInfo_String("FeatureExtractor_VarTypeName_varTypeName_PID", m_varTypeName_PID) );
68 
69  ATH_CHECK( m_Tool_InformationStore->getInfo_Int("FeatureExtractor_UseEmptySeeds", m_Config_UseEmptySeeds) );
70 
71  ATH_CHECK( m_Tool_InformationStore->getInfo_VecDouble("CellBased_BinEdges_Eta", m_Config_CellBased_BinEdges_Eta) );
72  ATH_CHECK( m_Tool_InformationStore->getInfo_VecDouble("CellBased_EtaBinned_Pi0MVACut_1prong", m_Config_CellBased_EtaBinned_Pi0MVACut_1prong) );
73  ATH_CHECK( m_Tool_InformationStore->getInfo_VecDouble("CellBased_EtaBinned_Pi0MVACut_3prong", m_Config_CellBased_EtaBinned_Pi0MVACut_3prong) );
74 
75  return StatusCode::SUCCESS;
76 }
77 
78 
79 void PanTau::Tool_FeatureExtractor::fillVariantsSeedEt(const std::vector<PanTau::TauConstituent*>& tauConstituents,
80  std::map<std::string, double>& variants_SeedEt) {
81 
82  //use different approaches to calculate total energy of seed:
83  variants_SeedEt["EtAllConsts"] = 0.0;
84  variants_SeedEt["EtNeutLowA"] = 0.0;
85  variants_SeedEt["EtNeutLowB"] = 0.0;
86 
87  //loop over all constituents in seed
88  for (unsigned int iConst = 0; iConst < tauConstituents.size(); iConst++) {
89 
90  //get current constituents
91  PanTau::TauConstituent* curConstituent = tauConstituents.at(iConst);
92  double curEt = curConstituent->p4().Et();
93 
94  //update the different Et definitions
95  if (curConstituent->isOfType(PanTau::TauConstituent::t_Charged)) {
96  variants_SeedEt["EtAllConsts"] += curEt;
97  variants_SeedEt["EtNeutLowA"] += curEt;
98  variants_SeedEt["EtNeutLowB"] += curEt;
99  }
100  if (curConstituent->isOfType(PanTau::TauConstituent::t_Neutral)) {
101  variants_SeedEt["EtAllConsts"] += curEt;
102  }
103  if (curConstituent->isOfType(PanTau::TauConstituent::t_NeutLowA)) {
104  variants_SeedEt["EtNeutLowA"] += curEt;
105  }
106  if (curConstituent->isOfType(PanTau::TauConstituent::t_NeutLowB)) {
107  variants_SeedEt["EtNeutLowB"] += curEt;
108  }
109 
110  }//end loop over constituents in seed
111 
112  }
113 
114 
116  const std::string& featName,
117  double numerator,
118  const std::map<std::string, double>& denominatorMap) {
119  std::map<std::string, double>::const_iterator it = denominatorMap.begin();
120  for(; it!=denominatorMap.end(); ++it) {
121  std::string FullName = featName + it->first;
122  float value = (float)it->second;
123  if(value <= 0. || std::isnan(value) || std::isinf(value) ) continue;
124  targetMap->addFeature(FullName, numerator / it->second);
125  }
126 }
127 
128 
130 
131  bool noAnyConstituents = inSeed->isOfTechnicalQuality(PanTau::PanTauSeed::t_NoConstituentsAtAll);
132  bool noSelConstituents = inSeed->isOfTechnicalQuality(PanTau::PanTauSeed::t_NoSelectedConstituents);
133  bool noValidInputTau = inSeed->isOfTechnicalQuality(PanTau::PanTauSeed::t_NoValidInputTau);
134  bool isBadSeed = (noAnyConstituents || noSelConstituents || noValidInputTau);
135  if(static_cast<bool>(m_Config_UseEmptySeeds)) isBadSeed = noValidInputTau;
136 
137  if (isBadSeed) {
138  ATH_MSG_DEBUG("Seed is not valid for feature extraction (no constituents or no valid input tau) - just fill isPanTauCandidate feature");
139  inSeed->getFeatures()->addFeature(inSeed->getNameInputAlgorithm() + "_" + m_varTypeName_Basic + "_isPanTauCandidate", 0);
140  return StatusCode::SUCCESS;
141  }
142  inSeed->getFeatures()->addFeature(inSeed->getNameInputAlgorithm() + "_" + m_varTypeName_Basic + "_isPanTauCandidate", 1);
143 
144 
145  ATH_CHECK( calculateBasicFeatures(inSeed) );
146 
147  ATH_CHECK( addConstituentMomenta(inSeed) );
148 
149  // map containing different methods to calc seed et
150  std::map<std::string, double> variants_SeedEt;
151  // calculate the Et variants for the seed
152  fillVariantsSeedEt(inSeed->getConstituentsAsList_All(), variants_SeedEt);
153 
154  //loop through all types of Constituents in tau and calculate type features for them
155  //baseline
156  ATH_CHECK( calculateFeatures(inSeed, PanTau::TauConstituent::t_NoType, variants_SeedEt) ); //=> all constituents
157  ATH_CHECK( calculateFeatures(inSeed, PanTau::TauConstituent::t_Charged, variants_SeedEt) ); //=> charged ones in core
158  ATH_CHECK( calculateFeatures(inSeed, PanTau::TauConstituent::t_Neutral, variants_SeedEt) ); //=> neutral ones in core
159  ATH_CHECK( calculateFeatures(inSeed, PanTau::TauConstituent::t_Pi0Neut, variants_SeedEt) ); //=> pi0 tagged ones in core
160  //for testing
161  ATH_CHECK( calculateFeatures(inSeed, PanTau::TauConstituent::t_NeutLowA, variants_SeedEt) ); //=> same as neutral but with lower Et
162  ATH_CHECK( calculateFeatures(inSeed, PanTau::TauConstituent::t_NeutLowB, variants_SeedEt) ); //=> same as neutral but with even lower et
163 
164  //fill the combined features
165  ATH_CHECK( addCombinedFeatures(inSeed, variants_SeedEt) );
166 
167  //fill the impact paramter features
168  ATH_CHECK( addImpactParameterFeatures(inSeed) );
169 
170  return StatusCode::SUCCESS;
171 }
172 
173 
175 
176  PanTau::TauFeature* featureMap = inSeed->getFeatures();
177 
178  std::string featureAlg = inSeed->getNameInputAlgorithm();
179  std::string featurePrefix = m_varTypeName_Basic;
180  std::string name = featureAlg + "_" + featurePrefix;
181 
182  double SumCharge = 0;
183  double AbsCharge = 0;
184 
188  for(int iType=0; iType<PanTau::TauConstituent::t_nTypes; iType++) {
189 
190  bool foundIt = false;
191  std::vector<TauConstituent*> curList = inSeed->getConstituentsOfType(iType, foundIt);
192  if(!foundIt) continue;
193 
194  //store multiplicity of current type
196  unsigned int nConstituents = curList.size();
197  featureMap->addFeature(name + "_N" + typeName + "Consts", nConstituents);
198 
199  //count charge, i.e. skip if not charged
200  if(iType != (int)PanTau::TauConstituent::t_Charged) continue;
201  for(unsigned int iConst=0; iConst<nConstituents; iConst++) {
202  PanTau::TauConstituent* curConstituent = curList[iConst];
203  SumCharge += curConstituent->getCharge();
204  AbsCharge += std::abs((double)curConstituent->getCharge());
205  }
206  }
207 
208  //store charge
209  featureMap->addFeature(name + "_SumCharge", SumCharge);
210  featureMap->addFeature(name + "_AbsCharge", AbsCharge);
211 
213  //all constituents
214  std::string typeNameAll = PanTau::TauConstituent::AllConstituentsName();
215  featureMap->addFeature(name + "_N" + typeNameAll + "Consts", inSeed->getConstituentsAsList_Core().size() + inSeed->getConstituentsAsList_Wide().size());
216 
218  //proto 4-vector (just the sum of all constituents)
219  // will have better four momentum after mode ID
220  TLorentzVector tlv_ProtoMomentumCore = inSeed->getProtoMomentumCore();
221  featureMap->addFeature(name + "_ProtoMomentumCore_pt", tlv_ProtoMomentumCore.Perp());
222  featureMap->addFeature(name + "_ProtoMomentumCore_eta", tlv_ProtoMomentumCore.Eta());
223  featureMap->addFeature(name + "_ProtoMomentumCore_phi", tlv_ProtoMomentumCore.Phi());
224  featureMap->addFeature(name + "_ProtoMomentumCore_m", tlv_ProtoMomentumCore.M());
225 
226  TLorentzVector tlv_ProtoMomentumWide = inSeed->getProtoMomentumWide();
227  featureMap->addFeature(name + "_ProtoMomentumWide_pt", tlv_ProtoMomentumWide.Perp());
228  featureMap->addFeature(name + "_ProtoMomentumWide_eta", tlv_ProtoMomentumWide.Eta());
229  featureMap->addFeature(name + "_ProtoMomentumWide_phi", tlv_ProtoMomentumWide.Phi());
230  featureMap->addFeature(name + "_ProtoMomentumWide_m", tlv_ProtoMomentumWide.M());
231 
232  return StatusCode::SUCCESS;
233 }
234 
235 
237  std::string inputAlgName = inSeed->getNameInputAlgorithm();
238  TauFeature* tauFeatureMap = inSeed->getFeatures();
239  std::string prefixVARType = m_varTypeName_HLV;
240  for(int iType=0; iType<(int)PanTau::TauConstituent::t_nTypes; iType++) {
241  bool isOK;
242  std::vector<PanTau::TauConstituent*> list_TypeConstituents = inSeed->getConstituentsOfType(iType, isOK); // list of constituents of current type
243  unsigned int n_Constituents_Type = list_TypeConstituents.size(); // number of objects of current type
244  TLorentzVector tlv_TypeConstituents = inSeed->getSubsystemHLV(iType, isOK); // summed hlv of objects of current type
245  std::string curTypeName = PanTau::TauConstituent::getTypeName((PanTau::TauConstituent::Type)iType);
246  std::string name = inputAlgName + "_" + curTypeName + "_" + prefixVARType;
247 
248  std::vector<PanTau::TauConstituent*> list_TypeConstituents_SortBDT = inSeed->getConstituentsOfType(iType, isOK);
249  std::sort(list_TypeConstituents_SortBDT.begin(), list_TypeConstituents_SortBDT.end(), sortTauConstituentMVA);
250 
251  if(!list_TypeConstituents.empty()) {
252  tauFeatureMap->addFeature(name + "_SumPt", tlv_TypeConstituents.Perp());
253  tauFeatureMap->addFeature(name + "_SumEta", tlv_TypeConstituents.Eta());
254  tauFeatureMap->addFeature(name + "_SumPhi", tlv_TypeConstituents.Phi());
255  tauFeatureMap->addFeature(name + "_SumM", tlv_TypeConstituents.M());
256  }
257 
258  //store 4-vectors of current type (et sort);
259  std::vector<double> curConsts_pt = std::vector<double>(0);
260  std::vector<double> curConsts_eta = std::vector<double>(0);
261  std::vector<double> curConsts_phi = std::vector<double>(0);
262  std::vector<double> curConsts_m = std::vector<double>(0);
263  for(unsigned int iConst=0; iConst<n_Constituents_Type; iConst++) {
264  TLorentzVector tlv_curConst = list_TypeConstituents[iConst]->p4();
265  curConsts_pt.push_back(tlv_curConst.Perp());
266  curConsts_eta.push_back(tlv_curConst.Eta());
267  curConsts_phi.push_back(tlv_curConst.Phi());
268  curConsts_m.push_back(tlv_curConst.M());
269  }
270  tauFeatureMap->addVecFeature(name + "_EtSort_Constituents_pt", curConsts_pt);
271  tauFeatureMap->addVecFeature(name + "_EtSort_Constituents_eta", curConsts_eta);
272  tauFeatureMap->addVecFeature(name + "_EtSort_Constituents_phi", curConsts_phi);
273  tauFeatureMap->addVecFeature(name + "_EtSort_Constituents_m", curConsts_m);
274 
275  //store 4-vectors of current type (bdt sort)
276  std::vector<double> curConstsBDT_pt = std::vector<double>(0);
277  std::vector<double> curConstsBDT_eta = std::vector<double>(0);
278  std::vector<double> curConstsBDT_phi = std::vector<double>(0);
279  std::vector<double> curConstsBDT_m = std::vector<double>(0);
280  for(unsigned int iConst=0; iConst<n_Constituents_Type; iConst++) {
281  TLorentzVector tlv_curConstBDT = list_TypeConstituents_SortBDT[iConst]->p4();
282  curConstsBDT_pt.push_back(tlv_curConstBDT.Perp());
283  curConstsBDT_eta.push_back(tlv_curConstBDT.Eta());
284  curConstsBDT_phi.push_back(tlv_curConstBDT.Phi());
285  curConstsBDT_m.push_back(tlv_curConstBDT.M());
286  }
287  tauFeatureMap->addVecFeature(name + "_BDTSort_Constituents_pt", curConstsBDT_pt);
288  tauFeatureMap->addVecFeature(name + "_BDTSort_Constituents_eta", curConstsBDT_eta);
289  tauFeatureMap->addVecFeature(name + "_BDTSort_Constituents_phi", curConstsBDT_phi);
290  tauFeatureMap->addVecFeature(name + "_BDTSort_Constituents_m", curConstsBDT_m);
291 
292  } //end loop over constituent types
293 
294  return StatusCode::SUCCESS;
295 }
296 
297 
299  int tauConstituentType,
300  const std::map<std::string, double>& variants_SeedEt) const {
301 
302  std::string curTypeName = PanTau::TauConstituent::getTypeName( (PanTau::TauConstituent::Type)tauConstituentType );
303  std::string curTypeName_All = PanTau::TauConstituent::AllConstituentsName();
304  PanTau::TauFeature* tauFeatureMap = inSeed->getFeatures();
305  std::string inputAlgName = inSeed->getNameInputAlgorithm();
306  TLorentzVector tlv_Reference = inSeed->getProtoMomentumCore();
307 
308  std::vector<PanTau::TauConstituent*> list_AllConstituents = inSeed->getConstituentsAsList_Core();
309 
310  bool foundIt = false;
311  std::vector<PanTau::TauConstituent*> list_TypeConstituents;
312  if (tauConstituentType != PanTau::TauConstituent::t_NoType) list_TypeConstituents = inSeed->getConstituentsOfType(tauConstituentType, foundIt);
313  if (tauConstituentType == PanTau::TauConstituent::t_NoType) list_TypeConstituents = list_AllConstituents;
314  if (!foundIt) return StatusCode::SUCCESS;
315 
316  unsigned int n_Constituents_All = list_AllConstituents.size();
317  unsigned int n_Constituents_Type = list_TypeConstituents.size();
318 
319  //sort the lists by Et
320  std::sort(list_AllConstituents.begin(), list_AllConstituents.end(), sortTauConstituentEt);
321  std::sort(list_TypeConstituents.begin(), list_TypeConstituents.end(), sortTauConstituentEt);
322 
323  TLorentzVector tlv_1st_Et;
324  TLorentzVector tlv_2nd_Et;
325  TLorentzVector tlv_3rd_Et;
326 
327  if(!list_TypeConstituents.empty()) tlv_1st_Et = list_TypeConstituents[0]->p4();
328  if(list_TypeConstituents.size() > 1) tlv_2nd_Et = list_TypeConstituents[1]->p4();
329  if(list_TypeConstituents.size() > 2) tlv_3rd_Et = list_TypeConstituents[2]->p4();
330 
331 
332  TLorentzVector tlv_Last_Et;
333  if(!list_TypeConstituents.empty()) tlv_Last_Et = list_TypeConstituents.back()->p4();
334 
335  //make an additional list of constituents, but now ordered by BDT value
336  std::vector<PanTau::TauConstituent*> list_TypeConstituents_SortBDT = list_TypeConstituents;
337  std::sort(list_TypeConstituents_SortBDT.begin(), list_TypeConstituents_SortBDT.end(), sortTauConstituentMVA);
338 
339  TLorentzVector tlv_1st_BDT;
340  TLorentzVector tlv_2nd_BDT;
341  TLorentzVector tlv_3rd_BDT;
342 
343  if(!list_TypeConstituents_SortBDT.empty()) tlv_1st_BDT = list_TypeConstituents_SortBDT[0]->p4();
344  if(list_TypeConstituents_SortBDT.size() > 1) tlv_2nd_BDT = list_TypeConstituents_SortBDT[1]->p4();
345  if(list_TypeConstituents_SortBDT.size() > 2) tlv_3rd_BDT = list_TypeConstituents_SortBDT[2]->p4();
346 
350 
351  // ===> hlv for the leading EFOs and the summed HLV
352  TLorentzVector tlv_TypeConstituents;
353  // ===> Sum of DeltaR to jet axis
354  double sum_DRToReference = 0;
355  double sum_DR2ToReference = 0;
356  double sum_DRToLeading = 0;
357  double sum_DR2ToLeading = 0;
358  // ===> Sum of Et, Et^2, E and E^2
359  double sum_Et = 0;
360  double sum_Et2 = 0;
361  double sum_E = 0;
362  double sum_E2 = 0;
363  // ===> Sum of Et (and E) times DeltaR, DeltaR', Angle
364  double sum_EtxDR = 0;
365  double sum_EtxDR2 = 0;
366  double sum_EtxDRprime = 0;
367  double sum_EtxAngle = 0;
368  // ===> Isolation rings
369  double sum_EtInRing00To01 = 0;
370  double sum_EtInRing01To02 = 0;
371  double sum_EtInRing02To03 = 0;
372  double sum_EtInRing03To04 = 0;
373  double sum_EtInRing04To05 = 0;
374  // ===> Multiplicities
375  unsigned int num_EFOs = 0;
376  unsigned int num_ConstsIn00To01 = 0;
377  unsigned int num_ConstsIn01To02 = 0;
378  unsigned int num_ConstsIn02To03 = 0;
379  unsigned int num_ConstsIn03To04 = 0;
380  // ===> Maximal values
381  double max_DeltaR = 0;
382 
383 
387  for(unsigned int iTypeConst=0; iTypeConst<list_TypeConstituents.size(); iTypeConst++) {
388 
389  //get hep lorentz vector
390  TLorentzVector tlv_curConst = list_TypeConstituents.at(iTypeConst)->p4();
391 
392  //final check (nan & inf)
393  if (std::isnan(tlv_curConst.Pt()) || std::isinf(tlv_curConst.Pt())) continue;
394 
395  //ready to calc stuff
396  //basically update each of the prepared sum_* and num_* variables above,
397  // the sum HLV and the pointers to 1st, 2nd, 3rd leading constituents of current type
398  tlv_TypeConstituents += tlv_curConst;
399 
400  //helpers to reduce function calls
401  double hlp_Et = tlv_curConst.Et();
402  double hlp_Et2 = hlp_Et * hlp_Et;
403  double hlp_E = tlv_curConst.E();
404  double hlp_E2 = hlp_E * hlp_E;
405  double hlp_DeltaR = tlv_Reference.DeltaR(tlv_curConst);
406  double hlp_DeltaR2 = hlp_DeltaR * hlp_DeltaR;
407  double hlp_DeltaRLeading = (tlv_1st_Et.Pt() == 0 ? 0 : tlv_1st_Et.DeltaR(tlv_curConst));
408  double hlp_DeltaR2Leading = hlp_DeltaRLeading * hlp_DeltaRLeading;
409  double hlp_DeltaRprime = m_HelperFunctions.deltaRprime(tlv_Reference.Vect(), tlv_curConst.Vect());
410  double hlp_Angle = tlv_Reference.Angle(tlv_curConst.Vect());
411 
412  // update sum of DeltaR to jet axis
413  sum_DRToReference += hlp_DeltaR;
414  sum_DR2ToReference += hlp_DeltaR2;
415  sum_DRToLeading += hlp_DeltaRLeading;
416  sum_DR2ToLeading += hlp_DeltaR2Leading;
417  // update Sum of Et, Et^2, E and E^2
418  sum_Et += hlp_Et;
419  sum_Et2 += hlp_Et2;
420  sum_E += hlp_E;
421  sum_E2 += hlp_E2;
422  // update Sum of Et (and E) times DeltaR, DeltaR', Angle
423  sum_EtxDR += hlp_Et * hlp_DeltaR;
424  sum_EtxDR2 += hlp_Et * hlp_DeltaR2;
425  sum_EtxDRprime += hlp_Et * hlp_DeltaRprime;
426  sum_EtxAngle += hlp_Et * hlp_Angle;
427  // update Isolation rings
428  if(hlp_DeltaR >= 0.0 && hlp_DeltaR < 0.1) sum_EtInRing00To01 += hlp_Et;
429  if(hlp_DeltaR >= 0.1 && hlp_DeltaR < 0.2) sum_EtInRing01To02 += hlp_Et;
430  if(hlp_DeltaR >= 0.2 && hlp_DeltaR < 0.3) sum_EtInRing02To03 += hlp_Et;
431  if(hlp_DeltaR >= 0.3 && hlp_DeltaR < 0.4) sum_EtInRing03To04 += hlp_Et;
432  if(hlp_DeltaR >= 0.4 && hlp_DeltaR < 0.5) sum_EtInRing04To05 += hlp_Et;
433  // update Multiplicities
434  num_EFOs++;
435  if(hlp_DeltaR >= 0.0 && hlp_DeltaR < 0.1) num_ConstsIn00To01++;
436  if(hlp_DeltaR >= 0.1 && hlp_DeltaR < 0.2) num_ConstsIn01To02++;
437  if(hlp_DeltaR >= 0.2 && hlp_DeltaR < 0.3) num_ConstsIn02To03++;
438  if(hlp_DeltaR >= 0.3 && hlp_DeltaR < 0.4) num_ConstsIn03To04++;
439  // update Max values
440  if(hlp_DeltaR > max_DeltaR) max_DeltaR = hlp_DeltaR;
441  }//end loop over selected EFOs
442 
443 
444 
448 
449  // naming string
450  std::string prefixVARType = "";
451 
453  //if there are no EFOs of this type in the seed, all other variables cannot be calculated to have any reasonable value
454  if( num_EFOs == 0 ) {
455  return StatusCode::SUCCESS;
456  }
457 
458  prefixVARType = m_varTypeName_Num;
459  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_ConstsIn00To01", num_ConstsIn00To01);
460  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_ConstsIn01To02", num_ConstsIn01To02);
461  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_ConstsIn02To03", num_ConstsIn02To03);
462  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_ConstsIn03To04", num_ConstsIn03To04);
463 
465  prefixVARType = m_varTypeName_PID;
466 
467  // Sorted by highest BDT score
468  double value_sumBDT_BDTSort = 0;
469  for(unsigned int iTypeConst=0; iTypeConst<n_Constituents_Type; iTypeConst++) {
470 
471  double value_BDT = list_TypeConstituents_SortBDT[iTypeConst]->getBDTValue();
472  if( std::isnan(value_BDT) || std::isinf(value_BDT) ) continue;
473 
474  //correct BDT value based on BDT cut
475  if(tauConstituentType != PanTau::TauConstituent::t_Charged) {
476  double mvaCorrection = 0.0;
477  double etaCurConst = list_TypeConstituents_SortBDT[iTypeConst]->p4().Eta();
478  int etaBinIndex = m_HelperFunctions.getBinIndex(m_Config_CellBased_BinEdges_Eta, std::abs(etaCurConst));
479  int numTrack = inSeed->getTauJet()->nTracks();
480  if(numTrack == 1) { mvaCorrection = m_Config_CellBased_EtaBinned_Pi0MVACut_1prong.at(etaBinIndex); }
481  else { mvaCorrection = m_Config_CellBased_EtaBinned_Pi0MVACut_3prong.at(etaBinIndex); }
482 
483  value_BDT = value_BDT - mvaCorrection;
484  }
485 
486  value_sumBDT_BDTSort += value_BDT;
487  std::string iConst = m_HelperFunctions.convertNumberToString((double)(iTypeConst+1));
488  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_BDTValues_BDTSort_" + iConst, value_BDT);
489  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_BDTValuesSum_BDTSort_" + iConst, value_sumBDT_BDTSort);
490  }
491 
492  //sorted by highest Et
493  double value_sumBDT_EtSort = 0;
494  for(unsigned int iTypeConst=0; iTypeConst<n_Constituents_Type; iTypeConst++) {
495 
496  double value_BDT = list_TypeConstituents[iTypeConst]->getBDTValue();
497  if( std::isnan(value_BDT) || std::isinf(value_BDT) ) continue;
498 
499  value_sumBDT_EtSort += value_BDT;
500  std::string iConst = m_HelperFunctions.convertNumberToString((double)(iTypeConst+1));
501  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_BDTValues_EtSort_" + iConst, value_BDT);
502  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_BDTValuesSum_EtSort_" + iConst, value_sumBDT_EtSort);
503  }
504 
505 
508  //only execute if the constituent type is neutral
509  if(PanTau::TauConstituent::isNeutralType(tauConstituentType)) {
510 
511  TLorentzVector totalTLV_SumShots = TLorentzVector(0., 0., 0., 0.);
512  unsigned int totalPhotonsInSeed = 0;
513  unsigned int totalShotsInSeed = 0;
514  double maxDeltaRSumShotToConst = -999;
515  double minDeltaRSumShotToConst = 999;
516  double maxDeltaRSumShotToTau = -999;
517  double minDeltaRSumShotToTau = 999;
518 
519  std::vector<TLorentzVector> allShotTLVs = std::vector<TLorentzVector>(0);
520 
521  for(unsigned int iConst=0; iConst<list_TypeConstituents_SortBDT.size(); iConst++) {
522 
523  PanTau::TauConstituent* curConst = list_TypeConstituents_SortBDT.at(iConst);
524  TLorentzVector tlv_CurConst = curConst->p4();
525  std::vector<PanTau::TauConstituent*> shotConstituents = curConst->getShots();
526  unsigned int nShots = shotConstituents.size();
527 
528  unsigned int totalPhotonsInNeutral = 0;
529  TLorentzVector tlv_SumShots = TLorentzVector(0., 0., 0., 0.);
530 
531  for(unsigned int iShot=0; iShot<nShots; iShot++) {
532  PanTau::TauConstituent* curShot = shotConstituents.at(iShot);
533  totalPhotonsInNeutral += curShot->getNPhotonsInShot();
534  tlv_SumShots += curShot->p4();
535  allShotTLVs.push_back(curShot->p4());
536  }//end loop over shots
537  totalShotsInSeed += nShots;
538  totalTLV_SumShots += tlv_SumShots;
539  totalPhotonsInSeed += totalPhotonsInNeutral;
540 
541  std::string iConstStr = m_HelperFunctions.convertNumberToString((double)(iConst+1));
542 
543  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_nPhotons_BDTSort_" + iConstStr, totalPhotonsInNeutral);
544  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_nShots_BDTSort_" + iConstStr, nShots);
545 
546  //the et/eta/phi/m of the hlv of all shots combined for this neutral-type constituent
547  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_SumShots_Et_BDTSort_" + iConstStr, tlv_SumShots.Et());
548  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_SumShots_Eta_BDTSort_" + iConstStr, tlv_SumShots.Eta());
549  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_SumShots_Phi_BDTSort_" + iConstStr, tlv_SumShots.Phi());
550  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_SumShots_M_BDTSort_" + iConstStr, tlv_SumShots.M());
551 
552  //energy ratio, deltaR of sumShots and constituent
553  double deltaRSumShotToConst = tlv_CurConst.DeltaR(tlv_SumShots);
554  if(deltaRSumShotToConst > maxDeltaRSumShotToConst) maxDeltaRSumShotToConst = deltaRSumShotToConst;
555  if(deltaRSumShotToConst < minDeltaRSumShotToConst) minDeltaRSumShotToConst = deltaRSumShotToConst;
556  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_ConstDeltaRToSumShots_BDTSort_" + iConstStr, deltaRSumShotToConst);
557  if(tlv_CurConst.Et() > 0.) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_EtSumShotsOverConstEt_BDTSort_" + iConstStr, tlv_SumShots.Et() / tlv_CurConst.Et());
558 
559  //energy ratio, deltaR of shots and tauSeed
560  double deltaRSumShotToTau = tlv_Reference.DeltaR(tlv_SumShots);
561  if(deltaRSumShotToTau > maxDeltaRSumShotToTau) maxDeltaRSumShotToTau = deltaRSumShotToTau;
562  if(deltaRSumShotToTau < minDeltaRSumShotToTau) minDeltaRSumShotToTau = deltaRSumShotToTau;
563  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_TauDeltaRToSumShots_BDTSort_" + iConstStr, deltaRSumShotToTau);
564  if(tlv_Reference.Et() > 0.) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_EtSumShotsOverTauEt_BDTSort_" + iConstStr, tlv_SumShots.Et() / tlv_Reference.Et());
565 
566  }//end loop over constituents in tau
567 
568  //delta R values
569  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_MaxDeltaRSumShotToConst", maxDeltaRSumShotToConst);
570  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_MinDeltaRSumShotToConst", minDeltaRSumShotToConst);
571  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_MaxDeltaRSumShotToTau", maxDeltaRSumShotToTau);
572  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_MinDeltaRSumShotToTau", minDeltaRSumShotToTau);
573  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_DeltaRAllShotsToTau", tlv_Reference.DeltaR(totalTLV_SumShots));
574 
575  //et ratio
576  if(tlv_Reference.Et() > 0.) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_EtAllShotsOverEtTau", totalTLV_SumShots.Et() / tlv_Reference.Et());
577 
578  //number of shots in seed
579  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_NShotsInSeed", totalShotsInSeed);
580  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_NPhotonsInSeed", totalPhotonsInSeed);
581 
582  //build di-Shot mass
583  double maxDiShotMass = -200;
584  double minDiShotMass = 99999;
585  double bestDiShotMass = -200;
586  double bestPi0Diff = 99999;
587  for(unsigned int iShot=0; iShot<allShotTLVs.size(); iShot++) {
588  TLorentzVector cur_iShot = allShotTLVs.at(iShot);
589 
590  for(unsigned int jShot=iShot+1; jShot<allShotTLVs.size(); jShot++) {
591  TLorentzVector cur_jShot = allShotTLVs.at(jShot);
592 
593  ATH_MSG_DEBUG("\t\tBuilding di-shot mass of shots " << iShot << " & " << jShot);
594  TLorentzVector tlv_DiShot = cur_iShot + cur_jShot;
595  double curDiShotMass = tlv_DiShot.M();
596  double curpi0Diff = std::abs(curDiShotMass - 134.98);
597  ATH_MSG_DEBUG("\t\tit is: " << curDiShotMass);
598  if(curpi0Diff < bestPi0Diff) bestDiShotMass = curDiShotMass;
599  if(curDiShotMass > maxDiShotMass) maxDiShotMass = curDiShotMass;
600  if(curDiShotMass < minDiShotMass) minDiShotMass = curDiShotMass;
601  }
602  }
603 
604  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_BestDiShotMass", bestDiShotMass);
605  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_MaxDiShotMass", maxDiShotMass);
606  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_MinDiShotMass", minDiShotMass);
607 
608  }//end if check for shot info dumping
609 
610 
612  prefixVARType = m_varTypeName_Ratio;
613 
614  if(curTypeName != curTypeName_All) addFeatureWrtSeedEnergy(tauFeatureMap, inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_EtOver", sum_Et, variants_SeedEt);
615 
616  if(tlv_1st_Et.Pt() != 0) addFeatureWrtSeedEnergy(tauFeatureMap, inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_1stEtOver", tlv_1st_Et.Et(), variants_SeedEt);
617  if(tlv_1st_BDT.Pt() != 0) addFeatureWrtSeedEnergy(tauFeatureMap, inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_1stBDTEtOver", tlv_1st_BDT.Et(), variants_SeedEt);
618 
619  if(tlv_Last_Et.Pt() != 0) addFeatureWrtSeedEnergy(tauFeatureMap, inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_SoftestEtOver", tlv_Last_Et.Et(), variants_SeedEt);
620 
621  if(tlv_1st_Et.Pt() != 0 && sum_Et > 0.) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_1stEtOverTypeEt", tlv_1st_Et.Et() / sum_Et);
622  if(tlv_1st_BDT.Pt() != 0 && sum_Et > 0.) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_1stBDTEtOverTypeEt", tlv_1st_BDT.Et() / sum_Et);
623 
624  if(n_Constituents_All != 0 && curTypeName != curTypeName_All) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_EFOsOverTotalEFOs", (double)(((double)num_EFOs) / ((double)n_Constituents_All)));
625  if(tlv_1st_Et.Pt() != 0 && tlv_2nd_Et.Pt() != 0) {
626  if(tlv_1st_Et.Et() > 0. && tlv_2nd_Et.Et() > 0. ) {
627  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_Log1stEtOver2ndEt", std::log10(tlv_1st_Et.Et() / tlv_2nd_Et.Et()));
628  }
629  }
630  if(tlv_1st_Et.Pt() != 0 && tlv_3rd_Et.Pt() != 0) {
631  if(tlv_1st_Et.Et() > 0. && tlv_3rd_Et.Et() > 0.) {
632  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_Log1stEtOver3rdEt", std::log10(tlv_1st_Et.Et() / tlv_3rd_Et.Et()));
633  }
634  }
635  if(tlv_2nd_Et.Pt() != 0 && tlv_3rd_Et.Pt() != 0) {
636  if(tlv_2nd_Et.Et() > 0. && tlv_3rd_Et.Et() > 0.) {
637  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_Log2ndEtOver3rdEt", std::log10(tlv_2nd_Et.Et() / tlv_3rd_Et.Et()));
638  }
639  }
640 
641  //and for the BDT score ordered EFOs
642  if(tlv_1st_BDT.Pt() != 0 && tlv_2nd_BDT.Pt() != 0) {
643  if(tlv_1st_BDT.Et() > 0. && tlv_2nd_BDT.Et() > 0. ) {
644  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_Log1stEtOver2ndEt_BDTSort", std::log10(tlv_1st_BDT.Et() / tlv_2nd_BDT.Et()));
645  }
646  }
647  if(tlv_1st_BDT.Pt() != 0 && tlv_3rd_BDT.Pt() != 0) {
648  if(tlv_1st_BDT.Et() > 0. && tlv_3rd_BDT.Et() > 0.) {
649  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_Log1stEtOver3rdEt_BDTSort", std::log10(tlv_1st_BDT.Et() / tlv_3rd_BDT.Et()));
650  }
651  }
652  if(tlv_2nd_BDT.Pt() != 0 && tlv_3rd_BDT.Pt() != 0) {
653  if(tlv_2nd_BDT.Et() > 0. && tlv_3rd_BDT.Et() > 0.) {
654  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_Log2ndEtOver3rdEt_BDTSort", std::log10(tlv_2nd_BDT.Et() / tlv_3rd_BDT.Et()));
655  }
656  }
657 
658 
660  if(curTypeName == curTypeName_All) {
661  prefixVARType = m_varTypeName_EtInRing;
662 
663  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_00To01", sum_EtInRing00To01);
664  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_01To02", sum_EtInRing01To02);
665  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_02To03", sum_EtInRing02To03);
666  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_03To04", sum_EtInRing03To04);
667  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_04To05", sum_EtInRing04To05);
668  }
669 
670 
672  if(curTypeName == curTypeName_All) {
673  prefixVARType = m_varTypeName_Isolation;
674 
675  double iso_EtIn01 = sum_EtInRing00To01;
676  double iso_EtIn02 = iso_EtIn01 + sum_EtInRing01To02;
677  double iso_EtIn03 = iso_EtIn02 + sum_EtInRing02To03;
678  double iso_EtIn04 = iso_EtIn03 + sum_EtInRing03To04;
679 
680  addFeatureWrtSeedEnergy(tauFeatureMap, inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_EtIn01Over", iso_EtIn01, variants_SeedEt);
681  addFeatureWrtSeedEnergy(tauFeatureMap, inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_EtIn02Over", iso_EtIn02, variants_SeedEt);
682  addFeatureWrtSeedEnergy(tauFeatureMap, inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_EtIn03Over", iso_EtIn03, variants_SeedEt);
683  addFeatureWrtSeedEnergy(tauFeatureMap, inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_EtIn04Over", iso_EtIn04, variants_SeedEt);
684 
685  addFeatureWrtSeedEnergy(tauFeatureMap, inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_EtIn00To02Over", (sum_EtInRing00To01 + sum_EtInRing01To02), variants_SeedEt);
686  addFeatureWrtSeedEnergy(tauFeatureMap, inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_EtIn02To04Over", (sum_EtInRing02To03 + sum_EtInRing03To04), variants_SeedEt);
687 
688  if(iso_EtIn02>0.) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_EtIn01OverEtIn02", iso_EtIn01 / iso_EtIn02);
689  if(iso_EtIn04>0.) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_EtIn01OverEtIn04", iso_EtIn01 / iso_EtIn04);
690  }
691 
692 
694  prefixVARType = m_varTypeName_Mean;
695 
696  if(num_EFOs > 0) {
697  addFeatureWrtSeedEnergy(tauFeatureMap, inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_Et_Wrt", (sum_Et / num_EFOs), variants_SeedEt);
698  addFeatureWrtSeedEnergy(tauFeatureMap, inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_DRToJetAxis_Wrt", (sum_DRToReference / num_EFOs), variants_SeedEt);
699  addFeatureWrtSeedEnergy(tauFeatureMap, inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_DRToLeading_Wrt", (sum_DRToLeading / num_EFOs), variants_SeedEt);
700  }
701 
702 
704  prefixVARType = m_varTypeName_StdDev;
705 
706  double stddev_E = m_HelperFunctions.stddev(sum_E2, sum_E, num_EFOs);
707  double stddev_Et = m_HelperFunctions.stddev(sum_Et2, sum_Et, num_EFOs);
708  double stddev_DRToJetAxis = m_HelperFunctions.stddev(sum_DR2ToReference, sum_DRToReference, num_EFOs);
709  double stddev_DRToLeading = m_HelperFunctions.stddev(sum_DRToLeading, sum_DR2ToLeading, num_EFOs);
710 
711  if(stddev_E > 0.) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_E", stddev_E);
712  if(stddev_Et > 0.) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_Et", stddev_Et);
713  if(stddev_Et > 0.) addFeatureWrtSeedEnergy(tauFeatureMap, inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_Et_Wrt", stddev_Et, variants_SeedEt);
714  if(stddev_DRToJetAxis > 0.) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_DRToJetAxis", stddev_DRToJetAxis);
715  if(stddev_DRToLeading > 0.) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_DRToLeading", stddev_DRToLeading);
716 
717 
719  prefixVARType = m_varTypeName_Angle;
720 
721  double angle_12 = 0;
722  double angle_13 = 0;
723  double angle_23 = 0;
724 
725  if(curTypeName != curTypeName_All) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_ToJetAxis", tlv_Reference.Angle(tlv_TypeConstituents.Vect()));
726  if(tlv_1st_Et.Pt() != 0) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_1stToJetAxis", tlv_Reference.Angle(tlv_1st_Et.Vect()));
727  if(tlv_2nd_Et.Pt() != 0) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_2ndToJetAxis", tlv_Reference.Angle(tlv_2nd_Et.Vect()));
728  if(tlv_3rd_Et.Pt() != 0) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_3rdToJetAxis", tlv_Reference.Angle(tlv_3rd_Et.Vect()));
729  if(tlv_1st_Et.Pt() != 0) {
730  if(tlv_2nd_Et.Pt() != 0) {
731  angle_12 = tlv_1st_Et.Angle(tlv_2nd_Et.Vect());
732  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_1stTo2nd", angle_12);
733  }
734  if(tlv_3rd_Et.Pt() != 0) {
735  angle_13 = tlv_1st_Et.Angle(tlv_3rd_Et.Vect());
736  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_1stTo3rd", angle_13);
737  }
738  }
739  if(tlv_2nd_Et.Pt() != 0 && tlv_3rd_Et.Pt() != 0) {
740  angle_23 = tlv_2nd_Et.Angle(tlv_3rd_Et.Vect());
741  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_2ndTo3rd", angle_23);
742  }
743  if(num_EFOs > 2 && tlv_1st_Et.Pt() != 0 && tlv_2nd_Et.Pt() != 0 && tlv_3rd_Et.Pt() != 0) {
744  double angle_Planes = ( tlv_1st_Et.Vect().Cross(tlv_2nd_Et.Vect()) ).Angle( tlv_1st_Et.Vect().Cross(tlv_3rd_Et.Vect()) );
745  double angle_max = 0;
746  if(angle_12 > angle_13) {
747  if(angle_12 > angle_23) angle_max = angle_12;
748  else angle_max =angle_23;
749  } else {
750  if(angle_13 > angle_23) angle_max =angle_13;
751  else angle_max =angle_23;
752  }
753  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_MaxToJetAxis", angle_max);
754  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_MeanValue123", (angle_12 + angle_13 + angle_23)/3.);
755  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_Btw1213Planes", angle_Planes);
756 
757  }
758 
759 
761  prefixVARType = m_varTypeName_DeltaR;
762 
763  if(curTypeName != curTypeName_All) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_ToJetAxis", tlv_Reference.DeltaR(tlv_TypeConstituents));
764  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_MaxToJetAxis_EtSort", max_DeltaR);
765  if(tlv_1st_Et.Pt() != 0) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_1stToJetAxis_EtSort", tlv_Reference.DeltaR(tlv_1st_Et));
766  if(tlv_2nd_Et.Pt() != 0) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_2ndToJetAxis_EtSort", tlv_Reference.DeltaR(tlv_2nd_Et));
767  if(tlv_3rd_Et.Pt() != 0) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_3rdToJetAxis_EtSort", tlv_Reference.DeltaR(tlv_3rd_Et));
768  if(tlv_1st_Et.Pt() != 0) {
769  if(tlv_2nd_Et.Pt() != 0) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_1stTo2nd_EtSort", tlv_1st_Et.DeltaR(tlv_2nd_Et));
770  if(tlv_3rd_Et.Pt() != 0) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_1stTo3rd_EtSort", tlv_1st_Et.DeltaR(tlv_3rd_Et));
771  }
772  if(tlv_2nd_Et.Pt() != 0 && tlv_3rd_Et.Pt() != 0) {
773  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_2ndTo3rd_EtSort", tlv_2nd_Et.DeltaR(tlv_3rd_Et));
774  }
775 
776  if(tlv_1st_BDT.Pt() != 0) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_1stToJetAxis_BDTSort", tlv_Reference.DeltaR(tlv_1st_BDT));
777  if(tlv_2nd_BDT.Pt() != 0) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_2ndToJetAxis_BDTSort", tlv_Reference.DeltaR(tlv_2nd_BDT));
778  if(tlv_3rd_BDT.Pt() != 0) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_3rdToJetAxis_BDTSort", tlv_Reference.DeltaR(tlv_3rd_BDT));
779  if(tlv_1st_BDT.Pt() != 0) {
780  if(tlv_2nd_BDT.Pt() != 0) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_1stTo2nd_BDTSort", tlv_1st_BDT.DeltaR(tlv_2nd_BDT));
781  if(tlv_3rd_BDT.Pt() != 0) tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_1stTo3rd_BDTSort", tlv_1st_BDT.DeltaR(tlv_3rd_BDT));
782  }
783  if(tlv_2nd_BDT.Pt() != 0 && tlv_3rd_BDT.Pt() != 0) {
784  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_2ndTo3rd_BDTSort", tlv_2nd_BDT.DeltaR(tlv_3rd_BDT));
785  }
786 
787 
789  // Moment wrt X = Sum( Et * X ) / Sum(Et)
790  // ==> Named as Eflow_EFOType_JetMoment_EtX" when using Et as weight
791  // ==> Named as Eflow_EFOType_JetMoment_EX" when using E as weight
792  prefixVARType = m_varTypeName_JetMoment;
793 
794  if(sum_Et > 0.) {
795  //Using transverse energy
796  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_EtDR", sum_EtxDR / sum_Et);
797  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_EtDRprime", sum_EtxDRprime / sum_Et);
798  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_EtDR2", sum_EtxDR2 / sum_Et);
799  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_EtAngle", sum_EtxAngle / sum_Et);
800  tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_EtDRxTotalEt", (sum_EtxDR / sum_Et) * variants_SeedEt.at("EtAllConsts"));
801  }
802 
803  return StatusCode::SUCCESS;
804 }
805 
806 
808  const std::map<std::string, double>& variants_SeedEt) const {
809 
810  // Prepare some short notations for variables
811  PanTau::TauFeature* tauFeatures = inSeed->getFeatures();
812  std::string inputAlgName = inSeed->getNameInputAlgorithm();
813 
814  //et: EFO Type
815  int et_Charged = PanTau::TauConstituent::t_Charged;
816  int et_Pi0Neut = PanTau::TauConstituent::t_Pi0Neut;
817  int et_Neutral = PanTau::TauConstituent::t_Neutral;
819 
820  bool foundIt;
821  std::vector<PanTau::TauConstituent*> list_NeutralConstituents = inSeed->getConstituentsOfType(et_Neutral, foundIt);
822 
823  // Prepare the list of names for EFO Types &
824  // the 4 momenta of the different sub systems
825  // (ie. charged, neutral subsystem, etc...)
826  std::string name_EFOType[PanTau::TauConstituent::t_nTypes];
827  double num_EFOs[PanTau::TauConstituent::t_nTypes];
828  TLorentzVector tlv_System[PanTau::TauConstituent::t_nTypes];
829  TLorentzVector tlv_1stEFO[PanTau::TauConstituent::t_nTypes];
830  TLorentzVector tlv_2ndEFO[PanTau::TauConstituent::t_nTypes];
831 
832  // get input objects to calc combined features
833  bool tlv_Sys_OK[PanTau::TauConstituent::t_nTypes];
834  bool tlv_1st_OK[PanTau::TauConstituent::t_nTypes];
835  bool tlv_2nd_OK[PanTau::TauConstituent::t_nTypes];
836 
837  //initialize arrays with default values
838  for(unsigned int iType=0; iType<(unsigned int)PanTau::TauConstituent::t_nTypes; iType++) {
839  name_EFOType[iType] = "";
840  num_EFOs[iType] = 0.;
841  tlv_System[iType] = TLorentzVector();
842  tlv_1stEFO[iType] = TLorentzVector();
843  tlv_2ndEFO[iType] = TLorentzVector();
844  tlv_Sys_OK[iType] = false;
845  tlv_1st_OK[iType] = false;
846  tlv_2nd_OK[iType] = false;
847  }
848 
849  for(int iType=0; iType<(int)PanTau::TauConstituent::t_nTypes; iType++) {
851 
852  tlv_System[iType] = inSeed->getSubsystemHLV(iType, tlv_Sys_OK[iType]);
853  if (!tlv_Sys_OK[iType]) continue;
854 
855  std::vector<TauConstituent*> typeConstituents = inSeed->getConstituentsOfType(iType, tlv_Sys_OK[iType]);
856  if (typeConstituents.empty()) tlv_Sys_OK[iType] = false;
857  if (!tlv_Sys_OK[iType]) continue;
858 
859  num_EFOs[iType] = typeConstituents.size();
860 
861  if (!typeConstituents.empty()) {
862  tlv_1stEFO[iType] = typeConstituents.at(0)->p4();
863  tlv_1st_OK[iType] = true;
864  } else {
865  tlv_1st_OK[iType] = false;
866  }
867 
868  if (typeConstituents.size() > 1) {
869  tlv_2ndEFO[iType] = typeConstituents.at(1)->p4();
870  tlv_2nd_OK[iType] = true;
871  } else {
872  tlv_2nd_OK[iType] = false;
873  }
874 
875  }
876 
877  // From the extracted input, calc combined features
878  std::string prefixVARType = m_varTypeName_Combined;
879 
880  // Combined-Single Features
881  // Ratios of numbers (heavily spiked, just keep them for validation)
882  if(tlv_Sys_OK[et_Charged] && tlv_Sys_OK[et_Neutral] && num_EFOs[et_Neutral] > 0.) {
883  tauFeatures->addFeature(inputAlgName + "_" + prefixVARType + "_NumChargedOverNumNeutral", num_EFOs[et_Charged] / num_EFOs[et_Neutral]);
884  }
885  if(tlv_Sys_OK[et_Charged] && tlv_Sys_OK[et_All] && num_EFOs[et_All] > 0.) {
886  tauFeatures->addFeature(inputAlgName + "_" + prefixVARType + "_NumChargedOverNumTotal", num_EFOs[et_Charged] / num_EFOs[et_All]);
887  }
888 
889  if(num_EFOs[et_Charged]>0. && num_EFOs[et_Neutral]>1.) {
890  if(tlv_1st_OK[et_Charged] && tlv_1st_OK[et_Neutral] && tlv_2nd_OK[et_Neutral]) {
891  TVector3 axis_Plane_cn1 = (tlv_1stEFO[et_Charged].Vect()).Cross( tlv_1stEFO[et_Neutral].Vect() );
892  TVector3 axis_Plane_cn2 = (tlv_1stEFO[et_Charged].Vect()).Cross( tlv_2ndEFO[et_Neutral].Vect() );
893  tauFeatures->addFeature(inputAlgName + "_" + prefixVARType + "_AnglePlane1stCharged1st2ndNeutral", axis_Plane_cn1.Angle(axis_Plane_cn2));
894  }
895  }
896 
897  PanTau::TauConstituent* tauConst_NeutralLargestAngle = PanTau::HelperFunctions::getNeutralConstWithLargestAngle(tlv_System[et_Charged],
898  list_NeutralConstituents);
899  if(tauConst_NeutralLargestAngle != nullptr) {
900  TLorentzVector tlv_NeutralLargestAngle = tauConst_NeutralLargestAngle->p4();
901 
902  tauFeatures->addFeature(inputAlgName + "_" + prefixVARType + "_FarthestNeutral_AngleToCharged", tlv_System[et_Charged].Angle(tlv_NeutralLargestAngle.Vect()) );
903  tauFeatures->addFeature(inputAlgName + "_" + prefixVARType + "_FarthestNeutral_BDTScore", tauConst_NeutralLargestAngle->getBDTValue());
904  if(tlv_System[et_Charged].Et() > 0) tauFeatures->addFeature(inputAlgName + "_" + prefixVARType + "_FarthestNeutral_EtOverChargedEt", tlv_NeutralLargestAngle.Et() / tlv_System[et_Charged].Et());
905  }
906 
907  // Combined Type-vs-Type Features
908  // Loop over all EFO types...
909  // for every type, loop over all other types (but neglect permutations, i.e. A,B is the same as B,A)
910  // calculate ratios, angles etc...
911 
912  for(int iType=0; iType<PanTau::TauConstituent::t_nTypes; iType++) {
913 
914  if(iType == (int)PanTau::TauConstituent::t_NoType) continue;
915  int type_Denom = iType;
916 
917  for(int jType=0; jType<PanTau::TauConstituent::t_nTypes; jType++) {
918 
919  if(jType == (int)PanTau::TauConstituent::t_NoType) continue;
920  int type_Nom = jType;
921 
922  if(jType == iType) continue;
923 
924  std::string typeName_Nom = PanTau::TauConstituent::getTypeName((PanTau::TauConstituent::Type)type_Nom);
925  std::string typeName_Denom = PanTau::TauConstituent::getTypeName((PanTau::TauConstituent::Type)type_Denom);
926 
927  double sum_Et_Nom = 0.0;
928  double sum_Et_Denom = 0.0;
929  if(tlv_Sys_OK[type_Nom] && tlv_Sys_OK[type_Denom]) {
930  sum_Et_Nom = tlv_System[type_Nom].Et();
931  sum_Et_Denom = tlv_System[type_Denom].Et();
932  }
933 
934  // Fraction of leading EFO of system A wrt complete system B
935  // this is not symmetric wrt system A and B, hence do this for all combinations
936  if(tlv_1st_OK[type_Nom]) {
937  if(tlv_1stEFO[type_Nom].Et() > 0. && sum_Et_Denom > 0.) {
938  tauFeatures->addFeature(inputAlgName + "_" + prefixVARType + "_Log1st" + typeName_Nom + "EtOver" + typeName_Denom + "Et", std::log10(tlv_1stEFO[type_Nom].Et() / sum_Et_Denom) );
939  }
940  }
941 
942  //following features symmetric in system A-B, hence skip multi calculation
943  if(jType <= iType) continue;
944 
945  //Energy ratios between systems
946  if(sum_Et_Denom > 0. && sum_Et_Nom > 0.) {
947  tauFeatures->addFeature(inputAlgName + "_" + prefixVARType + "_Log" + typeName_Nom + "EtOver" + typeName_Denom + "Et", std::log10(sum_Et_Nom / sum_Et_Denom) );
948  }//end check for div by zero
949 
950  //Angles between systems
951  if(tlv_Sys_OK[type_Nom] && tlv_Sys_OK[type_Denom]) {
952  tauFeatures->addFeature(inputAlgName + "_" + prefixVARType + "_Angle" + typeName_Nom + "To" + typeName_Denom, tlv_System[type_Nom].Angle( tlv_System[type_Denom].Vect()) );
953  }//end check for valid system pointer
954 
955  if(tlv_1st_OK[type_Nom] && tlv_1st_OK[type_Denom]) {
956  //Delta R between 1st and 1st EFO
957  tauFeatures->addFeature(inputAlgName + "_" + prefixVARType + "_DeltaR1st" + typeName_Nom + "To1st" + typeName_Denom, tlv_1stEFO[type_Nom].DeltaR( tlv_1stEFO[type_Denom] ) );
958 
959  //Angles between 1st and 1st EFO
960  tauFeatures->addFeature(inputAlgName + "_" + prefixVARType + "_Angle1st" + typeName_Nom + "To1st" + typeName_Denom, tlv_1stEFO[type_Nom].Angle( tlv_1stEFO[type_Denom].Vect() ) );
961  } //end check for valid leading efo
962 
963  }//end loop over system B
964  }//end loop over system A
965 
966 
967  // Combined Selected-Type Features
968 
969  //setup arrays for combination of selected charged and neutral combinations
970  const int cTypes = 1;
971  const int nTypes = 2;
972  int index_charged[cTypes] = {et_Charged};
973  int index_neutral[nTypes] = {et_Pi0Neut, et_Neutral};
974 
975  for(int cType=0; cType<cTypes; cType++) {
976  for(int nType=0; nType<nTypes; nType++) {
977 
978  int et_c = index_charged[cType];
979  int et_n = index_neutral[nType];
980 
983 
984  if(!tlv_Sys_OK[et_c] || !tlv_Sys_OK[et_n]) continue;
985 
986  //mean Et fraction of charged+neutral system wrt total ET
987  if(num_EFOs[et_c] + num_EFOs[et_n] > 0.) {
988  double mean_cTypenTypeEt = ( tlv_System[et_c].Et() + tlv_System[et_n].Et() ) / (num_EFOs[et_c] + num_EFOs[et_n]);
989  addFeatureWrtSeedEnergy(tauFeatures, inputAlgName + "_" + prefixVARType + "_Mean" + name_cType + name_nType + "Et_Wrt", mean_cTypenTypeEt, variants_SeedEt);
990  }
991 
992  //invariant masses
993  tauFeatures->addFeature(inputAlgName + "_" + prefixVARType + "_InvMass" + name_cType + name_nType, ( tlv_System[et_c] + tlv_System[et_n] ).M() );
994 
995  //angle 1st charged to second neutral
996  if(tlv_2nd_OK[et_n]) {
997  //Angles between 1st and 2nd EFO
998  tauFeatures->addFeature(inputAlgName + "_" + prefixVARType + "_Angle1st2nd" + name_cType + name_nType, tlv_1stEFO[et_c].Angle( tlv_2ndEFO[et_n].Vect()) );
999  } //end check for valid 2nd EFOs
1000 
1001  }//end loop neutral types
1002  }//end loop charged types
1003 
1004  return StatusCode::SUCCESS;
1005 }
1006 
1007 
1009 
1010  const xAOD::TauJet* tauJet = inSeed->getTauJet();
1011 
1012  const xAOD::Vertex* vtx_TauJet = tauJet->vertex();
1013  if(!vtx_TauJet) {
1014  ATH_MSG_DEBUG("Vertex of taujet points to 0! Not extracting impact parameters");
1015  return StatusCode::SUCCESS;
1016  }
1017 
1018  PanTau::TauFeature* tauFeatures = inSeed->getFeatures();
1019  std::string inputAlgName = inSeed->getNameInputAlgorithm();
1020  std::string featureNamePrefix = m_varTypeName_ImpactParams;
1021  std::vector<double> impactParameters(0);
1022  std::vector<double> impactParameterSignf(0);
1023 
1024  // get a list of tracks from the inputseed
1025  // NOTE: if we ever have more than one charged type, may want to generalize this part to automagically get IPs from all tracks
1026  bool foundIt;
1027  std::vector<PanTau::TauConstituent*> list_ChargedConsts = inSeed->getConstituentsOfType(PanTau::TauConstituent::t_Charged, foundIt);
1028  if (!foundIt || list_ChargedConsts.empty()) return StatusCode::SUCCESS;
1029  std::sort(list_ChargedConsts.begin(), list_ChargedConsts.end(), sortTauConstituentEt);
1030 
1031  std::vector<const xAOD::TrackParticle*> list_Tracks;
1032  for(unsigned int iChrg=0; iChrg<list_ChargedConsts.size(); iChrg++) list_Tracks.push_back( list_ChargedConsts[iChrg]->getPFO()->track(0) );
1033 
1034  // calculate the transverse impact parameter for the 4 highest momentum tracks
1035  for(unsigned int iTrk=0; iTrk<list_Tracks.size(); iTrk++) {
1036  const xAOD::TrackParticle* curTrack = list_Tracks[iTrk];
1037 
1038  double errD02 = curTrack->definingParametersCovMatrix()(0, 0);
1039  double signfD0 = -999.;
1040  if(errD02 > 0) signfD0 = curTrack->d0() / sqrtf( errD02 );
1041 
1042  double errZ02 = curTrack->definingParametersCovMatrix()(1, 1);
1043  double signfZ0 = -999.;
1044  if(errZ02 > 0) signfZ0 = curTrack->z0() / sqrtf( errZ02 );
1045 
1046  // add to features
1047  if (iTrk < 4) {
1048  std::string indexTrk = m_HelperFunctions.convertNumberToString(iTrk+1);
1049  tauFeatures->addFeature(inputAlgName + "_" + featureNamePrefix + "_TransIPTrack" + indexTrk + "_SortByEt", curTrack->d0() );
1050  tauFeatures->addFeature(inputAlgName + "_" + featureNamePrefix + "_LongIPTrack" + indexTrk + "_SortByEt", curTrack->z0() );
1051 
1052  if (!std::isnan(signfD0)) tauFeatures->addFeature(inputAlgName + "_" + featureNamePrefix + "_TransSignfIPTrack" + indexTrk + "_SortByEt", signfD0);
1053  if (!std::isnan(signfZ0)) tauFeatures->addFeature(inputAlgName + "_" + featureNamePrefix + "_LongSignfIPTrack" + indexTrk + "_SortByEt", signfZ0);
1054 
1055  impactParameters.push_back(std::abs(curTrack->d0()));
1056  impactParameterSignf.push_back(std::abs(signfD0));
1057  }
1058 
1059  }//end loop over tracks
1060 
1061  //sort impact parameters and also store sorted by value
1062  std::sort( impactParameters.begin(), impactParameters.end(), std::greater<double>() );
1063  std::sort( impactParameterSignf.begin(), impactParameterSignf.end(), std::greater<double>() );
1064 
1065  for(unsigned int iIP=0; iIP<impactParameters.size(); iIP++) {
1066  std::string curNum = m_HelperFunctions.convertNumberToString(iIP+1);
1067  tauFeatures->addFeature(inputAlgName + "_" + featureNamePrefix + "_TransIP" + curNum + "_SortByValue", impactParameters[iIP] );
1068  tauFeatures->addFeature(inputAlgName + "_" + featureNamePrefix + "_TransSignfIP" + curNum + "_SortByValue", impactParameterSignf[iIP] );
1069  }
1070 
1071  return StatusCode::SUCCESS;
1072 }
PanTau::Tool_FeatureExtractor::addCombinedFeatures
StatusCode addCombinedFeatures(PanTau::PanTauSeed *inSeed, const std::map< std::string, double > &variants_SeedEt) const
Definition: Tool_FeatureExtractor.cxx:807
PanTauSeed.h
DiTauMassTools::Angle
double Angle(const TLorentzVector &vec1, const TLorentzVector &vec2)
Definition: PhysicsAnalysis/TauID/DiTauMassTools/Root/HelperFunctions.cxx:46
PanTau::Tool_FeatureExtractor::calculateBasicFeatures
StatusCode calculateBasicFeatures(PanTau::PanTauSeed *inSeed) const
Definition: Tool_FeatureExtractor.cxx:174
PanTau::Tool_FeatureExtractor::fillVariantsSeedEt
static void fillVariantsSeedEt(const std::vector< PanTau::TauConstituent * > &tauConstituents, std::map< std::string, double > &variants_SeedEt)
Definition: Tool_FeatureExtractor.cxx:79
PanTau::PanTauSeed::getProtoMomentumWide
TLorentzVector getProtoMomentumWide() const
Definition: PanTauSeed.h:232
PanTau::TauConstituent::t_Neutral
@ t_Neutral
Definition: TauConstituent.h:45
PanTau::TauConstituent::Type
Type
Type enumeration to specify type of this tau constituent.
Definition: TauConstituent.h:42
PanTau::PanTauSeed::getFeatures
const PanTau::TauFeature * getFeatures() const
Definition: PanTauSeed.h:230
PanTau::PanTauSeed::getTauJet
const xAOD::TauJet * getTauJet() const
Definition: PanTauSeed.h:228
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
PanTau::PanTauSeed::getSubsystemHLV
TLorentzVector getSubsystemHLV(int tauConstituent_Type, bool &foundit)
Definition: PanTauSeed.cxx:379
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
PanTau::TauConstituent::t_Charged
@ t_Charged
Definition: TauConstituent.h:44
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
PanTau::PanTauSeed::getNameInputAlgorithm
std::string getNameInputAlgorithm() const
Definition: PanTauSeed.h:227
PanTau::PanTauSeed::getConstituentsOfType
std::vector< PanTau::TauConstituent * > getConstituentsOfType(int tauConstituent_Type, bool &foundit)
Definition: PanTauSeed.cxx:358
met::DeltaR
@ DeltaR
Definition: METRecoCommon.h:11
PanTau::PanTauSeed::t_NoValidInputTau
@ t_NoValidInputTau
Definition: PanTauSeed.h:34
HelperFunctions.h
xAOD::TauJet_v3::nTracks
size_t nTracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const
Definition: TauJet_v3.cxx:526
skel.it
it
Definition: skel.GENtoEVGEN.py:423
PanTau::Tool_FeatureExtractor::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: Tool_FeatureExtractor.cxx:44
asg
Definition: DataHandleTestTool.h:28
PanTau::TauFeature::addFeature
bool addFeature(const std::string &name, const double value)
adds a new feature
Definition: TauFeature.cxx:44
PanTau::TauConstituent::p4
virtual FourMom_t p4() const
The full 4-momentum of the particle as a TLorentzVector.
Definition: TauConstituent.cxx:100
xAOD::TrackParticle_v1::z0
float z0() const
Returns the parameter.
PanTau::TauConstituent::getNPhotonsInShot
int getNPhotonsInShot() const
Definition: TauConstituent.cxx:276
athena.value
value
Definition: athena.py:122
PanTau::Tool_FeatureExtractor::Tool_FeatureExtractor
Tool_FeatureExtractor(const std::string &name)
Definition: Tool_FeatureExtractor.cxx:34
PanTau::Tool_FeatureExtractor::addFeatureWrtSeedEnergy
static void addFeatureWrtSeedEnergy(PanTau::TauFeature *targetMap, const std::string &featName, double numerator, const std::map< std::string, double > &denominatorMap)
Definition: Tool_FeatureExtractor.cxx:115
PanTau::TauFeature
Definition: TauFeature.h:19
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:83
TauConstituent.h
xAOD::TrackParticle_v1::d0
float d0() const
Returns the parameter.
PanTau::TauConstituent::getBDTValue
double getBDTValue() const
Definition: TauConstituent.cxx:227
PanTau::PanTauSeed::getConstituentsAsList_Core
std::vector< PanTau::TauConstituent * > getConstituentsAsList_Core() const
Definition: PanTauSeed.h:235
PanTau::Tool_FeatureExtractor::m_Tool_InformationStore
ToolHandle< PanTau::ITool_InformationStore > m_Tool_InformationStore
Definition: Tool_FeatureExtractor.h:46
PanTau::TauConstituent::isNeutralType
static bool isNeutralType(int tauConstituentType)
Definition: TauConstituent.cxx:173
PanTau::TauConstituent::AllConstituentsName
static std::string AllConstituentsName()
Definition: TauConstituent.h:56
PanTau::TauConstituent::getTypeName
std::vector< std::string > getTypeName() const
Definition: TauConstituent.cxx:204
PanTau::HelperFunctions::getNeutralConstWithLargestAngle
static TauConstituent * getNeutralConstWithLargestAngle(const TLorentzVector &charged, const std::vector< PanTau::TauConstituent * > &neutral)
Definition: Reconstruction/PanTau/PanTauAlgs/Root/HelperFunctions.cxx:16
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
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
PanTau::PanTauSeed::getConstituentsAsList_All
std::vector< PanTau::TauConstituent * > getConstituentsAsList_All() const
Definition: PanTauSeed.h:237
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
PanTau::Tool_FeatureExtractor::varTypeName_Shots
static const std::string varTypeName_Shots()
Definition: Tool_FeatureExtractor.h:102
Vertex.h
Tool_FeatureExtractor.h
PanTau::Tool_FeatureExtractor::calculateFeatures
StatusCode calculateFeatures(PanTau::PanTauSeed *inSeed, int tauConstituentType, const std::map< std::string, double > &variants_SeedEt) const
Definition: Tool_FeatureExtractor.cxx:298
WriteCellNoiseToCool.FullName
FullName
Definition: WriteCellNoiseToCool.py:514
xAOD::TrackParticle_v1::definingParametersCovMatrix
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
Definition: TrackParticle_v1.cxx:246
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
PanTau::HelperFunctions::bindToolHandle
static StatusCode bindToolHandle(ToolHandle< T > &, std::string)
Definition: Reconstruction/PanTau/PanTauAlgs/PanTauAlgs/HelperFunctions.h:64
PanTau::PanTauSeed::t_NoConstituentsAtAll
@ t_NoConstituentsAtAll
Definition: PanTauSeed.h:35
PanTau::TauConstituent::isOfType
bool isOfType(TauConstituent::Type aType) const
Definition: TauConstituent.cxx:237
PanTau::TauConstituent::t_Pi0Neut
@ t_Pi0Neut
Definition: TauConstituent.h:46
TrackParticle.h
python.PyAthena.v
v
Definition: PyAthena.py:157
PanTau::TauFeature::addVecFeature
bool addVecFeature(const std::string &name, const std::vector< double > &value)
adds a new vector feature
Definition: TauFeature.cxx:57
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
Tool_InformationStore.h
xAOD::TauJet_v3::vertex
const Vertex * vertex() const
PanTau::Tool_FeatureExtractor::execute
virtual StatusCode execute(PanTau::PanTauSeed *inSeed) const override
Definition: Tool_FeatureExtractor.cxx:129
sortTauConstituentEt
bool sortTauConstituentEt(const PanTau::TauConstituent *u, const PanTau::TauConstituent *v)
Definition: Tool_FeatureExtractor.cxx:29
PanTau::PanTauSeed::isOfTechnicalQuality
bool isOfTechnicalQuality(int pantauSeed_TechnicalQuality) const
Definition: PanTauSeed.cxx:349
PanTau::PanTauSeed::getConstituentsAsList_Wide
std::vector< PanTau::TauConstituent * > getConstituentsAsList_Wide() const
Definition: PanTauSeed.h:236
PanTau::TauConstituent::t_NoType
@ t_NoType
Definition: TauConstituent.h:43
sortTauConstituentMVA
bool sortTauConstituentMVA(const PanTau::TauConstituent *u, const PanTau::TauConstituent *v)
Definition: Tool_FeatureExtractor.cxx:24
TauJet.h
PanTau::PanTauSeed::t_NoSelectedConstituents
@ t_NoSelectedConstituents
Definition: PanTauSeed.h:36
PanTau::TauConstituent::t_NeutLowB
@ t_NeutLowB
Definition: TauConstituent.h:50
PanTau::Tool_FeatureExtractor::addConstituentMomenta
StatusCode addConstituentMomenta(PanTau::PanTauSeed *inSeed) const
Definition: Tool_FeatureExtractor.cxx:236
ReadCalibFromCool.typeName
typeName
Definition: ReadCalibFromCool.py:477
PanTau::PanTauSeed::getProtoMomentumCore
TLorentzVector getProtoMomentumCore() const
Definition: PanTauSeed.h:233
PanTau::TauConstituent::t_NeutLowA
@ t_NeutLowA
Definition: TauConstituent.h:49
TauFeature.h
PanTau::TauConstituent::t_nTypes
@ t_nTypes
Definition: TauConstituent.h:51
PanTau::TauConstituent
Definition: TauConstituent.h:25
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
PanTau::Tool_FeatureExtractor::m_Tool_InformationStoreName
std::string m_Tool_InformationStoreName
Definition: Tool_FeatureExtractor.h:47
PanTau::Tool_FeatureExtractor::addImpactParameterFeatures
StatusCode addImpactParameterFeatures(PanTau::PanTauSeed *inSeed) const
Definition: Tool_FeatureExtractor.cxx:1008
PanTau::TauConstituent::getCharge
int getCharge() const
Definition: TauConstituent.cxx:246
PanTau::TauConstituent::getShots
std::vector< TauConstituent * > getShots() const
Definition: TauConstituent.cxx:261
readCCLHist.float
float
Definition: readCCLHist.py:83
PanTau::PanTauSeed
Definition: PanTauSeed.h:24