ATLAS Offline Software
Loading...
Searching...
No Matches
CP::JetTileCorrectionTool Class Reference

#include <JetTileCorrectionTool.h>

Inheritance diagram for CP::JetTileCorrectionTool:
Collaboration diagram for CP::JetTileCorrectionTool:

Public Types

Definition of the StoreGate-like object's definition
typedef ServiceHandle< StoreGateSvcMetaStore_t
 Type of the metadata store object in Athena.
typedef const ServiceHandle< StoreGateSvc > & MetaStorePtr_t
 Type of the metadata store pointer in standalone mode.

Public Member Functions

 JetTileCorrectionTool (const std::string &name)
 Create a proper constructor for Athena.
virtual ~JetTileCorrectionTool ()
 Destructor:
virtual StatusCode initialize ()
 Function initialising the tool.
virtual CorrectionCode applyCorrection (xAOD::Jet &object)
 Apply the correction on a modifyable object.
virtual CorrectionCode correctedCopy (const xAOD::Jet &input, xAOD::Jet *&output)
 Create a corrected copy from a constant jet.
virtual bool isAffectedBySystematic (const SystematicVariation &systematic) const
 returns: whether this tool is affected by the given systematic
virtual SystematicSet affectingSystematics () const
 returns: the list of all systematics this tool can be affected by
virtual SystematicSet recommendedSystematics () const
 returns: the list of all systematics this tool recommends to use
const CP::SystematicSetappliedSystematics () const
 returns: the currently applied systematics
virtual StatusCode applySystematicVariation (const SystematicSet &systConfig)
 effects: configure this tool for the given list of systematic variations.
StatusCode registerSystematics ()
JTC::TS getTileStatus (const xAOD::Jet &jet)
StatusCode addTileStatus (const xAOD::Jet &jet)
void setRJET (float r)
virtual StatusCode sysInitialize ()
 Function initialising the tool in the correct way in Athena.
virtual void print () const
 Print the state of the tool.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
Functions providing access to the input/output metadata
MetaStorePtr_t inputMetaStore () const
 Accessor for the input metadata store.
MetaStorePtr_t outputMetaStore () const
 Accessor for the output metadata store.
Additional helper functions, not directly mimicking Athena
template<class T>
const T * getProperty (const std::string &name) const
 Get one of the tool's properties.
const std::string & msg_level_name () const __attribute__((deprecated))
 A deprecated function for getting the message level's name.
const std::string & getName (const void *ptr) const
 Get the name of an object that is / should be in the event store.
SG::sgkey_t getKey (const void *ptr) const
 Get the (hashed) key of an object that is in the event store.

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.
Callback functions helping in metadata reading/writing
void setUseIncidents (const bool flag)
virtual void handle (const Incident &inc)
 Function receiving incidents from IncidentSvc/TEvent.
virtual StatusCode beginInputFile ()
 Function called when a new input file is opened.
virtual StatusCode endInputFile ()
 Function called when the currently open input file got completely processed.
virtual StatusCode beginEvent ()
 Function called when a new events is loaded.
virtual StatusCode metaDataStop ()
 Function called when the tool should write out its metadata.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

void loadDeadUser ()
void loadDeadDB ()
std::vector< floatgetCorrections (const xAOD::Jet &j)
JTC::TS overlap (const xAOD::Jet &j, const JTC::Hole &region)
int getPtBin (float pt)
bool inIOV (const JTC::Hole &region, int run)
bool inHole (const xAOD::Jet &j, const JTC::Hole &rdead)
bool inHole (float eta, float phi, const JTC::Hole &rdead)
IPair getModulePosition (const xAOD::Jet &jet, const JTC::Hole &module)
void loadModulesFromMap (const xAOD::Jet &jet, JTC::TS &status, const std::map< std::string, JTC::Hole > &hmap, JTC::PART part=JTC::PART::LB, JTC::TYPE type=JTC::TYPE::DB)
StatusCode loadAllModules (const xAOD::Jet &jet, JTC::TS &status)
JTC::Hole partModToHole (int part, int mod)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

bool m_constScale = false
bool m_isMC = false
int m_current_run = -1
int m_NbinsPt = -1
std::vector< std::string > m_v_user_dead
TFile * m_rootFile = 0
std::string m_rootFileName
std::string m_bd_dead_mapFile
std::vector< JTC::Regionm_position_masked
TH1F * m_core_sys_LB = 0
 //needs to be transient!
TH1F * m_core_sys_EB = 0
std::map< int, TH1F * > m_pars_LB
std::map< int, TH1F * > m_pars_EB
std::map< std::string, JTC::Holem_db_dead_LB
std::map< std::string, JTC::Holem_db_dead_EB
std::map< std::string, JTC::Holem_user_dead_LB
std::map< std::string, JTC::Holem_user_dead_EB
float m_RJET
std::unordered_map< CP::SystematicSet, CP::SystematicSetm_systFilter
 Systematics filter map.
CP::SystematicSetm_appliedSystematics = 0
 Currently applied systematics.
MetaStore_t m_inputMetaStore
 Object accessing the input metadata store.
MetaStore_t m_outputMetaStore
 Object accessing the output metadata store.
bool m_beginInputFileCalled
 Flag helping to discover when the tool misses the opening of the first input file.
bool m_useIncidents
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 44 of file JetTileCorrectionTool.h.

Member Typedef Documentation

◆ MetaStore_t

Type of the metadata store object in Athena.

Definition at line 66 of file AsgMetadataTool.h.

◆ MetaStorePtr_t

Type of the metadata store pointer in standalone mode.

Definition at line 68 of file AsgMetadataTool.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ JetTileCorrectionTool()

CP::JetTileCorrectionTool::JetTileCorrectionTool ( const std::string & name)

Create a proper constructor for Athena.

Create a constructor for standalone usage

Definition at line 45 of file JetTileCorrectionTool.cxx.

