Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:25

0001 #ifndef HelpfulWatchers_BeginOfTrackCounter_h
0002 #define HelpfulWatchers_BeginOfTrackCounter_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     HelpfulWatchers
0006 // Class  :     BeginOfTrackCounter
0007 //
0008 /**\class BeginOfTrackCounter BeginOfTrackCounter.h
0009  SimG4Core/HelpfulWatchers/interface/BeginOfTrackCounter.h
0010 
0011  Description: Counts the number of BeginOfTrack signals and puts that value into
0012  the Event
0013 
0014  Usage:
0015     The module takes one optional parameter "instanceLabel" which is used to
0016     set the label used to put the data into the Event
0017 
0018 */
0019 //
0020 // Original Author:
0021 //         Created:  Tue Nov 29 12:26:39 EST 2005
0022 //
0023 
0024 // system include files
0025 #include <string>
0026 
0027 // user include files
0028 #include "SimG4Core/Notification/interface/BeginOfTrack.h"
0029 #include "SimG4Core/Notification/interface/Observer.h"
0030 #include "SimG4Core/Watcher/interface/SimProducer.h"
0031 
0032 // forward declarations
0033 namespace edm {
0034   class ParameterSet;
0035 }
0036 
0037 namespace simwatcher {
0038   class BeginOfTrackCounter : public SimProducer, public Observer<const BeginOfTrack *> {
0039   public:
0040     BeginOfTrackCounter(const edm::ParameterSet &);
0041     BeginOfTrackCounter(const BeginOfTrackCounter &) = delete;                   // stop default
0042     const BeginOfTrackCounter &operator=(const BeginOfTrackCounter &) = delete;  // stop default
0043 
0044     // ---------- const member functions ---------------------
0045 
0046     // ---------- static member functions --------------------
0047 
0048     // ---------- member functions ---------------------------
0049     void produce(edm::Event &, const edm::EventSetup &) override;
0050 
0051   private:
0052     void update(const BeginOfTrack *) override;
0053     // ---------- member data --------------------------------
0054     int m_count;
0055     std::string m_label;
0056   };
0057 
0058 }  // namespace simwatcher
0059 #endif