CMS 3D CMS Logo

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

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

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

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
 
- 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 16 of file TrackerDigiGeometryESModule.h.

Constructor & Destructor Documentation

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

Definition at line 31 of file TrackerDigiGeometryESModule.cc.

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

32  : alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")),
33  myLabel_(p.getParameter<std::string>("appendToDataLabel"))
34 {
35  applyAlignment_ = p.getParameter<bool>("applyAlignment");
36  fromDDD_ = p.getParameter<bool>("fromDDD");
37 
38  setWhatProduced(this);
39 
40  edm::LogInfo("Geometry") << "@SUB=TrackerDigiGeometryESModule"
41  << "Label '" << myLabel_ << "' "
42  << (applyAlignment_ ? "looking for" : "IGNORING")
43  << " alignment labels '" << alignmentsLabel_ << "'.";
44 }
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 47 of file TrackerDigiGeometryESModule.cc.

47 {}

Member Function Documentation

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

Definition at line 50 of file TrackerDigiGeometryESModule.cc.

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

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

Definition at line 69 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.

70 {
71  //
72  // Called whenever the alignments, alignment errors or global positions change
73  //
75  iRecord.getRecord<IdealGeometryRecord>().get( gD );
76 
78  iRecord.getRecord<PTrackerParametersRcd>().get( ptp );
79 
81  _tracker = boost::shared_ptr<TrackerGeometry>(builder.build(&(*gD), *ptp ));
82 
83  if (applyAlignment_) {
84  // Since fake is fully working when checking for 'empty', we should get rid of applyAlignment_!
85  edm::ESHandle<Alignments> globalPosition;
86  iRecord.getRecord<GlobalPositionRcd>().get(alignmentsLabel_, globalPosition);
87  edm::ESHandle<Alignments> alignments;
88  iRecord.getRecord<TrackerAlignmentRcd>().get(alignmentsLabel_, alignments);
90  iRecord.getRecord<TrackerAlignmentErrorExtendedRcd>().get(alignmentsLabel_, alignmentErrors);
91  // apply if not empty:
92  if (alignments->empty() && alignmentErrors->empty() && globalPosition->empty()) {
93  edm::LogInfo("Config") << "@SUB=TrackerDigiGeometryRecord::produce"
94  << "Alignment(Error)s and global position (label '"
95  << alignmentsLabel_ << "') empty: Geometry producer (label "
96  << "'" << myLabel_ << "') assumes fake and does not apply.";
97  } else {
98  GeometryAligner ali;
99  ali.applyAlignments<TrackerGeometry>(&(*_tracker), &(*alignments), &(*alignmentErrors),
100  align::DetectorGlobalPosition(*globalPosition,
102  }
103 
105  iRecord.getRecord<TrackerSurfaceDeformationRcd>().get(alignmentsLabel_, surfaceDeformations);
106  // apply if not empty:
107  if (surfaceDeformations->empty()) {
108  edm::LogInfo("Config") << "@SUB=TrackerDigiGeometryRecord::produce"
109  << "AlignmentSurfaceDeformations (label '"
110  << alignmentsLabel_ << "') empty: Geometry producer (label "
111  << "'" << myLabel_ << "') assumes fake and does not apply.";
112  } else {
113  GeometryAligner ali;
114  ali.attachSurfaceDeformations<TrackerGeometry>(&(*_tracker), &(*surfaceDeformations));
115  }
116  }
117 
118  return _tracker;
119 }
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)
Definition: DetId.h:18
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp)
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 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().