#ifndef ABSRCPGEOMETER_HPP #define ABSRCPGEOMETER_HPP // // $Id: absRcpGeometer.hpp,v 1.7 2001/06/14 19:10:00 hobbs Exp $ // // File: absRcpGeometer.hpp // Purpose: An abstract base class for geometers which receive version // information via RCP (for now, the ChannelGeometer and MaterialGeometer // for each subdector. This base class provides support for: // // (1) RCP parameter version tracking by dependent code via the RCPID // portion of the interface, and // (2) Notification that new RCP parameters might be needed. Whenever // the overall geometry manager detects a possible version change // in the input event data (history chunk for MC or run number for // other data), the method absRefresh is called. This first calls // the subdetector specific checkVersion, passing it version // information. If a new RCP is needed, the subdetector code should // return a pointer to the RCP object. absRefresh then updates the // RCPID and calls the subdetector specific refresh method if a new // RCP is required. // // Subdetectors should override the refresh and checkVersion code. Dummy // checkVersion code is supplied which simply return "no change needed" // for every call. // // Although it's probably unnecessary, this inherits from // absObservedGeometer to allow direct notification of RCP changes to // dependent classes // // Created: 9-NOV-2000 John Hobbs // // $Revision: 1.7 $ // // // Include files and forward references #include "rcp/RCPID.hpp" #include "rcp/RCP.hpp" #include "geometry_system/management/absObservedGeometer.hpp" namespace edm { class Event; } // Global definitions namespace dgs { class absRcpGeometer: public absObservedGeometer { public: /// Constructor. Registers the Geometer absRcpGeometer(); /// Destructor. Unregisters the Geometer ~absRcpGeometer(); /// Retrieve the RCPID of the current RCP edm::RCPID id() const; /** Called by the overall geometry synchronization code (GeometerManager) if new RCP information could possibly be needed. Currently the information includes the history chunks version string for pmc, psim, t (test release), p (unified production release) and preco. In addition, the run number is provided. The flag isMC is TRUE for MC data. Currently Monte Carlo data is anything with a MCKINE, PMC or PSIM history chunk. If none are present, the event is assumed to be COLLIDER DATA. **/ bool absRefresh(const bool isMC, const int runNumber, const std::vector& versions, const edm::Event *anEvt=0); /// Force a change of constants without subdetector input. Use at initialize bool absRefresh(const edm::RCP* newRCP); /** Check the event version information passed as an arguement to see if a new RCP is needed. If it is, return a pointer to the new RCP. If not, return an emptry RCPID. The default implementation never triggers a change in parameters. See absRefresh (above) for a description of the parameters. **/ virtual edm::RCP* check_version(const bool isMC, const int runNumber, const std::vector& versions, const edm::Event *anEvt=0); /// Do I want to be call every event? bool check_every_event() const { return _check_every_event; } protected: virtual bool refresh(const edm::RCP* newRCP)=0; bool _check_every_event; private: edm::RCPID d_currentRCP; }; } #endif //ABSRCPGEOMETER_HPP