|
ATLAS Offline Software
|
#include <METSystematicsTool.h>
|
| METSystematicsTool (const std::string &name) |
|
StatusCode | softTrkSystInitialize () |
|
StatusCode | softCaloSystInitialize () |
|
StatusCode | jetTrkSystInitialize () |
|
StatusCode | initialize () |
| Dummy implementation of the initialisation function. More...
|
|
CP::CorrectionCode | applyCorrection (xAOD::MissingET &inputMet, const xAOD::MissingETAssociationHelper &helper) const |
|
CP::CorrectionCode | correctedCopy (const xAOD::MissingET &met, xAOD::MissingET *&outputmet, const xAOD::MissingETAssociationHelper &helper) const |
|
bool | isAffectedBySystematic (const CP::SystematicVariation &var) const |
| returns: whether this tool is affected by the given systematic guarantee: no-fail More...
|
|
CP::SystematicSet | affectingSystematics () const |
| returns: the list of all systematics this tool can be affected by guarantee: strong failures: out of memory II More...
|
|
CP::SystematicSet | recommendedSystematics () const |
| returns: the list of all systematics this tool can be affected by guarantee: strong failures: out of memory II More...
|
|
StatusCode | applySystematicVariation (const CP::SystematicSet &set) |
| effects: configure this tool for the given list of systematic variations. More...
|
|
StatusCode | sysApplySystematicVariation (const CP::SystematicSet &) |
| effects: configure this tool for the given list of systematic variations. More...
|
|
void | setRandomSeed (int seed) const |
|
virtual void | print () const =0 |
| Print the state of the tool. More...
|
|
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 |
|
const SystematicSet & | appliedSystematics () const |
| returns: the list of systematics that have been applied to this tool. More...
|
|
std::string | appliedSystematicsString () const |
| returns: a string representation of appliedSystematics() guarantee: strong failures: out of memory II rationale: this is meant to be used when printing out the applied systematics for debugging purposes (or when embedding them in a string). More...
|
|
void | testInvariant () const |
| effects: test the invariance of this object guarantee: no-fail More...
|
|
|
| FRIEND_TEST (METSystTest, TestDefaultHistosFilled) |
|
| FRIEND_TEST (METSystTest, TestJetTrkHistosFilled) |
|
| FRIEND_TEST (METSystTest, TestAddAffectingSystematic) |
|
| FRIEND_TEST (METSystTest, TestProjectST) |
|
| FRIEND_TEST (METSystTest, TestProjectST2) |
|
| METSystematicsTool () |
|
CP::CorrectionCode | internalSoftTermApplyCorrection (xAOD::MissingET &softMet, xAOD::MissingETContainer const *METcont, xAOD::EventInfo const &eInfo) const |
|
CP::CorrectionCode | calcJetTrackMETWithSyst (xAOD::MissingET &jettrkmet, const xAOD::MissingETAssociationHelper &helper) const |
|
CP::CorrectionCode | calcJetTrackMETWithSyst (xAOD::MissingET &jettrkmet, const xAOD::MissingETAssociationHelper &helper, const xAOD::Jet *jet) const |
|
CP::CorrectionCode | getCorrectedJetTrackMET (xAOD::MissingET &jettrkmet, const xAOD::MissingETAssociationHelper &helper) const |
|
TRandom3 * | getTLSRandomGen () const |
|
int | getNPV () const |
|
xAOD::EventInfo const * | getDefaultEventInfo () const |
|
StatusCode | addMETAffectingSystematics () |
|
StatusCode | extractHistoPath (std::string &histfile, std::string &systpath, std::string &configdir, std::string &suffix, SystType const &type) |
|
missingEt | calcPtHard (xAOD::MissingETContainer const *const cont) const |
|
missingEt | caloSyst_scale (missingEt const &softTerms, double const scale) const |
|
missingEt | caloSyst_reso (missingEt const &softTerms) const |
|
missingEt | softTrkSyst_scale (missingEt const &softTerms, missingEt const &ptHard, double const shift) const |
|
missingEt | softTrkSyst_reso (missingEt const &softTerms, missingEt const &ptHard, double const shift, double const smearpara, double const smearperp) const |
|
missingEt | projectST (missingEt const &softTerms, missingEt const &ptHard) const |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
SystApplied | m_appliedSystEnum {NONE} |
|
Gaudi::Property< std::string > | m_configPrefix {this, "ConfigPrefix", "METUtilities/R22_PreRecs", ""} |
|
Gaudi::Property< std::string > | m_configSoftTrkFile {this, "ConfigSoftTrkFile", "TrackSoftTerms-pflow.config", ""} |
|
Gaudi::Property< std::string > | m_configJetTrkFile {this, "ConfigJetTrkFile", "", ""} |
|
Gaudi::Property< std::string > | m_configSoftCaloFile {this, "ConfigSoftCaloFile", "", ""} |
|
Gaudi::Property< bool > | m_useDevArea {this, "UseDevArea", false, ""} |
|
std::unique_ptr< TH3D > | m_shiftpara_pthard_njet_mu {} |
|
std::unique_ptr< TH3D > | m_resopara_pthard_njet_mu {} |
|
std::unique_ptr< TH3D > | m_resoperp_pthard_njet_mu {} |
|
std::unique_ptr< TH2D > | m_jet_systRpt_pt_eta {} |
|
std::unique_ptr< TH1D > | m_h_calosyst_scale {} |
|
std::unique_ptr< TH1D > | m_h_calosyst_reso {} |
|
boost::thread_specific_ptr< TRandom3 > | m_rand_tls |
|
int | m_units {-1} |
|
SG::ReadHandleKey< xAOD::VertexContainer > | m_VertexContKey {this, "VertexContainer", "PrimaryVertices", ""} |
|
SG::ReadHandleKey< xAOD::MissingETContainer > | m_TruthContKey {this, "TruthContainer", "MET_Truth", ""} |
|
SG::ReadHandleKey< xAOD::EventInfo > | m_EventInfoKey {this, "EventInfo", "EventInfo", ""} |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
SystematicSet * | m_appliedSystematics |
| description: pointer to currenty applied systematics More...
|
|
std::unordered_map< SystematicSet, SystematicSet > | m_systFilterMap |
| map of cached systematics filtering More...
|
|
Definition at line 82 of file METSystematicsTool.h.
◆ StoreGateSvc_t
◆ METSystematicsTool() [1/2]
met::METSystematicsTool::METSystematicsTool |
( |
const std::string & |
name | ) |
|
◆ METSystematicsTool() [2/2]
met::METSystematicsTool::METSystematicsTool |
( |
| ) |
|
|
private |
◆ addAffectingSystematic()
effects: add a systematic to the list of registered systematics.
It will optionally also add this sytematic to the recommended set. side effects: this will add the systematic to the global list of systematics, if not already there guarantee: strong failures: out of memory II
Definition at line 111 of file SystematicsTool.cxx.
117 reg.registerSystematic( systematic );
121 return StatusCode::FAILURE;
124 return StatusCode::SUCCESS;
◆ addAffectingSystematics()
effects: add a SystematicSet to the registered systematics.
Definition at line 141 of file SystematicsTool.cxx.
◆ addMETAffectingSystematics()
StatusCode met::METSystematicsTool::addMETAffectingSystematics |
( |
| ) |
|
|
private |
Definition at line 41 of file METSystematicsTool.cxx.
50 ATH_MSG_ERROR(
"failed to properly add softTrk affecting systematics " );
51 return StatusCode::FAILURE;
58 ATH_MSG_ERROR(
"failed to properly add softCalo affecting systematics " );
59 return StatusCode::FAILURE;
65 ATH_MSG_ERROR(
"failed to properly add jetTrk affecting systematics " );
66 return StatusCode::FAILURE;
75 ATH_MSG_DEBUG(
"These systematics are set based on your config files: " );
80 return StatusCode::SUCCESS;
◆ addRecommendedSystematic()
effects: add a systematic to the list of recommended systematics failures: unsupported systematic
Definition at line 127 of file SystematicsTool.cxx.
134 if( reg.addSystematicToRecommended( systematic ) !=
135 StatusCode::SUCCESS ) {
136 return StatusCode::FAILURE;
138 return StatusCode::SUCCESS;
◆ addRecommendedSystematics()
StatusCode CP::SystematicsTool::addRecommendedSystematics |
( |
const SystematicSet & |
systematics | ) |
|
|
protectedinherited |
effects: add a SystematicSet to the recommended systematics.
Definition at line 151 of file SystematicsTool.cxx.
158 if( reg.addSystematicsToRecommended(
systematics ) !=
159 StatusCode::SUCCESS ) {
160 return StatusCode::FAILURE;
162 return StatusCode::SUCCESS;
◆ affectingSystematics()
◆ appliedSystematics()
const SystematicSet & CP::SystematicsTool::appliedSystematics |
( |
| ) |
const |
|
inherited |
returns: the list of systematics that have been applied to this tool.
this is not including systematics that were applied, but do not affect this tool guarantee: no-fail
Definition at line 54 of file SystematicsTool.cxx.
58 std::cerr <<
"SystematicsTool::appliedSystematics WARNING: "
59 <<
"no systematic configuration has been applied yet. "
60 <<
"Returning NULL" << std::endl;
61 static const SystematicSet
dummy;
◆ appliedSystematicsString()
std::string CP::SystematicsTool::appliedSystematicsString |
( |
| ) |
const |
|
inherited |
returns: a string representation of appliedSystematics() guarantee: strong failures: out of memory II rationale: this is meant to be used when printing out the applied systematics for debugging purposes (or when embedding them in a string).
Definition at line 67 of file SystematicsTool.cxx.
◆ applyCorrection()
Implements IMETSystematicsTool.
Definition at line 243 of file METSystematicsTool.cxx.
251 ATH_MSG_WARNING(
"event info is empty, returning without applying correction");
256 ATH_MSG_WARNING(
"This tool should be applied to MC only. Return without changing the input MET object");
263 if(METcont ==
nullptr){
264 ATH_MSG_WARNING(
"MissingET object not owned by a container. Returning without applying correction" );
274 if(
helper.map() ==
nullptr) {
275 ATH_MSG_WARNING(
"The MissingETAssociationMap for the given MissingETAssociationHelper is null. Returning without applying correction ");
282 ATH_MSG_WARNING(
"METSystematicsTool received a MissingET object it can't correct. You should only pass soft MET terms or jet track MET terms.");
◆ applySystematicVariation()
effects: configure this tool for the given list of systematic variations.
any requested systematics that are not affecting this tool will be silently ignored (unless they cause other errors). guarantee: basic failures: out of memory II failures: systematic unknown failures: requesting multiple variations on the same systematic (e.g. up & down) failures: requesting an unsupported variation on an otherwise supported systematic (e.g. a 2 sigma variation and the tool only supports 1 sigma variations) failures: unsupported combination of supported systematic failures: other tool specific errors
Reimplemented from CP::SystematicsTool.
Definition at line 125 of file METSystematicsTool.h.
◆ calcJetTrackMETWithSyst() [1/2]
Definition at line 511 of file METSystematicsTool.cxx.
518 ATH_MSG_ERROR(
"jet track systematics histogram not initialized properly.") ;
526 std::vector<const xAOD::Jet*>
jets;
527 for(
const iplink_t& jetlink : acc_constitObjLinks(jettrkmet)) {
529 ATH_MSG_ERROR(
"Invalid object of type " << (*jetlink)->type() <<
" in jet term");
534 bool originalInputs =
jets.empty() ? false : !acc_originalObject.isAvailable(*
jets.front());
546 if(std::abs(
jet->eta())<=2.5)
558 uncert = std::sqrt(uncert*uncert+uncert_frac*uncert_frac);
580 jettrkmet.
setMpx ( jettrkmet.
mpx()*(1 + uncert/(std::abs(jettrkmet.
mpx())*std::sqrt(2))));
581 jettrkmet.
setMpy ( jettrkmet.
mpy()*(1 + uncert/(std::abs(jettrkmet.
mpy())*std::sqrt(2))));
◆ calcJetTrackMETWithSyst() [2/2]
◆ calcPtHard()
Definition at line 674 of file METSystematicsTool.cxx.
680 if (!truthCont.isValid()) {
687 if(truthiter == truthCont->end()){
694 ptHard.mpx = truthmet.
mpx();
695 ptHard.mpy = truthmet.
mpy();
696 ptHard.sumet = truthmet.
sumet();
697 ptHard.name = truthmet.
name();
698 ptHard.source = truthmet.
source();
704 ptHard.mpx -= (*iMET)->mpx();
705 ptHard.mpy -= (*iMET)->mpy();
706 ptHard.sumet += (*iMET)->sumet();
710 if( ptHard.sumet < 0 ) {
711 ATH_MSG_ERROR(
"PtHard has a negative sumet, returning ptHart = 0");
720 if(ptHard.sumet<1.0e-6){
◆ caloSyst_reso()
Definition at line 615 of file METSystematicsTool.cxx.
619 double const metSigma = .7 * std::sqrt(softTerms.sumet);
621 double const smearedSigma = std::sqrt( (metSigma* (1. + resUnc))*(metSigma* (1. + resUnc)) -
622 metSigma * metSigma );
624 ATH_MSG_VERBOSE(
"caloSyst_reso: metSigma: " << metSigma <<
", resUnc: " << resUnc <<
", smearedSigma = " << smearedSigma);
626 double const softTermsMet = std::sqrt( softTerms.mpx * softTerms.mpx +
627 softTerms.mpy * softTerms.mpy );
631 double const shift = softTermsMet<1
e-9 ? 0. :
rand*smearedSigma / softTermsMet;
635 return missingEt(softTerms.mpx*(1.+shift),softTerms.mpy*(1.+shift),softTerms.sumet,
636 softTerms.name,softTerms.source);
◆ caloSyst_scale()
◆ correctedCopy()
Implements IMETSystematicsTool.
Definition at line 287 of file METSystematicsTool.cxx.
292 if(outputmet !=
nullptr ){
293 ATH_MSG_WARNING(
"Please pass a nullptr to the 2nd argument of correctedCopy to fill the output pointer");
305 ATH_MSG_WARNING(
"This tool should be applied to MC only. Return without changing the input MET object");
312 if(METcont ==
nullptr){
313 ATH_MSG_WARNING(
"MissingET object not owned by a container. Unable to apply correction, returning output MET object as null" );
320 outputmet =
nullptr;
delete copy;
326 if(
helper.map() ==
nullptr) {
327 ATH_MSG_WARNING(
"MissingETAssociationHelper contained a null MissingETAssociationMap pointer");
328 outputmet =
nullptr;
delete copy;
334 outputmet =
nullptr;
delete copy;
◆ 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);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ 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]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extractHistoPath()
StatusCode met::METSystematicsTool::extractHistoPath |
( |
std::string & |
histfile, |
|
|
std::string & |
systpath, |
|
|
std::string & |
configdir, |
|
|
std::string & |
suffix, |
|
|
SystType const & |
type |
|
) |
| |
|
private |
Definition at line 729 of file METSystematicsTool.cxx.
739 std::string configpath =
"";
740 std::string configfile =
"";
756 ATH_MSG_INFO(
"Searching for configFile: " << configfile);
758 ATH_MSG_DEBUG(
"CALIBPATH: " << gSystem->Getenv(
"CALIBPATH") );
760 if(configpath.empty() || configfile.empty() ){
762 return StatusCode::FAILURE;
765 if(
reader.ReadFile(configpath.c_str(),EEnvLevel(0)) < 0) {
767 return StatusCode::FAILURE;
770 ATH_MSG_INFO(
"Configuring from file : " << configpath );
776 systpath =
reader.GetValue(
"GlobalSyst.sourcedir" ,
"" );
780 systpath =
reader.GetValue(
"PtHardSyst.sourcedir" ,
"" );
792 std::string
const units_string =
reader.GetValue(
"Units",
"" );
796 if(units_string !=
"GeV"){
797 ATH_MSG_ERROR(
"initialized the different systematics using two config files that conflict on units");
798 return StatusCode::FAILURE;
802 if( (!units_string.empty()) &&
803 (units_string !=
"MeV")
805 ATH_MSG_ERROR(
"initialized the different systematics using two config files that conflict on units");
806 return StatusCode::FAILURE;
811 if( (units_string.empty()) ||
812 (units_string ==
"MeV")
815 }
else if(units_string ==
"GeV"){
818 ATH_MSG_ERROR(
"You specified an incorrect 'Units' value. Please specify MeV , GeV , or leave it blank for MeV");
819 return StatusCode::FAILURE;
828 ATH_MSG_ERROR(
"Failed to correctly set histfile path, or path to histograms inside of the histfile" );
829 return StatusCode::FAILURE;
837 ATH_MSG_ERROR(
"Something is wrong with your units initialization. Please contact the developers (you should never get here).");
838 return StatusCode::FAILURE;
842 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
◆ FRIEND_TEST() [1/5]
met::METSystematicsTool::FRIEND_TEST |
( |
METSystTest |
, |
|
|
TestAddAffectingSystematic |
|
|
) |
| |
|
private |
◆ FRIEND_TEST() [2/5]
met::METSystematicsTool::FRIEND_TEST |
( |
METSystTest |
, |
|
|
TestDefaultHistosFilled |
|
|
) |
| |
|
private |
◆ FRIEND_TEST() [3/5]
met::METSystematicsTool::FRIEND_TEST |
( |
METSystTest |
, |
|
|
TestJetTrkHistosFilled |
|
|
) |
| |
|
private |
◆ FRIEND_TEST() [4/5]
met::METSystematicsTool::FRIEND_TEST |
( |
METSystTest |
, |
|
|
TestProjectST |
|
|
) |
| |
|
private |
◆ FRIEND_TEST() [5/5]
met::METSystematicsTool::FRIEND_TEST |
( |
METSystTest |
, |
|
|
TestProjectST2 |
|
|
) |
| |
|
private |
◆ getCorrectedJetTrackMET()
◆ getDefaultEventInfo()
◆ 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
127 return (
proxy ==
nullptr ? 0 :
proxy->sgkey() );
128 #endif // XAOD_STANDALONE
◆ 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
114 static const std::string
dummy =
"";
116 #endif // XAOD_STANDALONE
◆ getNPV()
int met::METSystematicsTool::getNPV |
( |
| ) |
const |
|
private |
Definition at line 858 of file METSystematicsTool.cxx.
862 if (!vertices.isValid()) {
864 ATH_MSG_ERROR(
"Failed to retrieve default NPV value from PrimaryVertices");
870 for (itr = vertices->begin(); itr != vertices->end(); ++itr)
◆ getProperty()
template<class T >
const T* asg::AsgTool::getProperty |
( |
const std::string & |
name | ) |
const |
|
inherited |
Get one of the tool's properties.
◆ getTLSRandomGen()
TRandom3 * met::METSystematicsTool::getTLSRandomGen |
( |
| ) |
const |
|
private |
◆ initialize()
StatusCode met::METSystematicsTool::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...
Reimplemented from asg::AsgTool.
Definition at line 83 of file METSystematicsTool.cxx.
93 if (lastchar !=
'/') {
99 m_configJetTrkFile.empty() )
ATH_MSG_WARNING(
"you have initialized the METSystematicsTool with no configuration file. The tool will do nothing. Please set the configuration file properties.");
◆ 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.
◆ internalSoftTermApplyCorrection()
Definition at line 343 of file METSystematicsTool.cxx.
352 ATH_MSG_ERROR(
"not soft met, cannot apply soft term correction to this MET");
360 <<
", met = " << softMet.
met()
362 <<
", do syst? " << doSyst);
366 <<
", met = " << softMet.
met()
368 <<
", do syst? " << doSyst);
375 missingEt softMetStruct;
376 softMetStruct.mpx = softMet.
mpx();
377 softMetStruct.mpy = softMet.
mpy();
378 softMetStruct.sumet = softMet.
sumet();
379 softMetStruct.name = softMet.
name();
380 softMetStruct.source = softMet.
source();
382 if(METcont ==
nullptr){
383 ATH_MSG_WARNING(
"failed to retrieve MET container from passed object");
388 double const ptHardMet = std::sqrt( ptHard.mpx * ptHard.mpx +
389 ptHard.mpy * ptHard.mpy ) ;
392 size_t njet = (jetterm==
nullptr) ? 0 : acc_constitObjLinks(*jetterm ).size();
417 softMetStruct =
softTrkSyst_reso(softMetStruct, ptHard, ptHardShift, smearpara, 0.);
422 softMetStruct =
softTrkSyst_reso(softMetStruct, ptHard, ptHardShift, 0., smearperp );
428 softMetStruct =
softTrkSyst_reso(softMetStruct, ptHard, ptHardShift, smearpara , smearperp);
446 ATH_MSG_DEBUG(
"No systematic applied, returning nominal MET term");
451 softMet.
setMpx( softMetStruct.mpx);
452 softMet.
setMpy( softMetStruct.mpy);
453 softMet.
setSumet( softMetStruct.sumet);
454 softMet.
setName( softMetStruct.name);
455 softMet.
setSource( softMetStruct.source);
461 <<
", met = " << softMet.
met() );
◆ isAffectedBySystematic()
◆ jetTrkSystInitialize()
StatusCode met::METSystematicsTool::jetTrkSystInitialize |
( |
| ) |
|
Definition at line 144 of file METSystematicsTool.cxx.
149 std::string gsystpath =
"";
150 std::string configdir =
"";
151 std::string blank =
"";
155 TFile
infile((configdir).c_str());
163 return StatusCode::FAILURE;
169 return StatusCode::SUCCESS;
◆ 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()
◆ 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() [1/2]
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, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
Definition at line 131 of file AsgTool.cxx.
◆ print() [2/2]
virtual void asg::IAsgTool::print |
( |
| ) |
const |
|
pure virtualinherited |
Print the state of the tool.
Implemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, asg::AsgTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
◆ projectST()
Definition at line 658 of file METSystematicsTool.cxx.
661 double const ptHardMet = std::sqrt( ptHard.mpx * ptHard.mpx +
662 ptHard.mpy * ptHard.mpy );
664 double const ux = ptHard.mpx/ptHardMet;
665 double const uy = ptHard.mpy/ptHardMet;
666 double const projL = ux*softTerms.mpx + uy*softTerms.mpy;
667 double const projT = uy*softTerms.mpx - ux*softTerms.mpy;
668 missingEt
proj(projL,projT,softTerms.sumet,
669 softTerms.name,softTerms.source);
◆ recommendedSystematics()
◆ renounce()
◆ renounceArray()
◆ setRandomSeed()
void met::METSystematicsTool::setRandomSeed |
( |
int |
seed | ) |
const |
|
virtual |
◆ softCaloSystInitialize()
StatusCode met::METSystematicsTool::softCaloSystInitialize |
( |
| ) |
|
Definition at line 108 of file METSystematicsTool.cxx.
111 ATH_MSG_INFO(
"Doing SoftCalo systematics initialization. THIS IS FOR SOFTWARE DEVELOPMENT ONLY.");
112 ATH_MSG_INFO(
"CST IS NOT YET RECOMMENDED OR SUPPORTED BY THE MET GROUP. YOU ARE USING A 2012 config file.");
115 std::string gsystpath =
"";
117 std::string blank =
"";
123 ATH_MSG_INFO(
"METSystematics: Read calo uncertainties" );
133 return StatusCode::FAILURE;
140 return StatusCode::SUCCESS;
◆ softTrkSyst_reso()
Definition at line 644 of file METSystematicsTool.cxx.
651 missingEt projection =
projectST(softTerms,ptHard);
652 projection.mpx = (projection.mpx + shift + smearpara );
653 projection.mpy = (projection.mpy + + smearperp );
◆ softTrkSyst_scale()
◆ softTrkSystInitialize()
StatusCode met::METSystematicsTool::softTrkSystInitialize |
( |
| ) |
|
Definition at line 173 of file METSystematicsTool.cxx.
178 std::string psystpath =
"";
197 return StatusCode::FAILURE;
205 return StatusCode::SUCCESS;
◆ sysApplySystematicVariation()
effects: configure this tool for the given list of systematic variations.
systConfig is guaranteed to contain only supported systematics. guarantee: basic failures: out of memory II failures: unsupported combination of supported systematics failures: other tool specific errors
Implements CP::SystematicsTool.
Definition at line 208 of file METSystematicsTool.cxx.
214 if( systSet.empty() ) {
216 return StatusCode::SUCCESS;
217 }
else if( systSet.size() > 1 ) {
218 ATH_MSG_WARNING(
"Tool does not support multiple systematics, returning unsupported" );
219 return StatusCode::FAILURE;
235 return StatusCode::FAILURE;
240 return StatusCode::SUCCESS;
◆ 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.
◆ testInvariant()
void CP::SystematicsTool::testInvariant |
( |
| ) |
const |
|
inherited |
effects: test the invariance of this object guarantee: no-fail
Definition at line 165 of file SystematicsTool.cxx.
◆ updateVHKA()
◆ m_affectingSystematics
SystematicSet CP::SystematicsTool::m_affectingSystematics |
|
protectedinherited |
description: members directly corresponding to accessors
Definition at line 146 of file SystematicsTool.h.
◆ m_appliedSystematics
SystematicSet* CP::SystematicsTool::m_appliedSystematics |
|
privateinherited |
description: pointer to currenty applied systematics
Definition at line 151 of file SystematicsTool.h.
◆ m_appliedSystEnum
◆ m_configJetTrkFile
Gaudi::Property<std::string> met::METSystematicsTool::m_configJetTrkFile {this, "ConfigJetTrkFile", "", ""} |
|
private |
◆ m_configPrefix
Gaudi::Property<std::string> met::METSystematicsTool::m_configPrefix {this, "ConfigPrefix", "METUtilities/R22_PreRecs", ""} |
|
private |
◆ m_configSoftCaloFile
Gaudi::Property<std::string> met::METSystematicsTool::m_configSoftCaloFile {this, "ConfigSoftCaloFile", "", ""} |
|
private |
◆ m_configSoftTrkFile
Gaudi::Property<std::string> met::METSystematicsTool::m_configSoftTrkFile {this, "ConfigSoftTrkFile", "TrackSoftTerms-pflow.config", ""} |
|
private |
◆ m_detStore
◆ m_EventInfoKey
◆ m_evtStore
◆ m_h_calosyst_reso
std::unique_ptr<TH1D> met::METSystematicsTool::m_h_calosyst_reso {} |
|
private |
◆ m_h_calosyst_scale
std::unique_ptr<TH1D> met::METSystematicsTool::m_h_calosyst_scale {} |
|
private |
◆ m_jet_systRpt_pt_eta
std::unique_ptr<TH2D> met::METSystematicsTool::m_jet_systRpt_pt_eta {} |
|
private |
◆ m_rand_tls
boost::thread_specific_ptr<TRandom3> met::METSystematicsTool::m_rand_tls |
|
mutableprivate |
◆ m_recommendedSystematics
SystematicSet CP::SystematicsTool::m_recommendedSystematics |
|
protectedinherited |
◆ m_resopara_pthard_njet_mu
std::unique_ptr<TH3D> met::METSystematicsTool::m_resopara_pthard_njet_mu {} |
|
private |
◆ m_resoperp_pthard_njet_mu
std::unique_ptr<TH3D> met::METSystematicsTool::m_resoperp_pthard_njet_mu {} |
|
private |
◆ m_shiftpara_pthard_njet_mu
std::unique_ptr<TH3D> met::METSystematicsTool::m_shiftpara_pthard_njet_mu {} |
|
private |
◆ m_systFilterMap
std::unordered_map<SystematicSet, SystematicSet> CP::SystematicsTool::m_systFilterMap |
|
privateinherited |
◆ m_TruthContKey
◆ m_units
int met::METSystematicsTool::m_units {-1} |
|
private |
◆ m_useDevArea
Gaudi::Property<bool> met::METSystematicsTool::m_useDevArea {this, "UseDevArea", false, ""} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_VertexContKey
◆ m_vhka
The documentation for this class was generated from the following files:
Const iterator class for DataVector/DataList.
void setSumet(float value)
Set .
MET association descriptor contains object links and corresponding parameters.
float sumet() const
Returns.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
void setMpy(float value)
Set the component.
static bool isTotalTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
Class to wrap a set of SystematicVariations.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
MissingET_v1 MissingET
Version control by type defintion.
std::string name() const
returns: the systematics joined into a single string.
#define ATH_MSG_VERBOSE(x)
bool const RAWDATA *ch2 const
Class providing the definition of the 4-vector interface.
static bool isTrackTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
@ IS_SIMULATION
true: simulation, false: data
void setSource(MissingETBase::Types::bitmask_t src)
Set the source of the MET object.
@ NoVtx
Dummy vertex. TrackParticle was not used in vertex fit.
static bool isJetTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
Vector sum of constituents for subtractive overlap removal.
virtual void setOwner(IDataHandleHolder *o)=0
void setName(const std::string &name)
Set the name of the MET object.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
@ Error
Some error happened during the object correction.
static Types::bitmask_t jet(Region reg=Region::FullAcceptance)
Standard MET term from reconstructed jets.
float cpy() const
Returns .
float sumpt() const
Returns sum of component pt.
Principal data object for Missing ET.
float mpx() const
Returns .
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
const std::string & name() const
Identifier getters.
void setMpx(float value)
Set the component.
ConstVec jetTrkVec() const
Get track constituent vector for the reference jet.
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Container for xAOD::MissingET_v1 objects.
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
MissingETBase::Types::bitmask_t source() const
MET object source tag.
static const MissingETAssociation * getAssociation(const MissingETAssociationMap *pMap, const Jet *pJet)
ConstVec overlapTrkVec(const MissingETAssociationHelper &helper) const
Retrieve total track-based vector to be subtracted from the jet.
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
@ Ok
The correction was done successfully.
static Types::bitmask_t truthNonInt()
Standard bit pattern indicating genuine true MET.
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
const SG::AuxVectorData * container() const
Return the container holding this element.
float cpx() const
Returns .
reader
read the goodrunslist xml file(s)
float mpy() const
Returns .
static bool isSoftTerm(Types::bitmask_t bits, Region reg=Region::FullAcceptance)
#define RCU_READ_INVARIANT(x)
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Jet_v1 Jet
Definition of the current "jet version".
float met() const
Returns .
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.