CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MisalignedTrackerESProducer Class Reference
Inheritance diagram for MisalignedTrackerESProducer:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 MisalignedTrackerESProducer (const edm::ParameterSet &p)
 Constructor. More...
 
std::unique_ptr< TrackerGeometryproduce (const TrackerDigiGeometryRecord &iRecord)
 Produce the misaligned tracker geometry and store it. More...
 
 ~MisalignedTrackerESProducer () override
 Destructor. More...
 
- 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)
 

Private Attributes

const std::string theAlignRecordName
 misalignment scenario More...
 
const std::string theErrorRecordName
 
const bool theSaveFakeScenario
 whether or not writing to DB More...
 
const bool theSaveToDB
 
const edm::ParameterSet theScenario
 if theSaveToDB is true, save a fake scenario (empty alignments), irrespective of the misalignment scenario below More...
 

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
 
- 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::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

An ESProducer that fills the TrackerDigiGeometryRcd with a misaligned tracker

This should replace the standard TrackerDigiGeometryESModule when producing Misalignment scenarios.

Definition at line 37 of file MisalignedTrackerESProducer.cc.

Constructor & Destructor Documentation

MisalignedTrackerESProducer::MisalignedTrackerESProducer ( const edm::ParameterSet p)

Constructor.

Definition at line 65 of file MisalignedTrackerESProducer.cc.

References edm::ESProducer::setWhatProduced().

65  :
66  theSaveToDB(p.getUntrackedParameter<bool>("saveToDbase")),
67  theSaveFakeScenario(p.getUntrackedParameter<bool>("saveFakeScenario")),
69  theAlignRecordName("TrackerAlignmentRcd"),
70  theErrorRecordName("TrackerAlignmentErrorExtendedRcd")
71 {
72  setWhatProduced(this);
73 
74 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const bool theSaveFakeScenario
whether or not writing to DB
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
const std::string theAlignRecordName
misalignment scenario
const edm::ParameterSet theScenario
if theSaveToDB is true, save a fake scenario (empty alignments), irrespective of the misalignment sce...
MisalignedTrackerESProducer::~MisalignedTrackerESProducer ( )
override

Destructor.

Definition at line 78 of file MisalignedTrackerESProducer.cc.

78 {}

Member Function Documentation

std::unique_ptr< TrackerGeometry > MisalignedTrackerESProducer::produce ( const TrackerDigiGeometryRecord iRecord)

Produce the misaligned tracker geometry and store it.

Definition at line 83 of file MisalignedTrackerESProducer.cc.

References GeometryAligner::applyAlignments(), TrackerGeomBuilderFromGeometricDet::build(), cond::service::PoolDBOutputService::currentTime(), DEFINE_FWK_EVENTSETUP_MODULE, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), edm::Service< T >::isAvailable(), edm::ESHandle< T >::product(), theAlignRecordName, theErrorRecordName, theSaveFakeScenario, theSaveToDB, theScenario, and cond::service::PoolDBOutputService::writeOne().

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

84 {
85  //Retrieve tracker topology from geometry
87  iRecord.getRecord<TrackerTopologyRcd>().get(tTopoHandle);
88  const TrackerTopology* const tTopo = tTopoHandle.product();
89 
90  edm::LogInfo("MisalignedTracker") << "Producer called";
91 
92  // Create the tracker geometry from ideal geometry
94  iRecord.getRecord<IdealGeometryRecord>().get( gD );
96  iRecord.getRecord<PTrackerParametersRcd>().get( ptp );
98  std::unique_ptr<TrackerGeometry> theTracker( trackerBuilder.build(&(*gD), *ptp, tTopo));
99 
100  // Create the alignable hierarchy
101  auto theAlignableTracker = std::make_unique<AlignableTracker>( &(*theTracker), tTopo );
102 
103  // Create misalignment scenario, apply to geometry
104  TrackerScenarioBuilder scenarioBuilder( &(*theAlignableTracker) );
105  scenarioBuilder.applyScenario( theScenario );
106  Alignments* alignments = theAlignableTracker->alignments();
107  AlignmentErrorsExtended* alignmentErrors = theAlignableTracker->alignmentErrors();
108 
109  // Store result to EventSetup
110  GeometryAligner aligner;
111  aligner.applyAlignments<TrackerGeometry>( &(*theTracker), alignments, alignmentErrors,
112  AlignTransform()); // dummy global position
113 
114  // Write alignments to DB: have to sort beforhand!
115  if (theSaveToDB) {
116 
117  // Call service
119  if( !poolDbService.isAvailable() ) // Die if not available
120  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
121  if (theSaveFakeScenario) { // make empty!
122  alignments->clear();
123  alignmentErrors->clear();
124  }
125  poolDbService->writeOne<Alignments>(alignments, poolDbService->currentTime(),
127  poolDbService->writeOne<AlignmentErrorsExtended>(alignmentErrors, poolDbService->currentTime(),
129  } else {
130  // poolDbService::writeOne takes over ownership
131  // we have to delete in the case that containers are not written
132  delete alignments;
133  delete alignmentErrors;
134  }
135 
136 
137  edm::LogInfo("MisalignedTracker") << "Producer done";
138  return theTracker;
139 
140 }
const bool theSaveFakeScenario
whether or not writing to DB
Class to update a given geometry with a set of alignments.
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
const std::string theAlignRecordName
misalignment scenario
bool isAvailable() const
Definition: Service.h:46
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
const edm::ParameterSet theScenario
if theSaveToDB is true, save a fake scenario (empty alignments), irrespective of the misalignment sce...
Builds a scenario from configuration and applies it to the alignable tracker.
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

const std::string MisalignedTrackerESProducer::theAlignRecordName
private

misalignment scenario

Definition at line 54 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

const std::string MisalignedTrackerESProducer::theErrorRecordName
private

Definition at line 54 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

const bool MisalignedTrackerESProducer::theSaveFakeScenario
private

whether or not writing to DB

Definition at line 52 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

const bool MisalignedTrackerESProducer::theSaveToDB
private

Definition at line 51 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

const edm::ParameterSet MisalignedTrackerESProducer::theScenario
private

if theSaveToDB is true, save a fake scenario (empty alignments), irrespective of the misalignment scenario below

Definition at line 53 of file MisalignedTrackerESProducer.cc.

Referenced by produce().