test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
HGCalTriggerDigiProducer Class Reference
Inheritance diagram for HGCalTriggerDigiProducer:
edm::EDProducer 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::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- 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
 
 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 & 
itemsToGetFromEvent () 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

HGCalTriggerBackendProcessor backEndProcessor_
 
std::unique_ptr
< HGCalTriggerFECodecBase
codec_
 
edm::EDGetToken inputbh_
 
edm::EDGetToken inputee_
 
edm::EDGetToken inputfh_
 
std::unique_ptr
< HGCalTriggerGeometryBase
triggerGeometry_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer 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::EDProducer
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_, geometry, reco::get(), edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), HGCalTriggerBackendProcessor::setProduces(), AlCaHLTBitMon_QueryRunRegistry::string, and triggerGeometry_.

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"))),
43  backEndProcessor_(conf.getParameterSet("BEConfiguration")) {
44 
45  //setup geometry configuration
46  const edm::ParameterSet& geometryConfig =
47  conf.getParameterSet("TriggerGeometry");
48  const std::string& trigGeomName =
49  geometryConfig.getParameter<std::string>("TriggerGeometryName");
51  HGCalTriggerGeometryFactory::get()->create(trigGeomName,geometryConfig);
52  triggerGeometry_.reset(geometry);
53 
54  //setup FE codec
55  const edm::ParameterSet& feCodecConfig =
56  conf.getParameterSet("FECodec");
57  const std::string& feCodecName =
58  feCodecConfig.getParameter<std::string>("CodecName");
60  HGCalTriggerFECodecFactory::get()->create(feCodecName,feCodecConfig);
61  codec_.reset(codec);
62  codec_->unSetDataPayload();
63 
64  produces<l1t::HGCFETriggerDigiCollection>();
65  // register backend processor products
67 }
T getParameter(std::string const &) const
HGCalTriggerBackendProcessor backEndProcessor_
std::unique_ptr< HGCalTriggerGeometryBase > triggerGeometry_
std::unique_ptr< HGCalTriggerFECodecBase > codec_
void setProduces(edm::EDProducer &prod) const
ParameterSet const & getParameterSet(std::string const &) const
ESHandle< TrackerGeometry > geometry
T get(const Candidate &c)
Definition: component.h:55
HGCalTriggerDigiProducer::~HGCalTriggerDigiProducer ( )
inline

Definition at line 21 of file HGCalTriggerDigiProducer.cc.

21 { }

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 69 of file HGCalTriggerDigiProducer.cc.

References HGCalTriggerGeometryBase::es_info::geom_bh, HGCalTriggerGeometryBase::es_info::geom_ee, HGCalTriggerGeometryBase::es_info::geom_fh, edm::EventSetup::get(), info(), AlCaHLTBitMon_QueryRunRegistry::string, HGCalTriggerGeometryBase::es_info::topo_bh, HGCalTriggerGeometryBase::es_info::topo_ee, HGCalTriggerGeometryBase::es_info::topo_fh, and triggerGeometry_.

70  {
71  triggerGeometry_->reset();
73  const std::string& ee_sd_name = triggerGeometry_->eeSDName();
74  const std::string& fh_sd_name = triggerGeometry_->fhSDName();
75  const std::string& bh_sd_name = triggerGeometry_->bhSDName();
76  es.get<IdealGeometryRecord>().get(ee_sd_name,info.geom_ee);
77  es.get<IdealGeometryRecord>().get(fh_sd_name,info.geom_fh);
78  es.get<IdealGeometryRecord>().get(bh_sd_name,info.geom_bh);
79  es.get<IdealGeometryRecord>().get(ee_sd_name,info.topo_ee);
80  es.get<IdealGeometryRecord>().get(fh_sd_name,info.topo_fh);
81  es.get<IdealGeometryRecord>().get(bh_sd_name,info.topo_bh);
82  triggerGeometry_->initialize(info);
83 }
std::unique_ptr< HGCalTriggerGeometryBase > triggerGeometry_
static const TGPicture * info(bool iBackgroundIsBlack)
edm::ESHandle< HGCalTopology > topo_ee
edm::ESHandle< HGCalGeometry > geom_bh
edm::ESHandle< HGCalGeometry > geom_ee
edm::ESHandle< HGCalGeometry > geom_fh
edm::ESHandle< HGCalTopology > topo_bh
edm::ESHandle< HGCalTopology > topo_fh
const T & get() const
Definition: EventSetup.h:56
void HGCalTriggerDigiProducer::produce ( edm::Event e,
const edm::EventSetup es 
)
virtual

Implements edm::EDProducer.

Definition at line 85 of file HGCalTriggerDigiProducer.cc.

