CMS 3D CMS Logo

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

#include <TrackerDigiGeometryESModule.h>

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 ()
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
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< PTrackerParameters, PTrackerParametersRcdtrackerParamsToken_
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtrackerTopoToken_
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 
- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
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 >
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 eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Detailed Description

Definition at line 30 of file TrackerDigiGeometryESModule.h.

Constructor & Destructor Documentation

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

Definition at line 21 of file TrackerDigiGeometryESModule.cc.

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

22  : alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")),
23  myLabel_(p.getParameter<std::string>("appendToDataLabel")),
24  applyAlignment_(p.getParameter<bool>("applyAlignment"))
25 {
26  {
27  auto cc = setWhatProduced(this);
28  const edm::ESInputTag kEmptyTag;
29  geometricDetToken_ = cc.consumesFrom<GeometricDet,IdealGeometryRecord>(kEmptyTag);
30  trackerTopoToken_ = cc.consumesFrom<TrackerTopology,TrackerTopologyRcd>(kEmptyTag);
31  trackerParamsToken_ = cc.consumesFrom<PTrackerParameters,PTrackerParametersRcd>(kEmptyTag);
32 
33  if(applyAlignment_) {
34  const edm::ESInputTag kAlignTag{"",alignmentsLabel_};
35  globalAlignmentToken_ = cc.consumesFrom<Alignments,GlobalPositionRcd>(kAlignTag);
36  trackerAlignmentToken_ = cc.consumesFrom<Alignments,TrackerAlignmentRcd>(kAlignTag);
39  }
40  }
41 
42  edm::LogInfo("Geometry") << "@SUB=TrackerDigiGeometryESModule"
43  << "Label '" << myLabel_ << "' "
44  << (applyAlignment_ ? "looking for" : "IGNORING")
45  << " alignment labels '" << alignmentsLabel_ << "'.";
46 }
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
edm::ESGetToken< AlignmentErrorsExtended, TrackerAlignmentErrorExtendedRcd > alignmentErrorsToken_
edm::ESGetToken< GeometricDet, IdealGeometryRecord > geometricDetToken_
const std::string alignmentsLabel_
Called when geometry description changes.
edm::ESGetToken< AlignmentSurfaceDeformations, TrackerSurfaceDeformationRcd > deformationsToken_
edm::ESGetToken< PTrackerParameters, PTrackerParametersRcd > trackerParamsToken_
edm::ESGetToken< Alignments, TrackerAlignmentRcd > trackerAlignmentToken_
edm::ESGetToken< Alignments, GlobalPositionRcd > globalAlignmentToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopoToken_
TrackerDigiGeometryESModule::~TrackerDigiGeometryESModule ( )
override

Definition at line 49 of file TrackerDigiGeometryESModule.cc.

49 {}

Member Function Documentation

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

Definition at line 52 of file TrackerDigiGeometryESModule.cc.

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

