ATLAS Offline Software
Loading...
Searching...
No Matches
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< FPGATrackSimBinUtil::StoredHit > &hits)
void addEvent (const std::vector< const FPGATrackSimBinUtil::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 226 of file FPGATrackSimGenScanMonitoring.h.

Constructor & Destructor Documentation

◆ eventDispSet()

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

Member Function Documentation

◆ addEvent() [1/3]

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

Definition at line 631 of file FPGATrackSimGenScanMonitoring.cxx.

631 {
632 unsigned int count = m_rZ.size(); // all four graph sets should have the same size
633
634 // If over limit on number of event displays just return
635 if (count > m_maxEvts) return;
636
637 // make the graphs to store the event display points
638 m_rZ.push_back(initGraph("EventDisp_RZ_" + m_name + std::to_string(count)));
639 m_xY.push_back(initGraph("EventDisp_XY_" + m_name + std::to_string(count)));
640 m_rPhi.push_back(initGraph("EventDisp_RPhi_" + m_name + std::to_string(count)));
641 m_rEta.push_back(initGraph("EventDisp_REta_" + m_name + std::to_string(count)));
642
643 for (auto &hit : hits) {
644 AddPoint(m_rZ.back(), hit->hitptr->getZ(), hit->hitptr->getR());
645 AddPoint(m_xY.back(), hit->hitptr->getX(), hit->hitptr->getY());
646 AddPoint(m_rEta.back(), hit->etaShift, hit->hitptr->getR());
647 AddPoint(m_rPhi.back(), hit->phiShift, hit->hitptr->getR());
648 }
649}
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146

◆ addEvent() [2/3]

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

Definition at line 617 of file FPGATrackSimGenScanMonitoring.cxx.

617 {
618 // If over limit on number of event displays just return
619 if (m_rZ.size() > m_maxEvts) return;
620
621 // convert vector of instances to vector of pointers to instances
622 std::vector<const FPGATrackSimBinUtil::StoredHit *> ptrvec;
623 for (auto &hit : hits) {
624 ptrvec.push_back(&hit);
625 }
626
627 // then just call pointer-based implementation
628 return addEvent(ptrvec);
629}
void addEvent(const std::vector< std::shared_ptr< const FPGATrackSimHit > > &hits)

◆ addEvent() [3/3]

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

Definition at line 601 of file FPGATrackSimGenScanMonitoring.cxx.

601 {
602 unsigned int count = m_rZ.size(); // both graph sets should have the same size
603
604 // If over limit on number of event displays just return
605 if (count > m_maxEvts)
606 return;
607
608 m_rZ.push_back(initGraph("EventDisp_RZ_" + m_name + std::to_string(count)));
609 m_xY.push_back(initGraph("EventDisp_XY_" + m_name + std::to_string(count)));
610
611 for (auto &hit : hits) {
612 AddPoint(m_rZ.back(), hit->getZ(), hit->getR());
613 AddPoint(m_xY.back(), hit->getX(), hit->getY());
614 }
615}

◆ AddPoint()

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

Definition at line 595 of file FPGATrackSimGenScanMonitoring.cxx.

596 {
597 g->SetPoint(g->GetN(), x, y);
598}
#define y
#define x

◆ initGraph()

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

Definition at line 588 of file FPGATrackSimGenScanMonitoring.cxx.

589 {
590 TGraph *retv = new TGraph();
591 retv->SetName(name.c_str());
592 return retv;
593}

◆ registerGraphs()

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

Definition at line 651 of file FPGATrackSimGenScanMonitoring.cxx.

651 {
652 // Make a vector of all the vectors of graphs and then loop to register
653 // them all...
654 for (auto &graphs : std::vector<std::vector<TGraph *> *>({&m_rZ, &m_xY, &m_rPhi, &m_rEta})) {
655 for (auto &g : *graphs) {
656 ATH_CHECK(parent->regGraph(g));
657 }
658 }
659 return StatusCode::SUCCESS;
660}
#define ATH_CHECK
Evaluate an expression and check for errors.

Member Data Documentation

◆ m_maxEvts

const unsigned FPGATrackSimGenScanMonitoring::eventDispSet::m_maxEvts {}
private

Definition at line 241 of file FPGATrackSimGenScanMonitoring.h.

241{};

◆ m_name

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

Definition at line 240 of file FPGATrackSimGenScanMonitoring.h.

◆ m_rEta

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

Definition at line 245 of file FPGATrackSimGenScanMonitoring.h.

◆ m_rPhi

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

Definition at line 246 of file FPGATrackSimGenScanMonitoring.h.

◆ m_rZ

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

Definition at line 243 of file FPGATrackSimGenScanMonitoring.h.

◆ m_xY

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

Definition at line 244 of file FPGATrackSimGenScanMonitoring.h.


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