File indexing completed on 2024-04-06 12:30:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #include "SimG4Core/HelpfulWatchers/src/BeginOfTrackCounter.h"
0017
0018 #include "FWCore/Framework/interface/Event.h"
0019 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0020
0021
0022
0023
0024 using namespace simwatcher;
0025
0026
0027
0028
0029
0030
0031
0032 BeginOfTrackCounter::BeginOfTrackCounter(const edm::ParameterSet &iPSet)
0033 : m_count(0), m_label(iPSet.getUntrackedParameter<std::string>("instanceLabel", "nBeginOfTracks")) {
0034 produces<int>(m_label);
0035 }
0036
0037
0038
0039
0040
0041 void BeginOfTrackCounter::produce(edm::Event &e, const edm::EventSetup &) {
0042 std::unique_ptr<int> product(new int(m_count));
0043 e.put(std::move(product), m_label);
0044 m_count = 0;
0045 }
0046
0047 void BeginOfTrackCounter::update(const BeginOfTrack *) { ++m_count; }