CMS 3D CMS Logo

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

Public Member Functions

virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
 HGCalTriggerDigiProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~HGCalTriggerDigiProducer ()
 
- 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 inputbh_
 
edm::EDGetToken inputee_
 
edm::EDGetToken inputfh_
 
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 18 of file HGCalTriggerDigiProducer.cc.

Constructor & Destructor Documentation

HGCalTriggerDigiProducer::HGCalTriggerDigiProducer ( const edm::ParameterSet conf)

Definition at line 39 of file HGCalTriggerDigiProducer.cc.

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

39  :
40  inputee_(consumes<HGCEEDigiCollection>(conf.getParameter<edm::InputTag>("eeDigis"))),
41  inputfh_(consumes<HGCHEDigiCollection>(conf.getParameter<edm::InputTag>("fhDigis"))),
42  //inputbh_(consumes<HGCHEDigiCollection>(conf.getParameter<edm::InputTag>("bhDigis"))),
44 {
45  //setup FE codec
46  const edm::ParameterSet& feCodecConfig = conf.getParameterSet("FECodec");
47  const std::string& feCodecName = feCodecConfig.getParameter<std::string>("CodecName");
48  HGCalTriggerFECodecBase* codec = HGCalTriggerFECodecFactory::get()->create(feCodecName,feCodecConfig);
49  codec_.reset(codec);
50  codec_->unSetDataPayload();
51 
52  produces<l1t::HGCFETriggerDigiCollection>();
53  // register backend processor products
54  backEndProcessor_->setProduces(*this);
55 }
T getParameter(std::string const &) const
std::unique_ptr< HGCalTriggerFECodecBase > codec_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::unique_ptr< HGCalTriggerBackendProcessor > backEndProcessor_
ParameterSet const & getParameterSet(std::string const &) const
T get(const Candidate &c)
Definition: component.h:55
HGCalTriggerDigiProducer::~HGCalTriggerDigiProducer ( )
inline

Definition at line 21 of file HGCalTriggerDigiProducer.cc.

References beginRun(), and produce().

21 { }

Member Function Documentation

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

Definition at line 57 of file HGCalTriggerDigiProducer.cc.

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

Referenced by ~HGCalTriggerDigiProducer().

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

Definition at line 65 of file HGCalTriggerDigiProducer.cc.

References backEndProcessor_, codec_, edm::Event::getByToken(), HGCalTriggerGeometryBase::getModuleFromCell(), inputee_, inputfh_, eostools::move(), edm::Event::put(), l1t::HGCFETriggerDigi::setDetId(), and triggerGeometry_.

Referenced by ~HGCalTriggerDigiProducer().

65  {
66  std::unique_ptr<l1t::HGCFETriggerDigiCollection>
67  fe_output( new l1t::HGCFETriggerDigiCollection );
68 
70  edm::Handle<HGCHEDigiCollection> fh_digis_h, bh_digis_h;
71 
72  e.getByToken(inputee_,ee_digis_h);
73  e.getByToken(inputfh_,fh_digis_h);
74  //e.getByToken(inputbh_,bh_digis_h);
75 
76  const HGCEEDigiCollection& ee_digis = *ee_digis_h;
77  const HGCHEDigiCollection& fh_digis = *fh_digis_h;
78  //const HGCHEDigiCollection& bh_digis = *bh_digis_h;
79 
80  // First find modules containing hits and prepare list of hits for each module
81  std::unordered_map<uint32_t, HGCEEDigiCollection> hit_modules_ee;
82  for(const auto& eedata : ee_digis) {
83  uint32_t module = triggerGeometry_->getModuleFromCell(eedata.id());
84  auto itr_insert = hit_modules_ee.emplace(module,HGCEEDigiCollection());
85  itr_insert.first->second.push_back(eedata);
86  }
87  std::unordered_map<uint32_t,HGCHEDigiCollection> hit_modules_fh;
88  for(const auto& fhdata : fh_digis) {
89  uint32_t module = triggerGeometry_->getModuleFromCell(fhdata.id());
90  auto itr_insert = hit_modules_fh.emplace(module, HGCHEDigiCollection());
91  itr_insert.first->second.push_back(fhdata);
92  }
93  // loop on modules containing hits and call front-end processing
94  // we produce one output trigger digi per module in the FE
95  fe_output->reserve(hit_modules_ee.size() + hit_modules_fh.size());
96  for( const auto& module_hits : hit_modules_ee ) {
97  fe_output->push_back(l1t::HGCFETriggerDigi());
98  l1t::HGCFETriggerDigi& digi = fe_output->back();
99  codec_->setDataPayload(module_hits.second,HGCHEDigiCollection(),HGCHEDigiCollection());
100  codec_->encode(digi);
101  digi.setDetId( DetId(module_hits.first) );
102  codec_->unSetDataPayload();
103  } //end loop on EE modules
104  for( const auto& module_hits : hit_modules_fh ) {
105  fe_output->push_back(l1t::HGCFETriggerDigi());
106  l1t::HGCFETriggerDigi& digi = fe_output->back();
107  codec_->setDataPayload(HGCEEDigiCollection(),module_hits.second,HGCHEDigiCollection());
108  codec_->encode(digi);
109  digi.setDetId( DetId(module_hits.first) );
110  codec_->unSetDataPayload();
111  } //end loop on FH modules
112 
113 
114  // get the orphan handle and fe digi collection
115  auto fe_digis_handle = e.put(std::move(fe_output));
116  auto fe_digis_coll = *fe_digis_handle;
117 
118  //now we run the emulation of the back-end processor
119  backEndProcessor_->reset();
120  backEndProcessor_->run(fe_digis_coll,es,e);
121  backEndProcessor_->putInEvent(e);
122 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
edm::SortedCollection< HGCEEDataFrame > HGCEEDigiCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
std::unique_ptr< HGCalTriggerFECodecBase > codec_
void setDetId(const IDTYPE &id)
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
std::unique_ptr< HGCalTriggerBackendProcessor > backEndProcessor_
virtual unsigned getModuleFromCell(const unsigned cell_det_id) const =0
Definition: DetId.h:18
Definition: vlib.h:208
edm::SortedCollection< HGCHEDataFrame > HGCHEDigiCollection
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

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

Definition at line 33 of file HGCalTriggerDigiProducer.cc.

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

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

Definition at line 32 of file HGCalTriggerDigiProducer.cc.

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

edm::EDGetToken HGCalTriggerDigiProducer::inputbh_
private

Definition at line 29 of file HGCalTriggerDigiProducer.cc.

edm::EDGetToken HGCalTriggerDigiProducer::inputee_
private

Definition at line 29 of file HGCalTriggerDigiProducer.cc.

Referenced by produce().

edm::EDGetToken HGCalTriggerDigiProducer::inputfh_
private

Definition at line 29 of file HGCalTriggerDigiProducer.cc.

Referenced by produce().

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

Definition at line 30 of file HGCalTriggerDigiProducer.cc.

Referenced by beginRun(), and produce().