ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
FPGATrackSimGenScanMonitoring::eventDispSet Struct Reference
Collaboration diagram for FPGATrackSimGenScanMonitoring::eventDispSet:

Public Member Functions

 eventDispSet (std::string name, int maxevts)
 
TGraph * initGraph (const std::string &name)
 
void AddPoint (TGraph *g, double x, double y)
 
void addEvent (const std::vector< std::shared_ptr< const FPGATrackSimHit >> &hits)
 
void addEvent (const std::vector< FPGATrackSimGenScanTool::StoredHit > &hits)
 
void addEvent (const std::vector< const FPGATrackSimGenScanTool::StoredHit * > &hits)
 
StatusCode registerGraphs (FPGATrackSimGenScanMonitoring *parent)
 

Private Attributes

const std::string m_name
 
const unsigned m_maxEvts
 
std::vector< TGraph * > m_rZ
 
std::vector< TGraph * > m_xY
 
std::vector< TGraph * > m_rEta
 
std::vector< TGraph * > m_rPhi
 

Detailed Description

Definition at line 245 of file FPGATrackSimGenScanMonitoring.h.

Constructor & Destructor Documentation

◆ eventDispSet()

FPGATrackSimGenScanMonitoring::eventDispSet::eventDispSet ( std::string  name,
int  maxevts 
)
inline

Definition at line 246 of file FPGATrackSimGenScanMonitoring.h.

247  : m_name(name), m_maxEvts(maxevts) {}

Member Function Documentation

◆ addEvent() [1/3]

void FPGATrackSimGenScanMonitoring::eventDispSet::addEvent ( const std::vector< const FPGATrackSimGenScanTool::StoredHit * > &  hits)

Definition at line 623 of file FPGATrackSimGenScanMonitoring.cxx.

624 {
625  unsigned int count = m_rZ.size(); // all four graph sets should have the same size
626 
627  // If over limit on number of event displays just return
628  if (count > m_maxEvts) return;
629 
630  // make the graphs to store the event display points
631  m_rZ.push_back(initGraph("EventDisp_RZ_" + m_name + std::to_string(count)));
632  m_xY.push_back(initGraph("EventDisp_XY_"+m_name+std::to_string(count)));
633  m_rPhi.push_back(initGraph("EventDisp_RPhi_"+m_name+std::to_string(count)));
634  m_rEta.push_back(initGraph("EventDisp_REta_"+m_name+std::to_string(count)));
635 
636  for (auto & hit : hits)
637  {
638  AddPoint(m_rZ.back(), hit->hitptr->getZ(), hit->hitptr->getR());
639  AddPoint(m_xY.back(), hit->hitptr->getX(), hit->hitptr->getY());
640  AddPoint(m_rEta.back(), hit->etaShift, hit->hitptr->getR());
641  AddPoint(m_rPhi.back(), hit->phiShift, hit->hitptr->getR());
642  }
643 }

◆ addEvent() [2/3]

void FPGATrackSimGenScanMonitoring::eventDispSet::addEvent ( const std::vector< FPGATrackSimGenScanTool::StoredHit > &  hits)

Definition at line 607 of file FPGATrackSimGenScanMonitoring.cxx.

608 {
609  // If over limit on number of event displays just return
610  if (m_rZ.size() > m_maxEvts) return;
611 
612  // convert vector of instances to vector of pointers to instances
613  std::vector<const FPGATrackSimGenScanTool::StoredHit *> ptrvec;
614  for (auto & hit: hits)
615  {
616  ptrvec.push_back(&hit);
617  }
618 
619  // then just call pointer-based implementation
620  return addEvent(ptrvec);
621 }

◆ addEvent() [3/3]

void FPGATrackSimGenScanMonitoring::eventDispSet::addEvent ( const std::vector< std::shared_ptr< const FPGATrackSimHit >> &  hits)

Definition at line 591 of file FPGATrackSimGenScanMonitoring.cxx.

592 {
593  unsigned int count = m_rZ.size(); // both graph sets should have the same size
594 
595  // If over limit on number of event displays just return
596  if (count > m_maxEvts) return;
597 
598  m_rZ.push_back(initGraph("EventDisp_RZ_"+m_name+std::to_string(count)));
599  m_xY.push_back(initGraph("EventDisp_XY_"+m_name+std::to_string(count)));
600  for (auto & hit: hits)
601  {
602  AddPoint(m_rZ.back(), hit->getZ(), hit->getR());
603  AddPoint(m_xY.back(), hit->getX(), hit->getY());
604  }
605 }

