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 (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename Record >
void updateFromMayConsumes (unsigned int iIndex, const Record &iRecord)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
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

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- 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 EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 

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::MisalignedTrackerESProducer ( const edm::ParameterSet p)

Constructor.

Definition at line 61 of file MisalignedTrackerESProducer.cc.

62  : theSaveToDB(p.getUntrackedParameter<bool>("saveToDbase")),
63  theSaveFakeScenario(p.getUntrackedParameter<bool>("saveFakeScenario")),
64  theScenario(p.getParameter<edm::ParameterSet>("scenario")),
65  theAlignRecordName("TrackerAlignmentRcd"),
66  theErrorRecordName("TrackerAlignmentErrorExtendedRcd") {
67  setWhatProduced(this);
68 }

References edm::ESProducer::setWhatProduced().

◆ ~MisalignedTrackerESProducer()

MisalignedTrackerESProducer::~MisalignedTrackerESProducer ( )
override

Destructor.

Definition at line 71 of file MisalignedTrackerESProducer.cc.

71 {}

Member Function Documentation

◆ produce()

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

Produce the misaligned tracker geometry and store it.

Definition at line 74 of file MisalignedTrackerESProducer.cc.

74  {
75  //Retrieve tracker topology from geometry
77  iRecord.getRecord<TrackerTopologyRcd>().get(tTopoHandle);
78  const TrackerTopology* const tTopo = tTopoHandle.product();
79 
80  edm::LogInfo("MisalignedTracker") << "Producer called";
81 
82  // Create the tracker geometry from ideal geometry
84  iRecord.getRecord<IdealGeometryRecord>().get(gD);
86  iRecord.getRecord<PTrackerParametersRcd>().get(ptp);
88  std::unique_ptr<TrackerGeometry> theTracker(trackerBuilder.build(&(*gD), *ptp, tTopo));
89 
90  // Create the alignable hierarchy
91  auto theAlignableTracker = std::make_unique<AlignableTracker>(&(*theTracker), tTopo);
92 
93  // Create misalignment scenario, apply to geometry
94  TrackerScenarioBuilder scenarioBuilder(&(*theAlignableTracker));
95  scenarioBuilder.applyScenario(theScenario);
96  Alignments* alignments = theAlignableTracker->alignments();
97  AlignmentErrorsExtended* alignmentErrors = theAlignableTracker->alignmentErrors();
98 
99  // Store result to EventSetup
100  GeometryAligner aligner;
101  aligner.applyAlignments<TrackerGeometry>(&(*theTracker),
102  alignments,
103  alignmentErrors,
104  AlignTransform()); // dummy global position
105 
106  // Write alignments to DB: have to sort beforhand!
107  if (theSaveToDB) {
108  // Call service
110  if (!poolDbService.isAvailable()) // Die if not available
111  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
112  if (theSaveFakeScenario) { // make empty!
113  alignments->clear();
114  alignmentErrors->clear();
115  }
116  poolDbService->writeOne<Alignments>(alignments, poolDbService->currentTime(), theAlignRecordName);
117  poolDbService->writeOne<AlignmentErrorsExtended>(alignmentErrors, poolDbService->currentTime(), theErrorRecordName);
118  } else {
119  // poolDbService::writeOne takes over ownership
120  // we have to delete in the case that containers are not written
121  delete alignments;
122  delete alignmentErrors;
123  }
124 
125  edm::LogInfo("MisalignedTracker") << "Producer done";
126  return theTracker;
127 }

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

Member Data Documentation

◆ theAlignRecordName

const std::string MisalignedTrackerESProducer::theAlignRecordName
private

misalignment scenario

Definition at line 53 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

◆ theErrorRecordName

const std::string MisalignedTrackerESProducer::theErrorRecordName
private

Definition at line 53 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

◆ theSaveFakeScenario

const bool MisalignedTrackerESProducer::theSaveFakeScenario
private

whether or not writing to DB

Definition at line 51 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

◆ theSaveToDB

const bool MisalignedTrackerESProducer::theSaveToDB
private

Definition at line 49 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

◆ theScenario

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

Referenced by produce().

edm::eventsetup::DependentRecordImplementation::getRecord
const DepRecordT getRecord() const
Definition: DependentRecordImplementation.h:51
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
MisalignedTrackerESProducer::theSaveToDB
const bool theSaveToDB
Definition: MisalignedTrackerESProducer.cc:49
TrackerScenarioBuilder
Builds a scenario from configuration and applies it to the alignable tracker.
Definition: TrackerScenarioBuilder.h:24
MisalignedTrackerESProducer::theAlignRecordName
const std::string theAlignRecordName
misalignment scenario
Definition: MisalignedTrackerESProducer.cc:53
TrackerTopology
Definition: TrackerTopology.h:16
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::LogInfo
Definition: MessageLogger.h:254
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
TrackerGeomBuilderFromGeometricDet::build
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
Definition: TrackerGeomBuilderFromGeometricDet.cc:43
MisalignedTrackerESProducer::theErrorRecordName
const std::string theErrorRecordName
Definition: MisalignedTrackerESProducer.cc:53
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
PTrackerParametersRcd
Definition: PTrackerParametersRcd.h:9
edm::ESHandle< TrackerTopology >
AlignTransform
Definition: AlignTransform.h:15
MisalignedTrackerESProducer::theSaveFakeScenario
const bool theSaveFakeScenario
whether or not writing to DB
Definition: MisalignedTrackerESProducer.cc:51
edm::ParameterSet
Definition: ParameterSet.h:36
edm::Service< cond::service::PoolDBOutputService >
get
#define get
AlignmentErrorsExtended
Definition: AlignmentErrorsExtended.h:10
MisalignedTrackerESProducer::theScenario
const edm::ParameterSet theScenario
if theSaveToDB is true, save a fake scenario (empty alignments), irrespective of the misalignment sce...
Definition: MisalignedTrackerESProducer.cc:52
cond::service::PoolDBOutputService::writeOne
Hash writeOne(const T *payload, Time_t time, const std::string &recordName)
Definition: PoolDBOutputService.h:57
TrackerGeomBuilderFromGeometricDet
Definition: TrackerGeomBuilderFromGeometricDet.h:17
cms::Exception
Definition: Exception.h:70
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
Alignments
Definition: Alignments.h:10
GeometryAligner::applyAlignments
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
Definition: GeometryAligner.h:52
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27
cond::service::PoolDBOutputService::currentTime
cond::Time_t currentTime() const
Definition: PoolDBOutputService.cc:189
GeometryAligner
Class to update a given geometry with a set of alignments.
Definition: GeometryAligner.h:33
TrackerGeometry
Definition: TrackerGeometry.h:14