CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HeterogeneousHGCalHEFCellPositionsFiller Class Reference

#include <HeterogeneousHGCalHEFCellPositionsFiller.h>

Inheritance diagram for HeterogeneousHGCalHEFCellPositionsFiller:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 HeterogeneousHGCalHEFCellPositionsFiller (const edm::ParameterSet &)
 
std::unique_ptr< HeterogeneousHGCalHEFCellPositionsConditionsproduce (const HeterogeneousHGCalHEFCellPositionsConditionsRecord &)
 
 ~HeterogeneousHGCalHEFCellPositionsFiller () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
 ESProducer (ESProducer &&)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Private Member Functions

void set_conditions_ ()
 

Private Attributes

const hgcal_conditions::HeterogeneousHEFCellPositionsConditionsESProductd_conds = nullptr
 
const HGCalDDDConstantsddd_ = nullptr
 
edm::ESGetToken< HGCalGeometry, IdealGeometryRecordgeometryToken_
 
const HGCalParametersparams_ = nullptr
 
hgcal_conditions::positions::HGCalPositionsMappingposmap_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Definition at line 31 of file HeterogeneousHGCalHEFCellPositionsFiller.h.

Constructor & Destructor Documentation

◆ HeterogeneousHGCalHEFCellPositionsFiller()

HeterogeneousHGCalHEFCellPositionsFiller::HeterogeneousHGCalHEFCellPositionsFiller ( const edm::ParameterSet ps)
explicit

◆ ~HeterogeneousHGCalHEFCellPositionsFiller()

HeterogeneousHGCalHEFCellPositionsFiller::~HeterogeneousHGCalHEFCellPositionsFiller ( )
override

Definition at line 9 of file HeterogeneousHGCalHEFCellPositionsFiller.cc.

References posmap_.

9 { delete posmap_; }
hgcal_conditions::positions::HGCalPositionsMapping * posmap_

Member Function Documentation

◆ produce()

std::unique_ptr< HeterogeneousHGCalHEFCellPositionsConditions > HeterogeneousHGCalHEFCellPositionsFiller::produce ( const HeterogeneousHGCalHEFCellPositionsConditionsRecord iRecord)

Definition at line 82 of file HeterogeneousHGCalHEFCellPositionsFiller.cc.

