ATLAS Offline Software
Public Member Functions | Public Attributes | Private Types | Private Attributes | List of all members
DerivationFramework::BPhysVertexTrackBase::TrackTypeCounter Class Reference

#include <BPhysVertexTrackBase.h>

Collaboration diagram for DerivationFramework::BPhysVertexTrackBase::TrackTypeCounter:

Public Member Functions

 TrackTypeCounter (BPhysVertexTrackBase &Parent, std::string Name)
 
 ~TrackTypeCounter ()
 
void addToCounter (uint64_t atype, uint64_t rtype=0, const std::string &prefix="", const std::string &suffix="", uint64_t counts=1)
 
void addToCounter (const std::string &name, uint64_t atype=0, uint64_t counts=1)
 
std::string countsToString (uint indent=0) const
 

Public Attributes

std::string name
 

Private Types

typedef std::map< std::string, std::pair< uint64_t, uint64_t > > NameCountMap_t
 

Private Attributes

NameCountMap_t m_cnts
 
BPhysVertexTrackBasem_parent
 

Detailed Description

Definition at line 85 of file BPhysVertexTrackBase.h.

Member Typedef Documentation

◆ NameCountMap_t

typedef std::map<std::string, std::pair<uint64_t, uint64_t> > DerivationFramework::BPhysVertexTrackBase::TrackTypeCounter::NameCountMap_t
private

Definition at line 105 of file BPhysVertexTrackBase.h.

Constructor & Destructor Documentation

◆ TrackTypeCounter()

DerivationFramework::BPhysVertexTrackBase::TrackTypeCounter::TrackTypeCounter ( BPhysVertexTrackBase Parent,
std::string  Name 
)

Definition at line 221 of file BPhysVertexTrackBase.cxx.

223  : name(std::move(Name)), m_parent(Parent) {
224  }

◆ ~TrackTypeCounter()

DerivationFramework::BPhysVertexTrackBase::TrackTypeCounter::~TrackTypeCounter ( )
default

Member Function Documentation

◆ addToCounter() [1/2]

void DerivationFramework::BPhysVertexTrackBase::TrackTypeCounter::addToCounter ( const std::string &  name,
uint64_t  atype = 0,
uint64_t  counts = 1 
)

Definition at line 242 of file BPhysVertexTrackBase.cxx.

244  {
245 
246  NameCountMap_t::const_iterator it = m_cnts.find(name);
247 
248  if ( it != m_cnts.end() ) {
249  m_cnts[name].first += counts;
250  } else {
251  m_cnts[name] = std::make_pair(counts, atype);
252  }
253  }

◆ addToCounter() [2/2]

void DerivationFramework::BPhysVertexTrackBase::TrackTypeCounter::addToCounter ( uint64_t  atype,
uint64_t  rtype = 0,
const std::string &  prefix = "",
const std::string &  suffix = "",
uint64_t  counts = 1 
)

Definition at line 228 of file BPhysVertexTrackBase.cxx.

232  {
233  boost::format f("%sT%010d_R%010d%s");
234  f % (prefix.length() > 0 ? prefix+"_" : "")
235  % atype
236  % m_parent.m_useTrackTypes[rtype]
237  % (suffix.length() > 0 ? "_"+suffix : "");
238 
239  addToCounter(f.str(), atype, counts);
240  }

◆ countsToString()

std::string DerivationFramework::BPhysVertexTrackBase::TrackTypeCounter::countsToString ( uint  indent = 0) const

Definition at line 255 of file BPhysVertexTrackBase.cxx.

256  {
257 
258  boost::format f("%sCounters for %s:\n");
259  f % boost::io::group(std::setw(indent), " ") % name;
260  std::string str = f.str();
261 
262  int lmax(0);
263  for (NameCountMap_t::const_iterator it = m_cnts.begin();
264  it != m_cnts.end(); ++it) {
265  lmax = std::max(lmax, (int)(it->first).length());
266  }
267 
268  for (NameCountMap_t::const_iterator it = m_cnts.begin();
269  it != m_cnts.end(); ++it) {
270  boost::format f("%s%-s : %10lld %33s");
271  f % boost::io::group(std::setw(indent+4), " ")
272  % boost::io::group(std::setw(lmax), it->first)
273  % (it->second).first
274  % std::bitset<33>((it->second).second).to_string();
275  str += f.str() + "\n";
276  }
277  // clean up last newline
278  str.erase(str.length()-1);
279 
280  return str;
281  }

Member Data Documentation

◆ m_cnts

NameCountMap_t DerivationFramework::BPhysVertexTrackBase::TrackTypeCounter::m_cnts
private

Definition at line 106 of file BPhysVertexTrackBase.h.

◆ m_parent

BPhysVertexTrackBase& DerivationFramework::BPhysVertexTrackBase::TrackTypeCounter::m_parent
private

Definition at line 107 of file BPhysVertexTrackBase.h.

◆ name

std::string DerivationFramework::BPhysVertexTrackBase::TrackTypeCounter::name

Definition at line 101 of file BPhysVertexTrackBase.h.


The documentation for this class was generated from the following files:
DerivationFramework::BPhysVertexTrackBase::TrackTypeCounter::m_parent
BPhysVertexTrackBase & m_parent
Definition: BPhysVertexTrackBase.h:107
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
hotSpotInTAG.suffix
string suffix
Definition: hotSpotInTAG.py:186
max
#define max(a, b)
Definition: cfImp.cxx:41
vtune_athena.format
format
Definition: vtune_athena.py:14
skel.it
it
Definition: skel.GENtoEVGEN.py:423
DerivationFramework::BPhysVertexTrackBase::m_useTrackTypes
std::vector< uint64_t > m_useTrackTypes
Definition: BPhysVertexTrackBase.h:260
geometry_dat_to_json.indent
indent
Definition: geometry_dat_to_json.py:18
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
DerivationFramework::BPhysVertexTrackBase::TrackTypeCounter::name
std::string name
Definition: BPhysVertexTrackBase.h:101
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
Name
JetDumper::Name Name
Definition: JetDumper.cxx:19
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
python.CaloScaleNoiseConfig.str
str
Definition: CaloScaleNoiseConfig.py:78
DeMoScan.first
bool first
Definition: DeMoScan.py:534
str
Definition: BTagTrackIpAccessor.cxx:11
DerivationFramework::BPhysVertexTrackBase::TrackTypeCounter::addToCounter
void addToCounter(uint64_t atype, uint64_t rtype=0, const std::string &prefix="", const std::string &suffix="", uint64_t counts=1)
Definition: BPhysVertexTrackBase.cxx:228
DerivationFramework::BPhysVertexTrackBase::TrackTypeCounter::m_cnts
NameCountMap_t m_cnts
Definition: BPhysVertexTrackBase.h:106