Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:25:05

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 */
0019 //
0020 // Original Author:
0021 //         Created:  Tue Nov 22 15:35:11 EST 2005
0022 //
0023 
0024 #include "FWCore/Framework/interface/EventSetup.h"
0025 #include "FWCore/Framework/interface/ConsumesCollector.h"
0026 
0027 class SimWatcher {
0028 public:
0029   SimWatcher() {}
0030   virtual ~SimWatcher() {}
0031 
0032   // Two methods are needed to be implemented in the thread
0033   // safe watchers and producers
0034   virtual void registerConsumes(edm::ConsumesCollector){};
0035   virtual void beginRun(edm::EventSetup const &){};
0036 
0037   bool isMT() const { return applicableForMT; }
0038 
0039   SimWatcher(const SimWatcher &) = delete;
0040   const SimWatcher &operator=(const SimWatcher &) = delete;
0041 
0042 protected:
0043   // Set "true" for thread safe watchers/producers
0044   void setMT(bool val) { applicableForMT = val; }
0045 
0046 private:
0047   bool applicableForMT{false};
0048 };
0049 
0050 #endif