 |
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 |
| |
| StatusCode | getNominalResolutionHist (const xAOD::Jet &jet, double &resolution, const TH2D *histo) const |
| |
| 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 695 of file JetCalibrationTool.cxx.
699 if ( !
jet.getAttribute<
int>(
"OriginCorrected",
tmp) )
700 jet.setAttribute<
int>(
"OriginCorrected",
false);
701 if ( !
jet.getAttribute<
int>(
"PileupCorrected",
tmp) )
702 jet.setAttribute<
int>(
"PileupCorrected",
false);
707 jet.setAttribute<
float>(
"DetectorEta",jetconstitP4.eta());
712 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 269 of file JetCalibrationTool.cxx.
274 TString generatorsInfo{};
275 TString simFlavour{};
278 if (
inputMetaStore()->contains<xAOD::FileMetaData>(
"FileMetaData") ) {
285 if (dataYear >= 2015 && dataYear <= 2018) {
287 }
else if (dataYear >= 2022 && dataYear <= 2024) {
290 ATH_MSG_WARNING(
"Data year " << dataYear <<
" not recognized from file metadata. The corresponding mcCampaign will not be known.");
294 std::string str_generatorsInfo;
296 generatorsInfo = str_generatorsInfo;
298 std::string str_simFlavour;
300 simFlavour = str_simFlavour;
304 std::string str_mcCampaign;
306 str_mcCampaign.resize(4);
310 ATH_MSG_INFO(
"Have loaded metadata mcDSID:" << mcDSID <<
", generatorsInfo: " << generatorsInfo <<
", mcCampaign: " <<
mcCampaign <<
", simFlavour: " << simFlavour);
318 if ( calibration.EqualTo(
"Bcid") ){
319 m_globalConfig->SetValue(
"PileupStartingScale",
"JetBcidScaleMomentum");
320 std::unique_ptr<JetCalibrationStep> bcidCorr = std::make_unique<BcidOffsetCorrection>(this->
name()+
"_Bcid",
m_globalConfig, jetAlgo, calibPath,
m_isData);
323 return StatusCode::SUCCESS;
325 else if ( calibration.EqualTo(
"JetArea") || calibration.EqualTo(
"Residual") ) {
326 std::unique_ptr<JetCalibrationStep> puCorr = std::make_unique<JetPileupCorrection>(this->
name()+
"_Pileup",
m_globalConfig, jetAlgo, calibPath,
331 return StatusCode::SUCCESS;
333 else if ( calibration.EqualTo(
"EtaJES") || calibration.EqualTo(
"AbsoluteEtaJES") ) {
334 std::unique_ptr<JetCalibrationStep> etaJESCorr = std::make_unique<EtaJESCorrection>(this->
name()+
"_EtaJES",
m_globalConfig, jetAlgo, calibPath,
false,
m_devMode);
338 return StatusCode::SUCCESS;
340 else if ( calibration.EqualTo(
"EtaMassJES") ) {
341 std::unique_ptr<JetCalibrationStep> etaJESCorr = std::make_unique<EtaJESCorrection>(this->
name()+
"_EtaMassJES",
m_globalConfig, jetAlgo, calibPath,
true,
m_devMode);
345 return StatusCode::SUCCESS;
347 else if ( calibration.EqualTo(
"GSC") ) {
354 TString actualCalibPath;
356 actualCalibPath =
"JetCalibTools/";
358 actualCalibPath =
"JetCalibTool/CalibArea-" +
m_calibAreaTag +
"/";
363 ATH_MSG_WARNING(
"JPS_FastSim.doCalibration is set in JetCalibrationTool config but isData is set to true. Will turn off FastSim calibration.");
368 ATH_MSG_FATAL(
"JPS_FastSim.doCalibration is set in JetCalibrationTool config but file has no FileMetaData. Please fix the sample or configuration.");
369 return StatusCode::FAILURE;
372 JPS_FastSim->
msg().setLevel( this->
msg().
level() );
379 JPS_PtResidual->
msg().setLevel( this->
msg().
level() );
383 return StatusCode::SUCCESS;
385 else if ( calibration.EqualTo(
"GNNC") ) {
386 std::unique_ptr<JetCalibrationStep> gnnc = std::make_unique<GlobalNNCalibration>(this->
name()+
"_GNNC",
m_globalConfig,jetAlgo,calibPath,
m_devMode);
390 return StatusCode::SUCCESS;
392 else if ( calibration.EqualTo(
"MC2MC") ) {
394 TString actualCalibPath;
396 actualCalibPath =
"JetCalibTools/";
398 actualCalibPath =
"JetCalibTool/CalibArea-" +
m_calibAreaTag +
"/";
401 ATH_MSG_FATAL(
"MC2MC step of jet calibration is requested but file has no FileMetaData. Please fix the sample or configuration.");
402 return StatusCode::FAILURE;
404 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);
408 return StatusCode::SUCCESS;
410 else if ( calibration.EqualTo(
"JMS") ) {
411 std::unique_ptr<JetCalibrationStep> jetMassCorr = std::make_unique<JMSCorrection>(this->
name()+
"_JMS",
m_globalConfig, jetAlgo, calibPath,
m_devMode);
412 jetMassCorr->
msg().setLevel( this->
msg().
level() );
415 return StatusCode::SUCCESS;
417 else if ( calibration.EqualTo(
"InsituCombinedMass") ){
420 jetMassCorr->
msg().setLevel( this->
msg().
level() );
424 return StatusCode::SUCCESS;
426 else if ( calibration.EqualTo(
"Insitu") ) {
428 std::unique_ptr<JetCalibrationStep> insituDataCorr = std::make_unique<InsituDataCorrection>(this->
name()+
"_Insitu",
m_globalConfig, jetAlgo, calibPath,
m_devMode);
429 insituDataCorr->
msg().setLevel( this->
msg().
level() );
432 return StatusCode::SUCCESS;
435 ATH_MSG_INFO(
"Initializing Time-Dependent Insitu Corrections");
438 unsigned int firstRun =
static_cast<unsigned int>(
m_runBins.at(
i)+1.5);
442 insituDataCorr->
msg().setLevel( this->
msg().
level() );
446 return StatusCode::SUCCESS;
449 else if ( calibration.EqualTo(
"Smear") ) {
451 ATH_MSG_FATAL(
"Asked for smearing of data, which is not supported. Aborting.");
452 return StatusCode::FAILURE;
454 std::unique_ptr<JetCalibrationStep> jetSmearCorr = std::make_unique<JetSmearingCorrection>(this->
name()+
"_Smear",
m_globalConfig,jetAlgo,calibPath,
m_devMode);
459 return StatusCode::SUCCESS;
461 else if ( calibration.EqualTo(
"LargeRDNN") ) {
462 std::unique_ptr<JetCalibrationStep> largeR_dnn = std::make_unique<GlobalLargeRDNNCalibration>(this->
name()+
"_R10DNN",
m_globalConfig,calibPath,
m_devMode);
466 return StatusCode::SUCCESS;
468 ATH_MSG_FATAL(
"Calibration string not recognized: " << calibration <<
", aborting.");
469 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 |
◆ getNominalResolutionHist()
| StatusCode JetCalibrationTool::getNominalResolutionHist |
( |
const xAOD::Jet & |
jet, |
|
|
double & |
resolution, |
|
|
const TH2D * |
histo |
|
) |
| const |
Definition at line 736 of file JetCalibrationTool.cxx.
742 return StatusCode::FAILURE;
747 return StatusCode::FAILURE;
751 if (
histo->GetDimension() != 2)
753 ATH_MSG_ERROR(
"Blocking reading of a " <<
histo->GetDimension() <<
"D histogram as a 2D histogram");
754 return StatusCode::FAILURE;
759 double y = fabs(
jet.eta());
762 const double minX =
histo->GetXaxis()->GetBinLowEdge(1);
763 const double maxX =
histo->GetXaxis()->GetBinLowEdge(
histo->GetNbinsX()+1);
766 else if (
x <= minX )
768 const double minY =
histo->GetYaxis()->GetBinLowEdge(1);
769 const double maxY =
histo->GetYaxis()->GetBinLowEdge(
histo->GetNbinsY()+1);
772 else if (
y <= minY )
778 return StatusCode::SUCCESS;
◆ 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 69 of file JetCalibrationTool.cxx.
77 if ( jetAlgo.EqualTo(
"") || calibSeq.EqualTo(
"") ) {
78 ATH_MSG_FATAL(
"JetCalibrationTool::initialize : At least one of your constructor arguments is not set. Did you use the copy constructor?");
79 return StatusCode::FAILURE;
82 if (
m_config.empty() ) {
ATH_MSG_FATAL(
"No configuration file specified.");
return StatusCode::FAILURE; }
88 dir =
"JetCalibTools/";
90 else{
dir.insert(14,calibPath);}
94 ATH_MSG_FATAL(
"Couldn't find ConfigFile " << configPath );
return StatusCode::FAILURE;
96 ATH_MSG_INFO(
"Reading global JES settings from: " << configPath);
105 if ( calibSeq.Contains(
"JetArea") ) {
109 else {
ATH_MSG_FATAL(
"jetAlgo " << jetAlgo <<
" not recognized.");
return StatusCode::FAILURE; }
117 std::string rhoKey_config =
m_globalConfig->GetValue(
"RhoKey",
"None");
119 bool requireRhoInput =
false;
122 if ( !calibSeq.Contains(
"JetArea") && !calibSeq.Contains(
"Residual") ) {
125 }
else if ( calibSeq.Contains(
"JetArea") ) {
126 if (
m_rhoKey.key().compare(
"auto") == 0 && rhoKey_config.compare(
"None") == 0) {
137 else if(rhoKey_config.compare(
"None") != 0 &&
m_rhoKey.key().compare(
"auto") == 0){
140 requireRhoInput =
true;
141 if ( !calibSeq.Contains(
"Residual") )
m_doResidual =
false;
142 }
else if ( !calibSeq.Contains(
"JetArea") && calibSeq.Contains(
"Residual") ) {
144 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.");
150 "HLT_xAOD__JetContainer_a4tcemsubjesISFS");
152 if ( !calibSeq.Contains(
"Origin") )
m_doOrigin =
false;
153 if ( !calibSeq.Contains(
"GSC") && !calibSeq.Contains(
"GNNC"))
m_doGSC =
false;
154 if ( !calibSeq.Contains(
"Bcid") )
m_doBcid =
false;
155 if ( calibSeq.Contains(
"DNN") )
m_doDNNCal =
true;
158 if ( calibSeq.Contains(
"Insitu") && !
m_isData ) {
159 ATH_MSG_FATAL(
"JetCalibrationTool::initialize : calibSeq string contains Insitu with isData set to false. Can't apply in-situ correction to MC!!");
160 return StatusCode::FAILURE;
178 TEnv *globalConfig_insitu =
new TEnv();
179 int status = globalConfig_insitu->ReadFile(fn_insitu ,EEnvLevel(0));
180 if (
status!=0) {
ATH_MSG_FATAL(
"Cannot read config file " << fn_insitu );
return StatusCode::FAILURE; }
198 TEnv *globalInsituCombMass =
new TEnv();
199 int status = globalInsituCombMass->ReadFile(fn_comb ,EEnvLevel(0));
200 if (
status!=0) {
ATH_MSG_FATAL(
"Cannot read config file " << fn_comb );
return StatusCode::FAILURE; }
208 for (
unsigned int i=0;
i<vecCalibSeq.size(); ++
i) {
209 if ( vecCalibSeq[
i].EqualTo(
"Origin") || vecCalibSeq[
i].EqualTo(
"DEV") )
continue;
210 if ( vecCalibSeq[
i].EqualTo(
"Residual") &&
m_doJetArea )
continue;
223 ATH_MSG_ERROR(
"Residual calibration requested but no primary vertex container specified!");
224 return StatusCode::FAILURE;
227 if(
m_jetAlgo.find(
"PFlow")!=std::string::npos) {
228 ATH_MSG_ERROR(
"GSC calibration for PFlow requested but no primary vertex container specified!");
229 return StatusCode::FAILURE;
232 ATH_MSG_ERROR(
"GSC calibration with tracks requested but no primary vertex container specified!");
233 return StatusCode::FAILURE;
241 if (
m_calibSeq.find(
"Smear") == std::string::npos) {
244 TFile *f_LegJER =
new TFile(fn_JER,
"READ");
248 TString data_hist_name =
"JER_Nominal_data_" +
m_jetAlgo;
251 hist_data = (TH2D*)f_LegJER->Get(data_hist_name);
252 hist_MC = (TH2D*)f_LegJER->Get(mc_hist_name);
258 m_resMC = (TH2D*)hist_MC->Clone();
259 m_resMC->SetDirectory(
nullptr);
265 return StatusCode::SUCCESS;
◆ initializeEvent()
| StatusCode JetCalibrationTool::initializeEvent |
( |
JetEventInfo & |
jetEventInfo | ) |
const |
|
private |
Definition at line 484 of file JetCalibrationTool.cxx.
488 ATH_MSG_FATAL(
" JetCalibrationTool::initializeEvent : The tool was not initialized.");
489 return StatusCode::FAILURE;
505 if ( rhRhoKey.isValid() ) {
507 eventShape = rhRhoKey.cptr();
508 if ( !rhRhoKey.isValid() ) {
510 ATH_MSG_FATAL(
"Could not retrieve the xAOD::EventShape container " <<
m_rhoKey.key() <<
" from the input file");
511 return StatusCode::FAILURE;
515 return StatusCode::FAILURE;
521 ATH_MSG_FATAL(
"Could not retrieve xAOD::EventShape container " <<
m_rhoKey.key() <<
" from the input file");
522 return StatusCode::FAILURE;
535 return StatusCode::FAILURE;
539 return StatusCode::FAILURE;
544 for (
const auto *
jet : *
jets) {
555 static std::atomic<unsigned int> eventInfoWarnings = 0;
557 if ( rhEvtInfo.isValid() ) {
558 eventObj = rhEvtInfo.cptr();
561 if ( eventInfoWarnings < 20 )
562 ATH_MSG_ERROR(
" JetCalibrationTool::initializeEvent : Failed to retrieve event information.");
563 jetEventInfo.
setMu(0);
565 return StatusCode::SUCCESS;
572 if(!eventInfoDecor.isPresent()) {
574 return StatusCode::FAILURE;
576 jetEventInfo.
setMu( eventInfoDecor(0) );
586 if (
m_doGSC && PVIndexAccessor.isAvailable(*eventObj) )
587 jetEventInfo.
setPVIndex( PVIndexAccessor(*eventObj) );
592 if (rhPV.isValid()) {
593 vertices = rhPV.cptr();
596 for ( ; vtx_itr != vtx_end; ++vtx_itr ){
618 static const SG::ConstAccessor<int> BCIDGapBeforeTrainMinus12Acc (
"DFCommonJets_BCIDGapBeforeTrainMinus12");
635 if (rhPV.isValid()) {
636 vertices = rhPV.cptr();
638 ATH_MSG_WARNING(
" JetCalibrationTool::initializeEvent : Failed to retrieve primary vertices.");
640 return StatusCode::SUCCESS;
647 eventNPV = std::count_if(vertices->
begin(), vertices->
end(), [](
const xAOD::Vertex* vtx){ return vtx->vertexType() == xAOD::VxType::PileUp || vtx->vertexType() == xAOD::VxType::PriVtx;});
648 jetEventInfo.
setNPV(eventNPV);
654 static std::atomic<unsigned int> vertexIndexWarnings = 0;
655 if (jetEventInfo.
PVIndex() < 0 ||
static_cast<size_t>(jetEventInfo.
PVIndex()) >= vertices->
size())
657 ++vertexIndexWarnings;
658 if (vertexIndexWarnings < 20)
659 ATH_MSG_WARNING(
" JetCalibrationTool::initializeEvent : PV index is out of bounds.");
661 return StatusCode::SUCCESS;
667 static std::atomic<unsigned int> eventInfoWarningsMu = 0;
669 if ( rhEvtInfo.isValid() ) {
671 jetEventInfo.
setMu(eventInfoDecor(0));
673 ++eventInfoWarningsMu;
674 if ( eventInfoWarningsMu < 20 )
ATH_MSG_WARNING(
" JetCalibrationTool::initializeEvent : Failed to retrieve event information.");
675 jetEventInfo.
setMu(0);
678 static std::atomic<unsigned int> eventInfoWarningsPV = 0;
681 if (rhPV.isValid()) {
682 vertices = rhPV.cptr();
684 eventNPV = std::count_if(vertices->
begin(), vertices->
end(), [](
const xAOD::Vertex* vtx){ return vtx->vertexType() == xAOD::VxType::PileUp || vtx->vertexType() == xAOD::VxType::PriVtx;});
685 jetEventInfo.
setNPV(eventNPV);
687 ++eventInfoWarningsPV;
688 if ( eventInfoWarningsPV < 20 )
ATH_MSG_WARNING(
" JetCalibrationTool::initializeEvent : Failed to retrieve primary vertices.");
692 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 70 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_calibAreaTagLeg
| std::string JetCalibrationTool::m_calibAreaTagLeg |
|
private |
◆ m_calibFileLeg
| std::string JetCalibrationTool::m_calibFileLeg |
|
private |
◆ m_calibMCTypeLeg
| std::string JetCalibrationTool::m_calibMCTypeLeg |
|
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 68 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_resData
| TH2D* JetCalibrationTool::m_resData {} |
|
private |
◆ m_resMC
| TH2D* JetCalibrationTool::m_resMC {} |
|
private |
◆ 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.