CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
MTDDigiGeometryESModule Class Reference
Inheritance diagram for MTDDigiGeometryESModule:
edm::ESProducer edm::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

Public Member Functions

 MTDDigiGeometryESModule (const edm::ParameterSet &p)
 
std::unique_ptr< MTDGeometryproduce (const MTDDigiGeometryRecord &)
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex 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< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 

Private Attributes

edm::ESGetToken< AlignmentErrorsExtended, MTDAlignmentErrorExtendedRcdalignErrorsToken_
 
const std::string alignmentsLabel_
 Called when geometry description changes. More...
 
const bool applyAlignment_
 
edm::ESGetToken< AlignmentSurfaceDeformations, MTDSurfaceDeformationRcddeformationsToken_
 
const bool fromDDD_
 
edm::ESGetToken< GeometricTimingDet, IdealGeometryRecordgeomTimingDetToken_
 
edm::ESGetToken< Alignments, GlobalPositionRcdglobalAlignToken_
 
edm::ESGetToken< Alignments, MTDAlignmentRcdmtdAlignToken_
 
edm::ESGetToken< MTDTopology, MTDTopologyRcdmtdTopoToken_
 
const std::string myLabel_
 
edm::ESGetToken< PMTDParameters, PMTDParametersRcdpmtdParamsToken_
 

Additional Inherited Members

- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- 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::ESProductResolverFactoryProducer
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::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

Detailed Description

Definition at line 35 of file MTDDigiGeometryESModule.cc.

Constructor & Destructor Documentation

◆ MTDDigiGeometryESModule()

MTDDigiGeometryESModule::MTDDigiGeometryESModule ( const edm::ParameterSet p)

Definition at line 62 of file MTDDigiGeometryESModule.cc.

References alignErrorsToken_, alignmentsLabel_, applyAlignment_, gpuPixelDoublets::cc, deformationsToken_, geomTimingDetToken_, globalAlignToken_, gpuClustering::pixelStatus::kEmpty, mtdAlignToken_, mtdTopoToken_, myLabel_, pmtdParamsToken_, and edm::ESProducer::setWhatProduced().

63  : alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")),
64  myLabel_(p.getParameter<std::string>("appendToDataLabel")),
65  applyAlignment_(p.getParameter<bool>("applyAlignment")),
66  fromDDD_(p.getParameter<bool>("fromDDD"))
67 
68 {
69  auto cc = setWhatProduced(this);
70  const edm::ESInputTag kEmpty;
74 
75  {
76  const edm::ESInputTag kAlignTag{"", alignmentsLabel_};
77  globalAlignToken_ = cc.consumesFrom<Alignments, GlobalPositionRcd>(kAlignTag);
78  mtdAlignToken_ = cc.consumesFrom<Alignments, MTDAlignmentRcd>(kAlignTag);
81  }
82 
83  edm::LogInfo("Geometry") << "@SUB=MTDDigiGeometryESModule"
84  << "Label '" << myLabel_ << "' " << (applyAlignment_ ? "looking for" : "IGNORING")
85  << " alignment labels '" << alignmentsLabel_ << "'.";
86 }
edm::ESGetToken< GeometricTimingDet, IdealGeometryRecord > geomTimingDetToken_
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
edm::ESGetToken< Alignments, MTDAlignmentRcd > mtdAlignToken_
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
edm::ESGetToken< MTDTopology, MTDTopologyRcd > mtdTopoToken_
edm::ESGetToken< AlignmentSurfaceDeformations, MTDSurfaceDeformationRcd > deformationsToken_
edm::ESGetToken< Alignments, GlobalPositionRcd > globalAlignToken_
edm::ESGetToken< PMTDParameters, PMTDParametersRcd > pmtdParamsToken_
edm::ESGetToken< AlignmentErrorsExtended, MTDAlignmentErrorExtendedRcd > alignErrorsToken_
Log< level::Info, false > LogInfo
const std::string alignmentsLabel_
Called when geometry description changes.

Member Function Documentation

◆ fillDescriptions()

