ATLAS Offline Software
Loading...
Searching...
No Matches
HepMCWeightSvc::WeightInfo Struct Reference

Cached sets of weights. More...

Collaboration diagram for HepMCWeightSvc::WeightInfo:

Public Member Functions

void fillVec ()
 Initialize sorted vector from map.

Public Attributes

unsigned long m_chanNum = 0
 Channel number for this set of weights.
WeightMap m_weightNames
 Map of weight names.
std::vector< std::string > m_weightNameVec
 Sorted vector of weight names.

Detailed Description

Cached sets of weights.

We retain NWEIGHTS sets of weights. They are overwritten in a round-robin fashion if needed.

Definition at line 103 of file HepMCWeightSvc.h.

Member Function Documentation

◆ fillVec()

void HepMCWeightSvc::WeightInfo::fillVec ( )

Initialize sorted vector from map.

Definition at line 243 of file HepMCWeightSvc.cxx.

244{
245 m_weightNameVec.clear();
246 using WPair = std::pair<std::string, unsigned long int>;
247 std::vector<WPair> sorted;
248 for(const auto& i : m_weightNames) {
249 sorted.emplace_back (i);
250 }
251 std::sort (sorted.begin(), sorted.end(),
252 [](const WPair& a, const WPair& b) {return a.second < b.second; });
253 for (auto& a: sorted) {
254 m_weightNameVec.emplace_back (std::move (a.first));
255 }
256}
static Double_t a
std::vector< typename R::value_type > sorted(const R &r, PROJ proj={})
Helper function to create a sorted vector from an unsorted range.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
WeightMap m_weightNames
Map of weight names.
std::vector< std::string > m_weightNameVec
Sorted vector of weight names.

Member Data Documentation

◆ m_chanNum

unsigned long HepMCWeightSvc::WeightInfo::m_chanNum = 0

Channel number for this set of weights.

Definition at line 106 of file HepMCWeightSvc.h.

◆ m_weightNames

WeightMap HepMCWeightSvc::WeightInfo::m_weightNames

Map of weight names.

Definition at line 109 of file HepMCWeightSvc.h.

◆ m_weightNameVec

std::vector<std::string> HepMCWeightSvc::WeightInfo::m_weightNameVec

Sorted vector of weight names.

Definition at line 112 of file HepMCWeightSvc.h.


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