References backEndProcessor_, codec_, edm::Event::getByToken(), inputee_, inputfh_, eostools::move(), convertSQLitetoXML_cfg::output, edm::Event::put(), HGCalTriggerBackendProcessor::putInEvent(), HGCalTriggerBackendProcessor::reset(), HGCalTriggerBackendProcessor::run(), l1t::HGCFETriggerDigi::setDetId(), AlCaHLTBitMon_QueryRunRegistry::string, and triggerGeometry_.

85  {
86  std::unique_ptr<l1t::HGCFETriggerDigiCollection>
87  fe_output( new l1t::HGCFETriggerDigiCollection );
88 
90  edm::Handle<HGCHEDigiCollection> fh_digis_h, bh_digis_h;
91 
92  e.getByToken(inputee_,ee_digis_h);
93  e.getByToken(inputfh_,fh_digis_h);
94  //e.getByToken(inputbh_,bh_digis_h);
95 
96  const HGCEEDigiCollection& ee_digis = *ee_digis_h;
97  const HGCHEDigiCollection& fh_digis = *fh_digis_h;
98  //const HGCHEDigiCollection& bh_digis = *bh_digis_h;
99 
100  // First find modules containing hits and prepare list of hits for each module
101  std::unordered_map<uint32_t, HGCEEDigiCollection> hit_modules_ee;
102  for(const auto& eedata : ee_digis) {
103  uint32_t module = triggerGeometry_->getModuleFromCell(eedata.id());
104  auto itr_insert = hit_modules_ee.emplace(module,HGCEEDigiCollection());
105  itr_insert.first->second.push_back(eedata);
106  }
107  std::unordered_map<uint32_t,HGCHEDigiCollection> hit_modules_fh;
108  for(const auto& fhdata : fh_digis) {
109  uint32_t module = triggerGeometry_->getModuleFromCell(fhdata.id());
110  auto itr_insert = hit_modules_fh.emplace(module, HGCHEDigiCollection());
111  itr_insert.first->second.push_back(fhdata);
112  }
113  // loop on modules containing hits and call front-end processing
114  // we produce one output trigger digi per module in the FE
115  fe_output->reserve(hit_modules_ee.size() + hit_modules_fh.size());
116  std::stringstream output;
117  for( const auto& module_hits : hit_modules_ee ) {
118  fe_output->push_back(l1t::HGCFETriggerDigi());
119  l1t::HGCFETriggerDigi& digi = fe_output->back();
120  codec_->setDataPayload(*triggerGeometry_, module_hits.second,HGCHEDigiCollection(),HGCHEDigiCollection());
121  codec_->encode(digi);
122  digi.setDetId( DetId(module_hits.first) );
123  codec_->print(digi,output);
124  edm::LogInfo("HGCalTriggerDigiProducer")
125  << output.str();
126  codec_->unSetDataPayload();
127  output.str(std::string());
128  output.clear();
129  } //end loop on EE modules
130  for( const auto& module_hits : hit_modules_fh ) {
131  fe_output->push_back(l1t::HGCFETriggerDigi());
132  l1t::HGCFETriggerDigi& digi = fe_output->back();
133  codec_->setDataPayload(*triggerGeometry_,HGCEEDigiCollection(),module_hits.second,HGCHEDigiCollection());
134  codec_->encode(digi);
135  digi.setDetId( DetId(module_hits.first) );
136  codec_->print(digi,output);
137  edm::LogInfo("HGCalTriggerDigiProducer")
138  << output.str();
139  codec_->unSetDataPayload();
140  output.str(std::string());
141  output.clear();
142  } //end loop on FH modules
143 
144 
145  // get the orphan handle and fe digi collection
146  auto fe_digis_handle = e.put(std::move(fe_output));
147  auto fe_digis_coll = *fe_digis_handle;
148 
149  //now we run the emulation of the back-end processor
150  backEndProcessor_.run(fe_digis_coll,triggerGeometry_);
153 }
HGCalTriggerBackendProcessor backEndProcessor_
std::unique_ptr< HGCalTriggerGeometryBase > triggerGeometry_
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:457
std::unique_ptr< HGCalTriggerFECodecBase > codec_
void setDetId(const IDTYPE &id)
def move
Definition: eostools.py:510
void run(const l1t::HGCFETriggerDigiCollection &coll, const std::unique_ptr< HGCalTriggerGeometryBase > &geom)
Definition: DetId.h:18
Definition: vlib.h:208
edm::SortedCollection< HGCHEDataFrame > HGCHEDigiCollection

Member Data Documentation

HGCalTriggerBackendProcessor HGCalTriggerDigiProducer::backEndProcessor_
private

Definition at line 33 of file HGCalTriggerDigiProducer.cc.

Referenced by HGCalTriggerDigiProducer(), and produce().

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

Definition at line 32 of file HGCalTriggerDigiProducer.cc.

Referenced by 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().

std::unique_ptr<HGCalTriggerGeometryBase> HGCalTriggerDigiProducer::triggerGeometry_
private

Definition at line 31 of file HGCalTriggerDigiProducer.cc.

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