![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
#include <TrackSystematicsMaker.h>
|
| TrackSystematicsMaker (const std::string &name) |
|
virtual | ~TrackSystematicsMaker () |
|
| TrackSystematicsMaker (const TrackSystematicsMaker &rhs)=delete |
|
| TrackSystematicsMaker (TrackSystematicsMaker &&rhs)=delete |
|
TrackSystematicsMaker & | operator= (const TrackSystematicsMaker &rhs)=delete |
|
StatusCode | initialize () |
| Dummy implementation of the initialisation function. More...
|
|
StatusCode | execute (bool) |
|
const std::list< CP::SystematicSet > & | specifiedSystematics () const |
|
const std::list< CP::SystematicSet > & | recommendedSystematics () const |
|
virtual void | specifiedSystematics (const std::set< std::string > &specifiedSystematics) |
| Specify the systematics to be used. 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 |
|
Definition at line 44 of file TrackSystematicsMaker.h.
◆ StoreGateSvc_t
◆ TrackSystematicsMaker() [1/3]
top::TrackSystematicsMaker::TrackSystematicsMaker |
( |
const std::string & |
name | ) |
|
|
explicit |
◆ ~TrackSystematicsMaker()
top::TrackSystematicsMaker::~TrackSystematicsMaker |
( |
| ) |
|
|
virtual |
◆ TrackSystematicsMaker() [2/3]
◆ TrackSystematicsMaker() [3/3]
◆ applyBiasingSystematic()
– Inform the tool –///
– Save corrected xAOD Container to StoreGate / TStore –///
Definition at line 184 of file TrackSystematicsMaker.cxx.
187 if(
m_config->sgKeyTracks(syst.
hash()) ==
"InDetTrackParticles_")
188 return StatusCode::SUCCESS;
199 "Failed to configure tool for systematic variation");
203 top::check(
tool->applyCorrection(*trkCpy),
"Failure to apply track systematic");
208 std::string outputSGKey =
m_config->sgKeyTracks(syst.
hash());
209 std::string outputSGKeyAux = outputSGKey +
"Aux.";
212 StatusCode saveAux =
evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
214 if (!
save || !saveAux) {
215 return StatusCode::FAILURE;
218 return StatusCode::SUCCESS;
◆ applySmearingSystematic()
– Inform the tool –///
– Save corrected xAOD Container to StoreGate / TStore –///
Definition at line 146 of file TrackSystematicsMaker.cxx.
150 if(
m_config->sgKeyTracks(syst.
hash()) ==
"InDetTrackParticles_")
151 return StatusCode::SUCCESS;
160 top::check(
tool->applySystematicVariation(syst),
"Failed to configure tool for systematic variation");
165 top::check(
tool->applyCorrection(*trkCpy),
"Failure to apply track systematic");
170 std::string outputSGKey =
m_config->sgKeyTracks(syst.
hash());
171 std::string outputSGKeyAux = outputSGKey +
"Aux.";
175 StatusCode saveAux =
evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
177 if (!
save || !saveAux) {
178 return StatusCode::FAILURE;
181 return StatusCode::SUCCESS;
◆ applyTruthFilterSystematic()
– Inform the tool –///
– Save corrected xAOD Container to StoreGate / TStore –///
Definition at line 103 of file TrackSystematicsMaker.cxx.
106 if(
m_config->sgKeyTracks(syst.
hash()) ==
"InDetTrackParticles_")
107 return StatusCode::SUCCESS;
117 "Failed to configure tool for systematic variation");
124 if (not
tool->accept(trkCpy)) trkCpy->auxdecor<
char>(
"passTruthFilter") = 0;
125 else trkCpy->auxdecor<
char>(
"passTruthFilter") = 1;
131 std::string outputSGKey =
m_config->sgKeyTracks(syst.
hash());
132 std::string outputSGKeyAux = outputSGKey +
"Aux.";
136 StatusCode saveAux =
evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
138 if (!
save || !saveAux) {
139 return StatusCode::FAILURE;
142 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]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode top::TrackSystematicsMaker::execute |
( |
bool |
executeNominal | ) |
|
– Save corrected xAOD Container to StoreGate / TStore –///
– Only run this on the systematic execution –///
– Save corrected xAOD Container to StoreGate / TStore –///
– SMEARING –///
– BIASING –///
– TRUTH FILTER –///
Definition at line 221 of file TrackSystematicsMaker.cxx.
225 if (!
m_config->isMC() && executeNominal) {
235 std::string outputSGKeyAux = outputSGKey +
"Aux.";
238 StatusCode saveAux =
evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
240 if (!
save || !saveAux) {
241 return StatusCode::FAILURE;
245 return StatusCode::SUCCESS;
247 if (!
m_config->isMC() && !executeNominal) {
248 return StatusCode::SUCCESS;
263 std::string outputSGKeyAux = outputSGKey +
"Aux.";
266 StatusCode saveAux =
evtStore()->tds()->record(shallow_xaod_copy.second, outputSGKeyAux);
268 if (!
save || !saveAux) {
269 return StatusCode::FAILURE;
273 return StatusCode::SUCCESS;
278 for (
const auto& syst :
m_systs.smearing) {
280 "Failure to apply TrackSystematic");
291 top::check(biasingTool,
"Failure to selected biasing tool");
292 for (
const auto& syst :
m_systs.bias) {
294 "Failure to apply TrackSystematic");
302 "Failure to retrieve EventInfo");
304 top::check(ei->isAvailable<
unsigned int>(
"RandomRunNumber"),
305 "Require that RandomRunNumber decoration is available.");
306 auto randomRunNumber = ei->auxdataConst<
unsigned int>(
"RandomRunNumber");
308 if (randomRunNumber != 0 ){
310 "RandomRunNumber is below valid range.");
312 "RandomRunNumber is above valid range.");
320 top::check(biasingTool,
"Failure to selected biasing tool");
321 for (
const auto& syst :
m_systs.bias) {
323 "Failure to apply TrackSystematic");
329 for (
const auto& syst :
m_systs.truthFilter) {
332 "Failure to apply TrackSystematic");
335 ATH_MSG_DEBUG(
" top::TrackSystematicsMaker completed execute");
336 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
◆ 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::TrackSystematicsMaker::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 50 of file TrackSystematicsMaker.cxx.
53 ATH_MSG_WARNING(
"Usage of tracks in AnalysisTop is experimental for now!\n");
67 const std:: string& syststr =
m_config->systematics();
68 std::set<std::string> syst;
70 if (
m_config->isSystNominal(syststr)) {
75 }
else if (
m_config->isSystAll(syststr)) {
81 std::set<std::string> syst;
82 bool ok =
m_config->getSystematicsList(syststr, syst);
84 ATH_MSG_ERROR(
" top::TrackSystematicsMaker could not determine systematic list");
85 return StatusCode::FAILURE;
97 ATH_MSG_INFO(
" top::TrackSystematicsMaker completed initialize");
98 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.
◆ recommendedSystematics()
◆ renounce()
◆ renounceArray()
◆ retrieveTrackCPTool()
StatusCode top::TrackSystematicsMaker::retrieveTrackCPTool |
( |
| ) |
|
|
private |
Definition at line 423 of file TrackSystematicsMaker.cxx.
429 std::string biasToolPrefix {
"top::TrackCPTools::InDetTrackBiasingTool"};
436 unsigned int end = 0;
445 for (
unsigned int i = 0;
i <
end;
i++) {
448 std::string biasToolName {
460 if (asg::ToolStore::contains<InDet::InDetTrackBiasingTool>(biasToolName)) {
461 m_biasTool[
i] = asg::ToolStore::get<InDet::InDetTrackBiasingTool>(biasToolName);
464 return StatusCode::FAILURE;
475 return StatusCode::SUCCESS;
◆ specifiedSystematics() [1/2]
◆ specifiedSystematics() [2/2]
void top::TrackSystematicsMaker::specifiedSystematics |
( |
const std::set< std::string > & |
specifiedSystematics | ) |
|
|
virtual |
Specify the systematics to be used.
- Parameters
-
specifiedSystematics | Set of systematics (by name) to be used; an empty set will result in no systematic variation. |
– MC only –///
– Are we only doing Nominal? Did the user specify specific systematics to use? –///
Definition at line 339 of file TrackSystematicsMaker.cxx.
344 const bool allTrackSystematics =
m_config->contains(specSys,
"AllTracks");
351 std::set<CP::SystematicSet> systs;
367 systs.insert(
m_systs.truthFilter.begin(),
m_systs.truthFilter.end());
370 for (
const auto&
s : systs) {
373 if (
s.name() ==
"") {
383 if (allTrackSystematics) {
389 for (
const auto&
i : specSys) {
391 if (!
filter.filterTree(
s.name())) {
◆ 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.
◆ updateVHKA()
◆ bias
◆ m_biasTool
◆ m_config
◆ m_detStore
◆ m_evtStore
◆ m_nominalSystematicSet
◆ m_recommendedSystematics
◆ m_runPeriods
std::vector<std::uint32_t> top::TrackSystematicsMaker::m_runPeriods |
|
private |
◆ m_smearingTool
◆ m_specifiedSystematics
◆ m_systs
struct { ... } top::TrackSystematicsMaker::m_systs |
◆ m_truthFilterTool
◆ m_truthOriginTool
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ smearing
◆ truthFilter
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
std::list< CP::SystematicSet > m_recommendedSystematics
struct top::TrackSystematicsMaker::@221 m_systs
std::vector< CP::SystematicSet > make_systematics_vector(const SystematicSet &systematics)
utility functions for working with systematics
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Class to wrap a set of SystematicVariations.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
std::list< CP::SystematicSet > m_specifiedSystematics
StatusCode applySmearingSystematic(InDet::InDetTrackSmearingTool *tool, const CP::SystematicSet &syst) const
std::vector< ToolHandle< InDet::InDetTrackBiasingTool > > m_biasTool
virtual void setOwner(IDataHandleHolder *o)=0
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.
CP::SystematicSet m_nominalSystematicSet
def save(self, fileName="./columbo.out")
ToolHandle< InDet::InDetTrackTruthOriginTool > m_truthOriginTool
StatusCode applyTruthFilterSystematic(InDet::InDetTrackTruthFilterTool *tool, const CP::SystematicSet &syst) const
::StatusCode StatusCode
StatusCode definition for legacy code.
ToolHandle< InDet::InDetTrackSmearingTool > m_smearingTool
StatusCode retrieveTrackCPTool()
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.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
std::string to_string(const DetectorType &type)
StatusCode applyBiasingSystematic(InDet::InDetTrackBiasingTool *tool, const CP::SystematicSet &syst) const
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.
Class describing the basic event information.
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
ToolHandle< InDet::InDetTrackTruthFilterTool > m_truthFilterTool
const std::list< CP::SystematicSet > & specifiedSystematics() const
Class describing a TrackParticle.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
std::shared_ptr< top::TopConfig > m_config
std::vector< std::uint32_t > m_runPeriods