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 &)
 
 BeginOfTrackCounter (const BeginOfTrackCounter &)=delete
 
const BeginOfTrackCounteroperator= (const BeginOfTrackCounter &)=delete
 
void produce (edm::Event &, const edm::EventSetup &) override
 
- Public Member Functions inherited from SimProducer
const SimProduceroperator= (const SimProducer &)=delete
 
void registerProducts (edm::ProducesCollector producesCollector)
 
 SimProducer ()
 
 SimProducer (const SimProducer &)=delete
 
- Public Member Functions inherited from SimWatcher
virtual void beginRun (edm::EventSetup const &)
 
bool isMT () const
 
const SimWatcheroperator= (const SimWatcher &)=delete
 
virtual void registerConsumes (edm::ConsumesCollector)
 
 SimWatcher ()
 
 SimWatcher (const SimWatcher &)=delete
 
virtual ~SimWatcher ()
 
- Public Member Functions inherited from Observer< const BeginOfTrack *>
 Observer ()
 
void slotForUpdate (const BeginOfTrack * iT)
 
virtual ~Observer ()
 

Private Member Functions

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)
 
- Protected Member Functions inherited from SimWatcher
void setMT (bool val)
 

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.

References m_label.

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

◆ BeginOfTrackCounter() [2/2]

simwatcher::BeginOfTrackCounter::BeginOfTrackCounter ( const BeginOfTrackCounter )
delete

Member Function Documentation

◆ operator=()

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

◆ produce()

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

Implements SimProducer.

Definition at line 41 of file BeginOfTrackCounter.cc.

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

41  {
42  std::unique_ptr<int> product(new int(m_count));
43  e.put(std::move(product), m_label);
44  m_count = 0;
45 }
def move(src, dest)
Definition: eostools.py:511

◆ update()

void BeginOfTrackCounter::update ( const BeginOfTrack )
overrideprivatevirtual

Member Data Documentation

◆ m_count

int simwatcher::BeginOfTrackCounter::m_count
private

Definition at line 54 of file BeginOfTrackCounter.h.

Referenced by produce(), and update().

◆ m_label

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

Definition at line 55 of file BeginOfTrackCounter.h.

Referenced by BeginOfTrackCounter(), and produce().