46 : asg::AsgMetadataTool( name ),
47 m_RJET(0),
49 {
50 declareProperty("CorrectionFileName", m_rootFileName="JetTileCorrection/JetTile_pFile_010216.root", "Parametrization file");
51 declareProperty("MaskedRegionsMap", m_bd_dead_mapFile="JetTileCorrection/Tile_maskedDB_Run2.conf", "Masked regions DB file");
52 declareProperty("UserMaskedRegions", m_v_user_dead, "List of (ad-hoc) TileCal dead modules"); //array of extra dead modules
53 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::vector< std::string > m_v_user_dead
CP::SystematicSet * m_appliedSystematics
Currently applied systematics.

◆ ~JetTileCorrectionTool()

CP::JetTileCorrectionTool::~JetTileCorrectionTool ( )
virtual

Destructor:

Definition at line 55 of file JetTileCorrectionTool.cxx.

56 {
57 if ( m_rootFile ){
58 delete m_rootFile;
59 m_rootFile = nullptr;
60 }
61 }

Member Function Documentation

◆ addTileStatus()

StatusCode CP::JetTileCorrectionTool::addTileStatus ( const xAOD::Jet & jet)
virtual

Implements CP::IJetTileCorrectionTool.

Definition at line 489 of file JetTileCorrectionTool.cxx.

489 {
491 dec_status(jet) = (unsigned int) status; //save status decoration
492 return StatusCode::SUCCESS;
493 }
JTC::TS getTileStatus(const xAOD::Jet &jet)
static const SG::Decorator< unsigned int > dec_status("TileStatus")
status
Definition merge.py:16
setRawEt setRawPhi int

◆ affectingSystematics()

SystematicSet CP::JetTileCorrectionTool::affectingSystematics ( ) const
virtual

returns: the list of all systematics this tool can be affected by

Implements CP::IReentrantSystematicsTool.

Definition at line 228 of file JetTileCorrectionTool.cxx.

229 {
230 SystematicSet result;
231
232 result.insert(CP::SystematicVariation("JET_TILECORR_Uncertainty", 1));
233 result.insert(CP::SystematicVariation("JET_TILECORR_Uncertainty", -1));
234
235 return result;
236 }

◆ appliedSystematics()

const CP::SystematicSet & CP::JetTileCorrectionTool::appliedSystematics ( ) const
inline

returns: the currently applied systematics

Definition at line 80 of file JetTileCorrectionTool.h.

80 {
82 }

◆ applyCorrection()

CorrectionCode CP::JetTileCorrectionTool::applyCorrection ( xAOD::Jet & object)
virtual

Apply the correction on a modifyable object.

Implements CP::IJetTileCorrectionTool.

Definition at line 149 of file JetTileCorrectionTool.cxx.

149 {
150
151 //init decorations
152 dec_ptraw(jet) = jet.pt();
153 dec_status(jet) = (unsigned int) TS::UNKNOWN;
154
155 //check validity range of the correction
156 if( std::abs(jet.eta()) > iov_aeta_max ) return CorrectionCode::OutOfValidityRange;
157 if( jet.pt() < iov_pt_min || jet.pt() > iov_pt_max ) return CorrectionCode::OutOfValidityRange;
158
159 JTC::TS status = TS::GOOD;
160 if( loadAllModules(jet, status) != StatusCode::SUCCESS )
162
163 dec_status(jet) = (unsigned int) status; //save status decoration
164
165 // Nothing to do, return gracefully:
166 if(status == TS::GOOD) return CorrectionCode::Ok;
167
168 //get relative-pt factor to correct for
169 std::vector<float> cfactors = getCorrections(jet);
170
171 //if not correction need it, just leave
172 if(cfactors.empty()) return CorrectionCode::Ok;
173
174 // Redefine the jet 4vector by scaling both pt and mass
175 float newPt = jet.pt();
176 float newM = jet.m();
177
178 for(auto cf : cfactors){
179
180 newPt /= cf;
181 newM /= cf;
182 }
183
184 // Set the new jet 4vector
185 xAOD::JetFourMom_t newp4;
186 newp4.SetCoordinates(newPt, jet.eta(), jet.phi(), newM);
187
188 jet.setJetP4( newp4 );
189
190 ATH_MSG_DEBUG("JetTileCorrection applied.");
191
192 // Return gracefully:
193 return CorrectionCode::Ok;
194 }
#define ATH_MSG_DEBUG(x)
const float iov_aeta_max
const float iov_pt_max
const float iov_pt_min
@ Error
Some error happened during the object correction.
@ OutOfValidityRange
Input object is out of validity range.
@ Ok
The correction was done successfully.
std::vector< float > getCorrections(const xAOD::Jet &j)
StatusCode loadAllModules(const xAOD::Jet &jet, JTC::TS &status)
static const SG::Decorator< float > dec_ptraw("Ptraw")
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Definition JetTypes.h:17

◆ applySystematicVariation()

StatusCode CP::JetTileCorrectionTool::applySystematicVariation ( const SystematicSet & systConfig)
virtual

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). 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

Implements CP::ISystematicsTool.

Definition at line 244 of file JetTileCorrectionTool.cxx.

244 {
245
246 // First, check if we already know this systematic configuration
247 auto itr = m_systFilter.find(systConfig);
248
249 // If it's a new input set, we need to filter it
250 if( itr == m_systFilter.end() ){
251
252 // New systematic. We need to parse it.
253 static const CP::SystematicSet affectingSys = affectingSystematics();
254 CP::SystematicSet filteredSys;
255 if (!CP::SystematicSet::filterForAffectingSystematics(systConfig, affectingSys, filteredSys)){
256 ATH_MSG_ERROR("Unsupported combination of systematics passed to the tool!");
257 return StatusCode::FAILURE;
258 }
259
260 // Insert filtered set into the map
261 itr = m_systFilter.insert(std::make_pair(systConfig, filteredSys)).first;
262 }
263
264 CP::SystematicSet& mySysConf = itr->second;
265 m_appliedSystematics = &mySysConf;
266 return StatusCode::SUCCESS;
267 }
#define ATH_MSG_ERROR(x)
std::unordered_map< CP::SystematicSet, CP::SystematicSet > m_systFilter
Systematics filter map.
virtual SystematicSet affectingSystematics() const
returns: the list of all systematics this tool can be affected by
static StatusCode filterForAffectingSystematics(const SystematicSet &systConfig, const SystematicSet &affectingSystematics, SystematicSet &filteredSystematics)
description: filter the systematics for the affected systematics returns: success guarantee: strong f...

