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::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

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
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename Record >
void updateFromMayConsumes (unsigned int iIndex, const Record &iRecord)
 
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, 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::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={})
 
- 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 35 of file MTDDigiGeometryESModule.cc.

Constructor & Destructor Documentation

◆ MTDDigiGeometryESModule()

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

Definition at line 62 of file MTDDigiGeometryESModule.cc.

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;
72  mtdTopoToken_ = cc.consumesFrom<MTDTopology, MTDTopologyRcd>(kEmpty);
73  pmtdParamsToken_ = cc.consumesFrom<PMTDParameters, PMTDParametersRcd>(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 }

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

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 89 of file MTDDigiGeometryESModule.cc.

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 }

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

◆ produce()

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

Definition at line 106 of file MTDDigiGeometryESModule.cc.

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 }

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_.

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

PMTDParameters
Definition: PMTDParameters.h:6
MTDDigiGeometryESModule::mtdTopoToken_
edm::ESGetToken< MTDTopology, MTDTopologyRcd > mtdTopoToken_
Definition: MTDDigiGeometryESModule.cc:48
edm::ESInputTag
Definition: ESInputTag.h:87
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
MTDSurfaceDeformationRcd
Definition: MTDSurfaceDeformationRcd.h:6
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
MTDAlignmentErrorExtendedRcd
Definition: MTDAlignmentErrorExtendedRcd.h:6
edm::LogInfo
Definition: MessageLogger.h:254
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
GeometryAligner::attachSurfaceDeformations
void attachSurfaceDeformations(C *geometry, const AlignmentSurfaceDeformations *surfaceDeformations)
Definition: GeometryAligner.h:120
MTDDigiGeometryESModule::pmtdParamsToken_
edm::ESGetToken< PMTDParameters, PMTDParametersRcd > pmtdParamsToken_
Definition: MTDDigiGeometryESModule.cc:49
GlobalPositionRcd
Definition: GlobalPositionRcd.h:6
MTDDigiGeometryESModule::alignErrorsToken_
edm::ESGetToken< AlignmentErrorsExtended, MTDAlignmentErrorExtendedRcd > alignErrorsToken_
Definition: MTDDigiGeometryESModule.cc:54
MTDDigiGeometryESModule::mtdAlignToken_
edm::ESGetToken< Alignments, MTDAlignmentRcd > mtdAlignToken_
Definition: MTDDigiGeometryESModule.cc:53
MTDDigiGeometryESModule::deformationsToken_
edm::ESGetToken< AlignmentSurfaceDeformations, MTDSurfaceDeformationRcd > deformationsToken_
Definition: MTDDigiGeometryESModule.cc:55
DetId
Definition: DetId.h:17
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
MTDAlignmentRcd
Definition: MTDAlignmentRcd.h:6
AlignmentErrorsExtended::empty
bool empty() const
Test of empty vector without having to look into internals:
Definition: AlignmentErrorsExtended.h:15
AlignmentSurfaceDeformations::empty
bool empty() const
Test of empty vector without having to look into internals:
Definition: AlignmentSurfaceDeformations.h:38
MTDDigiGeometryESModule::globalAlignToken_
edm::ESGetToken< Alignments, GlobalPositionRcd > globalAlignToken_
Definition: MTDDigiGeometryESModule.cc:52
MTDGeomBuilderFromGeometricTimingDet
Definition: MTDGeomBuilderFromGeometricTimingDet.h:16
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:112
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MTDDigiGeometryESModule::alignmentsLabel_
const std::string alignmentsLabel_
Called when geometry description changes.
Definition: MTDDigiGeometryESModule.cc:44
MTDTopology
Definition: MTDTopology.h:16
align::DetectorGlobalPosition
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
Definition: DetectorGlobalPosition.cc:10
MTDTopologyRcd
Definition: MTDTopologyRcd.h:10
PMTDParametersRcd
Definition: PMTDParametersRcd.h:9
MTDGeomBuilderFromGeometricTimingDet::build
MTDGeometry * build(const GeometricTimingDet *gd, const PMTDParameters &ptp, const MTDTopology *tTopo)
Definition: MTDGeomBuilderFromGeometricTimingDet.cc:36
GeometricTimingDet
Definition: GeometricTimingDet.h:28
MTDDigiGeometryESModule::applyAlignment_
const bool applyAlignment_
Definition: MTDDigiGeometryESModule.cc:57
MTDDigiGeometryESModule::myLabel_
const std::string myLabel_
Definition: MTDDigiGeometryESModule.cc:45
AlignmentSurfaceDeformations
Definition: AlignmentSurfaceDeformations.h:20
cc
AlignmentErrorsExtended
Definition: AlignmentErrorsExtended.h:10
MTDGeometry
Definition: MTDGeometry.h:14
MTDDigiGeometryESModule::geomTimingDetToken_
edm::ESGetToken< GeometricTimingDet, IdealGeometryRecord > geomTimingDetToken_
Definition: MTDDigiGeometryESModule.cc:47
Alignments::empty
bool empty() const
Test of empty vector without having to look into internals:
Definition: Alignments.h:15
mtd_digitizer
Definition: MTDDigitizer.h:35
DetId::Forward
Definition: DetId.h:30
Alignments
Definition: Alignments.h:10
MTDDigiGeometryESModule::fromDDD_
const bool fromDDD_
Definition: MTDDigiGeometryESModule.cc:58
GeometryAligner::applyAlignments
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
Definition: GeometryAligner.h:52
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27
GeometryAligner
Class to update a given geometry with a set of alignments.
Definition: GeometryAligner.h:33