void MTDDigiGeometryESModule::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 89 of file MTDDigiGeometryESModule.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

89  {
91  descDB.add<std::string>("appendToDataLabel", "");
92  descDB.add<bool>("fromDDD", false);
93  descDB.add<bool>("applyAlignment", true);
94  descDB.add<std::string>("alignmentsLabel", "");
95  descriptions.add("mtdGeometryDB", descDB);
96 
98  desc.add<std::string>("appendToDataLabel", "");
99  desc.add<bool>("fromDDD", true);
100  desc.add<bool>("applyAlignment", true);
101  desc.add<std::string>("alignmentsLabel", "");
102  descriptions.add("mtdGeometry", desc);
103 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

std::unique_ptr< MTDGeometry > MTDDigiGeometryESModule::produce ( const MTDDigiGeometryRecord iRecord)

Definition at line 106 of file MTDDigiGeometryESModule.cc.

References alignErrorsToken_, alignmentsLabel_, applyAlignment_, GeometryAligner::applyAlignments(), GeometryAligner::attachSurfaceDeformations(), MTDGeomBuilderFromGeometricTimingDet::build(), deformationsToken_, align::DetectorGlobalPosition(), Alignments::empty(), AlignmentErrorsExtended::empty(), AlignmentSurfaceDeformations::empty(), DetId::Forward, geomTimingDetToken_, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), globalAlignToken_, mtdAlignToken_, mtdTopoToken_, myLabel_, and pmtdParamsToken_.

