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
 
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
 
ESProducer const & operator= (const 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
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &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 TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &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.

9 { delete posmap_; }

References posmap_.

Member Function Documentation

◆ produce()

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

Definition at line 82 of file HeterogeneousHGCalHEFCellPositionsFiller.cc.

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 }

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

◆ set_conditions_()

void HeterogeneousHGCalHEFCellPositionsFiller::set_conditions_ ( )
private

Definition at line 12 of file HeterogeneousHGCalHEFCellPositionsFiller.cc.

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);
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 }

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_, HGCalDDDConstants::waferMax(), hgcal_conditions::positions::HGCalPositionsMapping::waferMax, HGCalDDDConstants::waferMin(), hgcal_conditions::positions::HGCalPositionsMapping::waferMin, hgcal_conditions::positions::HGCalPositionsMapping::waferSize, HGCalParameters::waferSize_, HGCalDDDConstants::waferType(), HGCalDDDConstants::waferZ(), and hgcal_conditions::positions::HGCalPositionsMapping::zLayer.

Referenced by produce().

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
hgcal_conditions::positions::HGCalPositionsMapping::nCellsHexagon
std::vector< std::int32_t > nCellsHexagon
Definition: HGCConditions.h:151
HeterogeneousHGCalHEFCellPositionsFiller::set_conditions_
void set_conditions_()
Definition: HeterogeneousHGCalHEFCellPositionsFiller.cc:12
hgcal_conditions::positions::HGCalPositionsMapping::waferSize
float waferSize
Definition: HGCConditions.h:154
hgcal_conditions::positions::HGCalPositionsMapping::sensorSeparation
float sensorSeparation
Definition: HGCConditions.h:155
edm::ESInputTag
Definition: ESInputTag.h:87
hgcal_conditions::positions::HGCalPositionsMapping::lastLayer
std::int32_t lastLayer
Definition: HGCConditions.h:158
hgcal_conditions::positions::HGCalPositionsMapping::firstLayer
std::int32_t firstLayer
Definition: HGCConditions.h:157
HGCalDDDConstants::firstLayer
int firstLayer() const
Definition: HGCalDDDConstants.h:53
HGCalDDDConstants::waferMin
int waferMin() const
Definition: HGCalDDDConstants.h:151
HGCalDDDConstants::waferZ
double waferZ(int layer, bool reco) const
Definition: HGCalDDDConstants.cc:1412
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
hgcal_conditions::positions::HGCalPositionsMapping::nCellsLayer
std::vector< std::int32_t > nCellsLayer
Definition: HGCConditions.h:149
cms::cuda::assert
assert(be >=bs)
HGCalParameters::waferSize_
double waferSize_
Definition: HGCalParameters.h:144
HeterogeneousHGCalHEFCellPositionsFiller::posmap_
hgcal_conditions::positions::HGCalPositionsMapping * posmap_
Definition: HeterogeneousHGCalHEFCellPositionsFiller.h:48
HGCalDDDConstants::lastLayer
int lastLayer(bool reco) const
Definition: HGCalDDDConstants.cc:575
HGCSiliconDetId
Definition: HGCSiliconDetId.h:22
HeterogeneousHGCalHEFCellPositionsFiller::geometryToken_
edm::ESGetToken< HGCalGeometry, IdealGeometryRecord > geometryToken_
Definition: HeterogeneousHGCalHEFCellPositionsFiller.h:39
HGCalParameters::sensorSeparation_
double sensorSeparation_
Definition: HGCalParameters.h:146
HGCalDDDConstants::waferMax
int waferMax() const
Definition: HGCalDDDConstants.h:150
DetId::HGCalHSi
Definition: DetId.h:33
HGCalDDDConstants::waferType
int waferType(DetId const &id, bool fromFile=false) const
Definition: HGCalDDDConstants.cc:1267
edm::eventsetup::DependentRecordImplementation::getTransientHandle
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:98
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
HGCalGeometry
Definition: HGCalGeometry.h:29
hgcal_conditions::positions::HGCalPositionsMapping::waferMin
std::int32_t waferMin
Definition: HGCConditions.h:160
hgcal_conditions::positions::HGCalPositionsMapping
Definition: HGCConditions.h:147
HeterogeneousHGCalHEFCellPositionsFiller::params_
const HGCalParameters * params_
Definition: HeterogeneousHGCalHEFCellPositionsFiller.h:51
HGCalDDDConstants::numberCellsHexagon
int numberCellsHexagon(int wafer) const
Definition: HGCalDDDConstants.cc:944
hgcal_conditions::positions::HGCalPositionsMapping::waferMax
std::int32_t waferMax
Definition: HGCConditions.h:159
hgcal_conditions::positions::HGCalPositionsMapping::nCellsWaferUChunk
std::vector< std::int32_t > nCellsWaferUChunk
Definition: HGCConditions.h:150
hgcal_conditions::positions::HGCalPositionsMapping::detid
std::vector< std::uint32_t > detid
Definition: HGCConditions.h:152
HeterogeneousHGCalHEFCellPositionsFiller::ddd_
const HGCalDDDConstants * ddd_
Definition: HeterogeneousHGCalHEFCellPositionsFiller.h:50
hgcal_conditions::positions::HGCalPositionsMapping::zLayer
std::vector< float > zLayer
Definition: HGCConditions.h:148
HGCalDDDConstants::getParameter
const HGCalParameters * getParameter() const
Definition: HGCalDDDConstants.h:59
up
Definition: BitonicSort.h:7
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
nlayers
Definition: HIMultiTrackSelector.h:48