References ddd_, relativeConstraints::geom, geometryToken_, HGCalDDDConstants::getParameter(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getTransientHandle(), params_, posmap_, set_conditions_(), and up.

83  {
84  auto geom = iRecord.getTransientHandle(geometryToken_);
85  ddd_ = &(geom->topology().dddConstants());
87 
89 
90  std::unique_ptr<HeterogeneousHGCalHEFCellPositionsConditions> up =
91  std::make_unique<HeterogeneousHGCalHEFCellPositionsConditions>(posmap_);
92  return up;
93 }
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: BitonicSort.h:7
const HGCalParameters * getParameter() const
hgcal_conditions::positions::HGCalPositionsMapping * posmap_
edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > geometryToken_

◆ set_conditions_()

void HeterogeneousHGCalHEFCellPositionsFiller::set_conditions_ ( )
private

Definition at line 12 of file HeterogeneousHGCalHEFCellPositionsFiller.cc.

References cms::cuda::assert(), ddd_, hgcal_conditions::positions::HGCalPositionsMapping::detid, HGCalDDDConstants::firstLayer(), hgcal_conditions::positions::HGCalPositionsMapping::firstLayer, DetId::HGCalHSi, HGCalDDDConstants::lastLayer(), hgcal_conditions::positions::HGCalPositionsMapping::lastLayer, hgcal_conditions::positions::HGCalPositionsMapping::nCellsHexagon, hgcal_conditions::positions::HGCalPositionsMapping::nCellsLayer, hgcal_conditions::positions::HGCalPositionsMapping::nCellsWaferUChunk, nlayers, HGCalDDDConstants::numberCellsHexagon(), params_, posmap_, DetId::rawId(), hgcal_conditions::positions::HGCalPositionsMapping::sensorSeparation, HGCalParameters::sensorSeparation_, hgcal_conditions::positions::HGCalPositionsMapping::waferMax, HGCalDDDConstants::waferMax(), hgcal_conditions::positions::HGCalPositionsMapping::waferMin, HGCalDDDConstants::waferMin(), hgcal_conditions::positions::HGCalPositionsMapping::waferSize, HGCalParameters::waferSize_, HGCalDDDConstants::waferType(), HGCalDDDConstants::waferZ(), and hgcal_conditions::positions::HGCalPositionsMapping::zLayer.

Referenced by produce().

12  {
13  //fill the CPU position structure from the geometry
14  posmap_->zLayer.clear();
15  posmap_->nCellsLayer.clear();
16  posmap_->nCellsWaferUChunk.clear();
17  posmap_->nCellsHexagon.clear();
18  posmap_->detid.clear();
19 
20  int nlayers = ddd_->lastLayer(true) - ddd_->firstLayer() + 1;
21  int upper_estimate_wafer_number_1D = 2 * nlayers * (ddd_->waferMax() - ddd_->waferMin());
22  int upper_estimate_wafer_number_2D = upper_estimate_wafer_number_1D * (ddd_->waferMax() - ddd_->waferMin());
23  int upper_estimate_cell_number = upper_estimate_wafer_number_2D * 3 * 12 * 12;
24  posmap_->zLayer.resize(nlayers * 2);
25  posmap_->nCellsLayer.reserve(nlayers * 2);
26  posmap_->nCellsWaferUChunk.reserve(upper_estimate_wafer_number_1D);
27  posmap_->nCellsHexagon.reserve(upper_estimate_wafer_number_2D);
28  posmap_->detid.reserve(upper_estimate_cell_number);
29  //set position-related variables
30  posmap_->waferSize = static_cast<float>(params_->waferSize_);
31  posmap_->sensorSeparation = static_cast<float>(params_->sensorSeparation_);
33  assert(posmap_->firstLayer == 1); //otherwise the loop over the layers has to be changed
34  posmap_->lastLayer = ddd_->lastLayer(true);
37 
38  unsigned sumCellsLayer, sumCellsWaferUChunk;
39 
40  //store detids following a geometry ordering
41  for (int ilayer = 1; ilayer <= posmap_->lastLayer; ++ilayer) {
42  sumCellsLayer = 0;
43  posmap_->zLayer[ilayer - 1] = static_cast<float>(ddd_->waferZ(ilayer, true)); //originally a double
44  posmap_->zLayer[ilayer - 1 + nlayers] = static_cast<float>(ddd_->waferZ(ilayer, true)); //originally a double
45 
46  for (int iwaferU = posmap_->waferMin; iwaferU < posmap_->waferMax; ++iwaferU) {
47  sumCellsWaferUChunk = 0;
48 
49  for (int iwaferV = posmap_->waferMin; iwaferV < posmap_->waferMax; ++iwaferV) {
50  //0: fine; 1: coarseThin; 2: coarseThick (as defined in DataFormats/ForwardDetId/interface/HGCSiliconDetId.h)
51  int type_ = ddd_->waferType(ilayer, iwaferU, iwaferV, false);
52 
53  int nCellsHexSide = ddd_->numberCellsHexagon(ilayer, iwaferU, iwaferV, false);
54  int nCellsHexTotal = ddd_->numberCellsHexagon(ilayer, iwaferU, iwaferV, true);
55  sumCellsLayer += nCellsHexTotal;
56  sumCellsWaferUChunk += nCellsHexTotal;
57  posmap_->nCellsHexagon.push_back(nCellsHexTotal);
58 
59  //left side of wafer
60  for (int cellUmax = nCellsHexSide, icellV = 0; cellUmax < 2 * nCellsHexSide and icellV < nCellsHexSide;
61  ++cellUmax, ++icellV) {
62  for (int icellU = 0; icellU <= cellUmax; ++icellU) {
63  HGCSiliconDetId detid_(DetId::HGCalHSi, 1, type_, ilayer, iwaferU, iwaferV, icellU, icellV);
64  posmap_->detid.push_back(detid_.rawId());
65  }
66  }
67  //right side of wafer
68  for (int cellUmin = 1, icellV = nCellsHexSide; cellUmin <= nCellsHexSide and icellV < 2 * nCellsHexSide;
69  ++cellUmin, ++icellV) {
70  for (int icellU = cellUmin; icellU < 2 * nCellsHexSide; ++icellU) {
71  HGCSiliconDetId detid_(DetId::HGCalHSi, 1, type_, ilayer, iwaferU, iwaferV, icellU, icellV);
72  posmap_->detid.push_back(detid_.rawId());
73  }
74  }
75  }
76  posmap_->nCellsWaferUChunk.push_back(sumCellsWaferUChunk);
77  }
78  posmap_->nCellsLayer.push_back(sumCellsLayer);
79  }
80 }
double waferZ(int layer, bool reco) const
int lastLayer(bool reco) const
int firstLayer() const
assert(be >=bs)
hgcal_conditions::positions::HGCalPositionsMapping * posmap_
int numberCellsHexagon(int wafer) const
int waferType(DetId const &id, bool fromFile) const

Member Data Documentation

◆ d_conds

const hgcal_conditions::HeterogeneousHEFCellPositionsConditionsESProduct* HeterogeneousHGCalHEFCellPositionsFiller::d_conds = nullptr
private

Definition at line 47 of file HeterogeneousHGCalHEFCellPositionsFiller.h.

◆ ddd_

const HGCalDDDConstants* HeterogeneousHGCalHEFCellPositionsFiller::ddd_ = nullptr
private

Definition at line 50 of file HeterogeneousHGCalHEFCellPositionsFiller.h.

Referenced by produce(), and set_conditions_().

◆ geometryToken_

edm::ESGetToken<HGCalGeometry, IdealGeometryRecord> HeterogeneousHGCalHEFCellPositionsFiller::geometryToken_
private

◆ params_

const HGCalParameters* HeterogeneousHGCalHEFCellPositionsFiller::params_ = nullptr
private

Definition at line 51 of file HeterogeneousHGCalHEFCellPositionsFiller.h.

Referenced by produce(), and set_conditions_().

◆ posmap_

hgcal_conditions::positions::HGCalPositionsMapping* HeterogeneousHGCalHEFCellPositionsFiller::posmap_
private