◆ AddPoint()

void FPGATrackSimGenScanMonitoring::eventDispSet::AddPoint ( TGraph *  g,
double  x,
double  y 
)

Definition at line 586 of file FPGATrackSimGenScanMonitoring.cxx.

587 {
588  g->SetPoint(g->GetN(), x, y);
589 }

◆ initGraph()

TGraph * FPGATrackSimGenScanMonitoring::eventDispSet::initGraph ( const std::string &  name)

Definition at line 579 of file FPGATrackSimGenScanMonitoring.cxx.

580 {
581  TGraph *retv = new TGraph();
582  retv->SetName(name.c_str());
583  return retv;
584 }

◆ registerGraphs()

StatusCode FPGATrackSimGenScanMonitoring::eventDispSet::registerGraphs ( FPGATrackSimGenScanMonitoring parent)

Definition at line 645 of file FPGATrackSimGenScanMonitoring.cxx.

645  {
646  // Make a vector of all the vectors of graphs and then loop to register them all...
647  for (auto &graphs :
648  std::vector<std::vector<TGraph *> *>({&m_rZ, &m_xY, &m_rPhi, &m_rEta})) {
649  for (auto& g : *graphs) { ATH_CHECK(parent->regGraph(g));}
650  }
651  return StatusCode::SUCCESS;
652 }

Member Data Documentation

◆ m_maxEvts

const unsigned FPGATrackSimGenScanMonitoring::eventDispSet::m_maxEvts
private

Definition at line 260 of file FPGATrackSimGenScanMonitoring.h.

◆ m_name

const std::string FPGATrackSimGenScanMonitoring::eventDispSet::m_name
private

Definition at line 259 of file FPGATrackSimGenScanMonitoring.h.

◆ m_rEta

std::vector<TGraph *> FPGATrackSimGenScanMonitoring::eventDispSet::m_rEta
private

Definition at line 264 of file FPGATrackSimGenScanMonitoring.h.

◆ m_rPhi

std::vector<TGraph *> FPGATrackSimGenScanMonitoring::eventDispSet::m_rPhi
private

Definition at line 265 of file FPGATrackSimGenScanMonitoring.h.

◆ m_rZ

std::vector<TGraph *> FPGATrackSimGenScanMonitoring::eventDispSet::m_rZ
private

Definition at line 262 of file FPGATrackSimGenScanMonitoring.h.

◆ m_xY

std::vector<TGraph *> FPGATrackSimGenScanMonitoring::eventDispSet::m_xY
private

Definition at line 263 of file FPGATrackSimGenScanMonitoring.h.


The documentation for this struct was generated from the following files:
FPGATrackSimGenScanMonitoring::eventDispSet::initGraph
TGraph * initGraph(const std::string &name)
Definition: FPGATrackSimGenScanMonitoring.cxx:579
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
graphs
Definition: graphs.py:1
x
#define x
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
FPGATrackSimGenScanMonitoring::eventDispSet::m_xY
std::vector< TGraph * > m_xY
Definition: FPGATrackSimGenScanMonitoring.h:263
FPGATrackSimGenScanMonitoring::eventDispSet::addEvent
void addEvent(const std::vector< std::shared_ptr< const FPGATrackSimHit >> &hits)
Definition: FPGATrackSimGenScanMonitoring.cxx:591
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
FPGATrackSimGenScanMonitoring::eventDispSet::m_rZ
std::vector< TGraph * > m_rZ
Definition: FPGATrackSimGenScanMonitoring.h:262
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
FPGATrackSimGenScanMonitoring::eventDispSet::AddPoint
void AddPoint(TGraph *g, double x, double y)
Definition: FPGATrackSimGenScanMonitoring.cxx:586
FPGATrackSimGenScanMonitoring::eventDispSet::m_rEta
std::vector< TGraph * > m_rEta
Definition: FPGATrackSimGenScanMonitoring.h:264
FPGATrackSimGenScanMonitoring::eventDispSet::m_maxEvts
const unsigned m_maxEvts
Definition: FPGATrackSimGenScanMonitoring.h:260
y
#define y
FPGATrackSimGenScanMonitoring::eventDispSet::m_rPhi
std::vector< TGraph * > m_rPhi
Definition: FPGATrackSimGenScanMonitoring.h:265
FPGATrackSimGenScanMonitoring::eventDispSet::m_name
const std::string m_name
Definition: FPGATrackSimGenScanMonitoring.h:259