ATLAS Offline Software
Loading...
Searching...
No Matches
Analysis::CalibrationDataInterfaceROOT::HadronisationReferenceHelper Class Reference

#include <CalibrationDataInterfaceROOT.h>

Collaboration diagram for Analysis::CalibrationDataInterfaceROOT::HadronisationReferenceHelper:

Public Member Functions

 HadronisationReferenceHelper (TMap *mapSF, TMap *mapEff)
 HadronisationReferenceHelper ()
bool getReference (const std::string &spec, std::string &ref) const
 Retrieve the (full) name of the reference histogram, given the hadronisation specification.

Private Attributes

std::map< std::string, std::string > m_refs
 map from hadronisation specification to container name

Detailed Description

Definition at line 363 of file CalibrationDataInterfaceROOT.h.

Constructor & Destructor Documentation

◆ HadronisationReferenceHelper() [1/2]

Analysis::CalibrationDataInterfaceROOT::HadronisationReferenceHelper::HadronisationReferenceHelper ( TMap * mapSF,
TMap * mapEff )

Definition at line 2755 of file CalibrationDataInterfaceROOT.cxx.

2756{
2757 // Create the map from hadronisation specifications to reference container names for
2758 // a given ROOT file directory.
2759 //
2760 // mapSF: reference specification as extracted from calibration scale factor file
2761 // mapEff: reference specification as extracted from MC efficiency file
2762 // (null if the two files are identical)
2763
2764 // First take the scale factor file's map
2765 if (mapSF) {
2766 TMapIter next(mapSF); TObjString* spec;
2767 while ((spec = (TObjString*) next())) {
2768 TObjString* ref = (TObjString*) mapSF->GetValue(spec);
2769 m_refs[string(spec->GetName())] = string(ref->GetName());
2770 }
2771 }
2772 // Then do the same with the efficiency file's map. The result will be to override any
2773 // items from the SF file's map. An exception is made for the scale factor calibration object,
2774 // for which (for the sake of consistency) the SF reference must be retained.
2775 if (mapEff) {
2776 TMapIter next(mapEff); TObjString* spec;
2777 while ((spec = (TObjString*) next())) {
2778 TObjString* ref = (TObjString*) mapEff->GetValue(spec);
2779 m_refs[string(spec->GetName())] = string(ref->GetName());
2780 }
2781 }
2782}
const std::regex ref(r_ef)
std::map< std::string, std::string > m_refs
map from hadronisation specification to container name
End of vector before end of string
Definition Arrayrep.cxx:228

◆ HadronisationReferenceHelper() [2/2]

Analysis::CalibrationDataInterfaceROOT::HadronisationReferenceHelper::HadronisationReferenceHelper ( )
inline

Definition at line 367 of file CalibrationDataInterfaceROOT.h.

367{;}

Member Function Documentation

◆ getReference()

bool Analysis::CalibrationDataInterfaceROOT::HadronisationReferenceHelper::getReference ( const std::string & spec,
std::string & ref ) const

Retrieve the (full) name of the reference histogram, given the hadronisation specification.

The return value will be false if the specification cannot be found, and true otherwise.

Definition at line 2786 of file CalibrationDataInterfaceROOT.cxx.

2788{
2789 // Extract the reference histogram name corresponding to the given hadronisation specification (if existing).
2790 // The return value is used to indicate whether the specification could be found.
2791 //
2792 // spec: hadronisation specification
2793 // ref: container name corresponding to this specification
2794
2795 std::map<string, string>::const_iterator it = m_refs.find(spec);
2796 if (it == m_refs.end()) return false;
2797
2798 ref = it->second;
2799 return true;
2800}

Member Data Documentation

◆ m_refs

std::map<std::string, std::string> Analysis::CalibrationDataInterfaceROOT::HadronisationReferenceHelper::m_refs
private

map from hadronisation specification to container name

Definition at line 376 of file CalibrationDataInterfaceROOT.h.


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