|
ATLAS Offline Software
|
#include <JetObjectCollectionMaker.h>
|
| JetObjectCollectionMaker (const std::string &name) |
|
virtual | ~JetObjectCollectionMaker () |
|
| JetObjectCollectionMaker (const JetObjectCollectionMaker &rhs)=delete |
|
| JetObjectCollectionMaker (JetObjectCollectionMaker &&rhs)=delete |
|
JetObjectCollectionMaker & | operator= (const JetObjectCollectionMaker &rhs)=delete |
|
StatusCode | initialize () |
| Dummy implementation of the initialisation function. More...
|
|
StatusCode | executeJets (bool) |
|
StatusCode | executeLargeRJets (bool) |
|
StatusCode | executeTrackJets (bool) |
|
StatusCode | printoutJets () |
|
StatusCode | printoutLargeRJets () |
|
virtual const std::list< CP::SystematicSet > & | specifiedSystematics () const |
|
virtual const std::list< CP::SystematicSet > & | specifiedSystematicsLargeR () const |
|
const std::list< CP::SystematicSet > & | recommendedSystematics () const |
|
virtual void | print () const |
| Print the state of the tool. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
virtual std::string | getLargeRModName (const std::string &NPModel) const |
|
virtual void | addSystematics (const std::set< std::string > &specifiedSystematics, const CP::SystematicSet &recommendedSysts, std::unordered_map< CP::SystematicSet, CP::SystematicSet > &map, const std::string &modName, bool isLargeR=false, bool onlyJER=false, bool isPseudoData=false) |
|
StatusCode | execute (const bool isLargeR, bool executeNominal) |
|
StatusCode | calibrate (const bool isLargeR) |
|
virtual StatusCode | applySystematic (ToolHandle< ICPJetUncertaintiesTool > &tool, const std::unordered_map< CP::SystematicSet, CP::SystematicSet > &map, bool isLargeR=false) |
|
virtual StatusCode | applyTaggingSFSystematic () |
|
StatusCode | printout (const bool isLargeR) |
|
void | renounceArray (SG::VarHandleKeyArray &handlesArray) |
| remove all handles from I/O resolution More...
|
|
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > | renounce (T &h) |
|
void | extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps) |
| Add StoreName to extra input/output deps as needed. More...
|
|
Definition at line 61 of file JetObjectCollectionMaker.h.
◆ Itr
◆ StoreGateSvc_t
◆ systMap
◆ JetObjectCollectionMaker() [1/3]
top::JetObjectCollectionMaker::JetObjectCollectionMaker |
( |
const std::string & |
name | ) |
|
|
explicit |
◆ ~JetObjectCollectionMaker()
virtual top::JetObjectCollectionMaker::~JetObjectCollectionMaker |
( |
| ) |
|
|
inlinevirtual |
◆ JetObjectCollectionMaker() [2/3]
◆ JetObjectCollectionMaker() [3/3]
◆ addSystematics()
– Get the recommended systematics from the tool, in std::vector format –///
Definition at line 819 of file JetObjectCollectionMaker.cxx.
827 if (isPseudoData &&
m_config->isSystNominal(
m_config->systematics()))
return;
833 if (
s.size() != 1)
continue;
838 if (onlyJER &&
ss->name().find(
"JER") == std::string::npos)
continue;
849 map.insert(std::make_pair(modSet,
s));
853 if (!
filter.filterTree(modSet.name())) {
856 map.insert(std::make_pair(modSet,
s));
◆ applySystematic()
– Get calibrated jets –///
– Loop over the systematics –///
– Don't do the nominal, we've already done that –///
– Grab systematic name, check if systematic is JMR-type –///
– Tell the tool which systematic to use –/// – Here we use the second, original CP::SystematicSet –///
– Shallow copy of the xAOD –///
– Update JVT –///
– Apply Corrrection –///
– Decorate fJVT for systematics too –///
– set links to original objects- needed for MET calculation –///
– Save corrected xAOD Container to StoreGate / TStore –/// – Here we use the first, AnalysisTop modified CP::SystematicSer –/// – This allows us to run multiple JES scenarios, which all have the same hash values –///
Definition at line 627 of file JetObjectCollectionMaker.cxx.
636 const std::string msg_jet_collection = isLargeR ?
"large-R jets" :
"small-R jets";
647 for (
Itr syst = map.begin(); syst != map.end(); ++syst) {
655 std::string systname = itr->name();
656 if (systname.find(
"JMR") != std::string::npos) isJMR =
true;
662 "Failed to applySystematicVariation for " + msg_jet_collection);
665 "Failed to applySystematicVariation (JMR) for " + msg_jet_collection);
670 for (std::pair<
const std::string, ToolHandle<ICPJetUncertaintiesTool> >& tagSF :
m_tagSFuncertTool) {
671 top::check(tagSF.second->applySystematicVariation((*syst).second),
672 "Failed to applySystematicVariation for " + msg_jet_collection);
677 std::pair< xAOD::JetContainer*, xAOD::ShallowAuxContainer* >
682 for (std::pair<
const std::string, ToolHandle<ICPJetUncertaintiesTool> >& tagSF :
m_tagSFuncertTool) {
683 top::check(tagSF.second->applyContainerCorrection(*shallow_xaod_copy.first),
684 "Failed to apply large-R jet tagging SF uncertainties");
691 top::check(
tool->applyContainerCorrection(*shallow_xaod_copy.first),
692 "Failed to apply JES/JER uncertainties for " + msg_jet_collection);
695 "Failed to JMR uncertainties for " + msg_jet_collection);
701 "Failed to recalculate JVT scores");
707 if (!isLargeR && (
m_config->doForwardJVTinMET() ||
m_config->getfJVTWP() !=
"None")) {
708 static bool checked_track_MET =
false;
709 if (!checked_track_MET) {
710 if (
evtStore()->contains<xAOD::MissingETContainer>(
"MET_Track")) {
713 ATH_MSG_ERROR(
" Cannot retrieve MET_Track, fJVT values can't be calculated correctly!!");
714 return StatusCode::FAILURE;
716 checked_track_MET =
true;
723 "Failed to apply fJVT decoration");
728 *shallow_xaod_copy.first);
729 if (!setLinks)
ATH_MSG_ERROR(
" Cannot set original object links"
730 " for jets, MET recalculation may struggle");
735 std::string outputSGKey;
737 outputSGKey =
m_config->sgKeyLargeRJets((*syst).first.hash());
739 outputSGKey =
m_config->sgKeyJetsStandAlone((*syst).first.hash());
741 std::string outputSGKeyAux = outputSGKey +
"Aux.";
744 StatusCode saveAux =
evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
745 if (!
save || !saveAux) {
746 return StatusCode::FAILURE;
750 return StatusCode::SUCCESS;
◆ applyTaggingSFSystematic()
StatusCode top::JetObjectCollectionMaker::applyTaggingSFSystematic |
( |
| ) |
|
|
protectedvirtual |
– Get calibrated jets –///
Definition at line 569 of file JetObjectCollectionMaker.cxx.
575 const size_t njets = ljets->size();
577 const std::unordered_map<std::string,std::string>& sfNames =
m_config->boostedTaggerSFnames();
580 ToolHandle<ICPJetUncertaintiesTool>&
tool =
it.second;
583 const std::string sfNameNominal = sfNames.at(
fullName);
586 std::string taggerName = sfNameNominal;
587 taggerName.erase(taggerName.length()-3);
595 std::pair< xAOD::JetContainer*, xAOD::ShallowAuxContainer* >
597 auto shallowJets = std::make_pair(std::unique_ptr<xAOD::JetContainer>{shallow_xaod_copy.first},
598 std::unique_ptr<xAOD::ShallowAuxContainer>{shallow_xaod_copy.second});
600 top::check(
tool->applySystematicVariation(
sys),
"Failed to applySystematicVariation");
602 const std::string sfNameShifted =
fullName +
"_" +
sys.name();
604 top::check(
tool->applyContainerCorrection(*shallow_xaod_copy.first),
605 "Failed to apply large-R jet SF uncertainties in nominal TTree");
607 for(
size_t i = 0;
i < njets;
i++) {
608 xAOD::Jet* shallowJet = shallowJets.first->at(
i);
611 float sf = accSF.isAvailable(*shallowJet) ? accSF(*shallowJet) : -999.;
612 jet->auxdecor<
float>(sfNameShifted.c_str()) =
sf;
615 if (
sys.name().find(
"TagEffUnc") != std::string::npos) {
616 if (accEff.isAvailable(*shallowJet)) {
617 jet->auxdecor<
float>(
fullName +
"_" +
sys.name() +
"_efficiency") = accEff(*shallowJet);
624 return StatusCode::SUCCESS;
◆ calibrate()
StatusCode top::JetObjectCollectionMaker::calibrate |
( |
const bool |
isLargeR | ) |
|
|
protected |
– Get base jets from xAOD –///
– Shallow copy of the xAOD –///
– Apply calibration –/// – Calibrate jet container –///
– Truth labeling required by the large-R jet uncertainties –///
– Loop over the xAOD Container –///
– small-R jets used in most analyses –///
– Calibrate jet –///
– for TA mass or calo mass, the calibrated mass or pt needs special treatment –///
– Update JVT –///
– Update fJVT –///
– Save calibrated jet to TStore –/// – set links to original objects- needed for MET calculation –///
– Save corrected xAOD Container to StoreGate / TStore –///
Definition at line 408 of file JetObjectCollectionMaker.cxx.
410 std::string sgKey = isLargeR ?
m_config->sgKeyLargeRJets() :
m_config->sgKeyJets();
422 "Failed to do applyCalibration on large-R jets");
429 "Failed to do applyCalibration on small-R jets");
433 for (
const auto jet : *(shallow_xaod_copy.first)) {
439 if (JSF != 1.0 || bJSF != 1.0) {
441 if (
jet->isAvailable<
int>(
"PartonTruthLabelID")) {
442 jet->getAttribute(
"PartonTruthLabelID", truthflav);
446 if (truthflav == 5) jet_p4 = jet_p4 * bJSF;
448 jet->setJetP4(jet_p4);
463 float tau3 =
jet->getAttribute<
float>(
"Tau3_wta");
464 float tau2 =
jet->getAttribute<
float>(
"Tau2_wta");
465 float tau1 =
jet->getAttribute<
float>(
"Tau1_wta");
466 float ECF1 =
jet->getAttribute<
float>(
"ECF1");
467 float ECF2 =
jet->getAttribute<
float>(
"ECF2");
468 float ECF3 =
jet->getAttribute<
float>(
"ECF3");
470 jet->auxdecor<
float>(
"Tau32_wta") = fabs(tau2) > 1.e-6 ? (tau3 / tau2) : -999;
472 jet->auxdecor<
float>(
"Tau21_wta") = fabs(tau1) > 1.e-6 ? (tau2 / tau1) : -999;
475 jet->auxdecor<
float>(
"D2") = (ECF2 > 1
e-8) ? (ECF3*ECF1*ECF1*ECF1) / (ECF2*ECF2*ECF2) : -999;
476 jet->auxdecor<
float>(
"C2") = (ECF2 > 1
e-8) ? (ECF3*ECF1) / (ECF2*ECF2) : -999;
477 jet->auxdecor<
float>(
"E3") = (ECF1 > 1
e-8) ? ECF3 / (ECF1*ECF1*ECF1) : -999;
481 const std::string calibChoice =
m_config->largeRJESJMSConfig();
483 if (calibChoice ==
"TAMass") {
486 jet->setJetP4(jet_calib_p4);
489 if (calibChoice ==
"CaloMass") {
492 jet->setJetP4(jetInsituP4_calo);
493 }
else if (calibChoice ==
"TAMass") {
496 jet->setJetP4(jetInsituP4_ta);
506 "Failed to recalculate JVT scores");
512 if (!isLargeR && (
m_config->doForwardJVTinMET() ||
m_config->getfJVTWP() !=
"None")) {
513 static bool checked_track_MET =
false;
514 if (!checked_track_MET) {
515 if (
evtStore()->contains<xAOD::MissingETContainer>(
"MET_Track")) {
518 ATH_MSG_ERROR(
" Cannot retrieve MET_Track, fJVT values can't be calculated correctly!!");
519 return StatusCode::FAILURE;
521 checked_track_MET =
true;
528 "Failed to apply fJVT decoration");
539 "Failed to retrieve uncalibrated Jets for METMaker!");
540 if (!xaod_original || !shallow_xaod_copy.first) {
541 ATH_MSG_ERROR(
"Cannot retrieve the original jet collection!");
542 return StatusCode::FAILURE;
545 if (!setLinks)
ATH_MSG_ERROR(
" Cannot set original object links for jets, MET recalculation may struggle");
549 std::string outputSGKey;
557 std::string outputSGKeyAux = outputSGKey +
"Aux.";
560 StatusCode saveAux =
evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
561 if (!
save || !saveAux) {
562 return StatusCode::FAILURE;
565 return StatusCode::SUCCESS;
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ decorateBJets()
StatusCode top::JetObjectCollectionMaker::decorateBJets |
( |
xAOD::Jet & |
jet | ) |
|
|
private |
Definition at line 903 of file JetObjectCollectionMaker.cxx.
906 static const std::string labelB =
"PartonTruthLabelID";
910 isbjet(
jet) = (
jet.pt() > 15000. && truth_label(
jet) == 5);
912 return StatusCode::SUCCESS;
◆ decorateDL1()
StatusCode top::JetObjectCollectionMaker::decorateDL1 |
( |
bool |
trackJets = false | ) |
|
|
private |
Definition at line 990 of file JetObjectCollectionMaker.cxx.
997 "Failed to retrieve track jet collection" +
m_config->sgKeyTrackJets());
1001 "Failed to retrieve small-R jet collection" +
m_config->sgKeyJets());
1004 for (
const auto *
jet : *
jets) {
1006 const std::unordered_map<std::string, ToolHandle<IBTaggingSelectionTool>>& btagDecorTools \
1008 for (std::pair<std::string, ToolHandle<IBTaggingSelectionTool>> algo : btagDecorTools) {
1009 double DL1_weight = -999.;
1010 double dl1_pb = -10.;
1011 double dl1_pc = -10.;
1012 double dl1_pu = -10.;
1013 double dl1_ptau = 0.;
1016 std::string taggerName = algo.first;
1017 if(taggerName ==
"GN2v00LegacyWP" || taggerName ==
"GN2v00NewAliasWP"){
1018 taggerName =
"GN2v00";
1025 if (!algo.second->getTaggerWeight(dl1_pb, dl1_pc, dl1_pu, DL1_weight, dl1_ptau)) {
1031 DLx.at(algo.first)(*jet) = DL1_weight;
1035 return StatusCode::SUCCESS;
◆ decorateHSJets()
StatusCode top::JetObjectCollectionMaker::decorateHSJets |
( |
| ) |
|
|
private |
Definition at line 915 of file JetObjectCollectionMaker.cxx.
924 "Failed to retrieve small-R jet collection" +
m_config->sgKeyJets());
931 " - this is needed to define HS jets for application of JVT");
933 for (
const auto *
jet : *
jets) {
935 for (
const auto *tjet : *truthJets) {
936 if (tjet->p4().DeltaR(
jet->p4()) < 0.3 && tjet->pt() > 10
e3) ishs =
true;
941 return StatusCode::SUCCESS;
◆ decorateMatchedTruth()
StatusCode top::JetObjectCollectionMaker::decorateMatchedTruth |
( |
| ) |
|
|
private |
Definition at line 944 of file JetObjectCollectionMaker.cxx.
951 "Failed to retrieve small-R jet collection" +
m_config->sgKeyJets());
956 const xAOD::Jet* matchedTruthJet =
nullptr;
959 for (
const auto *
jet : *
jets) {
961 for (
const auto *iTruthJet : *truthJets) {
962 TLorentzVector truthJetTLV;
963 truthJetTLV.SetPtEtaPhiE(iTruthJet->pt(),iTruthJet->eta(),iTruthJet->phi(),iTruthJet->e());
966 if(!matchedTruthJet) {
967 matchedTruthJet = iTruthJet;
969 const double newdR =
jet->p4().DeltaR(iTruthJet->p4());
972 matchedTruthJet = iTruthJet;
977 matchedPt(*
jet) = -9999;
980 if (!matchedTruthJet) {
981 matchedPt(*
jet) = -9999;
984 matchedPt(*
jet) = matchedTruthJet->
pt();
987 return StatusCode::SUCCESS;
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode top::JetObjectCollectionMaker::execute |
( |
const bool |
isLargeR, |
|
|
bool |
executeNominal |
|
) |
| |
|
protected |
– Run nominal first, if executing nominal
– First calibrate the nominal jets, everything else comes from this, so let's only do it once not 3000 times
– Return after calibrating the nominal –///
– Systematics from here –///
– JES, JER regular atk4 for now –///
– JES –///
Definition at line 342 of file JetObjectCollectionMaker.cxx.
344 if (executeNominal) {
349 "Failed to decorate jets with truth info of which are HS - this is needed for JVT scale-factors!");
365 return StatusCode::SUCCESS;
398 true),
"Failed to apply large-R syst.");
401 true),
"Failed to apply large-R pseudodata JER.");
405 return StatusCode::SUCCESS;
◆ executeJets()
StatusCode top::JetObjectCollectionMaker::executeJets |
( |
bool |
executeNominal | ) |
|
◆ executeLargeRJets()
StatusCode top::JetObjectCollectionMaker::executeLargeRJets |
( |
bool |
executeNominal | ) |
|
◆ executeTrackJets()
StatusCode top::JetObjectCollectionMaker::executeTrackJets |
( |
bool |
executeNominal | ) |
|
– No calibrations or systematics yet –/// – Only run this on the nominal execution –///
– Just make a shallow copy to keep these in line with everything else –///
– Shallow copy of the xAOD –///
– set links to original objects –///
– Save corrected xAOD Container to StoreGate / TStore –///
Definition at line 753 of file JetObjectCollectionMaker.cxx.
756 if (!executeNominal)
return StatusCode::SUCCESS;
771 if (!setLinks)
ATH_MSG_ERROR(
" Cannot set original object links for track jets");
774 std::string outputSGKey =
m_config->sgKeyTrackJets(
m_config->nominalHashValue());
775 std::string outputSGKeyAux = outputSGKey +
"Aux.";
778 StatusCode saveAux =
evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
779 if (!
save || !saveAux) {
780 return StatusCode::FAILURE;
782 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ getKey()
Get the (hashed) key of an object that is in the event store.
This is a bit of a special one. StoreGateSvc
and xAOD::TEvent
both provide ways for getting the SG::sgkey_t
key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
- See also
- asg::AsgTool::getName
- Parameters
-
ptr | The bare pointer to the object that the event store should know about |
- Returns
- The hashed key of the object in the store. If not found, an invalid (zero) key.
Definition at line 119 of file AsgTool.cxx.
121 #ifdef XAOD_STANDALONE
124 return evtStore()->event()->getKey( ptr );
127 return (
proxy ==
nullptr ? 0 :
proxy->sgkey() );
128 #endif // XAOD_STANDALONE
◆ getLargeRModName()
std::string top::JetObjectCollectionMaker::getLargeRModName |
( |
const std::string & |
NPModel | ) |
const |
|
protectedvirtual |
◆ getName()
const std::string & asg::AsgTool::getName |
( |
const void * |
ptr | ) |
const |
|
inherited |
Get the name of an object that is / should be in the event store.
This is a bit of a special one. StoreGateSvc
and xAOD::TEvent
both provide ways for getting the std::string
name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.
In order to allow tools to efficiently perform this operation, they can use this helper function.
- See also
- asg::AsgTool::getKey
- Parameters
-
ptr | The bare pointer to the object that the event store should know about |
- Returns
- The string name of the object in the store. If not found, an empty string.
Definition at line 106 of file AsgTool.cxx.
108 #ifdef XAOD_STANDALONE
111 return evtStore()->event()->getName( ptr );
114 static const std::string
dummy =
"";
116 #endif // XAOD_STANDALONE
◆ getProperty()
template<class T >
const T* asg::AsgTool::getProperty |
( |
const std::string & |
name | ) |
const |
|
inherited |
Get one of the tool's properties.
◆ initialize()
StatusCode top::JetObjectCollectionMaker::initialize |
( |
| ) |
|
|
virtual |
Dummy implementation of the initialisation function.
It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...
– Lets do the nominal systematics –/// – JetObjectCollectionMaker is a little different from the others –///
– Small-R JER (Pseudo-)Data Smearing Config –///
– Large-R JER (Pseudo-)Data Smearing Config –///
– JES systematics –///
– Large-R JES/JER/JMS/JMR systematics –///
– Large R jet tagger scale factor uncertainties – ///
– Large R jet substructure –///
– Large R jet truth labeling –///
– DL1 Decoration –///
Reimplemented from asg::AsgTool.
Definition at line 88 of file JetObjectCollectionMaker.cxx.
89 ATH_MSG_INFO(
" top::JetObjectCollectionMaker initialize");
102 "Failed to retrieve JetCalibrationToolLargeR");
119 if (
m_config->jetJERSmearingModel() ==
"Full_PseudoData" ||
124 if (!
m_config->isMC() && (
m_config->largeRJetUncertainties_NPModel()).find(
"_SimpleJER_") == std::string::npos)
127 if (
m_config->isMC() &&
m_config->doLargeRPseudodataJER() && (
m_config->largeRJetUncertainties_NPModel()).find(
"_SimpleJER_") == std::string::npos)
144 "Failed to retrieve JetUncertaintiesToolReducedNPScenario1");
147 "Failed to retrieve JetUncertaintiesToolReducedNPScenario2");
150 "Failed to retrieve JetUncertaintiesToolReducedNPScenario3");
153 "Failed to retrieve JetUncertaintiesToolReducedNPScenario4");
167 const std:: string& syststr =
m_config->systematics();
168 std::set<std::string> syst, systLargeR;
172 bool ok =
m_config->getSystematicsList(syststr, syst);
173 bool okLargeR =
m_config->getSystematicsList(syststr, systLargeR);
176 if (!ok || !okLargeR) {
177 ATH_MSG_ERROR(
" top::JetObjectCollectionMaker could not determine systematic list");
178 return StatusCode::FAILURE;
182 if (
m_config->contains(syst,
"AllJets")) {
186 if (
m_config->contains(syst,
"AllSmallRJets")) {
189 if (
m_config->contains(systLargeR,
"AllLargeRJets")) {
196 std::string allNP(
""),
197 np1(
"SR_Scenario1_"), np2(
"SR_Scenario2_"), np3(
"SR_Scenario3_"), np4(
"SR_Scenario4_");
230 ATH_MSG_WARNING(
"No Large-R jet systematic recommendations are available yet! Large-R jet systematics skipped!");
239 for (
const auto&
name :
m_config->boostedTaggerSFnames()) {
240 ToolHandle<ICPJetUncertaintiesTool> tmp_SF_uncert_tool(
"JetSFuncert_" +
name.first);
241 if (tmp_SF_uncert_tool.retrieve()) {
245 const CP::SystematicSet& recommendedSys = tmp_SF_uncert_tool->recommendedSystematics();
251 bool res = ((
sys.name().find(
"TopTag") == std::string::npos) &&
252 (
sys.name().find(
"WTag") == std::string::npos) &&
253 (
sys.name().find(
"ZTag") == std::string::npos) &&
254 (
sys.name().find(
"JetTag") == std::string::npos) &&
255 (
sys.name().find(
"bTag") == std::string::npos));
263 largeRsysts.
insert(correlatedSys);
274 std::string allNPlargeR(
"");
304 for (
const auto& algo :
m_config->bTagAlgos()) {
306 top::check(
m_btagSelToolsDL1Decor[algo.first].retrieve(),
"Failed to retrieve " + algo.first +
" btagging selector for " +
m_config->sgKeyJets() +
". This is required for b-tagging score decorations in EventSaver!");
311 for (
const auto& algo :
m_config->bTagAlgos_trkJet()) {
321 for (
const std::pair<std::string, std::string>&
name :
m_config->boostedJetTaggers()) {
327 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ msg() [1/2]
◆ msg() [2/2]
◆ msg_level_name()
const std::string & asg::AsgTool::msg_level_name |
( |
| ) |
const |
|
inherited |
A deprecated function for getting the message level's name.
Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:
MSG::name( msg().level() )
This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.
- Returns
- The string name of the current minimum message level that's printed
Definition at line 101 of file AsgTool.cxx.
◆ msgLvl()
◆ operator=()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ print()
void asg::AsgTool::print |
( |
| ) |
const |
|
virtualinherited |
Print the state of the tool.
Implements asg::IAsgTool.
Reimplemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, top::TopObjectSelection, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
Definition at line 131 of file AsgTool.cxx.
◆ printout()
StatusCode top::JetObjectCollectionMaker::printout |
( |
const bool |
isLargeR | ) |
|
|
protected |
– Loop over all systematics –///
Definition at line 797 of file JetObjectCollectionMaker.cxx.
800 std::string sgKey = isLargeR ?
m_config->sgKeyLargeRJets() :
m_config->sgKeyJets();
806 for (
auto x : *xaod) {
811 return StatusCode::SUCCESS;
◆ printoutJets()
StatusCode top::JetObjectCollectionMaker::printoutJets |
( |
| ) |
|
◆ printoutLargeRJets()
StatusCode top::JetObjectCollectionMaker::printoutLargeRJets |
( |
| ) |
|
◆ recommendedSystematics()
◆ renounce()
◆ renounceArray()
◆ specifiedSystematics()
◆ specifiedSystematicsLargeR()
virtual const std::list<CP::SystematicSet>& top::JetObjectCollectionMaker::specifiedSystematicsLargeR |
( |
| ) |
const |
|
inlinevirtual |
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ tagLargeRJets()
Definition at line 884 of file JetObjectCollectionMaker.cxx.
886 for (
const std::pair<std::string, std::string>&
name :
m_config->boostedJetTaggers()) {
893 if (validPtRangeLowDec(*
jet) && validPtRangeHighDec(*
jet) && validEtaRangeDec(*
jet)) {
894 passedRangeCheckDec(*
jet) = 1;
896 passedRangeCheckDec(*
jet) = 0;
900 return StatusCode::SUCCESS;
◆ tagNominalLargeRJets()
StatusCode top::JetObjectCollectionMaker::tagNominalLargeRJets |
( |
| ) |
|
|
private |
◆ updateVHKA()
◆ DLx
◆ m_boostedJetTaggers
std::unordered_map<std::string, ToolHandle<IJetDecorator> > top::JetObjectCollectionMaker::m_boostedJetTaggers |
|
private |
◆ m_btagSelToolsDL1Decor
std::unordered_map<std::string, ToolHandle<IBTaggingSelectionTool> > top::JetObjectCollectionMaker::m_btagSelToolsDL1Decor |
|
private |
◆ m_btagSelToolsDL1Decor_trkJet
std::unordered_map<std::string, ToolHandle<IBTaggingSelectionTool> > top::JetObjectCollectionMaker::m_btagSelToolsDL1Decor_trkJet |
|
private |
◆ m_config
std::shared_ptr<top::TopConfig> top::JetObjectCollectionMaker::m_config |
|
private |
◆ m_detStore
◆ m_do_fjvt
bool top::JetObjectCollectionMaker::m_do_fjvt = false |
|
private |
◆ m_doFull_JER
bool top::JetObjectCollectionMaker::m_doFull_JER |
|
private |
◆ m_doFull_JER_largeR
bool top::JetObjectCollectionMaker::m_doFull_JER_largeR |
|
private |
◆ m_doFull_JER_largeR_Pseudodata
bool top::JetObjectCollectionMaker::m_doFull_JER_largeR_Pseudodata |
|
private |
◆ m_doFull_JER_Pseudodata
bool top::JetObjectCollectionMaker::m_doFull_JER_Pseudodata |
|
private |
◆ m_doMultipleJES
bool top::JetObjectCollectionMaker::m_doMultipleJES |
|
private |
◆ m_evtStore
◆ m_FFJetSmearingTool
◆ m_isMC
bool top::JetObjectCollectionMaker::m_isMC |
|
private |
◆ m_jetCalibrationTool
◆ m_jetCalibrationToolLargeR
◆ m_jetJvtEfficiencyTool
◆ m_jetSelectfJvtTool
ToolHandle<IJetModifier> top::JetObjectCollectionMaker::m_jetSelectfJvtTool |
|
private |
◆ m_jetSubstructure
◆ m_jetTruthLabelingTool
◆ m_jetUncertaintiesTool
◆ m_jetUncertaintiesToolLargeR
◆ m_jetUncertaintiesToolLargeRPseudoData
◆ m_jetUncertaintiesToolPseudoData
◆ m_jetUncertaintiesToolReducedNPScenario1
◆ m_jetUncertaintiesToolReducedNPScenario2
◆ m_jetUncertaintiesToolReducedNPScenario3
◆ m_jetUncertaintiesToolReducedNPScenario4
◆ m_jetUpdateJvtTool
ToolHandle<IJetUpdateJvt> top::JetObjectCollectionMaker::m_jetUpdateJvtTool |
|
private |
◆ m_nominalSystematicSet
◆ m_recommendedSystematics
◆ m_specifiedSystematics
◆ m_specifiedSystematicsLargeR
std::list<CP::SystematicSet> top::JetObjectCollectionMaker::m_specifiedSystematicsLargeR |
|
private |
◆ m_specifiedSystematicsTrackJets
std::list<CP::SystematicSet> top::JetObjectCollectionMaker::m_specifiedSystematicsTrackJets |
|
private |
◆ m_systMap_AllNP
systMap top::JetObjectCollectionMaker::m_systMap_AllNP |
|
private |
◆ m_systMap_JERPseudo
systMap top::JetObjectCollectionMaker::m_systMap_JERPseudo |
|
private |
◆ m_systMap_LargeR
systMap top::JetObjectCollectionMaker::m_systMap_LargeR |
|
private |
◆ m_systMap_LargeR_JERPseudo
systMap top::JetObjectCollectionMaker::m_systMap_LargeR_JERPseudo |
|
private |
◆ m_systMap_ReducedNPScenario1
systMap top::JetObjectCollectionMaker::m_systMap_ReducedNPScenario1 |
|
private |
◆ m_systMap_ReducedNPScenario2
systMap top::JetObjectCollectionMaker::m_systMap_ReducedNPScenario2 |
|
private |
◆ m_systMap_ReducedNPScenario3
systMap top::JetObjectCollectionMaker::m_systMap_ReducedNPScenario3 |
|
private |
◆ m_systMap_ReducedNPScenario4
systMap top::JetObjectCollectionMaker::m_systMap_ReducedNPScenario4 |
|
private |
◆ m_tagSFSysNames
std::unordered_map<std::string, std::vector<std::string> > top::JetObjectCollectionMaker::m_tagSFSysNames |
|
private |
◆ m_tagSFuncertTool
std::unordered_map<std::string, ToolHandle<ICPJetUncertaintiesTool> > top::JetObjectCollectionMaker::m_tagSFuncertTool |
|
private |
◆ m_tagSFUncorrelatedSystematics
std::unordered_map<std::string, std::vector<CP::SystematicSet> > top::JetObjectCollectionMaker::m_tagSFUncorrelatedSystematics |
|
private |
◆ m_truthJetCollForHS
std::string top::JetObjectCollectionMaker::m_truthJetCollForHS |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
std::list< CP::SystematicSet > m_recommendedSystematics
def retrieve(aClass, aKey=None)
bool ptau(const std::string &taggername, double &value) const
StatusCode execute(const bool isLargeR, bool executeNominal)
StatusCode calibrate(const bool isLargeR)
ToolHandle< ICPJetUncertaintiesTool > m_jetUncertaintiesToolLargeRPseudoData
virtual void addSystematics(const std::set< std::string > &specifiedSystematics, const CP::SystematicSet &recommendedSysts, std::unordered_map< CP::SystematicSet, CP::SystematicSet > &map, const std::string &modName, bool isLargeR=false, bool onlyJER=false, bool isPseudoData=false)
ToolHandle< ICPJetUncertaintiesTool > m_jetUncertaintiesTool
std::vector< CP::SystematicSet > make_systematics_vector(const SystematicSet &systematics)
utility functions for working with systematics
virtual StatusCode applyTaggingSFSystematic()
Helper class to provide type-safe access to aux data.
StatusCode tagLargeRJets(const xAOD::JetContainer &jet)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::unordered_map< std::string, ToolHandle< IBTaggingSelectionTool > > m_btagSelToolsDL1Decor_trkJet
std::set< SystematicVariation >::const_iterator const_iterator
std::unordered_map< std::string, std::vector< CP::SystematicSet > > m_tagSFUncorrelatedSystematics
ToolHandle< CP::IJetJvtEfficiency > m_jetJvtEfficiencyTool
Class to wrap a set of SystematicVariations.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
double deltaR(const xAOD::IParticle &p1, const xAOD::IParticle &p2)
Calculate the delta-r distance between two particles (e.g.
systMap m_systMap_JERPseudo
std::shared_ptr< top::TopConfig > m_config
ToolHandle< ICPJetCorrectionTool > m_FFJetSmearingTool
ToolHandle< ICPJetUncertaintiesTool > m_jetUncertaintiesToolReducedNPScenario3
virtual void setOwner(IDataHandleHolder *o)=0
StatusCode decorateMatchedTruth()
std::list< CP::SystematicSet > m_specifiedSystematicsLargeR
virtual const std::list< CP::SystematicSet > & specifiedSystematicsLargeR() const
std::unique_ptr< top::TopJetSubstructure > m_jetSubstructure
JetCorrection-derived class that trims large-R jets while derivations are not ready.
virtual StatusCode applySystematic(ToolHandle< ICPJetUncertaintiesTool > &tool, const std::unordered_map< CP::SystematicSet, CP::SystematicSet > &map, bool isLargeR=false)
ToolHandle< ICPJetUncertaintiesTool > m_jetUncertaintiesToolPseudoData
ToolHandle< IJetCalibrationTool > m_jetCalibrationTool
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
std::size_t hash() const
returns: hash value for the joined string.
def save(self, fileName="./columbo.out")
bool pc(const std::string &taggername, double &value) const
StatusCode printout(const bool isLargeR)
Helper class to provide type-safe access to aux data.
CP::SystematicSet m_nominalSystematicSet
systMap m_systMap_ReducedNPScenario3
ToolHandle< ICPJetUncertaintiesTool > m_jetUncertaintiesToolReducedNPScenario4
::StatusCode StatusCode
StatusCode definition for legacy code.
std::string m_truthJetCollForHS
StatusCode decorateBJets(xAOD::Jet &jet)
systMap m_systMap_ReducedNPScenario2
std::pair< std::vector< unsigned int >, bool > res
std::set< SystematicVariation >::iterator iterator
std::unordered_map< std::string, std::vector< std::string > > m_tagSFSysNames
void check(bool thingToCheck, const std::string &usefulFailureMessage)
Print an error message and terminate if thingToCheck is false.
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
ToolHandle< ICPJetUncertaintiesTool > m_jetUncertaintiesToolReducedNPScenario2
StatusCode decorateHSJets()
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
std::unique_ptr< JetTruthLabelingTool > m_jetTruthLabelingTool
– Large R jet truth labeling –///
bool m_doFull_JER_largeR_Pseudodata
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
bool pu(const std::string &taggername, double &value) const
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
systMap m_systMap_ReducedNPScenario4
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
std::unordered_map< std::string, ToolHandle< IJetDecorator > > m_boostedJetTaggers
ToolHandle< IJetModifier > m_jetSelectfJvtTool
ToolHandle< IJetCalibrationTool > m_jetCalibrationToolLargeR
std::pair< std::unique_ptr< T >, std::unique_ptr< ShallowAuxContainer > > shallowCopyContainer(const T &cont, [[maybe_unused]] const EventContext &ctx)
Function making a shallow copy of a constant container.
const BTagging * getBTagging(const SG::AuxElement &part)
Access the default xAOD::BTagging object associated to an object.
StatusCode tagNominalLargeRJets()
std::list< CP::SystematicSet > m_specifiedSystematicsTrackJets
virtual const std::list< CP::SystematicSet > & specifiedSystematics() const
std::unordered_map< std::string, ToolHandle< ICPJetUncertaintiesTool > > m_tagSFuncertTool
#define ATH_MSG_WARNING(x)
bool setOriginalObjectLink(const IParticle &original, IParticle ©)
This function should be used by CP tools when they make a deep copy of an object in their correctedCo...
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
ToolHandle< ICPJetUncertaintiesTool > m_jetUncertaintiesToolReducedNPScenario1
std::unordered_map< std::string, ToolHandle< IBTaggingSelectionTool > > m_btagSelToolsDL1Decor
systMap m_systMap_ReducedNPScenario1
std::unordered_map< std::string, SG::AuxElement::Decorator< float > > DLx
bool m_doFull_JER_Pseudodata
std::unordered_map< CP::SystematicSet, CP::SystematicSet >::const_iterator Itr
std::list< CP::SystematicSet > m_specifiedSystematics
StatusCode decorateDL1(bool trackJets=false)
virtual double pt() const
The transverse momentum ( ) of the particle.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Derived class that constructs subjets while derivations are not ready.
systMap m_systMap_LargeR_JERPseudo
bool pb(const std::string &taggername, double &value) const
ToolHandle< ICPJetUncertaintiesTool > m_jetUncertaintiesToolLargeR