CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
simwatcher::BeginOfTrackCounter Class Reference

#include <BeginOfTrackCounter.h>

Inheritance diagram for simwatcher::BeginOfTrackCounter:
SimProducer Observer< const BeginOfTrack * > SimWatcher

Public Member Functions

 BeginOfTrackCounter (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
- Public Member Functions inherited from SimProducer
void registerProducts (edm::ProducesCollector producesCollector)
 
 SimProducer ()
 
- Public Member Functions inherited from SimWatcher
 SimWatcher ()
 
virtual ~SimWatcher ()
 
- Public Member Functions inherited from Observer< const BeginOfTrack * >
 Observer ()
 
void slotForUpdate (const BeginOfTrack * iT)
 
virtual ~Observer ()
 

Private Member Functions

 BeginOfTrackCounter (const BeginOfTrackCounter &)=delete
 
const BeginOfTrackCounteroperator= (const BeginOfTrackCounter &)=delete
 
void update (const BeginOfTrack *) override
 This routine will be called when the appropriate signal arrives. More...
 

Private Attributes

int m_count
 
std::string m_label
 

Additional Inherited Members

- Protected Member Functions inherited from SimProducer
template<class T >
void produces ()
 
template<class T >
void produces (const std::string &instanceName)
 

Detailed Description

Definition at line 38 of file BeginOfTrackCounter.h.

Constructor & Destructor Documentation

◆ BeginOfTrackCounter() [1/2]

BeginOfTrackCounter::BeginOfTrackCounter ( const edm::ParameterSet iPSet)

Definition at line 32 of file BeginOfTrackCounter.cc.

33  : m_count(0), m_label(iPSet.getUntrackedParameter<std::string>("instanceLabel", "nBeginOfTracks")) {
34  produces<int>(m_label);
35 }

References m_label.

◆ BeginOfTrackCounter() [2/2]

simwatcher::BeginOfTrackCounter::BeginOfTrackCounter ( const BeginOfTrackCounter )
privatedelete

Member Function Documentation

◆ operator=()

const BeginOfTrackCounter& simwatcher::BeginOfTrackCounter::operator= ( const BeginOfTrackCounter )
privatedelete

◆ produce()

void BeginOfTrackCounter::produce ( edm::Event e,
const edm::EventSetup  
)
overridevirtual

Implements SimProducer.

Definition at line 41 of file BeginOfTrackCounter.cc.

41  {
42  std::unique_ptr<int> product(new int(m_count));
43  e.put(std::move(product), m_label);
44  m_count = 0;
45 }

References MillePedeFileConverter_cfg::e, m_count, m_label, and eostools::move().

◆ update()

void BeginOfTrackCounter::update ( const BeginOfTrack )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

Definition at line 47 of file BeginOfTrackCounter.cc.

47 { ++m_count; }

References m_count.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().

Member Data Documentation

◆ m_count

int simwatcher::BeginOfTrackCounter::m_count
private

Definition at line 56 of file BeginOfTrackCounter.h.

Referenced by produce(), and update().

◆ m_label

std::string simwatcher::BeginOfTrackCounter::m_label
private

Definition at line 57 of file BeginOfTrackCounter.h.

Referenced by BeginOfTrackCounter(), and produce().

edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
simwatcher::BeginOfTrackCounter::m_count
int m_count
Definition: BeginOfTrackCounter.h:56
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
simwatcher::BeginOfTrackCounter::m_label
std::string m_label
Definition: BeginOfTrackCounter.h:57
eostools.move
def move(src, dest)
Definition: eostools.py:511
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37