ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
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. More...
 

Private Attributes

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

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 2745 of file CalibrationDataInterfaceROOT.cxx.

2746 {
2747  // Create the map from hadronisation specifications to reference container names for
2748  // a given ROOT file directory.
2749  //
2750  // mapSF: reference specification as extracted from calibration scale factor file
2751  // mapEff: reference specification as extracted from MC efficiency file
2752  // (null if the two files are identical)
2753 
2754  // First take the scale factor file's map
2755  if (mapSF) {
2756  TMapIter next(mapSF); TObjString* spec;
2757  while ((spec = (TObjString*) next())) {
2758  TObjString* ref = (TObjString*) mapSF->GetValue(spec);
2759  m_refs[string(spec->GetName())] = string(ref->GetName());
2760  }
2761  }
2762  // Then do the same with the efficiency file's map. The result will be to override any
2763  // items from the SF file's map. An exception is made for the scale factor calibration object,
2764  // for which (for the sake of consistency) the SF reference must be retained.
2765  if (mapEff) {
2766  TMapIter next(mapEff); TObjString* spec;
2767  while ((spec = (TObjString*) next())) {
2768  TObjString* ref = (TObjString*) mapEff->GetValue(spec);
2769  m_refs[string(spec->GetName())] = string(ref->GetName());
2770  }
2771  }
2772 }

◆ 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 2776 of file CalibrationDataInterfaceROOT.cxx.

2778 {
2779  // Extract the reference histogram name corresponding to the given hadronisation specification (if existing).
2780  // The return value is used to indicate whether the specification could be found.
2781  //
2782  // spec: hadronisation specification
2783  // ref: container name corresponding to this specification
2784 
2785  std::map<string, string>::const_iterator it = m_refs.find(spec);
2786  if (it == m_refs.end()) return false;
2787 
2788  ref = it->second;
2789  return true;
2790 }

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:
CaloCondBlobAlgs_fillNoiseFromASCII.spec
spec
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:47
skel.it
it
Definition: skel.GENtoEVGEN.py:396
fillPileUpNoiseLumi.next
next
Definition: fillPileUpNoiseLumi.py:52
Analysis::CalibrationDataInterfaceROOT::HadronisationReferenceHelper::m_refs
std::map< std::string, std::string > m_refs
map from hadronisation specification to container name
Definition: CalibrationDataInterfaceROOT.h:376
ref
const boost::regex ref(r_ef)