Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:27:47

0001 #ifndef FWCore_Framework_LuminosityBlockForOutput_h
0002 #define FWCore_Framework_LuminosityBlockForOutput_h
0003 
0004 // -*- C++ -*-
0005 //
0006 // Package:     Framework
0007 // Class  :     LuminosityBlockForOutput
0008 //
0009 /**\class LuminosityBlockForOutput LuminosityBlockForOutput.h FWCore/Framework/interface/LuminosityBlockForOutput.h
0010 
0011 Description: This is the primary interface for accessing per luminosity block EDProducts
0012 and inserting new derived per luminosity block EDProducts.
0013 
0014 For its usage, see "FWCore/Framework/interface/PrincipalGetAdapter.h"
0015 
0016 */
0017 /*----------------------------------------------------------------------
0018 
0019 ----------------------------------------------------------------------*/
0020 
0021 #include "DataFormats/Common/interface/Wrapper.h"
0022 #include "DataFormats/Provenance/interface/LuminosityBlockAuxiliary.h"
0023 #include "FWCore/Framework/interface/Frameworkfwd.h"
0024 #include "FWCore/Framework/interface/OccurrenceForOutput.h"
0025 #include "FWCore/Utilities/interface/propagate_const.h"
0026 #include "FWCore/Utilities/interface/LuminosityBlockIndex.h"
0027 
0028 #include <memory>
0029 #include <string>
0030 #include <typeinfo>
0031 #include <vector>
0032 
0033 namespace edmtest {
0034   class TestOutputModule;
0035 }
0036 
0037 namespace edm {
0038   class ModuleCallingContext;
0039 
0040   class LuminosityBlockForOutput : public OccurrenceForOutput {
0041   public:
0042     LuminosityBlockForOutput(LumiTransitionInfo const&,
0043                              ModuleDescription const&,
0044                              ModuleCallingContext const*,
0045                              bool isAtEnd);
0046     LuminosityBlockForOutput(LuminosityBlockPrincipal const&,
0047                              ModuleDescription const&,
0048                              ModuleCallingContext const*,
0049                              bool isAtEnd);
0050     ~LuminosityBlockForOutput() override;
0051 
0052     LuminosityBlockAuxiliary const& luminosityBlockAuxiliary() const { return aux_; }
0053     LuminosityBlockID const& id() const { return aux_.id(); }
0054     LuminosityBlockNumber_t luminosityBlock() const { return aux_.luminosityBlock(); }
0055     RunNumber_t run() const { return aux_.run(); }
0056     Timestamp const& beginTime() const { return aux_.beginTime(); }
0057     Timestamp const& endTime() const { return aux_.endTime(); }
0058 
0059     /**\return Reusable index which can be used to separate data for different simultaneous LuminosityBlocks.
0060      */
0061     LuminosityBlockIndex index() const;
0062 
0063     RunForOutput const& getRun() const { return *run_; }
0064 
0065   private:
0066     friend class edmtest::TestOutputModule;  // For testing
0067 
0068     LuminosityBlockPrincipal const& luminosityBlockPrincipal() const;
0069 
0070     LuminosityBlockAuxiliary const& aux_;
0071     std::shared_ptr<RunForOutput const> const run_;
0072   };
0073 
0074 }  // namespace edm
0075 #endif