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 edm::ParameterSet m_pSet
 
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 29 of file TrackerDigiGeometryESModule.cc.

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

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

46 {}

Member Function Documentation

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

Definition at line 49 of file TrackerDigiGeometryESModule.cc.

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

50 {
51  edm::ParameterSetDescription descTrackerGeometryConstants;
52  descTrackerGeometryConstants.add<bool>( "upgradeGeometry", false );
53  descTrackerGeometryConstants.add<int>( "ROWS_PER_ROC", 80 );
54  descTrackerGeometryConstants.add<int>( "COLS_PER_ROC", 52 );
55  descTrackerGeometryConstants.add<int>( "BIG_PIX_PER_ROC_X", 1 );
56  descTrackerGeometryConstants.add<int>( "BIG_PIX_PER_ROC_Y", 2 );
57  descTrackerGeometryConstants.add<int>( "ROCS_X", 0 );
58  descTrackerGeometryConstants.add<int>( "ROCS_Y", 0 );
59 
60  edm::ParameterSetDescription descTrackerSLHCGeometryConstants;
61  descTrackerSLHCGeometryConstants.add<bool>( "upgradeGeometry", true );
62  descTrackerSLHCGeometryConstants.add<int>( "ROWS_PER_ROC", 80 );
63  descTrackerSLHCGeometryConstants.add<int>( "COLS_PER_ROC", 52 );
64  descTrackerSLHCGeometryConstants.add<int>( "BIG_PIX_PER_ROC_X", 0 );
65  descTrackerSLHCGeometryConstants.add<int>( "BIG_PIX_PER_ROC_Y", 0 );
66  descTrackerSLHCGeometryConstants.add<int>( "ROCS_X", 2 );
67  descTrackerSLHCGeometryConstants.add<int>( "ROCS_Y", 8 );
68 
70  descDB.add<std::string>( "appendToDataLabel", "" );
71  descDB.add<bool>( "fromDDD", false );
72  descDB.add<bool>( "applyAlignment", true );
73  descDB.add<std::string>( "alignmentsLabel", "" );
74  descDB.addOptional<edm::ParameterSetDescription>( "trackerGeometryConstants", descTrackerGeometryConstants );
75  descriptions.add( "trackerGeometryDB", descDB );
76 
78  desc.add<std::string>( "appendToDataLabel", "" );
79  desc.add<bool>( "fromDDD", true );
80  desc.add<bool>( "applyAlignment", true );
81  desc.add<std::string>( "alignmentsLabel", "" );
82  desc.addOptional<edm::ParameterSetDescription>( "trackerGeometryConstants", descTrackerGeometryConstants );
83  descriptions.add( "trackerGeometry", desc );
84 
86  descSLHCDB.add<std::string>( "appendToDataLabel", "" );
87  descSLHCDB.add<bool>( "fromDDD", false );
88  descSLHCDB.add<bool>( "applyAlignment", true );
89  descSLHCDB.add<std::string>( "alignmentsLabel", "" );
90  descSLHCDB.addOptional<edm::ParameterSetDescription>( "trackerGeometryConstants", descTrackerSLHCGeometryConstants );
91  descriptions.add( "trackerSLHCGeometryDB", descSLHCDB );
92 
94  descSLHC.add<std::string>( "appendToDataLabel", "" );
95  descSLHC.add<bool>( "fromDDD", true );
96  descSLHC.add<bool>( "applyAlignment", true );
97  descSLHC.add<std::string>( "alignmentsLabel", "" );
98  descSLHC.addOptional<edm::ParameterSetDescription>( "trackerGeometryConstants", descTrackerSLHCGeometryConstants );
99  descriptions.add( "trackerSLHCGeometry", descSLHC );
100 }
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
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 104 of file TrackerDigiGeometryESModule.cc.

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

105 {
106  //
107  // Called whenever the alignments, alignment errors or global positions change
108  //
110  iRecord.getRecord<IdealGeometryRecord>().get( gD );
111 
113  _tracker = boost::shared_ptr<TrackerGeometry>(builder.build(&(*gD), m_pSet ));
114 
115  if (applyAlignment_) {
116  // Since fake is fully working when checking for 'empty', we should get rid of applyAlignment_!
117  edm::ESHandle<Alignments> globalPosition;
118  iRecord.getRecord<GlobalPositionRcd>().get(alignmentsLabel_, globalPosition);
119  edm::ESHandle<Alignments> alignments;
120  iRecord.getRecord<TrackerAlignmentRcd>().get(alignmentsLabel_, alignments);
122  iRecord.getRecord<TrackerAlignmentErrorExtendedRcd>().get(alignmentsLabel_, alignmentErrors);
123  // apply if not empty:
124  if (alignments->empty() && alignmentErrors->empty() && globalPosition->empty()) {
125  edm::LogInfo("Config") << "@SUB=TrackerDigiGeometryRecord::produce"
126  << "Alignment(Error)s and global position (label '"
127  << alignmentsLabel_ << "') empty: Geometry producer (label "
128  << "'" << myLabel_ << "') assumes fake and does not apply.";
129  } else {
130  GeometryAligner ali;
131  ali.applyAlignments<TrackerGeometry>(&(*_tracker), &(*alignments), &(*alignmentErrors),
132  align::DetectorGlobalPosition(*globalPosition,
134  }
135 
137  iRecord.getRecord<TrackerSurfaceDeformationRcd>().get(alignmentsLabel_, surfaceDeformations);
138  // apply if not empty:
139  if (surfaceDeformations->empty()) {
140  edm::LogInfo("Config") << "@SUB=TrackerDigiGeometryRecord::produce"
141  << "AlignmentSurfaceDeformations (label '"
142  << alignmentsLabel_ << "') empty: Geometry producer (label "
143  << "'" << myLabel_ << "') assumes fake and does not apply.";
144  } else {
145  GeometryAligner ali;
146  ali.attachSurfaceDeformations<TrackerGeometry>(&(*_tracker), &(*surfaceDeformations));
147  }
148  }
149 
150  return _tracker;
151 }
boost::shared_ptr< TrackerGeometry > _tracker
Called when geometry description changes.
Class to update a given geometry with a set of alignments.
TrackerGeometry * build(const GeometricDet *gd, const edm::ParameterSet &pSet)
void attachSurfaceDeformations(C *geometry, const AlignmentSurfaceDeformations *surfaceDeformations)
Definition: DetId.h:18
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
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 30 of file TrackerDigiGeometryESModule.h.

Referenced by produce(), and TrackerDigiGeometryESModule().

bool TrackerDigiGeometryESModule::fromDDD_
private

Definition at line 31 of file TrackerDigiGeometryESModule.h.

Referenced by TrackerDigiGeometryESModule().

const edm::ParameterSet TrackerDigiGeometryESModule::m_pSet
private

Definition at line 29 of file TrackerDigiGeometryESModule.h.

Referenced by produce().

const std::string TrackerDigiGeometryESModule::myLabel_
private

Definition at line 28 of file TrackerDigiGeometryESModule.h.

Referenced by produce(), and TrackerDigiGeometryESModule().