CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch1/src/SimG4Core/HelpfulWatchers/src/BeginOfTrackCounter.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     HelpfulWatchers
00004 // Class  :     BeginOfTrackCounter
00005 // 
00006 // Implementation:
00007 //     <Notes on implementation>
00008 //
00009 // Original Author:  
00010 //         Created:  Tue Nov 29 12:26:42 EST 2005
00011 // $Id: BeginOfTrackCounter.cc,v 1.1 2005/11/29 18:42:56 chrjones Exp $
00012 //
00013 
00014 // system include files
00015 
00016 // user include files
00017 #include "SimG4Core/HelpfulWatchers/src/BeginOfTrackCounter.h"
00018 
00019 #include "FWCore/Framework/interface/Event.h"
00020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00021 
00022 //
00023 // constants, enums and typedefs
00024 //
00025 using namespace simwatcher;
00026 //
00027 // static data member definitions
00028 //
00029 
00030 //
00031 // constructors and destructor
00032 //
00033 BeginOfTrackCounter::BeginOfTrackCounter(const edm::ParameterSet& iPSet) :
00034    m_count(0),
00035    m_label(iPSet.getUntrackedParameter<std::string>("instanceLabel","nBeginOfTracks"))
00036 {
00037    produces<int>(m_label);
00038 }
00039 
00040 
00041 //
00042 // member functions
00043 //
00044 
00045 void
00046 BeginOfTrackCounter::produce(edm::Event& e, const edm::EventSetup&)
00047 {
00048    std::auto_ptr<int> product(new int(m_count));
00049    e.put(product,m_label);
00050    m_count = 0;
00051 }
00052 
00053 void
00054 BeginOfTrackCounter::update(const BeginOfTrack*){
00055    ++m_count;
00056 }