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::shared_ptr< TrackerGeometryproduce (const TrackerDigiGeometryRecord &iRecord)
 Produce the misaligned tracker geometry and store it. More...
 
virtual ~MisalignedTrackerESProducer ()
 Destructor. More...
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()(false)
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer () noexcept(false)
 
- 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...
 
std::shared_ptr< TrackerGeometrytheTracker
 

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

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 66 of file MisalignedTrackerESProducer.cc.

References edm::ESProducer::setWhatProduced().

66  :
67  theSaveToDB(p.getUntrackedParameter<bool>("saveToDbase")),
68  theSaveFakeScenario(p.getUntrackedParameter<bool>("saveFakeScenario")),
70  theAlignRecordName("TrackerAlignmentRcd"),
71  theErrorRecordName("TrackerAlignmentErrorExtendedRcd")
72 {
73  setWhatProduced(this);
74 
75 }
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 ( )
virtual

Destructor.

Definition at line 79 of file MisalignedTrackerESProducer.cc.

79 {}

Member Function Documentation

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

Produce the misaligned tracker geometry and store it.

Definition at line 84 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, theTracker, and cond::service::PoolDBOutputService::writeOne().

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

85 {
86  //Retrieve tracker topology from geometry
88  iRecord.getRecord<TrackerTopologyRcd>().get(tTopoHandle);
89  const TrackerTopology* const tTopo = tTopoHandle.product();
90 
91  edm::LogInfo("MisalignedTracker") << "Producer called";
92 
93  // Create the tracker geometry from ideal geometry
95  iRecord.getRecord<IdealGeometryRecord>().get( gD );
97  iRecord.getRecord<PTrackerParametersRcd>().get( ptp );
99  theTracker = std::shared_ptr<TrackerGeometry>( trackerBuilder.build(&(*gD), *ptp, tTopo));
100 
101  // Create the alignable hierarchy
102  auto theAlignableTracker = std::make_unique<AlignableTracker>( &(*theTracker), tTopo );
103 
104  // Create misalignment scenario, apply to geometry
105  TrackerScenarioBuilder scenarioBuilder( &(*theAlignableTracker) );
106  scenarioBuilder.applyScenario( theScenario );
107  Alignments* alignments = theAlignableTracker->alignments();
108  AlignmentErrorsExtended* alignmentErrors = theAlignableTracker->alignmentErrors();
109 
110  // Store result to EventSetup
111  GeometryAligner aligner;
112  aligner.applyAlignments<TrackerGeometry>( &(*theTracker), alignments, alignmentErrors,
113  AlignTransform()); // dummy global position
114 
115  // Write alignments to DB: have to sort beforhand!
116  if (theSaveToDB) {
117 
118  // Call service
120  if( !poolDbService.isAvailable() ) // Die if not available
121  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
122  if (theSaveFakeScenario) { // make empty!
123  alignments->clear();
124  alignmentErrors->clear();
125  }
126  poolDbService->writeOne<Alignments>(alignments, poolDbService->currentTime(),
128  poolDbService->writeOne<AlignmentErrorsExtended>(alignmentErrors, poolDbService->currentTime(),
130  } else {
131  // poolDbService::writeOne takes over ownership
132  // we have to delete in the case that containers are not written
133  delete alignments;
134  delete alignmentErrors;
135  }
136 
137 
138  edm::LogInfo("MisalignedTracker") << "Producer done";
139  return theTracker;
140 
141 }
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)
std::shared_ptr< TrackerGeometry > theTracker
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().

std::shared_ptr<TrackerGeometry> MisalignedTrackerESProducer::theTracker
private

Definition at line 56 of file MisalignedTrackerESProducer.cc.

Referenced by produce().