Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:30:07

0001 
0002 #include "SimGeneral/MixingModule/interface/DigiAccumulatorMixModFactory.h"
0003 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0004 #include "FWCore/Utilities/interface/DebugMacros.h"
0005 #include "FWCore/Utilities/interface/EDMException.h"
0006 
0007 #include <iostream>
0008 
0009 EDM_REGISTER_PLUGINFACTORY(edm::DigiAccumulatorMixModPluginFactory, "DigiAccumulator");
0010 
0011 namespace edm {
0012   DigiAccumulatorMixModFactory::~DigiAccumulatorMixModFactory() {}
0013 
0014   DigiAccumulatorMixModFactory::DigiAccumulatorMixModFactory() {}
0015 
0016   DigiAccumulatorMixModFactory const DigiAccumulatorMixModFactory::singleInstance_;
0017 
0018   DigiAccumulatorMixModFactory const* DigiAccumulatorMixModFactory::get() {
0019     // will not work with plugin factories
0020     //static DigiAccumulatorMixModFactory f;
0021     //return &f;
0022 
0023     return &singleInstance_;
0024   }
0025 
0026   std::unique_ptr<DigiAccumulatorMixMod> DigiAccumulatorMixModFactory::makeDigiAccumulator(
0027       ParameterSet const& conf, ProducesCollector producesCollector, ConsumesCollector& iC) const {
0028     std::string accumulatorType = conf.getParameter<std::string>("accumulatorType");
0029     FDEBUG(1) << "DigiAccumulatorMixModFactory: digi_accumulator_type = " << accumulatorType << std::endl;
0030     auto wm = DigiAccumulatorMixModPluginFactory::get()->create(accumulatorType, conf, producesCollector, iC);
0031 
0032     if (wm.get() == nullptr) {
0033       throw edm::Exception(errors::Configuration, "NoSourceModule")
0034           << "DigiAccumulator Factory:\n"
0035           << "Cannot find dig type from ParameterSet: " << accumulatorType << "\n"
0036           << "Perhaps your source type is misspelled or is not an EDM Plugin?\n"
0037           << "Try running EdmPluginDump to obtain a list of available Plugins.";
0038     }
0039 
0040     FDEBUG(1) << "DigiAccumulatorMixModFactory: created a Digi Accumulator " << accumulatorType << std::endl;
0041 
0042     return wm;
0043   }
0044 }  // namespace edm