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::shared_ptr< TrackerGeometryproduce (const TrackerDigiGeometryRecord &)
 
 TrackerDigiGeometryESModule (const edm::ParameterSet &p)
 
 ~TrackerDigiGeometryESModule () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ~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

std::shared_ptr< TrackerGeometry_tracker
 Called when geometry description changes. More...
 
const std::string alignmentsLabel_
 
bool applyAlignment_
 
bool fromDDD_
 
const std::string myLabel_
 

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
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- 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 16 of file TrackerDigiGeometryESModule.h.

Constructor & Destructor Documentation

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

Definition at line 33 of file TrackerDigiGeometryESModule.cc.

References alignmentsLabel_, applyAlignment_, fromDDD_, edm::ParameterSet::getParameter(), myLabel_, and edm::ESProducer::setWhatProduced().

34  : alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")),
35  myLabel_(p.getParameter<std::string>("appendToDataLabel"))
36 {
37  applyAlignment_ = p.getParameter<bool>("applyAlignment");
38  fromDDD_ = p.getParameter<bool>("fromDDD");
39 
40  setWhatProduced(this);
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
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
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::shared_ptr< TrackerGeometry > TrackerDigiGeometryESModule::produce ( const TrackerDigiGeometryRecord iRecord)

Definition at line 71 of file TrackerDigiGeometryESModule.cc.

References _tracker, alignmentsLabel_, applyAlignment_, GeometryAligner::applyAlignments(), GeometryAligner::attachSurfaceDeformations(), TrackerGeomBuilderFromGeometricDet::build(), DEFINE_FWK_EVENTSETUP_MODULE, align::DetectorGlobalPosition(), AlignmentErrorsExtended::empty(), Alignments::empty(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), myLabel_, edm::ESHandle< T >::product(), and DetId::Tracker.

72 {
73  //
74  // Called whenever the alignments, alignment errors or global positions change
75  //
77  iRecord.getRecord<IdealGeometryRecord>().get( gD );
78 
80  iRecord.getRecord<TrackerTopologyRcd>().get(tTopoHand);
81  const TrackerTopology *tTopo=tTopoHand.product();
82 
84  iRecord.getRecord<PTrackerParametersRcd>().get( ptp );
85 
87  _tracker = std::shared_ptr<TrackerGeometry>(builder.build(&(*gD), *ptp, tTopo));
88 
89  if (applyAlignment_) {
90  // Since fake is fully working when checking for 'empty', we should get rid of applyAlignment_!
91  edm::ESHandle<Alignments> globalPosition;
92  iRecord.getRecord<GlobalPositionRcd>().get(alignmentsLabel_, globalPosition);
93  edm::ESHandle<Alignments> alignments;
94  iRecord.getRecord<TrackerAlignmentRcd>().get(alignmentsLabel_, alignments);
96  iRecord.getRecord<TrackerAlignmentErrorExtendedRcd>().get(alignmentsLabel_, alignmentErrors);
97  // apply if not empty:
98  if (alignments->empty() && alignmentErrors->empty() && globalPosition->empty()) {
99  edm::LogInfo("Config") << "@SUB=TrackerDigiGeometryRecord::produce"
100  << "Alignment(Error)s and global position (label '"
101  << alignmentsLabel_ << "') empty: Geometry producer (label "
102  << "'" << myLabel_ << "') assumes fake and does not apply.";
103  } else {
104  GeometryAligner ali;
105  ali.applyAlignments<TrackerGeometry>(&(*_tracker), &(*alignments), &(*alignmentErrors),
106  align::DetectorGlobalPosition(*globalPosition,
108  }
109 
111  iRecord.getRecord<TrackerSurfaceDeformationRcd>().get(alignmentsLabel_, surfaceDeformations);
112  // apply if not empty:
113  if (surfaceDeformations->empty()) {
114  edm::LogInfo("Config") << "@SUB=TrackerDigiGeometryRecord::produce"
115  << "AlignmentSurfaceDeformations (label '"
116  << alignmentsLabel_ << "') empty: Geometry producer (label "
117  << "'" << myLabel_ << "') assumes fake and does not apply.";
118  } else {
119  GeometryAligner ali;
120  ali.attachSurfaceDeformations<TrackerGeometry>(&(*_tracker), &(*surfaceDeformations));
121  }
122  }
123 
124  return _tracker;
125 }
bool empty() const
Test of empty vector without having to look into internals:
Definition: Alignments.h:15
Class to update a given geometry with a set of alignments.
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
void attachSurfaceDeformations(C *geometry, const AlignmentSurfaceDeformations *surfaceDeformations)
Definition: DetId.h:18
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
std::shared_ptr< TrackerGeometry > _tracker
Called when geometry description changes.
bool empty() const
Test of empty vector without having to look into internals:
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

std::shared_ptr<TrackerGeometry> TrackerDigiGeometryESModule::_tracker
private

Called when geometry description changes.

Definition at line 26 of file TrackerDigiGeometryESModule.h.

Referenced by produce().

const std::string TrackerDigiGeometryESModule::alignmentsLabel_
private

Definition at line 27 of file TrackerDigiGeometryESModule.h.

Referenced by produce(), and TrackerDigiGeometryESModule().

bool TrackerDigiGeometryESModule::applyAlignment_
private

Definition at line 29 of file TrackerDigiGeometryESModule.h.

Referenced by produce(), and TrackerDigiGeometryESModule().

bool TrackerDigiGeometryESModule::fromDDD_
private

Definition at line 30 of file TrackerDigiGeometryESModule.h.

Referenced by TrackerDigiGeometryESModule().

const std::string TrackerDigiGeometryESModule::myLabel_
private

Definition at line 28 of file TrackerDigiGeometryESModule.h.

Referenced by produce(), and TrackerDigiGeometryESModule().