|
ATLAS Offline Software
|
#include <CalibrationDataInterfaceTool.h>
|
| CalibrationDataInterfaceTool (const std::string &, const std::string &, const IInterface *) |
|
virtual | ~CalibrationDataInterfaceTool ()=default |
| default destructor More...
|
|
StatusCode | queryInterface (const InterfaceID &riid, void **ppvIf) |
| allow access to the ICalibrationDataInterfaceTool interface More...
|
|
virtual StatusCode | initialize () override |
| standard Athena-Algorithm method More...
|
|
CalibResult | getEfficiency (const Jet &jet, const std::string &label, const std::string &OP, Uncertainty unc=None) const |
| Main interface methods accessing the flavour tagging performance information. More...
|
|
CalibResult | getMCEfficiency (const Jet &jet, const std::string &label, const std::string &OP, Uncertainty unc=None) const |
| "MC" efficiency retrieval More...
|
|
CalibResult | getScaleFactor (const Jet &jet, const std::string &label, const std::string &OP, Uncertainty unc=None) const |
| efficiency scale factor retrieval 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 | sysInitialize () override |
| Perform system initialization for an algorithm. 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 > &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 |
|
const std::string & | EffCalibrationName (const std::string &flavour, unsigned int mapIndex=0) const |
| Main interface methods accessing the flavour tagging performance information. More...
|
|
void | setEffCalibrationNames (const std::map< std::string, std::vector< std::string > > &names) |
|
const std::string & | SFCalibrationName (const std::string &flavour) const |
|
void | setSFCalibrationNames (const std::map< std::string, std::string > &names) |
|
hold: in particular, "channel" (jet author) aliasing is possible. The difference is that run-time information is to be provided in a text file to be interpreted using ROOT's TEnv and
DB representation (all residing under a common root folder): .../<jet author>/<tagger>/<operating point>/<flavour>/<object name> where <operating point> can be a weight cut (represented as a string, with the period replaced with an underscore) or the string "Continuous" (for continuous calibration purposes).
- Author
- Frank Filthaut F.Fil.nosp@m.thau.nosp@m.t@sci.nosp@m.ence.nosp@m..ru.n.nosp@m.l
This tool provides an interface to flavour tagging performance estimates.
A separate instance should be used for each different tagging algorithm. For each instance, all appropriate jet collections and tagger operating points need to be specified.
The model:
- b-jets: data-MC scale factor (factorised 2D function of eta, pt) MC reference the product is the data efficiency; alternatively, the scale factor may be used
- c-jets: as for b-jets, but with a different MC reference
- light-flavour jets: data-MC scale factor (factorised 2D function of eta, pt) MC reference Besides the results, it is also possible to retrieve associated uncertainties. This need not be configured, and a choice as to the uncertainty component can be made on a case-by-case basis.
To retrieve results from COOL, a CalibrationBroker instance is used (a separate one from the one used for tagger weight distributions). This allows to use the CalibrationBroker's channel aliasing (although possibly with different aliases). Of course it is up to the user to verify that the aliasing is appropriate!
DB representation (all residing under a common root folder): .../<jet author>/<tagger>/<operating point>/<flavour>/<object name>
- Author
- Frank Filthaut F.Fil.nosp@m.thau.nosp@m.t@sci.nosp@m.ence.nosp@m..ru.n.nosp@m.l
Definition at line 64 of file CalibrationDataInterfaceTool.h.
◆ StoreGateSvc_t
◆ Uncertainty
retrieve either the total uncertainty or only the statistical or systematic components
Enumerator |
---|
None | |
Total | |
Statistical | |
Systematic | |
Definition at line 28 of file ICalibrationDataInterfaceTool.h.
◆ variableType
◆ CalibrationDataInterfaceTool()
Analysis::CalibrationDataInterfaceTool::CalibrationDataInterfaceTool |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
Definition at line 28 of file CalibrationDataInterfaceTool.cxx.
34 declareInterface<Analysis::ICalibrationDataInterfaceTool>(
this);
37 "tagging algorithm name");
39 "operating points for this tagging algorithm");
41 "efficiency calibration curve for b jets");
43 "efficiency calibration curve for c jets");
45 "efficiency calibration curve for tau jets");
47 "efficiency calibration curve for light-flavour jets");
49 "scale factor calibration curve for b jets");
51 "scale factor calibration curve for c jets");
53 "scale factor calibration curve for tau jets");
55 "scale factor calibration curve for light-flavour jets");
57 "tool interfacing with COOL Database");
◆ ~CalibrationDataInterfaceTool()
virtual Analysis::CalibrationDataInterfaceTool::~CalibrationDataInterfaceTool |
( |
| ) |
|
|
virtualdefault |
◆ combinedUncertainty()
double Analysis::CalibrationDataInterfaceBase::combinedUncertainty |
( |
double |
stat, |
|
|
const std::pair< double, double > & |
syst |
|
) |
| const |
|
protectedinherited |
utility function for combination of statistical and (a priori asymmetric) systematic uncertainty.
NB perhaps this should be in its own
Definition at line 147 of file CalibrationDataInterfaceBase.cxx.
158 if (TMath::Abs(syst.second) > TMath::Abs(
largest))
largest = syst.second;
◆ 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);
◆ 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.
◆ 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.
◆ 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()
◆ EffCalibrationName()
const std::string & Analysis::CalibrationDataInterfaceBase::EffCalibrationName |
( |
const std::string & |
flavour, |
|
|
unsigned int |
mapIndex = 0 |
|
) |
| const |
|
inherited |
Main interface methods accessing the flavour tagging performance information.
Note that for both of the following, the label is assumed to adhere to the TruthInfo conventions (see package PhysicsAnalysis/JetTagging/JetTagInfo).
Definition at line 47 of file CalibrationDataInterfaceBase.cxx.
56 catch (
const std::out_of_range&
e) {
57 std::cerr <<
"EffCalibrationName: flavour '" << flavour <<
"' is not known." << std::endl;
◆ 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
◆ getBasename()
std::string Analysis::CalibrationDataInterfaceBase::getBasename |
( |
const std::string & |
name | ) |
const |
|
protectedinherited |
◆ getContainername()
std::string Analysis::CalibrationDataInterfaceBase::getContainername |
( |
const std::string & |
flavour, |
|
|
bool |
SF, |
|
|
unsigned int |
mapIndex = 0 |
|
) |
| const |
|
protectedinherited |
auxiliary function for retrieval of container name
Definition at line 118 of file CalibrationDataInterfaceBase.cxx.
126 if (!
SF && mapIndex >= effNames.size()) {
127 std::cerr <<
"getContainername: given mapIndex=" << mapIndex <<
" incompatible with array size "
128 << effNames.size() <<
"; resetting to 0" << std::endl;
132 name +=
SF ?
"_SF" :
"_Eff";
◆ getEfficiency()
Main interface methods accessing the flavour tagging performance information.
Note that for both of the following, the label is assumed to adhere to the TruthInfo conventions (see package PhysicsAnalysis/JetTagging/JetTagInfo). efficiency retrieval
Implements Analysis::ICalibrationDataInterfaceTool.
Definition at line 287 of file CalibrationDataInterfaceTool.cxx.
294 double value = effResult.first*sfResult.first;
296 relative = effResult.second/effResult.first;
297 double sfRelative = sfResult.second/sfResult.first;
298 relative = std::sqrt(sfRelative*sfRelative + relative*relative);
301 <<
" MC eff=" << effResult.first);
◆ getMCEfficiency()
"MC" efficiency retrieval
Implements Analysis::ICalibrationDataInterfaceTool.
Definition at line 225 of file CalibrationDataInterfaceTool.cxx.
231 string flavour(
label);
232 if (flavour ==
"N/A") flavour =
"Light";
236 string effName(
getBasename(OP, flavour,
"_Eff",
false));
239 std::pair<CalibrationDataContainer*,bool>
ret =
244 <<
"tagger/jetCollection/flavour/operating point = "
267 cerr <<
"getMCEfficiency: error retrieving MC efficiency statistical uncertainty!"
273 cerr <<
"getMCEfficiency: error retrieving MC efficiency parameter systematic uncertainty!"
◆ getScaleFactor()
efficiency scale factor retrieval
Implements Analysis::ICalibrationDataInterfaceTool.
Definition at line 160 of file CalibrationDataInterfaceTool.cxx.
167 string flavour(
label);
168 if (flavour ==
"N/A") flavour =
"Light";
172 string sfName(
getBasename(OP, flavour,
"_SF",
true));
175 std::pair<CalibrationDataContainer*,bool>
ret =
180 <<
"tagger/jetCollection/flavour/operating point = "
203 cerr <<
"getScaleFactor: error retrieving Scale factor statistical uncertainty!"
209 cerr <<
"getScaleFactor: error retrieving Scale factor parameter systematic uncertainty!"
◆ initialize()
StatusCode Analysis::CalibrationDataInterfaceTool::initialize |
( |
| ) |
|
|
overridevirtual |
standard Athena-Algorithm method
Definition at line 75 of file CalibrationDataInterfaceTool.cxx.
87 string::size_type
end;
89 std::vector<string> calibrationBNames;
95 }
while (
end != string::npos);
98 std::vector<string> calibrationCNames;
104 }
while (
end != string::npos);
107 std::vector<string> calibrationTNames;
113 }
while (
end != string::npos);
116 std::vector<string> calibrationLightNames;
122 }
while (
end != string::npos);
127 std::map<string, std::vector<string> > effNames;
128 effNames[
"B"] = calibrationBNames;
129 effNames[
"C"] = calibrationCNames;
130 effNames[
"T"] = calibrationTNames;
131 effNames[
"Light"] = calibrationLightNames;
135 std::map<string, string> calibrationNames;
143 for (std::map<string, string>::const_iterator
it = calibrationNames.begin();
144 it != calibrationNames.end(); ++
it) {
145 for (std::vector<string>::const_iterator op = m_operatingPoints.begin();
146 op != m_operatingPoints.end(); ++op) {
152 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.
◆ interfaceID()
static const InterfaceID& Analysis::ICalibrationDataInterfaceTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
◆ makeVariables()
auxiliary function to create the intermediate struct needed for the data layer
Definition at line 325 of file CalibrationDataInterfaceTool.cxx.
328 x.jetAuthor =
jet.jetAuthor();
329 x.jetPt =
jet.pt() * 0.001;
330 x.jetEta =
jet.eta();
◆ msg() [1/2]
◆ msg() [2/2]
◆ 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.
◆ queryInterface()
StatusCode Analysis::CalibrationDataInterfaceTool::queryInterface |
( |
const InterfaceID & |
riid, |
|
|
void ** |
ppvIf |
|
) |
| |
◆ registerObjects()
void Analysis::CalibrationDataInterfaceTool::registerObjects |
( |
const std::string & |
folder, |
|
|
const std::string & |
OP |
|
) |
| const |
|
private |
◆ renounce()
◆ renounceArray()
◆ retrieveFunctionArguments()
void Analysis::CalibrationDataInterfaceTool::retrieveFunctionArguments |
( |
const Jet & |
jet, |
|
|
const std::string & |
object, |
|
|
Double_t * |
x |
|
) |
| const |
|
private |
auxiliary function to retrieve values of function arguments
◆ setEffCalibrationNames()
void Analysis::CalibrationDataInterfaceBase::setEffCalibrationNames |
( |
const std::map< std::string, std::vector< std::string > > & |
names | ) |
|
|
inherited |
◆ setSFCalibrationNames()
void Analysis::CalibrationDataInterfaceBase::setSFCalibrationNames |
( |
const std::map< std::string, std::string > & |
names | ) |
|
|
inherited |
◆ SFCalibrationName()
const std::string & Analysis::CalibrationDataInterfaceBase::SFCalibrationName |
( |
const std::string & |
flavour | ) |
const |
|
inherited |
Definition at line 72 of file CalibrationDataInterfaceBase.cxx.
80 catch (
const std::out_of_range&
e) {
81 std::cerr <<
"SFCalibrationName: flavour '" << flavour <<
"' is not known." << std::endl;
◆ sysInitialize()
◆ 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_broker
ToolHandle<CalibrationBroker> Analysis::CalibrationDataInterfaceTool::m_broker {this, "CalibrationBroker", "", "brief pointer to the performance broker"} |
|
private |
◆ m_calibrationEffNames
std::map<std::string, std::vector<std::string> > Analysis::CalibrationDataInterfaceBase::m_calibrationEffNames |
|
privateinherited |
◆ m_calibrationSFNames
std::map<std::string, std::string> Analysis::CalibrationDataInterfaceBase::m_calibrationSFNames |
|
privateinherited |
◆ m_detStore
◆ m_EffcalibrationBName
std::string Analysis::CalibrationDataInterfaceTool::m_EffcalibrationBName |
|
private |
◆ m_EffcalibrationCName
std::string Analysis::CalibrationDataInterfaceTool::m_EffcalibrationCName |
|
private |
◆ m_EffcalibrationLightName
std::string Analysis::CalibrationDataInterfaceTool::m_EffcalibrationLightName |
|
private |
◆ m_EffcalibrationTName
std::string Analysis::CalibrationDataInterfaceTool::m_EffcalibrationTName |
|
private |
◆ m_evtStore
◆ m_SFcalibrationBName
std::string Analysis::CalibrationDataInterfaceTool::m_SFcalibrationBName |
|
private |
◆ m_SFcalibrationCName
std::string Analysis::CalibrationDataInterfaceTool::m_SFcalibrationCName |
|
private |
◆ m_SFcalibrationLightName
std::string Analysis::CalibrationDataInterfaceTool::m_SFcalibrationLightName |
|
private |
◆ m_SFcalibrationTName
std::string Analysis::CalibrationDataInterfaceTool::m_SFcalibrationTName |
|
private |
◆ m_taggerName
std::string Analysis::CalibrationDataInterfaceBase::m_taggerName |
|
protectedinherited |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
std::pair< double, double > CalibResult
const std::string & EffCalibrationName(const std::string &flavour, unsigned int mapIndex=0) const
Main interface methods accessing the flavour tagging performance information.
std::map< std::string, std::vector< std::string > > m_calibrationEffNames
this simply collects the per-flavour properties.
const CalibResult dummyResult(dummyValue, dummyValue)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::map< std::string, std::string > m_calibrationSFNames
const float SF[NF]
Cross sections for Fluor.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
const std::string & SFCalibrationName(const std::string &flavour) const
std::string m_taggerName
tagging algorithm name
virtual void setOwner(IDataHandleHolder *o)=0
double combinedUncertainty(double stat, const std::pair< double, double > &syst) const
utility function for combination of statistical and (a priori asymmetric) systematic uncertainty.
std::pair< double, double > UncertaintyResult
The following typedef is for convenience: most uncertainties can be asymmetric.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
void setEffCalibrationNames(const std::map< std::string, std::vector< std::string > > &names)
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
void setSFCalibrationNames(const std::map< std::string, std::string > &names)
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
std::string getBasename(const std::string &name) const
auxiliary function for retrieval of name within the directory