CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | 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

boost::shared_ptr
< TrackerGeometry
produce (const TrackerDigiGeometryRecord &)
 
 TrackerDigiGeometryESModule (const edm::ParameterSet &p)
 
virtual ~TrackerDigiGeometryESModule ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- 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 ()
 

Private Attributes

boost::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, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- 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::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 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 12 of file TrackerDigiGeometryESModule.h.

Constructor & Destructor Documentation

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

Definition at line 28 of file TrackerDigiGeometryESModule.cc.

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

29  : alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")),
30  myLabel_(p.getParameter<std::string>("appendToDataLabel"))
31 {
32 
33  applyAlignment_ = p.getParameter<bool>("applyAlignment");
34  fromDDD_ = p.getParameter<bool>("fromDDD");
35 
36  setWhatProduced(this);
37 
38  edm::LogInfo("Geometry") << "@SUB=TrackerDigiGeometryESModule"
39  << "Label '" << myLabel_ << "' "
40  << (applyAlignment_ ? "looking for" : "IGNORING")
41  << " alignment labels '" << alignmentsLabel_ << "'.";
42 }
T getParameter(std::string const &) const
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
TrackerDigiGeometryESModule::~TrackerDigiGeometryESModule ( )
virtual

Definition at line 45 of file TrackerDigiGeometryESModule.cc.

45 {}

Member Function Documentation

boost::shared_ptr< TrackerGeometry > TrackerDigiGeometryESModule::produce ( const TrackerDigiGeometryRecord iRecord)

Definition at line 49 of file TrackerDigiGeometryESModule.cc.

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

50 {
51  //
52  // Called whenever the alignments, alignment errors or global positions change
53  //
55  iRecord.getRecord<IdealGeometryRecord>().get( gD );
56 
58  _tracker = boost::shared_ptr<TrackerGeometry>(builder.build(&(*gD)));
59 
60  if (applyAlignment_) {
61  // Since fake is fully working when checking for 'empty', we should get rid of applyAlignment_!
62  edm::ESHandle<Alignments> globalPosition;
63  iRecord.getRecord<GlobalPositionRcd>().get(alignmentsLabel_, globalPosition);
64  edm::ESHandle<Alignments> alignments;
65  iRecord.getRecord<TrackerAlignmentRcd>().get(alignmentsLabel_, alignments);
66  edm::ESHandle<AlignmentErrors> alignmentErrors;
67  iRecord.getRecord<TrackerAlignmentErrorRcd>().get(alignmentsLabel_, alignmentErrors);
68  // apply if not empty:
69  if (alignments->empty() && alignmentErrors->empty() && globalPosition->empty()) {
70  edm::LogInfo("Config") << "@SUB=TrackerDigiGeometryRecord::produce"
71  << "Alignment(Error)s and global position (label '"
72  << alignmentsLabel_ << "') empty: Geometry producer (label "
73  << "'" << myLabel_ << "') assumes fake and does not apply.";
74  } else {
75  GeometryAligner ali;
76  ali.applyAlignments<TrackerGeometry>(&(*_tracker), &(*alignments), &(*alignmentErrors),
77  align::DetectorGlobalPosition(*globalPosition,
79  }
80 
82  iRecord.getRecord<TrackerSurfaceDeformationRcd>().get(alignmentsLabel_, surfaceDeformations);
83  // apply if not empty:
84  if (surfaceDeformations->empty()) {
85  edm::LogInfo("Config") << "@SUB=TrackerDigiGeometryRecord::produce"
86  << "AlignmentSurfaceDeformations (label '"
87  << alignmentsLabel_ << "') empty: Geometry producer (label "
88  << "'" << myLabel_ << "') assumes fake and does not apply.";
89  } else {
90  GeometryAligner ali;
91  ali.attachSurfaceDeformations<TrackerGeometry>(&(*_tracker), &(*surfaceDeformations));
92  }
93  }
94 
95  return _tracker;
96 }
boost::shared_ptr< TrackerGeometry > _tracker
Called when geometry description changes.
Class to update a given geometry with a set of alignments.
void attachSurfaceDeformations(C *geometry, const AlignmentSurfaceDeformations *surfaceDeformations)
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrors *alignmentErrors, const AlignTransform &globalCoordinates)
Definition: DetId.h:20
TrackerGeometry * build(const GeometricDet *gd)
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)

Member Data Documentation

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

Called when geometry description changes.

Definition at line 19 of file TrackerDigiGeometryESModule.h.

Referenced by produce().

const std::string TrackerDigiGeometryESModule::alignmentsLabel_
private

Definition at line 22 of file TrackerDigiGeometryESModule.h.

Referenced by produce(), and TrackerDigiGeometryESModule().

bool TrackerDigiGeometryESModule::applyAlignment_
private

Definition at line 20 of file TrackerDigiGeometryESModule.h.

Referenced by produce(), and TrackerDigiGeometryESModule().

bool TrackerDigiGeometryESModule::fromDDD_
private

Definition at line 21 of file TrackerDigiGeometryESModule.h.

Referenced by TrackerDigiGeometryESModule().

const std::string TrackerDigiGeometryESModule::myLabel_
private

Definition at line 23 of file TrackerDigiGeometryESModule.h.

Referenced by produce(), and TrackerDigiGeometryESModule().