CMS 3D CMS Logo

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

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 HGCalTriggerDigiFEReproducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~HGCalTriggerDigiFEReproducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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
 

Detailed Description

Definition at line 21 of file HGCalTriggerDigiFEReproducer.cc.

Constructor & Destructor Documentation

◆ HGCalTriggerDigiFEReproducer()

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

Definition at line 41 of file HGCalTriggerDigiFEReproducer.cc.

42  : inputdigi_(consumes<l1t::HGCFETriggerDigiCollection>(conf.getParameter<edm::InputTag>("feDigis"))),
44  std::make_unique<HGCalTriggerBackendProcessor>(conf.getParameterSet("BEConfiguration"), consumesCollector()))
45 /*****************************************************************/
46 {
47  //setup FE codec
48  const edm::ParameterSet& feCodecConfig = conf.getParameterSet("FECodec");
49  const std::string& feCodecName = feCodecConfig.getParameter<std::string>("CodecName");
50  codec_ = HGCalTriggerFECodecFactory::get()->create(feCodecName, feCodecConfig);
51  codec_->unSetDataPayload();
52 
53  produces<l1t::HGCFETriggerDigiCollection>();
54  // register backend processor products
55  backEndProcessor_->setProduces(*this);
56 }

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

◆ ~HGCalTriggerDigiFEReproducer()

HGCalTriggerDigiFEReproducer::~HGCalTriggerDigiFEReproducer ( )
inlineoverride

Definition at line 24 of file HGCalTriggerDigiFEReproducer.cc.

24 {}

Member Function Documentation

◆ beginRun()

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

◆ produce()

void HGCalTriggerDigiFEReproducer::produce ( edm::Event e,
const edm::EventSetup es 
)
override

Definition at line 68 of file HGCalTriggerDigiFEReproducer.cc.

70 {
71  std::unique_ptr<l1t::HGCFETriggerDigiCollection> fe_output(new l1t::HGCFETriggerDigiCollection);
72 
74 
75  e.getByToken(inputdigi_, digis_h);
76 
77  const l1t::HGCFETriggerDigiCollection& digis = *digis_h;
78 
79  fe_output->reserve(digis.size());
80  std::stringstream output;
81  for (const auto& digi_in : digis) {
82  fe_output->push_back(l1t::HGCFETriggerDigi());
83  l1t::HGCFETriggerDigi& digi_out = fe_output->back();
84  codec_->setDataPayload(digi_in);
85  codec_->encode(digi_out);
86  digi_out.setDetId(digi_in.getDetId<HGCalDetId>());
87  codec_->print(digi_out, output);
88  edm::LogInfo("HGCalTriggerDigiFEReproducer") << output.str();
89  codec_->unSetDataPayload();
90  output.str(std::string());
91  output.clear();
92  }
93 
94  // get the orphan handle and fe digi collection
95  auto fe_digis_handle = e.put(std::move(fe_output));
96  auto fe_digis_coll = *fe_digis_handle;
97 
98  //now we run the emulation of the back-end processor
99  backEndProcessor_->run(fe_digis_coll, es, e);
100  backEndProcessor_->putInEvent(e);
101  backEndProcessor_->reset();
102 }

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

Member Data Documentation

◆ backEndProcessor_

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

Definition at line 35 of file HGCalTriggerDigiFEReproducer.cc.

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

◆ codec_

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

Definition at line 34 of file HGCalTriggerDigiFEReproducer.cc.

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

◆ inputdigi_

edm::EDGetToken HGCalTriggerDigiFEReproducer::inputdigi_
private

Definition at line 31 of file HGCalTriggerDigiFEReproducer.cc.

Referenced by produce().

◆ triggerGeometry_

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

Definition at line 32 of file HGCalTriggerDigiFEReproducer.cc.

Referenced by beginRun().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
l1t::HGCFETriggerDigi
Definition: HGCFETriggerDigi.h:64
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
edm::LogInfo
Definition: MessageLogger.h:254
edm::SortedCollection
Definition: SortedCollection.h:49
edm::SortedCollection::size
size_type size() const
Definition: SortedCollection.h:215
edm::Handle
Definition: AssociativeIterator.h:50
HGCalTriggerDigiFEReproducer::inputdigi_
edm::EDGetToken inputdigi_
Definition: HGCalTriggerDigiFEReproducer.cc:31
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
HGCalTriggerDigiFEReproducer::codec_
std::unique_ptr< HGCalTriggerFECodecBase > codec_
Definition: HGCalTriggerDigiFEReproducer.cc:34
l1t::HGCFETriggerDigi::setDetId
void setDetId(const IDTYPE &id)
Definition: HGCFETriggerDigi.h:79
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
HGCalTriggerDigiFEReproducer::triggerGeometry_
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
Definition: HGCalTriggerDigiFEReproducer.cc:32
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
HGCalDetId
Definition: HGCalDetId.h:8
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::SortedCollection::reserve
void reserve(size_type n)
Definition: SortedCollection.h:225
HGCalTriggerDigiFEReproducer::backEndProcessor_
std::unique_ptr< HGCalTriggerBackendProcessor > backEndProcessor_
Definition: HGCalTriggerDigiFEReproducer.cc:35
edm::InputTag
Definition: InputTag.h:15
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2121
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37