◆ beginEvent()

StatusCode asg::AsgMetadataTool::beginEvent ( )
protectedvirtualinherited

◆ 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, BookkeeperDumperTool, BookkeeperTool, PMGTools::PMGTruthWeightTool, TauAnalysisTools::TauEfficiencyCorrectionsTool, TauAnalysisTools::TauSmearingTool, Trig::TrigDecisionTool, Trig::xAODBunchCrossingTool, TrigConf::xAODConfigTool, xAODMaker::TriggerMenuMetaDataTool, and xAODMaker::TruthMetaDataTool.

Definition at line 185 of file AsgMetadataTool.cxx.

185 {
186
187 // Return gracefully:
188 return StatusCode::SUCCESS;
189 }

◆ correctedCopy()

CorrectionCode CP::JetTileCorrectionTool::correctedCopy ( const xAOD::Jet & input,
xAOD::Jet *& output )
virtual

Create a corrected copy from a constant jet.

Implements CP::IJetTileCorrectionTool.

Definition at line 196 of file JetTileCorrectionTool.cxx.

196 {
197
198 // A sanity check:
199 if( output ) {
200 ATH_MSG_WARNING( "Non-null pointer received. "
201 "There's a possible memory leak!" );
202 }
203
204 ATH_MSG_DEBUG("making the copy");
205
206 // Create the copy:
207 std::unique_ptr< xAOD::Jet > newobj( new xAOD::Jet( input ) );
208
209 // Apply the correction to it:
210 const CorrectionCode result = this->applyCorrection( *newobj );
211 if( result == CorrectionCode::Error ) {
212 ATH_MSG_ERROR( "Failed to apply correction to jet" );
213 } else {
214 output = newobj.release();
215 }
216
217 // Return the value from applyCorrection:
218 return result;
219 }
#define ATH_MSG_WARNING(x)
virtual CorrectionCode applyCorrection(xAOD::Jet &object)
Apply the correction on a modifyable object.
output
Definition merge.py:16
Jet_v1 Jet
Definition of the current "jet version".

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ endInputFile()

StatusCode asg::AsgMetadataTool::endInputFile ( )
protectedvirtualinherited

Function called when the currently open input file got completely processed.

Dummy implementation that can be overridden by the derived tool.

Reimplemented in BookkeeperDumperTool, BookkeeperTool, xAODMaker::TriggerMenuMetaDataTool, and xAODMaker::TruthMetaDataTool.

Definition at line 193 of file AsgMetadataTool.cxx.

193 {
194
195 // Return gracefully:
196 return StatusCode::SUCCESS;
197 }

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

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

◆ getCorrections()

std::vector< float > CP::JetTileCorrectionTool::getCorrections ( const xAOD::Jet & j)
private

Definition at line 537 of file JetTileCorrectionTool.cxx.

537 {
538
539 float ptlast = jet.pt();
540 int ptbin = getPtBin(ptlast);
541
542 //***
543 int ptbin_sys=m_core_sys_LB->FindBin(ptlast);
544 //***
545
546 std::vector<float> corrections = {};
547
548 if (ptbin < 0) return corrections; // no correction below 20GeV
549
550 //***
551 if (ptlast < 40000) return corrections;
552 //***
553
554 float clast = 1.;
555 float sigma = 0.;
556
557 if(m_appliedSystematics!=nullptr){ //nomimal value
558 sigma = m_appliedSystematics->getParameterByBaseName("JET_TILECORR_Uncertainty");
559 }
560
561 for(const auto& region : m_position_masked){
562
563 ptlast *= clast;
564 ptbin = getPtBin( ptlast );
565
566 if(region.part == PART::LB) {
567
568 //***
569 if (region.status == TS::CORE) clast = m_pars_LB[region.ep.first + Pix_eta * region.ep.second]->GetBinContent(ptbin) + sigma * m_core_sys_LB->GetBinContent(ptbin_sys); //systematics are bigger if we are in the core
570 else clast = m_pars_LB[region.ep.first + Pix_eta * region.ep.second]->GetBinContent(ptbin) + sigma * m_pars_LB[region.ep.first + Pix_eta * region.ep.second]->GetBinError(ptbin);
571 //***
572
573 }else{
574
575 //***
576 if (region.status == TS::CORE) clast = m_pars_EB[region.ep.first + Pix_eta * region.ep.second]->GetBinContent(ptbin) + sigma * m_core_sys_EB->GetBinContent(ptbin_sys); //systematics are bigger if we are in the core
577 else clast = m_pars_EB[region.ep.first + Pix_eta * region.ep.second]->GetBinContent(ptbin) + sigma * m_pars_EB[region.ep.first + Pix_eta * region.ep.second]->GetBinError(ptbin);
578 //***
579
580
581 }
582 corrections.push_back(clast);
583 }
584
585 return corrections;
586 }
#define Pix_eta
TH1F * m_core_sys_LB
//needs to be transient!
std::map< int, TH1F * > m_pars_EB
std::vector< JTC::Region > m_position_masked
std::map< int, TH1F * > m_pars_LB

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void * ptr) const
inherited

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
ptrThe 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.

119 {
120
121#ifdef XAOD_STANDALONE
122 // In case we use @c xAOD::TEvent, we have a direct function call
123 // for this.
124 return evtStore()->event()->getKey( ptr );
125#else
126 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127 return ( proxy == nullptr ? 0 : proxy->sgkey() );
128#endif // XAOD_STANDALONE
129 }
ServiceHandle< StoreGateSvc > & evtStore()

◆ getModulePosition()

IPair CP::JetTileCorrectionTool::getModulePosition ( const xAOD::Jet & jet,
const JTC::Hole & module )
private

Definition at line 414 of file JetTileCorrectionTool.cxx.

