|
ATLAS Offline Software
|
Go to the documentation of this file.
13 #ifndef XAOD_STANDALONE // For now metadata is Athena-only
46 m_appliedSystematics(nullptr)
66 #ifdef XAOD_STANDALONE
74 std::string projectName =
"";
76 if ( projectName ==
"IS_SIMULATION" )
m_isMC =
true;
77 else if (projectName.compare(0, 4,
"data") == 0 )
m_isMC =
false;
97 return StatusCode::FAILURE;
107 for(
unsigned int ieta=0; ieta <
Pix_eta ; ieta++){
108 for(
unsigned int iphi=0; iphi <
Pix_phi ; iphi++){
109 sub = Form(
"_%d_%d",ieta,iphi);
130 ATH_MSG_ERROR(
"Loading the central value systematic set failed.");
131 return StatusCode::FAILURE;
135 if (
registry.registerSystematics(*
this) != StatusCode::SUCCESS){
137 return StatusCode::FAILURE;
143 return StatusCode::SUCCESS;
150 dec_ptraw(
jet) =
jet.pt();
173 float newPt =
jet.pt();
174 float newM =
jet.m();
176 for(
auto cf : cfactors){
184 newp4.SetCoordinates(newPt,
jet.eta(),
jet.phi(), newM);
186 jet.setJetP4( newp4 );
199 "There's a possible memory leak!" );
212 output = newobj.release();
222 return sys.find (systematic) !=
sys.end ();
254 ATH_MSG_ERROR(
"Unsupported combination of systematics passed to the tool!");
255 return StatusCode::FAILURE;
259 itr =
m_systFilter.insert(std::make_pair(systConfig, filteredSys)).first;
264 return StatusCode::SUCCESS;
270 double phisize = region.
phi2-region.
phi1;
271 double phicenter = (region.
phi1+region.
phi2)/2.;
295 std::stringstream
ss(
r);
298 std::vector<std::string>
tokens;
299 while (getline(
ss,
s,
' ')) {
304 ATH_MSG_ERROR(
"Part-Module pair " <<
r <<
" not known! Please use \"PART MOD\" format ");
310 if (
tokens.at(0).find(
'B') != std::string::npos)
322 ATH_MSG_ERROR(
"Part-Module pair " <<
r <<
" not known! Please use \"PART MOD\" format ");
343 std::vector<Hole> dbholes={};
374 std::ifstream mapFile;
375 mapFile.open(mapFilename);
378 while (std::getline(mapFile,
line)){
380 if(
line[0]==
'#')
continue;
382 std::istringstream iss(
line);
389 rdead.
iov = std::make_pair(irun,erun);
390 dbholes.push_back( rdead );
396 for(
const auto&
h : dbholes){
397 if(std::abs(
h.eta1)>1 || std::abs(
h.eta2)>1){
407 ATH_MSG_DEBUG(
"Adding DB dead module at (eta1,phi1)=(" <<
h.eta1 <<
"," <<
h.phi1 <<
")");
414 float eta = (
mod.eta1+
mod.eta2)/2.;
420 float eta_dist = jet_eta-eta;
425 if(std::abs(phi_dist)<0.05){ inphi=0; }
426 else if(std::abs(phi_dist)<0.1){ inphi=1; }
427 else if(std::abs(phi_dist)<0.2){ inphi=2; }
428 else if(std::abs(phi_dist)<0.3){ inphi=3; }
429 else if(std::abs(phi_dist)<0.4){ inphi=4; }
433 int ineta = (
int)ieta;
437 if(
mod.eta1 < -0.1) ineta = -ineta;
439 return std::make_pair(ineta+8, inphi);
448 for (
const auto&
mod : hmap){
480 ATH_MSG_ERROR(
"Something went wrong while loading/checking the modules!");
490 return StatusCode::SUCCESS;
512 return StatusCode::FAILURE;
532 return StatusCode::SUCCESS;
537 float ptlast =
jet.pt();
544 std::vector<float> corrections = {};
546 if (ptbin < 0)
return corrections;
549 if (ptlast < 40000)
return corrections;
567 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);
574 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);
580 corrections.push_back(clast);
589 if(
pt < 20000.)
return -1;
594 if (ptbin < 1) ptbin = 1;
601 if( region.
iov.first>=0 && (
run < region.
iov.first) )
return false;
602 if( region.
iov.second>=0 && (
run > region.
iov.second) )
return false;
622 region.
iov = std::make_pair(0,1000000);
642 std::cout<<
"Bad partition value passed!\n";
658 std::cout<<
"Bad module value passed!\n";
def retrieve(aClass, aKey=None)
std::pair< int, int > iov
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Class to wrap a set of SystematicVariations.
JetFourMom_t jetP4() const
The full 4-momentum of the particle : internal jet type.
__HOSTDEV__ double Phi_mpi_pi(double)
@ IS_SIMULATION
true: simulation, false: data
Select isolated Photons, Electrons and Muons.
float getParameterByBaseName(const std::string &basename) const
returns: the parameter value for the given basename
modname
print (" ==> moduletype")
uint32_t runNumber() const
The current event's run number.
@ JetConstitScaleMomentum
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
@ OutOfValidityRange
Input object is out of validity range.
@ Error
Some error happened during the object correction.
Helper class to provide type-safe access to aux data.
::StatusCode StatusCode
StatusCode definition for legacy code.
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Class describing the basic event information.
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
@ Ok
The correction was done successfully.
#define ATH_MSG_WARNING(x)
This module implements the central registry for handling systematic uncertainties with CP tools.
Return value from object correction CP tools.
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
static StatusCode filterForAffectingSystematics(const SystematicSet &systConfig, const SystematicSet &affectingSystematics, SystematicSet &filteredSystematics)
description: filter the systematics for the affected systematics returns: success guarantee: strong f...
bool eventType(EventType type) const
Check for one particular bitmask value.
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
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....