CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
TrackerDigiGeometryESModule Class Reference
Inheritance diagram for TrackerDigiGeometryESModule:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

std::unique_ptr< TrackerGeometryproduce (const TrackerDigiGeometryRecord &)
 
 TrackerDigiGeometryESModule (const edm::ParameterSet &p)
 
 ~TrackerDigiGeometryESModule () 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)
 

Static Public Member Functions

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

Private Attributes

edm::ESGetToken< AlignmentErrorsExtended, TrackerAlignmentErrorExtendedRcdalignmentErrorsToken_
 
const std::string alignmentsLabel_
 Called when geometry description changes. More...
 
const bool applyAlignment_
 
edm::ESGetToken< AlignmentSurfaceDeformations, TrackerSurfaceDeformationRcddeformationsToken_
 
edm::ESGetToken< GeometricDet, IdealGeometryRecordgeometricDetToken_
 
edm::ESGetToken< Alignments, GlobalPositionRcdglobalAlignmentToken_
 
const std::string myLabel_
 
edm::ESGetToken< Alignments, TrackerAlignmentRcdtrackerAlignmentToken_
 
edm::ESGetToken< PTrackerAdditionalParametersPerDet, PTrackerAdditionalParametersPerDetRcdtrackerGeometricDetExtraToken_
 
edm::ESGetToken< PTrackerParameters, PTrackerParametersRcdtrackerParamsToken_
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtrackerTopoToken_
 

Additional Inherited Members

- 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 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 TArg >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &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 33 of file TrackerDigiGeometryESModule.cc.

Constructor & Destructor Documentation

◆ TrackerDigiGeometryESModule()

TrackerDigiGeometryESModule::TrackerDigiGeometryESModule ( const edm::ParameterSet p)

Definition at line 61 of file TrackerDigiGeometryESModule.cc.

References alignmentErrorsToken_, alignmentsLabel_, applyAlignment_, deformationsToken_, geometricDetToken_, globalAlignmentToken_, myLabel_, edm::ESProducer::setWhatProduced(), trackerAlignmentToken_, trackerGeometricDetExtraToken_, trackerParamsToken_, and trackerTopoToken_.

62  : alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")),
63  myLabel_(p.getParameter<std::string>("appendToDataLabel")),
64  applyAlignment_(p.getParameter<bool>("applyAlignment")) {
65  {
66  auto cc = setWhatProduced(this);
67  const edm::ESInputTag kEmptyTag;
68  geometricDetToken_ = cc.consumesFrom<GeometricDet, IdealGeometryRecord>(kEmptyTag);
69  trackerTopoToken_ = cc.consumesFrom<TrackerTopology, TrackerTopologyRcd>(kEmptyTag);
70  trackerParamsToken_ = cc.consumesFrom<PTrackerParameters, PTrackerParametersRcd>(kEmptyTag);
73 
74  if (applyAlignment_) {
75  const edm::ESInputTag kAlignTag{"", alignmentsLabel_};
76  globalAlignmentToken_ = cc.consumesFrom<Alignments, GlobalPositionRcd>(kAlignTag);
77  trackerAlignmentToken_ = cc.consumesFrom<Alignments, TrackerAlignmentRcd>(kAlignTag);
80  }
81  }
82 
83  edm::LogInfo("Geometry") << "@SUB=TrackerDigiGeometryESModule"
84  << "Label '" << myLabel_ << "' " << (applyAlignment_ ? "looking for" : "IGNORING")
85  << " alignment labels '" << alignmentsLabel_ << "'.";
86 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ESGetToken< GeometricDet, IdealGeometryRecord > geometricDetToken_
edm::ESGetToken< AlignmentErrorsExtended, TrackerAlignmentErrorExtendedRcd > alignmentErrorsToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopoToken_
edm::ESGetToken< Alignments, GlobalPositionRcd > globalAlignmentToken_
const std::string alignmentsLabel_
Called when geometry description changes.
edm::ESGetToken< AlignmentSurfaceDeformations, TrackerSurfaceDeformationRcd > deformationsToken_
Log< level::Info, false > LogInfo
edm::ESGetToken< PTrackerParameters, PTrackerParametersRcd > trackerParamsToken_
edm::ESGetToken< Alignments, TrackerAlignmentRcd > trackerAlignmentToken_
edm::ESGetToken< PTrackerAdditionalParametersPerDet, PTrackerAdditionalParametersPerDetRcd > trackerGeometricDetExtraToken_

◆ ~TrackerDigiGeometryESModule()

TrackerDigiGeometryESModule::~TrackerDigiGeometryESModule ( )
override

Definition at line 89 of file TrackerDigiGeometryESModule.cc.

89 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 91 of file TrackerDigiGeometryESModule.cc.

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

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

◆ produce()

std::unique_ptr< TrackerGeometry > TrackerDigiGeometryESModule::produce ( const TrackerDigiGeometryRecord iRecord)

Definition at line 108 of file TrackerDigiGeometryESModule.cc.

References alignmentErrorsToken_, alignmentsLabel_, applyAlignment_, GeometryAligner::applyAlignments(), GeometryAligner::attachSurfaceDeformations(), TrackerGeomBuilderFromGeometricDet::build(), deformationsToken_, align::DetectorGlobalPosition(), geometricDetToken_, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), globalAlignmentToken_, myLabel_, DetId::Tracker, PbPb_ZMuSkimMuonDPG_cff::tracker, trackerAlignmentToken_, trackerGeometricDetExtraToken_, trackerParamsToken_, and trackerTopoToken_.