106  {
107  //
108  // Called whenever the alignments, alignment errors or global positions change
109  //
110  GeometricTimingDet const& gD = iRecord.get(geomTimingDetToken_);
111 
112  MTDTopology const& tTopo = iRecord.get(mtdTopoToken_);
113 
114  PMTDParameters const& ptp = iRecord.get(pmtdParamsToken_);
115 
117  std::unique_ptr<MTDGeometry> mtd(builder.build(&(gD), ptp, &tTopo));
118 
119  if (applyAlignment_) {
120  // Since fake is fully working when checking for 'empty', we should get rid of applyAlignment_!
121  Alignments const& globalPosition = iRecord.get(globalAlignToken_);
122  Alignments const& alignments = iRecord.get(mtdAlignToken_);
123  AlignmentErrorsExtended const& alignmentErrors = iRecord.get(alignErrorsToken_);
124  // apply if not empty:
125  if (alignments.empty() && alignmentErrors.empty() && globalPosition.empty()) {
126  edm::LogInfo("Config") << "@SUB=MTDDigiGeometryRecord::produce"
127  << "Alignment(Error)s and global position (label '" << alignmentsLabel_
128  << "') empty: Geometry producer (label "
129  << "'" << myLabel_ << "') assumes fake and does not apply.";
130  } else {
131  GeometryAligner ali;
132  ali.applyAlignments<MTDGeometry>(mtd.get(),
133  &(alignments),
134  &(alignmentErrors),
136  }
137 
138  AlignmentSurfaceDeformations const& surfaceDeformations = iRecord.get(deformationsToken_);
139  // apply if not empty:
140  if (surfaceDeformations.empty()) {
141  edm::LogInfo("Config") << "@SUB=MTDDigiGeometryRecord::produce"
142  << "AlignmentSurfaceDeformations (label '" << alignmentsLabel_
143  << "') empty: Geometry producer (label "
144  << "'" << myLabel_ << "') assumes fake and does not apply.";
145  } else {
146  GeometryAligner ali;
147  ali.attachSurfaceDeformations<MTDGeometry>(mtd.get(), &(surfaceDeformations));
148  }
149  }
150 
151  return mtd;
152 }
void attachSurfaceDeformations(const C *geometry, const AlignmentSurfaceDeformations *surfaceDeformations)
edm::ESGetToken< GeometricTimingDet, IdealGeometryRecord > geomTimingDetToken_
edm::ESGetToken< Alignments, MTDAlignmentRcd > mtdAlignToken_
Class to update a given geometry with a set of alignments.
edm::ESGetToken< MTDTopology, MTDTopologyRcd > mtdTopoToken_
edm::ESGetToken< AlignmentSurfaceDeformations, MTDSurfaceDeformationRcd > deformationsToken_
bool empty() const
Test of empty vector without having to look into internals:
edm::ESGetToken< Alignments, GlobalPositionRcd > globalAlignToken_
void applyAlignments(const C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
edm::ESGetToken< PMTDParameters, PMTDParametersRcd > pmtdParamsToken_
bool empty() const
Test of empty vector without having to look into internals:
Definition: Alignments.h:15
edm::ESGetToken< AlignmentErrorsExtended, MTDAlignmentErrorExtendedRcd > alignErrorsToken_
bool empty() const
Test of empty vector without having to look into internals:
MTDGeometry * build(const GeometricTimingDet *gd, const PMTDParameters &ptp, const MTDTopology *tTopo)
Log< level::Info, false > LogInfo
Definition: DetId.h:17
const std::string alignmentsLabel_
Called when geometry description changes.
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const

Member Data Documentation

◆ alignErrorsToken_

edm::ESGetToken<AlignmentErrorsExtended, MTDAlignmentErrorExtendedRcd> MTDDigiGeometryESModule::alignErrorsToken_
private

Definition at line 54 of file MTDDigiGeometryESModule.cc.

Referenced by MTDDigiGeometryESModule(), and produce().

◆ alignmentsLabel_

const std::string MTDDigiGeometryESModule::alignmentsLabel_
private

Called when geometry description changes.

Definition at line 44 of file MTDDigiGeometryESModule.cc.

Referenced by MTDDigiGeometryESModule(), and produce().

◆ applyAlignment_

const bool MTDDigiGeometryESModule::applyAlignment_
private

Definition at line 57 of file MTDDigiGeometryESModule.cc.

Referenced by MTDDigiGeometryESModule(), and produce().

◆ deformationsToken_

edm::ESGetToken<AlignmentSurfaceDeformations, MTDSurfaceDeformationRcd> MTDDigiGeometryESModule::deformationsToken_
private

Definition at line 55 of file MTDDigiGeometryESModule.cc.

Referenced by MTDDigiGeometryESModule(), and produce().

◆ fromDDD_

const bool MTDDigiGeometryESModule::fromDDD_
private

Definition at line 58 of file MTDDigiGeometryESModule.cc.

◆ geomTimingDetToken_

edm::ESGetToken<GeometricTimingDet, IdealGeometryRecord> MTDDigiGeometryESModule::geomTimingDetToken_
private

Definition at line 47 of file MTDDigiGeometryESModule.cc.

Referenced by MTDDigiGeometryESModule(), and produce().

◆ globalAlignToken_

edm::ESGetToken<Alignments, GlobalPositionRcd> MTDDigiGeometryESModule::globalAlignToken_
private

Definition at line 52 of file MTDDigiGeometryESModule.cc.

Referenced by MTDDigiGeometryESModule(), and produce().

◆ mtdAlignToken_

edm::ESGetToken<Alignments, MTDAlignmentRcd> MTDDigiGeometryESModule::mtdAlignToken_
private

Definition at line 53 of file MTDDigiGeometryESModule.cc.

Referenced by MTDDigiGeometryESModule(), and produce().

◆ mtdTopoToken_

edm::ESGetToken<MTDTopology, MTDTopologyRcd> MTDDigiGeometryESModule::mtdTopoToken_
private

Definition at line 48 of file MTDDigiGeometryESModule.cc.

Referenced by MTDDigiGeometryESModule(), and produce().

◆ myLabel_

const std::string MTDDigiGeometryESModule::myLabel_
private

Definition at line 45 of file MTDDigiGeometryESModule.cc.

Referenced by MTDDigiGeometryESModule(), and produce().

◆ pmtdParamsToken_

edm::ESGetToken<PMTDParameters, PMTDParametersRcd> MTDDigiGeometryESModule::pmtdParamsToken_
private

Definition at line 49 of file MTDDigiGeometryESModule.cc.

Referenced by MTDDigiGeometryESModule(), and produce().