Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-11-26 03:52:07

0001 #ifndef Watcher_SimWatcher_h
0002 #define Watcher_SimWatcher_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Watcher
0006 // Class  :     SimWatcher
0007 //
0008 /**\class SimWatcher SimWatcher.h SimG4Core/Watcher/interface/SimWatcher.h
0009 
0010  Description: Base class for classes that 'watch' what OscarProducer does
0011 internally
0012 
0013  Usage:
0014     By itself, this class actually does nothing except allow dynamic loading
0015 into the OscarProducer.  To do useful work, one must inherit from this class
0016 and one or more 'Observer<T>' classes.
0017 
0018     A class that inherits from OscarProducer must have a constructor that takes
0019 a 'const edm::ParameterSet&' as its only argument.  This constructor will be
0020 called by the dynamic loading code.
0021 */
0022 //
0023 // Original Author:
0024 //         Created:  Tue Nov 22 15:35:11 EST 2005
0025 //
0026 
0027 #include "FWCore/Framework/interface/EventSetup.h"
0028 #include "FWCore/Framework/interface/ConsumesCollector.h"
0029 
0030 class SimWatcher {
0031 public:
0032   SimWatcher() {}
0033   virtual ~SimWatcher() {}
0034 
0035   // Two methods are needed to be implemented in the thread
0036   // safe watchers and producers
0037   virtual void registerConsumes(edm::ConsumesCollector){};
0038   virtual void beginRun(edm::EventSetup const &){};
0039 
0040   bool isMT() const { return applicableForMT; }
0041 
0042   SimWatcher(const SimWatcher &) = delete;
0043   const SimWatcher &operator=(const SimWatcher &) = delete;
0044 
0045 protected:
0046   // Set "true" for thread safe watchers/producers
0047   void setMT(bool val) { applicableForMT = val; }
0048 
0049 private:
0050   bool applicableForMT{false};
0051 };
0052 
0053 #endif