414 {
415
416 float eta = (mod.eta1+mod.eta2)/2.;
417 float phi = (mod.phi1+mod.phi2)/2.;
418
419 float jet_eta = jet.jetP4(xAOD::JetConstitScaleMomentum).eta();
421
422 float eta_dist = jet_eta-eta;
423 float phi_dist = TVector2::Phi_mpi_pi((double)jet_phi - (double)phi);
424
425 int inphi;
426
427 if(std::abs(phi_dist)<0.05){ inphi=0; }
428 else if(std::abs(phi_dist)<0.1){ inphi=1; }
429 else if(std::abs(phi_dist)<0.2){ inphi=2; }
430 else if(std::abs(phi_dist)<0.3){ inphi=3; }
431 else if(std::abs(phi_dist)<0.4){ inphi=4; }
432 else { inphi=5;}
433
434 float ieta = eta_dist/PIXWIDTH;
435 int ineta = (int)ieta;
436
437
438 //get parametrization from positive side always!
439 if(mod.eta1 < -0.1) ineta = -ineta;
440
441 return std::make_pair(ineta+8, inphi);
442 }
Scalar eta() const
pseudorapidity method
#define PIXWIDTH
JetFourMom_t jetP4() const
The full 4-momentum of the particle : internal jet type.
Definition Jet_v1.cxx:76
@ JetConstitScaleMomentum
Definition JetTypes.h:29

◆ 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
ptrThe 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.

106 {
107
108#ifdef XAOD_STANDALONE
109 // In case we use @c xAOD::TEvent, we have a direct function call
110 // for this.
111 return evtStore()->event()->getName( ptr );
112#else
113 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114 static const std::string dummy = "";
115 return ( proxy == nullptr ? dummy : proxy->name() );
116#endif // XAOD_STANDALONE
117 }

◆ getProperty()

template<class T>
const T * asg::AsgTool::getProperty ( const std::string & name) const
inherited

Get one of the tool's properties.

◆ getPtBin()

int CP::JetTileCorrectionTool::getPtBin ( float pt)
private

Definition at line 589 of file JetTileCorrectionTool.cxx.

589 {
590
591 if(pt < 20000.) return -1;
592
593 int ptbin = m_pars_LB[0]->FindBin(pt*0.001); // no correction below 20GeV
594
595 //adjust under/overflows
596 if (ptbin < 1) ptbin = 1;
597 if (ptbin > m_NbinsPt) ptbin = m_NbinsPt;
598
599 return ptbin;
600 }
setRcore setEtHad setFside pt

◆ getTileStatus()

JTC::TS CP::JetTileCorrectionTool::getTileStatus ( const xAOD::Jet & jet)
virtual

Implements CP::IJetTileCorrectionTool.

Definition at line 479 of file JetTileCorrectionTool.cxx.

479 {
480 JTC::TS status = TS::GOOD;
481 if( loadAllModules(jet, status) != StatusCode::SUCCESS ){
482 ATH_MSG_ERROR( "Something went wrong while loading/checking the modules!");
483 return TS::UNKNOWN;
484 }
485 return status;
486 }

◆ 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.

135 {
136
137 // Tell the user what's happening:
138 ATH_MSG_VERBOSE( "Callback received with incident: " << inc.type() );
139
140 // Call the appropriate member function:
141 if( inc.type() == IncidentType::BeginInputFile ) {
143 if( beginInputFile().isFailure() ) {
144 ATH_MSG_FATAL( "Failed to call beginInputFile()" );
145 throw std::runtime_error( "Couldn't call beginInputFile()" );
146 }
147 } else if( inc.type() == IncidentType::EndInputFile ) {
148 if( endInputFile().isFailure() ) {
149 ATH_MSG_FATAL( "Failed to call endInputFile()" );
150 throw std::runtime_error( "Couldn't call endInputFile()" );
151 }
152 } else if( inc.type() == IncidentType::BeginEvent ) {
153 // If the tool didn't catch the begin input file incident for the
154 // first input file of the job, then call the appropriate function
155 // now.
156 if( ! m_beginInputFileCalled ) {
158 if( beginInputFile().isFailure() ) {
159 ATH_MSG_FATAL( "Failed to call beginInputFile()" );
160 throw std::runtime_error( "Couldn't call beginInputFile()" );
161 }
162 }
163 if( beginEvent().isFailure() ) {
164 ATH_MSG_FATAL( "Failed to call beginEvent()" );
165 throw std::runtime_error( "Couldn't call beginEvent()" );
166 }
167
168 #ifdef XAOD_STANDALONE
169 } else if( inc.type() == IncidentType::MetaDataStop ) {
170 if( metaDataStop().isFailure() ) {
171 ATH_MSG_FATAL( "Failed to call metaDataStop()" );
172 throw std::runtime_error( "Couldn't call metaDataStop()" );
173 }
174
175 #endif // XAOD_STANDALONE
176 } else {
177 ATH_MSG_WARNING( "Unknown incident type received in AsgMetaDataTool: " << inc.type() );
178 }
179
180 return;
181 }
#define ATH_MSG_FATAL(x)
#define ATH_MSG_VERBOSE(x)
virtual StatusCode beginInputFile()
Function called when a new input file is opened.
virtual StatusCode beginEvent()
Function called when a new events is loaded.
bool m_beginInputFileCalled
Flag helping to discover when the tool misses the opening of the first input file.
virtual StatusCode endInputFile()
Function called when the currently open input file got completely processed.
virtual StatusCode metaDataStop()
Function called when the tool should write out its metadata.

◆ inHole() [1/2]

bool CP::JetTileCorrectionTool::inHole ( const xAOD::Jet & j,
const JTC::Hole & rdead )
private

Definition at line 608 of file JetTileCorrectionTool.cxx.

608 {
609 return inHole(jet.eta(), jet.phi(), rdead);
610 }
bool inHole(const xAOD::Jet &j, const JTC::Hole &rdead)

◆ inHole() [2/2]

bool CP::JetTileCorrectionTool::inHole ( float eta,
float phi,
const JTC::Hole & rdead )
private

Definition at line 613 of file JetTileCorrectionTool.cxx.

