CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HGCalTriggerDigiFEReproducer Class Reference
Inheritance diagram for HGCalTriggerDigiFEReproducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
 HGCalTriggerDigiFEReproducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~HGCalTriggerDigiFEReproducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

std::unique_ptr< HGCalTriggerBackendProcessorbackEndProcessor_
 
std::unique_ptr< HGCalTriggerFECodecBasecodec_
 
edm::EDGetToken inputdigi_
 
edm::ESHandle< HGCalTriggerGeometryBasetriggerGeometry_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 21 of file HGCalTriggerDigiFEReproducer.cc.

Constructor & Destructor Documentation

HGCalTriggerDigiFEReproducer::HGCalTriggerDigiFEReproducer ( const edm::ParameterSet conf)

Definition at line 43 of file HGCalTriggerDigiFEReproducer.cc.

References backEndProcessor_, codec_, reco::get(), edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), and AlCaHLTBitMon_QueryRunRegistry::string.

43  :
44  inputdigi_(consumes<l1t::HGCFETriggerDigiCollection>(conf.getParameter<edm::InputTag>("feDigis"))),
46 /*****************************************************************/
47 {
48  //setup FE codec
49  const edm::ParameterSet& feCodecConfig = conf.getParameterSet("FECodec");
50  const std::string& feCodecName = feCodecConfig.getParameter<std::string>("CodecName");
51  HGCalTriggerFECodecBase* codec = HGCalTriggerFECodecFactory::get()->create(feCodecName,feCodecConfig);
52  codec_.reset(codec);
53  codec_->unSetDataPayload();
54 
55  produces<l1t::HGCFETriggerDigiCollection>();
56  // register backend processor products
57  backEndProcessor_->setProduces(*this);
58 }
T getParameter(std::string const &) const
std::unique_ptr< HGCalTriggerFECodecBase > codec_
std::unique_ptr< HGCalTriggerBackendProcessor > backEndProcessor_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
ParameterSet const & getParameterSet(std::string const &) const
T get(const Candidate &c)
Definition: component.h:55
HGCalTriggerDigiFEReproducer::~HGCalTriggerDigiFEReproducer ( )
inline

Definition at line 25 of file HGCalTriggerDigiFEReproducer.cc.

References beginRun(), and produce().

25 { }

Member Function Documentation

void HGCalTriggerDigiFEReproducer::beginRun ( const edm::Run ,
const edm::EventSetup es 
)
virtual

Definition at line 61 of file HGCalTriggerDigiFEReproducer.cc.

References backEndProcessor_, codec_, edm::EventSetup::get(), edm::ESHandle< T >::product(), and triggerGeometry_.

Referenced by ~HGCalTriggerDigiFEReproducer().

63 {
65  codec_->setGeometry(triggerGeometry_.product());
67 }
std::unique_ptr< HGCalTriggerFECodecBase > codec_
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
std::unique_ptr< HGCalTriggerBackendProcessor > backEndProcessor_
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
void HGCalTriggerDigiFEReproducer::produce ( edm::Event e,
const edm::EventSetup es 
)
virtual

Definition at line 70 of file HGCalTriggerDigiFEReproducer.cc.

References backEndProcessor_, codec_, edm::Event::getByToken(), inputdigi_, eostools::move(), convertSQLitetoXML_cfg::output, edm::Event::put(), edm::SortedCollection< T, SORT >::reserve(), l1t::HGCFETriggerDigi::setDetId(), edm::SortedCollection< T, SORT >::size(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ~HGCalTriggerDigiFEReproducer().

72 {
73  std::unique_ptr<l1t::HGCFETriggerDigiCollection> fe_output( new l1t::HGCFETriggerDigiCollection );
74 
76 
77  e.getByToken(inputdigi_,digis_h);
78 
79  const l1t::HGCFETriggerDigiCollection& digis = *digis_h;
80 
81  fe_output->reserve(digis.size());
82  std::stringstream output;
83  for( const auto& digi_in : digis )
84  {
85  fe_output->push_back(l1t::HGCFETriggerDigi());
86  l1t::HGCFETriggerDigi& digi_out = fe_output->back();
87  codec_->setDataPayload(digi_in);
88  codec_->encode(digi_out);
89  digi_out.setDetId( digi_in.getDetId<HGCalDetId>() );
90  codec_->print(digi_out,output);
91  edm::LogInfo("HGCalTriggerDigiFEReproducer")
92  << output.str();
93  codec_->unSetDataPayload();
94  output.str(std::string());
95  output.clear();
96  }
97 
98  // get the orphan handle and fe digi collection
99  auto fe_digis_handle = e.put(std::move(fe_output));
100  auto fe_digis_coll = *fe_digis_handle;
101 
102  //now we run the emulation of the back-end processor
103  backEndProcessor_->run(fe_digis_coll,es,e);
104  backEndProcessor_->putInEvent(e);
105  backEndProcessor_->reset();
106 }
std::unique_ptr< HGCalTriggerFECodecBase > codec_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
std::unique_ptr< HGCalTriggerBackendProcessor > backEndProcessor_
void setDetId(const IDTYPE &id)
size_type size() const
void reserve(size_type n)
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

std::unique_ptr<HGCalTriggerBackendProcessor> HGCalTriggerDigiFEReproducer::backEndProcessor_
private

Definition at line 36 of file HGCalTriggerDigiFEReproducer.cc.

Referenced by beginRun(), HGCalTriggerDigiFEReproducer(), and produce().

std::unique_ptr<HGCalTriggerFECodecBase> HGCalTriggerDigiFEReproducer::codec_
private

Definition at line 35 of file HGCalTriggerDigiFEReproducer.cc.

Referenced by beginRun(), HGCalTriggerDigiFEReproducer(), and produce().

edm::EDGetToken HGCalTriggerDigiFEReproducer::inputdigi_
private

Definition at line 32 of file HGCalTriggerDigiFEReproducer.cc.

Referenced by produce().

edm::ESHandle<HGCalTriggerGeometryBase> HGCalTriggerDigiFEReproducer::triggerGeometry_
private

Definition at line 33 of file HGCalTriggerDigiFEReproducer.cc.

Referenced by beginRun().