53 {
55  descDB.add<std::string>( "appendToDataLabel", "" );
56  descDB.add<bool>( "fromDDD", false );
57  descDB.add<bool>( "applyAlignment", true );
58  descDB.add<std::string>( "alignmentsLabel", "" );
59  descriptions.add( "trackerGeometryDB", descDB );
60 
62  desc.add<std::string>( "appendToDataLabel", "" );
63  desc.add<bool>( "fromDDD", true );
64  desc.add<bool>( "applyAlignment", true );
65  desc.add<std::string>( "alignmentsLabel", "" );
66  descriptions.add( "trackerGeometry", desc );
67 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::unique_ptr< TrackerGeometry > TrackerDigiGeometryESModule::produce ( const TrackerDigiGeometryRecord iRecord)

Definition at line 71 of file TrackerDigiGeometryESModule.cc.

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

72 {
73  //
74  // Called whenever the alignments, alignment errors or global positions change
75  //
76  auto const& gD = iRecord.get( geometricDetToken_ );
77 
78  auto const& tTopo = iRecord.get(trackerTopoToken_);
79 
80  auto const& ptp = iRecord.get( trackerParamsToken_ );
81 
83  std::unique_ptr<TrackerGeometry> tracker(builder.build(&gD, ptp, &tTopo));
84 
85  if (applyAlignment_) {
86  // Since fake is fully working when checking for 'empty', we should get rid of applyAlignment_!
87  auto const& globalPosition = iRecord.get( globalAlignmentToken_ );
88  auto const& alignments = iRecord.get( trackerAlignmentToken_ );
89  auto const& alignmentErrors = iRecord.get( alignmentErrorsToken_ );
90  // apply if not empty:
91  if (alignments.empty() && alignmentErrors.empty() && globalPosition.empty()) {
92  edm::LogInfo("Config") << "@SUB=TrackerDigiGeometryRecord::produce"
93  << "Alignment(Error)s and global position (label '"
94  << alignmentsLabel_ << "') empty: Geometry producer (label "
95  << "'" << myLabel_ << "') assumes fake and does not apply.";
96  } else {
97  GeometryAligner ali;
98  ali.applyAlignments<TrackerGeometry>(tracker.get(), &(alignments), &(alignmentErrors),
99  align::DetectorGlobalPosition(globalPosition,
101  }
102 
103  auto const& surfaceDeformations = iRecord.get( deformationsToken_ );
104  // apply if not empty:
105  if (surfaceDeformations.empty()) {
106  edm::LogInfo("Config") << "@SUB=TrackerDigiGeometryRecord::produce"
107  << "AlignmentSurfaceDeformations (label '"
108  << alignmentsLabel_ << "') empty: Geometry producer (label "
109  << "'" << myLabel_ << "') assumes fake and does not apply.";
110  } else {
111  GeometryAligner ali;
112  ali.attachSurfaceDeformations<TrackerGeometry>(tracker.get(), &(surfaceDeformations));
113  }
114  }
115 
116  return tracker;
117 }
Class to update a given geometry with a set of alignments.
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
edm::ESGetToken< AlignmentErrorsExtended, TrackerAlignmentErrorExtendedRcd > alignmentErrorsToken_
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESGetToken< GeometricDet, IdealGeometryRecord > geometricDetToken_
void attachSurfaceDeformations(C *geometry, const AlignmentSurfaceDeformations *surfaceDeformations)
const std::string alignmentsLabel_
Called when geometry description changes.
edm::ESGetToken< AlignmentSurfaceDeformations, TrackerSurfaceDeformationRcd > deformationsToken_
edm::ESGetToken< PTrackerParameters, PTrackerParametersRcd > trackerParamsToken_
Definition: DetId.h:18
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
edm::ESGetToken< Alignments, TrackerAlignmentRcd > trackerAlignmentToken_
edm::ESGetToken< Alignments, GlobalPositionRcd > globalAlignmentToken_
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopoToken_

Member Data Documentation

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

Definition at line 49 of file TrackerDigiGeometryESModule.h.

Referenced by produce(), and TrackerDigiGeometryESModule().

const std::string TrackerDigiGeometryESModule::alignmentsLabel_
private

Called when geometry description changes.

Definition at line 40 of file TrackerDigiGeometryESModule.h.

Referenced by produce(), and TrackerDigiGeometryESModule().

const bool TrackerDigiGeometryESModule::applyAlignment_
private

Definition at line 52 of file TrackerDigiGeometryESModule.h.

Referenced by produce(), and TrackerDigiGeometryESModule().

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

Definition at line 50 of file TrackerDigiGeometryESModule.h.

Referenced by produce(), and TrackerDigiGeometryESModule().

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

Definition at line 43 of file TrackerDigiGeometryESModule.h.

Referenced by produce(), and TrackerDigiGeometryESModule().

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

Definition at line 47 of file TrackerDigiGeometryESModule.h.

Referenced by produce(), and TrackerDigiGeometryESModule().

const std::string TrackerDigiGeometryESModule::myLabel_
private

Definition at line 41 of file TrackerDigiGeometryESModule.h.

Referenced by produce(), and TrackerDigiGeometryESModule().

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

Definition at line 48 of file TrackerDigiGeometryESModule.h.

Referenced by produce(), and TrackerDigiGeometryESModule().

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

Definition at line 45 of file TrackerDigiGeometryESModule.h.

Referenced by produce(), and TrackerDigiGeometryESModule().

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

Definition at line 44 of file TrackerDigiGeometryESModule.h.

Referenced by produce(), and TrackerDigiGeometryESModule().