108  {
109  //
110  // Called whenever the alignments, alignment errors or global positions change
111  //
112  auto const& gD = iRecord.get(geometricDetToken_);
113 
114  auto const& tTopo = iRecord.get(trackerTopoToken_);
115 
116  auto const& ptp = iRecord.get(trackerParamsToken_);
117 
118  auto const& ptitp = iRecord.get(trackerGeometricDetExtraToken_);
119 
121  std::unique_ptr<TrackerGeometry> tracker(builder.build(&gD, &ptitp, ptp, &tTopo));
122 
123  if (applyAlignment_) {
124  // Since fake is fully working when checking for 'empty', we should get rid of applyAlignment_!
125  auto const& globalPosition = iRecord.get(globalAlignmentToken_);
126  auto const& alignments = iRecord.get(trackerAlignmentToken_);
127  auto const& alignmentErrors = iRecord.get(alignmentErrorsToken_);
128  // apply if not empty:
129  if (alignments.empty() && alignmentErrors.empty() && globalPosition.empty()) {
130  edm::LogInfo("Config") << "@SUB=TrackerDigiGeometryRecord::produce"
131  << "Alignment(Error)s and global position (label '" << alignmentsLabel_
132  << "') empty: Geometry producer (label "
133  << "'" << myLabel_ << "') assumes fake and does not apply.";
134  } else {
135  GeometryAligner ali;
137  &(alignments),
138  &(alignmentErrors),
140  }
141 
142  auto const& surfaceDeformations = iRecord.get(deformationsToken_);
143  // apply if not empty:
144  if (surfaceDeformations.empty()) {
145  edm::LogInfo("Config") << "@SUB=TrackerDigiGeometryRecord::produce"
146  << "AlignmentSurfaceDeformations (label '" << alignmentsLabel_
147  << "') empty: Geometry producer (label "
148  << "'" << myLabel_ << "') assumes fake and does not apply.";
149  } else {
150  GeometryAligner ali;
151  ali.attachSurfaceDeformations<TrackerGeometry>(tracker.get(), &(surfaceDeformations));
152  }
153  }
154 
155  return tracker;
156 }
void attachSurfaceDeformations(const C *geometry, const AlignmentSurfaceDeformations *surfaceDeformations)
Class to update a given geometry with a set of alignments.
TrackerGeometry * build(const GeometricDet *gd, const PTrackerAdditionalParametersPerDet *ptitp, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
edm::ESGetToken< GeometricDet, IdealGeometryRecord > geometricDetToken_
edm::ESGetToken< AlignmentErrorsExtended, TrackerAlignmentErrorExtendedRcd > alignmentErrorsToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopoToken_
void applyAlignments(const C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
edm::ESGetToken< Alignments, GlobalPositionRcd > globalAlignmentToken_
const std::string alignmentsLabel_
Called when geometry description changes.
edm::ESGetToken< AlignmentSurfaceDeformations, TrackerSurfaceDeformationRcd > deformationsToken_
Log< level::Info, false > LogInfo
Definition: DetId.h:17
edm::ESGetToken< PTrackerParameters, PTrackerParametersRcd > trackerParamsToken_
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
edm::ESGetToken< Alignments, TrackerAlignmentRcd > trackerAlignmentToken_
edm::ESGetToken< PTrackerAdditionalParametersPerDet, PTrackerAdditionalParametersPerDetRcd > trackerGeometricDetExtraToken_
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const

Member Data Documentation

◆ alignmentErrorsToken_

edm::ESGetToken<AlignmentErrorsExtended, TrackerAlignmentErrorExtendedRcd> TrackerDigiGeometryESModule::alignmentErrorsToken_
private

Definition at line 54 of file TrackerDigiGeometryESModule.cc.

Referenced by produce(), and TrackerDigiGeometryESModule().

◆ alignmentsLabel_

const std::string TrackerDigiGeometryESModule::alignmentsLabel_
private

Called when geometry description changes.

Definition at line 43 of file TrackerDigiGeometryESModule.cc.

Referenced by produce(), and TrackerDigiGeometryESModule().

◆ applyAlignment_

const bool TrackerDigiGeometryESModule::applyAlignment_
private

Definition at line 57 of file TrackerDigiGeometryESModule.cc.

Referenced by produce(), and TrackerDigiGeometryESModule().

◆ deformationsToken_

edm::ESGetToken<AlignmentSurfaceDeformations, TrackerSurfaceDeformationRcd> TrackerDigiGeometryESModule::deformationsToken_
private

Definition at line 55 of file TrackerDigiGeometryESModule.cc.

Referenced by produce(), and TrackerDigiGeometryESModule().

◆ geometricDetToken_

edm::ESGetToken<GeometricDet, IdealGeometryRecord> TrackerDigiGeometryESModule::geometricDetToken_
private

Definition at line 46 of file TrackerDigiGeometryESModule.cc.

Referenced by produce(), and TrackerDigiGeometryESModule().

◆ globalAlignmentToken_

edm::ESGetToken<Alignments, GlobalPositionRcd> TrackerDigiGeometryESModule::globalAlignmentToken_
private

Definition at line 52 of file TrackerDigiGeometryESModule.cc.

Referenced by produce(), and TrackerDigiGeometryESModule().

◆ myLabel_

const std::string TrackerDigiGeometryESModule::myLabel_
private

Definition at line 44 of file TrackerDigiGeometryESModule.cc.

Referenced by produce(), and TrackerDigiGeometryESModule().

◆ trackerAlignmentToken_

edm::ESGetToken<Alignments, TrackerAlignmentRcd> TrackerDigiGeometryESModule::trackerAlignmentToken_
private

Definition at line 53 of file TrackerDigiGeometryESModule.cc.

Referenced by produce(), and TrackerDigiGeometryESModule().

◆ trackerGeometricDetExtraToken_

edm::ESGetToken<PTrackerAdditionalParametersPerDet, PTrackerAdditionalParametersPerDetRcd> TrackerDigiGeometryESModule::trackerGeometricDetExtraToken_
private

Definition at line 50 of file TrackerDigiGeometryESModule.cc.

Referenced by produce(), and TrackerDigiGeometryESModule().

◆ trackerParamsToken_

edm::ESGetToken<PTrackerParameters, PTrackerParametersRcd> TrackerDigiGeometryESModule::trackerParamsToken_
private

Definition at line 48 of file TrackerDigiGeometryESModule.cc.

Referenced by produce(), and TrackerDigiGeometryESModule().

◆ trackerTopoToken_

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> TrackerDigiGeometryESModule::trackerTopoToken_
private

Definition at line 47 of file TrackerDigiGeometryESModule.cc.

Referenced by produce(), and TrackerDigiGeometryESModule().