15 return mu(
ptAcc) / 1.e3;
18 return std::abs(mu(
etaAcc));
41 int bin_flat(-1), bin_loss(-1);
46 float eloss_syst = bin_loss < 1 ? 1.e6 : std::abs(
m_loss->GetBinContent(bin_loss) * mu(
ptAcc)/1.0e6);
54 }
else return cc_flat;
57 float abs_error = std::abs(
m_flatness->GetBinError(bin_flat));
132 if (InDir_2Stations && InDir_2Stations!= InDir_3Stations) {
139 Error(
"BadMuonSysVetoHandler()",
"No TDirectory is given");
142 TIter next(InDir->GetListOfKeys());
143 while (TObject* obj = next()) {
144 std::string ObjName = obj->GetName();
145 float lowRange(-1.e20), highRange(1.e20);
146 if (ObjName.find(
"TF1") == std::string::npos) {
150 InDir->GetObject(ObjName.c_str(), TF);
164 if (!LowRange_str.empty()) {
165 lowRange = atof(LowRange_str.c_str()) / std::pow(10, LowRange_str.size() -1);
167 if (!HighRange_str.empty()) {
168 highRange = atof(HighRange_str.c_str()) / std::pow(10, LowRange_str.size() -1);
170 systPolynomials.insert(std::pair<
Ranges, std::unique_ptr<TF1>>(
Ranges(lowRange, highRange), std::unique_ptr<TF1>(TF)));
180 float RelHighPtSys = 0.;
181 if (mu(
ptAcc) >= 100.e3) {
186 RelHighPtSys = Poly->Eval((this->*
m_uncertVar)(mu.getXAODObject()));
190 RelHighPtSys = 0.005;
192 Eff = 1 +
m_SystWeight * std::sqrt(std::pow(Eff - 1,2) + RelHighPtSys * RelHighPtSys);
202 Error(
"BadMuonVetoSystHandler::initialize()",
"No polynomials");
215 Error(
"BadMuonVetoSystHandler()",
"Something went wrong with the initialization");
220 Error(
"BadMuonSysVetoHandler()",
"Precisionlayers unkown");
222 }
else if (nprecisionLayers >= 3) {
225 Poly = BinnedPoly.second.get();
229 }
else if (nprecisionLayers == 2) {
232 Poly = BinnedPoly.second.get();
241 while (!sstr.empty() && sstr[0] ==
'_') {
244 size_t pos = sstr.find(
"_");
245 std::string
Property = pos != std::string::npos ? sstr.substr(0, pos) : sstr;
246 if (pos != std::string::npos) {
247 sstr = sstr.substr(
Property.size() + 1, sstr.size());
std::map< Ranges, std::unique_ptr< TF1 > > m_syst2Stations
void fillMap(TDirectory *InDir, std::map< Ranges, std::unique_ptr< TF1 > > &systPolynomials)
bool initialize() override
Initialize method to load the inputs and check that everything will work as expected.
CP::CorrectionCode findAppropiatePolynomial(const xAOD::Muon &mu, TF1 *&Poly) const
BadMuonVetoSystHandler(TDirectory *InDir_3Stations, TDirectory *InDir_2Stations=nullptr)
std::map< Ranges, std::unique_ptr< TF1 > > m_syst3Stations
std::pair< float, float > Ranges
void SetSystematicWeight(float SystWeight) override
Set's the absolute scaling of the systematic.
CorrectionCode GetKineDependent(columnar::MuonId mu, float &Eff) const override
Add an additional uncertainty to the muon depending on its kinematics.
virtual ~BadMuonVetoSystHandler()
std::string getNextProperty(std::string &sstr) const
Return value from object correction CP tools.
@ Error
Some error happened during the object correction.
@ OutOfValidityRange
Input object is out of validity range.
@ Ok
The correction was done successfully.
float(IKinematicSystHandler::* KinVariable)(columnar::MuonId mu) const
Typedef to prepare function pointers to the muon.
float PtGeV(columnar::MuonId mu) const
float Pt(columnar::MuonId mu) const
columnar::MuonAccessor< float > ptAcc
columnar::MuonAccessor< float > etaAcc
KinVariable GetMuonVariableToUse(const std::string &name)
float AbsEta(columnar::MuonId mu) const
float Eta(columnar::MuonId mu) const
CorrectionCode GetKineDependent(columnar::MuonId mu, float &Eff) const override
Add an additional uncertainty to the muon depending on its kinematics.
std::unique_ptr< HistHandler > m_Handler
void SetSystematicWeight(float SystWeight) override
Set's the absolute scaling of the systematic.
PrimodialPtSystematic(std::unique_ptr< HistHandler > HistHandler)
bool initialize() override
Initialize method to load the inputs and check that everything will work as expected.
PtKinematicSystHandler(std::unique_ptr< HistHandler > pt_flatnesss, std::unique_ptr< HistHandler > energy_loss)
Constructor having two histhandler objects inside. The.
void SetSystematicWeight(float syst_weight) override
Set's the absolute scaling of the systematic.
std::unique_ptr< HistHandler > m_flatness
CorrectionCode GetKineDependent(columnar::MuonId mu, float &eff) const override
Add an additional uncertainty to the muon depending on its kinematics.
std::unique_ptr< HistHandler > m_loss
bool initialize() override
Initialize method to load the inputs and check that everything will work as expected.
TTVAClosureSysHandler(std::unique_ptr< HistHandler > HistHandler)
bool initialize() override
Initialize method to load the inputs and check that everything will work as expected.
CorrectionCode GetKineDependent(columnar::MuonId mu, float &Eff) const override
Add an additional uncertainty to the muon depending on its kinematics.
void SetSystematicWeight(float SystWeight) override
Set's the absolute scaling of the systematic.
std::unique_ptr< HistHandler > m_Handler
Support class for PropertyMgr.
Select isolated Photons, Electrons and Muons.
AthROOTErrorHandlerSvc: Replaces ROOT's standard error handler in order to detect Problematic ROOT is...
ObjectId< ContainerId::muon > MuonId
Muon_v1 Muon
Reference the current persistent version:
@ numberOfPrecisionLayers
layers with at least 3 hits [unit8_t].