613 {
614
615 if(rdead.eta1==rdead.eta2 || rdead.phi1==rdead.phi2) return false;
616 if((eta > rdead.eta1) && (eta < rdead.eta2) && (phi > rdead.phi1) && (phi < rdead.phi2)) return true;
617
618 return false;
619 }

◆ inIOV()

bool CP::JetTileCorrectionTool::inIOV ( const JTC::Hole & region,
int run )
private

Definition at line 602 of file JetTileCorrectionTool.cxx.

602 {
603 if( region.iov.first>=0 && (run < region.iov.first) ) return false;
604 if( region.iov.second>=0 && (run > region.iov.second) ) return false;
605 return true;
606 }
std::pair< int, int > iov

◆ initialize()

StatusCode CP::JetTileCorrectionTool::initialize ( void )
virtual

Function initialising the tool.

Reimplemented from asg::AsgTool.

Definition at line 63 of file JetTileCorrectionTool.cxx.

63 {
64
65 // Greet the user:
66 ATH_MSG_INFO( "Initialising..." );
67
68#ifdef XAOD_STANDALONE
69 // Retrieve the event information (check if MC or data)
70 const xAOD::EventInfo* ei(nullptr);
71 ATH_CHECK( evtStore()->retrieve( ei, "EventInfo" ) );
72
73 m_isMC = ei->eventType( xAOD::EventInfo::IS_SIMULATION );
74#else
75 // Retrieve the metadata (check if MC or data)
76 std::string projectName = "";
77 ATH_CHECK( AthAnalysisHelper::retrieveMetadata("/TagInfo", "project_name", projectName, inputMetaStore() ) );
78 if ( projectName == "IS_SIMULATION" ) m_isMC = true;
79 else if (projectName.compare(0, 4, "data") == 0 ) m_isMC = false;
80 ATH_MSG_INFO("Set up JetTileCorrectionTool -- this is MC? " << m_isMC);
81#endif
82
83
84 //set RJET
85 setRJET( (float) RJET );
86
87 //Load user dead regions map
89
90 //Load dead regions in DB map
91 loadDeadDB();
92
93 // Load the ROOT file
95 m_rootFile = TFile::Open( fname.c_str(), "READ" );
96
97 if ( !m_rootFile ) {
98 ATH_MSG_ERROR("Parametrization file " << m_rootFileName << "not found!");
99 return StatusCode::FAILURE;
100 }
101
102 //Load parametrizations
103 TString sub="";
104
105 m_pars_LB={};
106 m_pars_EB={};
107
108
109 for(unsigned int ieta=0; ieta < Pix_eta ; ieta++){
110 for(unsigned int iphi=0; iphi < Pix_phi ; iphi++){
111 sub = Form("_%d_%d",ieta,iphi);
112
113 //flatten 2D-etaphi-to-1D
114 m_pars_LB[ieta+iphi*Pix_eta]=(TH1F*)m_rootFile->Get("param_LB_fit"+sub);
115 m_pars_EB[ieta+iphi*Pix_eta]=(TH1F*)m_rootFile->Get("param_EB_fit"+sub);
116 m_pars_LB[ieta+iphi*Pix_eta]->SetDirectory(nullptr);
117 m_pars_EB[ieta+iphi*Pix_eta]->SetDirectory(nullptr);
118 }
119 }
120
121 //***
122 m_core_sys_LB=(TH1F*)m_rootFile->Get("sys_LB");
123 m_core_sys_EB=(TH1F*)m_rootFile->Get("sys_EB");
124 //***
125
126 //book number of pt bins in parametrization for later
127 m_NbinsPt = m_pars_LB[0]->GetNbinsX();
128
129
130 // set up for default running without systematics
131 if (!applySystematicVariation (SystematicSet ())) {
132 ATH_MSG_ERROR("Loading the central value systematic set failed.");
133 return StatusCode::FAILURE;
134 }
135 // Add the affecting systematics to the global registry
136 SystematicRegistry& registry = SystematicRegistry::getInstance();
137 if (registry.registerSystematics(*this) != StatusCode::SUCCESS){
138 ATH_MSG_ERROR("Unable to register the systematics");
139 return StatusCode::FAILURE;
140 }
141
142 ATH_MSG_DEBUG("Successfully initialized! ");
143
144 // Return gracefully:
145 return StatusCode::SUCCESS;
146 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define Pix_phi
#define RJET
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
static std::string retrieveMetadata(const std::string &folder, const std::string &key, const ServiceHandle< StoreGateSvc > &inputMetaStore)
method that always returns as a string you can use from, e.g, pyROOT with evt = ROOT....
virtual StatusCode applySystematicVariation(const SystematicSet &systConfig)
effects: configure this tool for the given list of systematic variations.
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
StatusCode registerSystematics(const IReentrantSystematicsTool &tool)
effects: register all the systematics from the tool
MetaStorePtr_t inputMetaStore() const
Accessor for the input metadata store.
@ IS_SIMULATION
true: simulation, false: data
retrieve(aClass, aKey=None)
Definition PyKernel.py:110
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
EventInfo_v1 EventInfo
Definition of the latest event info version.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

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.

93 {
94
95#ifdef XAOD_STANDALONE
96 return &m_inputMetaStore;
97#else // XAOD_STANDALONE
98 return m_inputMetaStore;
99#endif // XAOD_STANDALONE
100 }
MetaStore_t m_inputMetaStore
Object accessing the input metadata store.

◆ isAffectedBySystematic()

bool CP::JetTileCorrectionTool::isAffectedBySystematic ( const SystematicVariation & systematic) const
virtual

returns: whether this tool is affected by the given systematic

Implements CP::ISystematicsTool.

Definition at line 221 of file JetTileCorrectionTool.cxx.

222 {
223 SystematicSet sys = affectingSystematics();
224 return sys.find (systematic) != sys.end ();
225 }

◆ loadAllModules()

StatusCode CP::JetTileCorrectionTool::loadAllModules ( const xAOD::Jet & jet,
JTC::TS & status )
private

Definition at line 500 of file JetTileCorrectionTool.cxx.

500 {
501
502 m_position_masked.clear();
503
504 //Read dead regions DB if we change run/LB
505 if(!m_isMC){
506
507 const xAOD::EventInfo* ei = nullptr;
508 if( evtStore()->retrieve( ei, "EventInfo" ).isFailure() ) {
509 ATH_MSG_WARNING( "No EventInfo object could be retrieved" );
510 }
511
512 if (!ei) {
513 ATH_MSG_ERROR( "Cannot retrieve the EventInfo" );
514 return StatusCode::FAILURE;
515 }
516
517 m_current_run = ei->runNumber();
518
519 }
520
521 //load DB-defined modules in LB
522 loadModulesFromMap(jet, status, m_db_dead_LB, PART::LB, TYPE::DB);
523 //load DB-defined modules in EB
524 loadModulesFromMap(jet, status, m_db_dead_EB, PART::EB, TYPE::DB);
525
526 //load user-defined modules in LB
527 loadModulesFromMap(jet, status, m_user_dead_LB, PART::LB, TYPE::User);
528 //load user-defined modules in EB
529 loadModulesFromMap(jet, status, m_user_dead_EB, PART::EB, TYPE::User);
530
531 //sort modules by correction size (in decreasing order)
532 std::sort(m_position_masked.begin(), m_position_masked.end(), std::greater<Region>());
533
534 return StatusCode::SUCCESS;
535 }
std::map< std::string, JTC::Hole > m_db_dead_LB
std::map< std::string, JTC::Hole > m_user_dead_LB
std::map< std::string, JTC::Hole > m_user_dead_EB
void loadModulesFromMap(const xAOD::Jet &jet, JTC::TS &status, const std::map< std::string, JTC::Hole > &hmap, JTC::PART part=JTC::PART::LB, JTC::TYPE type=JTC::TYPE::DB)
std::map< std::string, JTC::Hole > m_db_dead_EB
uint32_t runNumber() const
The current event's run number.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ loadDeadDB()

void CP::JetTileCorrectionTool::loadDeadDB ( )
private

Definition at line 340 of file JetTileCorrectionTool.cxx.

340 {
341
342 m_db_dead_LB = {};
343 m_db_dead_EB = {};
344
345 std::vector<Hole> dbholes={};
346
347 //Simulation
348 if(m_isMC){
349
350 //-- MC15c : no dead modules
351 //COOLOFL_TILE/OFLP200 /TILE/OFL02/STATUS/ADC TileOfl02StatusAdc-IOVDEP-05
352 //COOLOFL_TILE/OFLP200 /TILE/OFL02/NOISE/CELL TileOfl02NoiseCell-OF2-07
353 //
354
355 //TODO: add RunNumber check and add these below if running on MC15b //M.T.
356
357 //-- MC15b : two dead modules
358 //COOLOFL_TILE/OFLP200 /TILE/OFL02/STATUS/ADC TileOfl02StatusAdc-IOVDEP-05
359 //COOLOFL_TILE/OFLP200 /TILE/OFL02/NOISE/CELL TileOfl02NoiseCell-OF2-07
360 //
361 // //LBA10
362 // Hole rdead = partModToHole(0, 9);
363 // rdead.iov = make_pair(0,1000000); //no range
364 // dbholes.push_back( rdead );
365
366 // //EBC21
367 // rdead = partModToHole(3, 20);
368 // rdead.iov = make_pair(0,1000000); //no range
369 // dbholes.push_back( rdead );
370
371 }
372 else{ //DATA
373
374 //read map file
375 std::string mapFilename = PathResolverFindCalibFile(m_bd_dead_mapFile);
376 std::ifstream mapFile;
377 mapFile.open(mapFilename);
378
379 std::string line;
380 while (std::getline(mapFile, line)){
381
382 if(line[0]=='#') continue;
383
384 std::istringstream iss(line);
385 int part,mod, irun, erun;
386 std::string modname;
387
388 if (!(iss >> part >> mod >> irun >> erun >> modname)) { break; } // error
389
390 Hole rdead = partModToHole(part, mod);
391 rdead.iov = std::make_pair(irun,erun);
392 dbholes.push_back( rdead );
393
394 }
395 }
396
397 int dbh=1;
398 for(const auto& h : dbholes){
399 if(std::abs(h.eta1)>1 || std::abs(h.eta2)>1){
400 m_db_dead_EB[Form("DB%d",dbh)] = h;
401 }
402 else{
403 m_db_dead_LB[Form("DB%d",dbh)] = h;
404 }
405
406 dbh++;
407
408 // ATH_MSG_INFO("Adding DB dead module at (eta1,phi1)=(" << h.eta1 << "," << h.phi1 << ")");
409 ATH_MSG_DEBUG("Adding DB dead module at (eta1,phi1)=(" << h.eta1 << "," << h.phi1 << ")");
410 }
411 }
JTC::Hole partModToHole(int part, int mod)
modname
print (" ==> moduletype")
Definition PyAthena.py:130

◆ loadDeadUser()

void CP::JetTileCorrectionTool::loadDeadUser ( )
private

Definition at line 289 of file JetTileCorrectionTool.cxx.

289 {
290
291 m_user_dead_LB = {};
292 m_user_dead_EB = {};
293
294 //Format accepted for module input: "LBA 10" == "0 9"
295 for(auto& r : m_v_user_dead){
296
297 std::stringstream ss(r);
298 std::string s;
299
300 std::vector<std::string> tokens;
301 while (getline(ss, s, ' ')) {
302 tokens.push_back(s);
303 }
304
305 if(tokens.size() < 2){
306 ATH_MSG_ERROR("Part-Module pair " << r << " not known! Please use \"PART MOD\" format ");
307 continue;
308 }
309
310 int i_part = 0;
311 int i_mod = std::atoi((tokens.at(1)).c_str());
312 if (tokens.at(0).find('B') != std::string::npos)
313 i_mod -= 1; // substract 1 from second coor if given in format "LBA 4"
314
315 if(tokens.at(0)=="LBA" || tokens.at(0)== "0"){
316 i_part = 0;
317 }else if (tokens.at(0)=="LBC" || tokens.at(0)== "1"){
318 i_part = 1;
319 }else if (tokens.at(0)=="EBA" || tokens.at(0)== "2"){
320 i_part = 2;
321 }else if (tokens.at(0)=="EBC" || tokens.at(0)== "3"){
322 i_part = 3;
323 }else{
324 ATH_MSG_ERROR("Part-Module pair " << r << " not known! Please use \"PART MOD\" format ");
325 continue;
326 }
327
328 //Classify into long and extended barrel modules
329 Hole rdead = partModToHole(i_part, i_mod);
330
331 if( i_part < 2 )
332 m_user_dead_LB[r] = rdead; //LBA, LBC
333 else
334 m_user_dead_EB[r] = rdead; //EBA, EBC
335
336 }
337 }
static Double_t ss
int r
Definition globals.cxx:22

◆ loadModulesFromMap()

void CP::JetTileCorrectionTool::loadModulesFromMap ( const xAOD::Jet & jet,
JTC::TS & status,
const std::map< std::string, JTC::Hole > & hmap,
JTC::PART part = JTC::PART::LB,
JTC::TYPE type = JTC::TYPE::DB )
private

Definition at line 444 of file JetTileCorrectionTool.cxx.

444 {
445
446 float cfactor(0.);
447 IPair mpos;
448 JTC::TS cstatus = TS::GOOD;
449
450 for (const auto& mod : hmap){
451
452 //check IOV for DB defined modules
453 if(!m_isMC && type == TYPE::DB && !inIOV(mod.second, m_current_run)) continue;
454
455 cstatus = overlap(jet,mod.second);
456 if(cstatus != TS::GOOD){
457
458 //get eta-phi position (relative to jet axis)
459 mpos = getModulePosition(jet,mod.second);
460
461 //get correction (1D-array)
462 if(part == PART::LB)
463 cfactor = m_pars_LB[mpos.first + Pix_eta * mpos.second]->GetBinContent(getPtBin(jet.pt()));
464 else
465 cfactor = m_pars_EB[mpos.first + Pix_eta * mpos.second]->GetBinContent(getPtBin(jet.pt()));
466
467 //overwrite global status with worst case
468 if(cstatus > status) status = cstatus;
469
470 //create new d-region and add it to the list
471 m_position_masked.emplace_back( mod.second,mpos,part,cfactor,cstatus,type );
472
473 }
474 }
475
476 }
std::pair< int, int > IPair
IPair getModulePosition(const xAOD::Jet &jet, const JTC::Hole &module)
bool inIOV(const JTC::Hole &region, int run)
JTC::TS overlap(const xAOD::Jet &j, const JTC::Hole &region)
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition Jet_v1.cxx:44

◆ metaDataStop()

StatusCode asg::AsgMetadataTool::metaDataStop ( )
protectedvirtualinherited

Function called when the tool should write out its metadata.

Dummy implementation that can be overridden by the derived tool.

Reimplemented in BookkeeperDumperTool, BookkeeperTool, xAODMaker::TriggerMenuMetaDataTool, and xAODMaker::TruthMetaDataTool.

Definition at line 209 of file AsgMetadataTool.cxx.

209 {
210
211 // Return gracefully:
212 return StatusCode::SUCCESS;
213 }

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ 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.

101 {
102
103 return MSG::name( msg().level() );
104 }
MsgStream & msg() const
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition MsgLevel.cxx:19

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

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.

102 {
103
104#ifdef XAOD_STANDALONE
105 return &m_outputMetaStore;
106#else // XAOD_STANDALONE
107 return m_outputMetaStore;
108#endif // XAOD_STANDALONE
109 }
MetaStore_t m_outputMetaStore
Object accessing the output metadata store.

◆ overlap()

JTC::TS CP::JetTileCorrectionTool::overlap ( const xAOD::Jet & j,
const JTC::Hole & region )
private

Definition at line 270 of file JetTileCorrectionTool.cxx.

270 {
271
272 double phisize = region.phi2-region.phi1;
273 double phicenter = (region.phi1+region.phi2)/2.;
274 float jet_eta = j.jetP4(xAOD::JetConstitScaleMomentum).eta();
276
277 // GOOD?
278 if( region.eta2 < (jet_eta-m_RJET) ) return TS::GOOD;
279 if( region.eta1 > (jet_eta+m_RJET) ) return TS::GOOD;
280 if( std::abs(TVector2::Phi_mpi_pi(jet_phi-phicenter)) > m_RJET+phisize/2.) return TS::GOOD;
281
282 // CORE-BAD?
283 if( inHole(jet_eta, jet_phi, region) ) return TS::CORE;
284
285 // CORE-EDGE? (elsewhere)
286 return TS::EDGE;
287 }

◆ partModToHole()

Hole CP::JetTileCorrectionTool::partModToHole ( int part,
int mod )
private

Definition at line 621 of file JetTileCorrectionTool.cxx.

621 {
622
623 Hole region;
624 region.iov = std::make_pair(0,1000000); //a dummy full IOV is set by default
625
626 switch(part){
627 case 0: //LBA
628 region.eta1=0;
629 region.eta2=0.9;
630 break;
631 case 1: //LBC
632 region.eta1=-0.9;
633 region.eta2=0;
634 break;
635 case 2: //EBA
636 region.eta1=0.8;
637 region.eta2=1.7;
638 break;
639 case 3: //EBC
640 region.eta1=-1.7;
641 region.eta2=-0.8;
642 break;
643 default:
644 std::cout<<"Bad partition value passed!\n";
645 region.eta1=-999;
646 region.eta2=-999;
647 region.phi1=-999;
648 region.phi2=-999;
649 return region;
650 }
651 if(mod<32){
652 region.phi1=((double)mod)*width;
653 region.phi2=region.phi1+width;
654 }
655 else if(mod<64){
656 region.phi1=((double)mod)*width-2.*M_PI;
657 region.phi2=region.phi1+width;
658 }
659 else{
660 std::cout<<"Bad module value passed!\n";
661 region.eta1=-999;
662 region.eta2=-999;
663 region.phi1=-999;
664 region.phi2=-999;
665 return region;
666 }
667 return region;
668 }
#define M_PI
const double width

◆ print()

◆ recommendedSystematics()

SystematicSet CP::JetTileCorrectionTool::recommendedSystematics ( ) const
virtual

returns: the list of all systematics this tool recommends to use

Implements CP::IReentrantSystematicsTool.

Definition at line 238 of file JetTileCorrectionTool.cxx.

239 {
240 return affectingSystematics();
241 }

◆ registerSystematics()

StatusCode CP::JetTileCorrectionTool::registerSystematics ( )

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setRJET()

void CP::JetTileCorrectionTool::setRJET ( float r)
virtual

Implements CP::IJetTileCorrectionTool.

Definition at line 495 of file JetTileCorrectionTool.cxx.

495 {
496 m_RJET = r;
497 }

◆ setUseIncidents()

void asg::AsgMetadataTool::setUseIncidents ( const bool flag)
inlineprotectedinherited

Definition at line 132 of file AsgMetadataTool.h.

133 {
135 }
bool flag
Definition master.py:29

◆ 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.

115 {
116
117#ifndef XAOD_STANDALONE
118 if (m_useIncidents) {
119 // Connect to the IncidentSvc:
120 ServiceHandle< IIncidentSvc > incSvc( "IncidentSvc", name() );
121 ATH_CHECK( incSvc.retrieve() );
122
123 // Set up the right callbacks: don't rethrow exceptions, any failure and we should end
124 incSvc->addListener( this, IncidentType::BeginEvent, 0, false );
125 }
126 // Let the base class do its thing:
127 ATH_CHECK( AlgTool::sysInitialize() );
128
129#endif // not XAOD_STANDALONE
130
131 // Return gracefully:
132 return StatusCode::SUCCESS;
133 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_appliedSystematics

CP::SystematicSet* CP::JetTileCorrectionTool::m_appliedSystematics = 0
private

Currently applied systematics.

Definition at line 156 of file JetTileCorrectionTool.h.

◆ m_bd_dead_mapFile

std::string CP::JetTileCorrectionTool::m_bd_dead_mapFile
private

Definition at line 134 of file JetTileCorrectionTool.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_constScale

bool CP::JetTileCorrectionTool::m_constScale = false
private

Definition at line 121 of file JetTileCorrectionTool.h.

◆ m_core_sys_EB

TH1F* CP::JetTileCorrectionTool::m_core_sys_EB = 0
private

Definition at line 140 of file JetTileCorrectionTool.h.

◆ m_core_sys_LB

TH1F* CP::JetTileCorrectionTool::m_core_sys_LB = 0
private

//needs to be transient!

Definition at line 139 of file JetTileCorrectionTool.h.

◆ m_current_run

int CP::JetTileCorrectionTool::m_current_run = -1
private

Definition at line 124 of file JetTileCorrectionTool.h.

◆ m_db_dead_EB

std::map<std::string,JTC::Hole> CP::JetTileCorrectionTool::m_db_dead_EB
private

Definition at line 146 of file JetTileCorrectionTool.h.

◆ m_db_dead_LB

std::map<std::string,JTC::Hole> CP::JetTileCorrectionTool::m_db_dead_LB
private

Definition at line 145 of file JetTileCorrectionTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_inputMetaStore

MetaStore_t asg::AsgMetadataTool::m_inputMetaStore
privateinherited

Object accessing the input metadata store.

Definition at line 119 of file AsgMetadataTool.h.

◆ m_isMC

bool CP::JetTileCorrectionTool::m_isMC = false
private

Definition at line 122 of file JetTileCorrectionTool.h.

◆ m_NbinsPt

int CP::JetTileCorrectionTool::m_NbinsPt = -1
private

Definition at line 127 of file JetTileCorrectionTool.h.

◆ m_outputMetaStore

MetaStore_t asg::AsgMetadataTool::m_outputMetaStore
privateinherited

Object accessing the output metadata store.

Definition at line 121 of file AsgMetadataTool.h.

◆ m_pars_EB

std::map<int,TH1F*> CP::JetTileCorrectionTool::m_pars_EB
private

Definition at line 144 of file JetTileCorrectionTool.h.

◆ m_pars_LB

std::map<int,TH1F*> CP::JetTileCorrectionTool::m_pars_LB
private

Definition at line 143 of file JetTileCorrectionTool.h.

◆ m_position_masked

std::vector<JTC::Region> CP::JetTileCorrectionTool::m_position_masked
private

Definition at line 136 of file JetTileCorrectionTool.h.

◆ m_RJET

float CP::JetTileCorrectionTool::m_RJET
private

Definition at line 150 of file JetTileCorrectionTool.h.

◆ m_rootFile

TFile* CP::JetTileCorrectionTool::m_rootFile = 0
private

Definition at line 131 of file JetTileCorrectionTool.h.

◆ m_rootFileName

std::string CP::JetTileCorrectionTool::m_rootFileName
private

Definition at line 132 of file JetTileCorrectionTool.h.

◆ m_systFilter

std::unordered_map<CP::SystematicSet, CP::SystematicSet> CP::JetTileCorrectionTool::m_systFilter
private

Systematics filter map.

Definition at line 153 of file JetTileCorrectionTool.h.

◆ m_useIncidents

bool asg::AsgMetadataTool::m_useIncidents
privateinherited

Definition at line 128 of file AsgMetadataTool.h.

◆ m_user_dead_EB

std::map<std::string,JTC::Hole> CP::JetTileCorrectionTool::m_user_dead_EB
private

Definition at line 148 of file JetTileCorrectionTool.h.

◆ m_user_dead_LB

std::map<std::string,JTC::Hole> CP::JetTileCorrectionTool::m_user_dead_LB
private

Definition at line 147 of file JetTileCorrectionTool.h.

◆ m_v_user_dead

std::vector<std::string> CP::JetTileCorrectionTool::m_v_user_dead
private

Definition at line 129 of file JetTileCorrectionTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: