ATLAS Offline Software
Classes | Signals | Public Member Functions | Private Slots | Private Attributes | List of all members
TouchedMuonChamberHelper Class Reference

#include <TouchedMuonChamberHelper.h>

Inheritance diagram for TouchedMuonChamberHelper:
Collaboration diagram for TouchedMuonChamberHelper:

Classes

class  Imp
 

Signals

void touchedMuonChambersChanged (const std::set< GeoPVConstLink > &)
 
void muonChambersTouchedByTracksChanged (void)
 

Public Member Functions

 TouchedMuonChamberHelper (QObject *parent=0)
 
virtual ~TouchedMuonChamberHelper ()
 
void incrementNumberOfObjectsForPV (const GeoPVConstLink &chamberPV)
 
void decrementNumberOfObjectsForPV (const GeoPVConstLink &chamberPV)
 
bool isTouchedByTrack (const GeoPVConstLink &chamberPV)
 Returns true if the passed chamber link has a track or segment. More...
 
void eraseEventData ()
 
void updateTouchedByTracks (const std::set< GeoPVConstLink > &)
 

Private Slots

void checkForChangeInTouchedChambers ()
 

Private Attributes

Impm_d
 

Detailed Description

Definition at line 30 of file TouchedMuonChamberHelper.h.

Constructor & Destructor Documentation

◆ TouchedMuonChamberHelper()

TouchedMuonChamberHelper::TouchedMuonChamberHelper ( QObject *  parent = 0)

Definition at line 36 of file TouchedMuonChamberHelper.cxx.

37  : QObject(parent), m_d(new Imp)
38 {
39  m_d->theclass = this;
40  m_d->updatesnotcheduled = true;
41 }

◆ ~TouchedMuonChamberHelper()

TouchedMuonChamberHelper::~TouchedMuonChamberHelper ( )
virtual

Definition at line 44 of file TouchedMuonChamberHelper.cxx.

45 {
46  delete m_d;
47 }

Member Function Documentation

◆ checkForChangeInTouchedChambers

void TouchedMuonChamberHelper::checkForChangeInTouchedChambers ( )
privateslot

Definition at line 92 of file TouchedMuonChamberHelper.cxx.

93 {
94  m_d->updatesnotcheduled = true;
95 
96  std::set<GeoPVConstLink> touchedchambers;
97  std::map<GeoPVConstLink,unsigned>::const_iterator it(m_d->pv2count.begin()),itE(m_d->pv2count.end());
98  for (;it!=itE;++it) {
99  if (it->second>0)
100  touchedchambers.insert(it->first);
101  }
102 
103  if (m_d->lastEmittedSet!=touchedchambers) {
104  m_d->lastEmittedSet = touchedchambers;
105  emit touchedMuonChambersChanged(touchedchambers);
106  }
107 }

◆ decrementNumberOfObjectsForPV()

void TouchedMuonChamberHelper::decrementNumberOfObjectsForPV ( const GeoPVConstLink &  chamberPV)

Definition at line 73 of file TouchedMuonChamberHelper.cxx.

74 {
76  if (it==m_d->pv2count.end()||it->second==0) {
77  std::cout<<" TouchedMuonChamberHelper::decrementNumberOfObjectsForPV Error: Asked to decrement to negative values!"<<std::endl;
78  return;
79  }
80  --(it->second);
81  if (m_d->updatesnotcheduled&&it->second==0)
82  m_d->ensureScheduleUpdate();//Last object in chamber
83 }

◆ eraseEventData()

void TouchedMuonChamberHelper::eraseEventData ( )

Definition at line 116 of file TouchedMuonChamberHelper.cxx.

117 {
118  m_d->pv2count.clear();
119  m_d->touchedByTracksSet.clear();
121 }

◆ incrementNumberOfObjectsForPV()

void TouchedMuonChamberHelper::incrementNumberOfObjectsForPV ( const GeoPVConstLink &  chamberPV)

Definition at line 59 of file TouchedMuonChamberHelper.cxx.

60 {
62  if (it==m_d->pv2count.end()) {
63  m_d->pv2count[chamberPV] = 1;
64  m_d->ensureScheduleUpdate();//First object in chamber
65  return;
66  }
67  ++(it->second);
68  if (m_d->updatesnotcheduled&&it->second==1)
69  m_d->ensureScheduleUpdate();//First object in chamber
70 }

◆ isTouchedByTrack()

bool TouchedMuonChamberHelper::isTouchedByTrack ( const GeoPVConstLink &  chamberPV)

Returns true if the passed chamber link has a track or segment.

Definition at line 86 of file TouchedMuonChamberHelper.cxx.

87 {
88  return (m_d->touchedByTracksSet.find(chamberPV)!=m_d->touchedByTracksSet.end());
89 }

◆ muonChambersTouchedByTracksChanged

void TouchedMuonChamberHelper::muonChambersTouchedByTracksChanged ( void  )
signal

◆ touchedMuonChambersChanged

void TouchedMuonChamberHelper::touchedMuonChambersChanged ( const std::set< GeoPVConstLink > &  )
signal

◆ updateTouchedByTracks()

void TouchedMuonChamberHelper::updateTouchedByTracks ( const std::set< GeoPVConstLink > &  set)

Definition at line 109 of file TouchedMuonChamberHelper.cxx.

109  {
110  // std::cout<<"TouchedMuonChamberHelper::updateTouchedByTracks - set is this big: "<<set.size()<<std::endl;
113 }

Member Data Documentation

◆ m_d

Imp* TouchedMuonChamberHelper::m_d
private

Definition at line 56 of file TouchedMuonChamberHelper.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
TouchedMuonChamberHelper::m_d
Imp * m_d
Definition: TouchedMuonChamberHelper.h:55
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TouchedMuonChamberHelper::Imp::updatesnotcheduled
bool updatesnotcheduled
Definition: TouchedMuonChamberHelper.cxx:25
TouchedMuonChamberHelper::touchedMuonChambersChanged
void touchedMuonChambersChanged(const std::set< GeoPVConstLink > &)
TruthTest.itE
itE
Definition: TruthTest.py:25
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TouchedMuonChamberHelper::muonChambersTouchedByTracksChanged
void muonChambersTouchedByTracksChanged(void)
TouchedMuonChamberHelper::Imp::touchedByTracksSet
std::set< GeoPVConstLink > touchedByTracksSet
Definition: TouchedMuonChamberHelper.cxx:31
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
TouchedMuonChamberHelper::Imp::ensureScheduleUpdate
void ensureScheduleUpdate()
Definition: TouchedMuonChamberHelper.cxx:50
TouchedMuonChamberHelper::Imp::theclass
TouchedMuonChamberHelper * theclass
Definition: TouchedMuonChamberHelper.cxx:24
TouchedMuonChamberHelper::Imp::lastEmittedSet
std::set< GeoPVConstLink > lastEmittedSet
Definition: TouchedMuonChamberHelper.cxx:27
TouchedMuonChamberHelper::checkForChangeInTouchedChambers
void checkForChangeInTouchedChambers()
Definition: TouchedMuonChamberHelper.cxx:92
TouchedMuonChamberHelper::Imp::pv2count
std::map< GeoPVConstLink, unsigned > pv2count
Definition: TouchedMuonChamberHelper.cxx:28