 |
ATLAS Offline Software
|
#include <JetCalibrationTool.h>
|
| JetCalibrationTool (const std::string &name="JetCalibrationTool") |
| Constructor with parameters: More...
|
|
| ~JetCalibrationTool () |
| Destructor: More...
|
|
StatusCode | initialize () override |
| Dummy implementation of the initialisation function. More...
|
|
StatusCode | applyCalibration (xAOD::JetContainer &) const override |
| Apply calibration to a jet container. More...
|
|
StatusCode | getNominalResolutionData (const xAOD::Jet &jet, double &resolution) const override |
|
StatusCode | getNominalResolutionMC (const xAOD::Jet &jet, double &resolution) const override |
|
virtual StatusCode | sysInitialize () |
| Function initialising the tool in the correct way in Athena. 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 | 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, V, H > &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 StatusCode | modify (xAOD::JetContainer &jets) const override final |
| Apply calibration to a jet container (for IJetModifier interface). More...
|
|
|
StatusCode | calibrate (xAOD::Jet &jet, JetEventInfo &jetEventInfo) const |
|
StatusCode | initializeEvent (JetEventInfo &jetEventInfo) const |
|
StatusCode | getCalibClass (const TString &calibration) |
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
Definition at line 32 of file JetCalibrationTool.h.
◆ MetaStore_t
◆ MetaStorePtr_t
Type of the metadata store pointer in standalone mode.
Definition at line 68 of file AsgMetadataTool.h.
◆ StoreGateSvc_t
◆ jetScale
◆ JetCalibrationTool()
JetCalibrationTool::JetCalibrationTool |
( |
const std::string & |
name = "JetCalibrationTool" | ) |
|
◆ ~JetCalibrationTool()
JetCalibrationTool::~JetCalibrationTool |
( |
| ) |
|
◆ applyCalibration()
◆ beginEvent()
StatusCode asg::AsgMetadataTool::beginEvent |
( |
| ) |
|
|
protectedvirtualinherited |
Function called when a new events is loaded.
Dummy implementation that can be overridden by the derived tool.
Reimplemented in AsgElectronEfficiencyCorrectionTool, TrigConf::xAODConfigTool, TauAnalysisTools::TauSelectionTool, TauAnalysisTools::DiTauSelectionTool, TauAnalysisTools::CommonSmearingTool, TauAnalysisTools::DiTauEfficiencyCorrectionsTool, Trig::TrigDecisionTool, TauAnalysisTools::TauEfficiencyCorrectionsTool, Trig::TrigConfBunchCrossingTool, xAODMaker::TriggerMenuMetaDataTool, and Trig::xAODBunchCrossingTool.
Definition at line 201 of file AsgMetadataTool.cxx.
204 return StatusCode::SUCCESS;
◆ beginInputFile()
StatusCode asg::AsgMetadataTool::beginInputFile |
( |
| ) |
|
|
protectedvirtualinherited |
Function called when a new input file is opened.
Dummy implementation that can be overridden by the derived tool.
Reimplemented in AsgElectronEfficiencyCorrectionTool, TrigConf::xAODConfigTool, PMGTools::PMGTruthWeightTool, BookkeeperTool, BookkeeperDumperTool, Trig::TrigDecisionTool, xAODMaker::TriggerMenuMetaDataTool, xAODMaker::TruthMetaDataTool, Trig::xAODBunchCrossingTool, TauAnalysisTools::TauEfficiencyCorrectionsTool, and TauAnalysisTools::TauSmearingTool.
Definition at line 185 of file AsgMetadataTool.cxx.
188 return StatusCode::SUCCESS;
◆ calibrate()
Definition at line 665 of file JetCalibrationTool.cxx.
669 if ( !
jet.getAttribute<
int>(
"OriginCorrected",
tmp) )
670 jet.setAttribute<
int>(
"OriginCorrected",
false);
671 if ( !
jet.getAttribute<
int>(
"PileupCorrected",
tmp) )
672 jet.setAttribute<
int>(
"PileupCorrected",
false);
677 jet.setAttribute<
float>(
"DetectorEta",jetconstitP4.eta());
682 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);
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()
◆ endInputFile()
StatusCode asg::AsgMetadataTool::endInputFile |
( |
| ) |
|
|
protectedvirtualinherited |
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ 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
◆ getCalibClass()
StatusCode JetCalibrationTool::getCalibClass |
( |
const TString & |
calibration | ) |
|
|
private |
Definition at line 239 of file JetCalibrationTool.cxx.
244 TString generatorsInfo{};
245 TString simFlavour{};
248 if (
inputMetaStore()->contains<xAOD::FileMetaData>(
"FileMetaData") ) {
255 if (dataYear >= 2015 && dataYear <= 2018) {
257 }
else if (dataYear >= 2022 && dataYear <= 2024) {
260 ATH_MSG_WARNING(
"Data year " << dataYear <<
" not recognized from file metadata. The corresponding mcCampaign will not be known.");
264 std::string str_generatorsInfo;
266 generatorsInfo = str_generatorsInfo;
268 std::string str_simFlavour;
270 simFlavour = str_simFlavour;
274 std::string str_mcCampaign;
276 str_mcCampaign.resize(4);
280 ATH_MSG_INFO(
"Have loaded metadata mcDSID:" << mcDSID <<
", generatorsInfo: " << generatorsInfo <<
", mcCampaign: " <<
mcCampaign <<
", simFlavour: " << simFlavour);
288 if ( calibration.EqualTo(
"Bcid") ){
289 m_globalConfig->SetValue(
"PileupStartingScale",
"JetBcidScaleMomentum");
290 std::unique_ptr<JetCalibrationStep> bcidCorr = std::make_unique<BcidOffsetCorrection>(this->
name()+
"_Bcid",
m_globalConfig, jetAlgo, calibPath,
m_isData);
293 return StatusCode::SUCCESS;
295 else if ( calibration.EqualTo(
"JetArea") || calibration.EqualTo(
"Residual") ) {
296 std::unique_ptr<JetCalibrationStep> puCorr = std::make_unique<JetPileupCorrection>(this->
name()+
"_Pileup",
m_globalConfig, jetAlgo, calibPath,
301 return StatusCode::SUCCESS;
303 else if ( calibration.EqualTo(
"EtaJES") || calibration.EqualTo(
"AbsoluteEtaJES") ) {
304 std::unique_ptr<JetCalibrationStep> etaJESCorr = std::make_unique<EtaJESCorrection>(this->
name()+
"_EtaJES",
m_globalConfig, jetAlgo, calibPath,
false,
m_devMode);
308 return StatusCode::SUCCESS;
310 else if ( calibration.EqualTo(
"EtaMassJES") ) {
311 std::unique_ptr<JetCalibrationStep> etaJESCorr = std::make_unique<EtaJESCorrection>(this->
name()+
"_EtaMassJES",
m_globalConfig, jetAlgo, calibPath,
true,
m_devMode);
315 return StatusCode::SUCCESS;
317 else if ( calibration.EqualTo(
"GSC") ) {
324 TString actualCalibPath;
326 actualCalibPath =
"JetCalibTools/";
328 actualCalibPath =
"JetCalibTool/CalibArea-" +
m_calibAreaTag +
"/";
333 ATH_MSG_WARNING(
"JPS_FastSim.doCalibration is set in JetCalibrationTool config but isData is set to true. Will turn off FastSim calibration.");
338 ATH_MSG_FATAL(
"JPS_FastSim.doCalibration is set in JetCalibrationTool config but file has no FileMetaData. Please fix the sample or configuration.");
339 return StatusCode::FAILURE;
342 JPS_FastSim->
msg().setLevel( this->
msg().
level() );
349 JPS_PtResidual->
msg().setLevel( this->
msg().
level() );
353 return StatusCode::SUCCESS;
355 else if ( calibration.EqualTo(
"GNNC") ) {
356 std::unique_ptr<JetCalibrationStep> gnnc = std::make_unique<GlobalNNCalibration>(this->
name()+
"_GNNC",
m_globalConfig,jetAlgo,calibPath,
m_devMode);
360 return StatusCode::SUCCESS;
362 else if ( calibration.EqualTo(
"MC2MC") ) {
364 TString actualCalibPath;
366 actualCalibPath =
"JetCalibTools/";
368 actualCalibPath =
"JetCalibTool/CalibArea-" +
m_calibAreaTag +
"/";
371 ATH_MSG_FATAL(
"MC2MC step of jet calibration is requested but file has no FileMetaData. Please fix the sample or configuration.");
372 return StatusCode::FAILURE;
374 std::unique_ptr<JetCalibrationStep> JPS_MC2MC = std::make_unique<Generic4VecCorrection>(this->
name()+
"_MC2MC",
m_globalConfig, jetAlgo, actualCalibPath,
m_forceCalibFile_MC2MC, Generic4VecCorrection::JET_CORRTYPE::MC2MC,
mcCampaign, simFlavour, (
int) mcDSID, generatorsInfo);
378 return StatusCode::SUCCESS;
380 else if ( calibration.EqualTo(
"JMS") ) {
381 std::unique_ptr<JetCalibrationStep> jetMassCorr = std::make_unique<JMSCorrection>(this->
name()+
"_JMS",
m_globalConfig, jetAlgo, calibPath,
m_devMode);
382 jetMassCorr->
msg().setLevel( this->
msg().
level() );
385 return StatusCode::SUCCESS;
387 else if ( calibration.EqualTo(
"InsituCombinedMass") ){
390 jetMassCorr->
msg().setLevel( this->
msg().
level() );
394 return StatusCode::SUCCESS;
396 else if ( calibration.EqualTo(
"Insitu") ) {
398 std::unique_ptr<JetCalibrationStep> insituDataCorr = std::make_unique<InsituDataCorrection>(this->
name()+
"_Insitu",
m_globalConfig, jetAlgo, calibPath,
m_devMode);
399 insituDataCorr->
msg().setLevel( this->
msg().
level() );
402 return StatusCode::SUCCESS;
405 ATH_MSG_INFO(
"Initializing Time-Dependent Insitu Corrections");
408 unsigned int firstRun =
static_cast<unsigned int>(
m_runBins.at(
i)+1.5);
412 insituDataCorr->
msg().setLevel( this->
msg().
level() );
416 return StatusCode::SUCCESS;
419 else if ( calibration.EqualTo(
"Smear") ) {
421 ATH_MSG_FATAL(
"Asked for smearing of data, which is not supported. Aborting.");
422 return StatusCode::FAILURE;
424 std::unique_ptr<JetCalibrationStep> jetSmearCorr = std::make_unique<JetSmearingCorrection>(this->
name()+
"_Smear",
m_globalConfig,jetAlgo,calibPath,
m_devMode);
429 return StatusCode::SUCCESS;
431 else if ( calibration.EqualTo(
"LargeRDNN") ) {
432 std::unique_ptr<JetCalibrationStep> largeR_dnn = std::make_unique<GlobalLargeRDNNCalibration>(this->
name()+
"_R10DNN",
m_globalConfig,calibPath,
m_devMode);
436 return StatusCode::SUCCESS;
438 ATH_MSG_FATAL(
"Calibration string not recognized: " << calibration <<
", aborting.");
439 return StatusCode::FAILURE;
◆ 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
◆ getNominalResolutionData()
StatusCode JetCalibrationTool::getNominalResolutionData |
( |
const xAOD::Jet & |
jet, |
|
|
double & |
resolution |
|
) |
| const |
|
overridevirtual |
◆ getNominalResolutionMC()
StatusCode JetCalibrationTool::getNominalResolutionMC |
( |
const xAOD::Jet & |
jet, |
|
|
double & |
resolution |
|
) |
| const |
|
overridevirtual |
◆ getProperty()
template<class T >
const T* asg::AsgTool::getProperty |
( |
const std::string & |
name | ) |
const |
|
inherited |
Get one of the tool's properties.
◆ handle()
void asg::AsgMetadataTool::handle |
( |
const Incident & |
inc | ) |
|
|
protectedvirtualinherited |
Function receiving incidents from IncidentSvc/TEvent.
Reimplemented in Trig::TrigDecisionTool.
Definition at line 135 of file AsgMetadataTool.cxx.
141 if( inc.type() == IncidentType::BeginInputFile ) {
145 throw std::runtime_error(
"Couldn't call beginInputFile()" );
147 }
else if( inc.type() == IncidentType::EndInputFile ) {
150 throw std::runtime_error(
"Couldn't call endInputFile()" );
152 }
else if( inc.type() == IncidentType::BeginEvent ) {
160 throw std::runtime_error(
"Couldn't call beginInputFile()" );
165 throw std::runtime_error(
"Couldn't call beginEvent()" );
168 #ifdef XAOD_STANDALONE
169 }
else if( inc.type() == IncidentType::MetaDataStop ) {
172 throw std::runtime_error(
"Couldn't call metaDataStop()" );
175 #endif // XAOD_STANDALONE
177 ATH_MSG_WARNING(
"Unknown incident type received in AsgMetaDataTool: " << inc.type() );
◆ initialize()
StatusCode JetCalibrationTool::initialize |
( |
| ) |
|
|
overridevirtual |
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 63 of file JetCalibrationTool.cxx.
71 if ( jetAlgo.EqualTo(
"") || calibSeq.EqualTo(
"") ) {
72 ATH_MSG_FATAL(
"JetCalibrationTool::initialize : At least one of your constructor arguments is not set. Did you use the copy constructor?");
73 return StatusCode::FAILURE;
76 if (
m_config.empty() ) {
ATH_MSG_FATAL(
"No configuration file specified.");
return StatusCode::FAILURE; }
82 dir =
"JetCalibTools/";
84 else{
dir.insert(14,calibPath);}
88 ATH_MSG_FATAL(
"Couldn't find ConfigFile " << configPath );
return StatusCode::FAILURE;
90 ATH_MSG_INFO(
"Reading global JES settings from: " << configPath);
99 if ( calibSeq.Contains(
"JetArea") ) {
103 else {
ATH_MSG_FATAL(
"jetAlgo " << jetAlgo <<
" not recognized.");
return StatusCode::FAILURE; }
111 std::string rhoKey_config =
m_globalConfig->GetValue(
"RhoKey",
"None");
113 bool requireRhoInput =
false;
116 if ( !calibSeq.Contains(
"JetArea") && !calibSeq.Contains(
"Residual") ) {
119 }
else if ( calibSeq.Contains(
"JetArea") ) {
120 if (
m_rhoKey.key().compare(
"auto") == 0 && rhoKey_config.compare(
"None") == 0) {
131 else if(rhoKey_config.compare(
"None") != 0 &&
m_rhoKey.key().compare(
"auto") == 0){
134 requireRhoInput =
true;
135 if ( !calibSeq.Contains(
"Residual") )
m_doResidual =
false;
136 }
else if ( !calibSeq.Contains(
"JetArea") && calibSeq.Contains(
"Residual") ) {
138 ATH_MSG_INFO(
"ApplyOnlyResidual should be true if only Residual pile up correction wants to be applied. Need to specify pile up starting scale in the configuration file.");
144 "HLT_xAOD__JetContainer_a4tcemsubjesISFS");
146 if ( !calibSeq.Contains(
"Origin") )
m_doOrigin =
false;
147 if ( !calibSeq.Contains(
"GSC") && !calibSeq.Contains(
"GNNC"))
m_doGSC =
false;
148 if ( !calibSeq.Contains(
"Bcid") )
m_doBcid =
false;
149 if ( calibSeq.Contains(
"DNN") )
m_doDNNCal =
true;
152 if ( calibSeq.Contains(
"Insitu") && !
m_isData ) {
153 ATH_MSG_FATAL(
"JetCalibrationTool::initialize : calibSeq string contains Insitu with isData set to false. Can't apply in-situ correction to MC!!");
154 return StatusCode::FAILURE;
172 TEnv *globalConfig_insitu =
new TEnv();
173 int status = globalConfig_insitu->ReadFile(fn_insitu ,EEnvLevel(0));
174 if (
status!=0) {
ATH_MSG_FATAL(
"Cannot read config file " << fn_insitu );
return StatusCode::FAILURE; }
192 TEnv *globalInsituCombMass =
new TEnv();
193 int status = globalInsituCombMass->ReadFile(fn_comb ,EEnvLevel(0));
194 if (
status!=0) {
ATH_MSG_FATAL(
"Cannot read config file " << fn_comb );
return StatusCode::FAILURE; }
202 for (
unsigned int i=0;
i<vecCalibSeq.size(); ++
i) {
203 if ( vecCalibSeq[
i].EqualTo(
"Origin") || vecCalibSeq[
i].EqualTo(
"DEV") )
continue;
204 if ( vecCalibSeq[
i].EqualTo(
"Residual") &&
m_doJetArea )
continue;
217 ATH_MSG_ERROR(
"Residual calibration requested but no primary vertex container specified!");
218 return StatusCode::FAILURE;
221 if(
m_jetAlgo.find(
"PFlow")!=std::string::npos) {
222 ATH_MSG_ERROR(
"GSC calibration for PFlow requested but no primary vertex container specified!");
223 return StatusCode::FAILURE;
226 ATH_MSG_ERROR(
"GSC calibration with tracks requested but no primary vertex container specified!");
227 return StatusCode::FAILURE;
235 return StatusCode::SUCCESS;
◆ initializeEvent()
StatusCode JetCalibrationTool::initializeEvent |
( |
JetEventInfo & |
jetEventInfo | ) |
const |
|
private |
Definition at line 454 of file JetCalibrationTool.cxx.
458 ATH_MSG_FATAL(
" JetCalibrationTool::initializeEvent : The tool was not initialized.");
459 return StatusCode::FAILURE;
475 if ( rhRhoKey.isValid() ) {
477 eventShape = rhRhoKey.cptr();
478 if ( !rhRhoKey.isValid() ) {
480 ATH_MSG_FATAL(
"Could not retrieve the xAOD::EventShape container " <<
m_rhoKey.key() <<
" from the input file");
481 return StatusCode::FAILURE;
485 return StatusCode::FAILURE;
491 ATH_MSG_FATAL(
"Could not retrieve xAOD::EventShape container " <<
m_rhoKey.key() <<
" from the input file");
492 return StatusCode::FAILURE;
505 return StatusCode::FAILURE;
509 return StatusCode::FAILURE;
514 for (
const auto *
jet : *
jets) {
525 static std::atomic<unsigned int> eventInfoWarnings = 0;
527 if ( rhEvtInfo.isValid() ) {
528 eventObj = rhEvtInfo.cptr();
531 if ( eventInfoWarnings < 20 )
532 ATH_MSG_ERROR(
" JetCalibrationTool::initializeEvent : Failed to retrieve event information.");
533 jetEventInfo.
setMu(0);
535 return StatusCode::SUCCESS;
542 if(!eventInfoDecor.isPresent()) {
544 return StatusCode::FAILURE;
546 jetEventInfo.
setMu( eventInfoDecor(0) );
556 if (
m_doGSC && PVIndexAccessor.isAvailable(*eventObj) )
557 jetEventInfo.
setPVIndex( PVIndexAccessor(*eventObj) );
562 if (rhPV.isValid()) {
563 vertices = rhPV.cptr();
566 for ( ; vtx_itr != vtx_end; ++vtx_itr ){
588 static const SG::ConstAccessor<int> BCIDGapBeforeTrainMinus12Acc (
"DFCommonJets_BCIDGapBeforeTrainMinus12");
605 if (rhPV.isValid()) {
606 vertices = rhPV.cptr();
608 ATH_MSG_WARNING(
" JetCalibrationTool::initializeEvent : Failed to retrieve primary vertices.");
610 return StatusCode::SUCCESS;
617 eventNPV = std::count_if(vertices->
begin(), vertices->
end(), [](
const xAOD::Vertex* vtx){ return vtx->vertexType() == xAOD::VxType::PileUp || vtx->vertexType() == xAOD::VxType::PriVtx;});
618 jetEventInfo.
setNPV(eventNPV);
624 static std::atomic<unsigned int> vertexIndexWarnings = 0;
625 if (jetEventInfo.
PVIndex() < 0 ||
static_cast<size_t>(jetEventInfo.
PVIndex()) >= vertices->
size())
627 ++vertexIndexWarnings;
628 if (vertexIndexWarnings < 20)
629 ATH_MSG_WARNING(
" JetCalibrationTool::initializeEvent : PV index is out of bounds.");
631 return StatusCode::SUCCESS;
637 static std::atomic<unsigned int> eventInfoWarningsMu = 0;
639 if ( rhEvtInfo.isValid() ) {
641 jetEventInfo.
setMu(eventInfoDecor(0));
643 ++eventInfoWarningsMu;
644 if ( eventInfoWarningsMu < 20 )
ATH_MSG_WARNING(
" JetCalibrationTool::initializeEvent : Failed to retrieve event information.");
645 jetEventInfo.
setMu(0);
648 static std::atomic<unsigned int> eventInfoWarningsPV = 0;
651 if (rhPV.isValid()) {
652 vertices = rhPV.cptr();
654 eventNPV = std::count_if(vertices->
begin(), vertices->
end(), [](
const xAOD::Vertex* vtx){ return vtx->vertexType() == xAOD::VxType::PileUp || vtx->vertexType() == xAOD::VxType::PriVtx;});
655 jetEventInfo.
setNPV(eventNPV);
657 ++eventInfoWarningsPV;
658 if ( eventInfoWarningsPV < 20 )
ATH_MSG_WARNING(
" JetCalibrationTool::initializeEvent : Failed to retrieve primary vertices.");
662 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.
◆ inputMetaStore()
AsgMetadataTool::MetaStorePtr_t asg::AsgMetadataTool::inputMetaStore |
( |
| ) |
const |
|
inherited |
Accessor for the input metadata store.
Definition at line 93 of file AsgMetadataTool.cxx.
95 #ifdef XAOD_STANDALONE
97 #else // XAOD_STANDALONE
99 #endif // XAOD_STANDALONE
◆ metaDataStop()
StatusCode asg::AsgMetadataTool::metaDataStop |
( |
| ) |
|
|
protectedvirtualinherited |
◆ modify()
|
inlinefinaloverridevirtualinherited |
◆ 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.
◆ outputMetaStore()
AsgMetadataTool::MetaStorePtr_t asg::AsgMetadataTool::outputMetaStore |
( |
| ) |
const |
|
inherited |
Accessor for the output metadata store.
Definition at line 102 of file AsgMetadataTool.cxx.
104 #ifdef XAOD_STANDALONE
106 #else // XAOD_STANDALONE
108 #endif // XAOD_STANDALONE
◆ 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, LundVariablesTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
Definition at line 131 of file AsgTool.cxx.
◆ renounce()
◆ renounceArray()
◆ setUseIncidents()
void asg::AsgMetadataTool::setUseIncidents |
( |
const bool |
flag | ) |
|
|
inlineprotectedinherited |
◆ sysInitialize()
StatusCode asg::AsgMetadataTool::sysInitialize |
( |
| ) |
|
|
virtualinherited |
Function initialising the tool in the correct way in Athena.
This function is used to set up the callbacks from IncidentSvc in Athena at the right time during initialisation, without the user having to do anything special in his/her code.
Reimplemented from AthCommonDataStore< AthCommonMsg< AlgTool > >.
Definition at line 115 of file AsgMetadataTool.cxx.
117 #ifndef XAOD_STANDALONE
124 incSvc->addListener(
this, IncidentType::BeginEvent, 0,
false );
129 #endif // not XAOD_STANDALONE
132 return StatusCode::SUCCESS;
◆ 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()
◆ m_actualMuKey
Initial value:{this, "actualInteractionsPerCrossing",
"EventInfo.actualInteractionsPerCrossing","Decoration for Actual Number of Interactions Per Crossing"}
Definition at line 69 of file JetCalibrationTool.h.
◆ m_beginInputFileCalled
bool asg::AsgMetadataTool::m_beginInputFileCalled |
|
privateinherited |
Flag helping to discover when the tool misses the opening of the first input file.
Definition at line 126 of file AsgMetadataTool.h.
◆ m_calibAreaTag
std::string JetCalibrationTool::m_calibAreaTag |
|
private |
◆ m_calibSeq
std::string JetCalibrationTool::m_calibSeq |
|
private |
◆ m_calibSteps
◆ m_config
std::string JetCalibrationTool::m_config |
|
private |
◆ m_detStore
◆ m_devMode
bool JetCalibrationTool::m_devMode {} |
|
private |
◆ m_dir
std::string JetCalibrationTool::m_dir |
|
private |
◆ m_doBcid
bool JetCalibrationTool::m_doBcid {true} |
|
private |
◆ m_doDNNCal
bool JetCalibrationTool::m_doDNNCal {} |
|
private |
◆ m_doGSC
bool JetCalibrationTool::m_doGSC {true} |
|
private |
◆ m_doJetArea
bool JetCalibrationTool::m_doJetArea {true} |
|
private |
◆ m_doOrigin
bool JetCalibrationTool::m_doOrigin {true} |
|
private |
◆ m_doResidual
bool JetCalibrationTool::m_doResidual {true} |
|
private |
◆ m_doSetDetectorEta
bool JetCalibrationTool::m_doSetDetectorEta {} |
|
private |
◆ m_eInfoName
std::string JetCalibrationTool::m_eInfoName |
|
private |
◆ m_evtInfoKey
◆ m_evtStore
◆ m_forceCalibFile_FastSim
std::string JetCalibrationTool::m_forceCalibFile_FastSim {} |
|
private |
◆ m_forceCalibFile_MC2MC
std::string JetCalibrationTool::m_forceCalibFile_MC2MC {} |
|
private |
◆ m_forceCalibFile_PtResidual
std::string JetCalibrationTool::m_forceCalibFile_PtResidual {} |
|
private |
◆ m_forceCampaign
std::string JetCalibrationTool::m_forceCampaign {} |
|
private |
◆ m_globalConfig
TEnv* JetCalibrationTool::m_globalConfig {} |
|
private |
◆ m_globalInsituCombMassConfig
std::vector<TEnv*> JetCalibrationTool::m_globalInsituCombMassConfig |
|
private |
◆ m_globalTimeDependentConfigs
std::vector<TEnv*> JetCalibrationTool::m_globalTimeDependentConfigs |
|
private |
◆ m_gscDepth
std::string JetCalibrationTool::m_gscDepth {"auto"} |
|
private |
◆ m_inputMetaStore
◆ m_insituCombMassCalib
bool JetCalibrationTool::m_insituCombMassCalib {} |
|
private |
◆ m_insituCombMassConfig
std::vector<TString> JetCalibrationTool::m_insituCombMassConfig |
|
private |
◆ m_isData
bool JetCalibrationTool::m_isData {true} |
|
private |
◆ m_jetAlgo
std::string JetCalibrationTool::m_jetAlgo |
|
private |
◆ m_jetScale
jetScale JetCalibrationTool::m_jetScale = jetScale::EM |
|
private |
◆ m_muKey
Initial value:{this, "averageInteractionsPerCrossingKey",
"EventInfo.averageInteractionsPerCrossing","Decoration for Average Interaction Per Crossing"}
Definition at line 67 of file JetCalibrationTool.h.
◆ m_nJetContainerName
std::string JetCalibrationTool::m_nJetContainerName |
|
private |
◆ m_nJetThreshold
float JetCalibrationTool::m_nJetThreshold {} |
|
private |
◆ m_originCorrectedClusters
bool JetCalibrationTool::m_originCorrectedClusters {} |
|
private |
◆ m_originScale
std::string JetCalibrationTool::m_originScale |
|
private |
◆ m_outputMetaStore
◆ m_pvKey
◆ m_rhoKey
◆ m_runBins
std::vector<double> JetCalibrationTool::m_runBins |
|
private |
◆ m_smearIndex
int JetCalibrationTool::m_smearIndex {-1} |
|
private |
◆ m_timeDependentCalib
bool JetCalibrationTool::m_timeDependentCalib {} |
|
private |
◆ m_timeDependentInsituConfigs
std::vector<TString> JetCalibrationTool::m_timeDependentInsituConfigs |
|
private |
◆ m_useIncidents
bool asg::AsgMetadataTool::m_useIncidents |
|
privateinherited |
◆ m_useNjetInResidual
bool JetCalibrationTool::m_useNjetInResidual {} |
|
private |
◆ m_useOriginVertex
bool JetCalibrationTool::m_useOriginVertex {} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
bool getDensity(EventDensityID id, double &v) const
Get a density variable from the object.
void setBcidDistanceFromFront(Int_t BcidDistanceFromFront)
Const iterator class for DataVector/DataList.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
Helper class to provide constant type-safe access to aux data.
void setBcidGapBeforeTrain(Int_t BcidGapBeforeTrain)
#define ATH_MSG_VERBOSE(x)
double resolution[nGasTypes][nParametersResolution]
StrV Vectorize(const TString &str, const TString &sep=" ")
uint32_t runNumber() const
The current event's run number.
virtual StatusCode initialize()=0
virtual void setOwner(IDataHandleHolder *o)=0
void setBcidGapBeforeTrainMinus12(Int_t BcidGapBeforeTrainMinus12)
void setNjet(double nJet)
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Handle class for reading a decoration on an object.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
MsgStream & msg() const
The standard message stream.
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.
Data class for event shapes.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
void setPVIndex(int PVindex)
std::string to_string(const DetectorType &type)
Class describing the basic event information.
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
VecD VectorizeD(const TString &str, const TString &sep=" ")
void setRunNumber(UInt_t RunNumber)
size_type size() const noexcept
Returns the number of elements in the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.