CMS 3D CMS Logo

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

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
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () noexcept(false)
 

Private Attributes

edm::ESGetToken< GeometricDet, IdealGeometryRecordgeomDetToken_
 
edm::ESGetToken< PTrackerAdditionalParametersPerDet, PTrackerAdditionalParametersPerDetRcdptitpToken_
 
edm::ESGetToken< PTrackerParameters, PTrackerParametersRcdptpToken_
 
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...
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtopoToken_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *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 TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
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::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
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 66 of file MisalignedTrackerESProducer.cc.

References gpuPixelDoublets::cc, geomDetToken_, ptitpToken_, ptpToken_, edm::ESProducer::setWhatProduced(), and topoToken_.

67  : theSaveToDB(p.getUntrackedParameter<bool>("saveToDbase")),
68  theSaveFakeScenario(p.getUntrackedParameter<bool>("saveFakeScenario")),
69  theScenario(p.getParameter<edm::ParameterSet>("scenario")),
70  theAlignRecordName("TrackerAlignmentRcd"),
71  theErrorRecordName("TrackerAlignmentErrorExtendedRcd") {
72  auto cc = setWhatProduced(this);
73  geomDetToken_ = cc.consumes();
74  ptpToken_ = cc.consumes();
75  ptitpToken_ = cc.consumes();
76  topoToken_ = cc.consumes();
77 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
const bool theSaveFakeScenario
whether or not writing to DB
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
const std::string theAlignRecordName
misalignment scenario
edm::ESGetToken< PTrackerParameters, PTrackerParametersRcd > ptpToken_
edm::ESGetToken< GeometricDet, IdealGeometryRecord > geomDetToken_
const edm::ParameterSet theScenario
if theSaveToDB is true, save a fake scenario (empty alignments), irrespective of the misalignment sce...
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
edm::ESGetToken< PTrackerAdditionalParametersPerDet, PTrackerAdditionalParametersPerDetRcd > ptitpToken_

◆ ~MisalignedTrackerESProducer()

MisalignedTrackerESProducer::~MisalignedTrackerESProducer ( )
override

Destructor.

Definition at line 80 of file MisalignedTrackerESProducer.cc.

80 {}

Member Function Documentation

◆ produce()

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 PixelBaryCentreAnalyzer_cfg::alignments, GeometryAligner::applyAlignments(), TrackerGeomBuilderFromGeometricDet::build(), cond::service::PoolDBOutputService::currentTime(), geomDetToken_, edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::get(), edm::Service< T >::isAvailable(), ptitpToken_, ptpToken_, theAlignRecordName, theErrorRecordName, theSaveFakeScenario, theSaveToDB, theScenario, topoToken_, and cond::service::PoolDBOutputService::writeOneIOV().

83  {
84  //Retrieve tracker topology from geometry
85  const TrackerTopology* tTopo = &iRecord.get(topoToken_);
86 
87  edm::LogInfo("MisalignedTracker") << "Producer called";
88 
89  // Create the tracker geometry from ideal geometry
90  const GeometricDet* gD = &iRecord.get(geomDetToken_);
91  const PTrackerParameters& ptp = iRecord.get(ptpToken_);
92  const PTrackerAdditionalParametersPerDet* ptitp = &iRecord.get(ptitpToken_);
93 
95  std::unique_ptr<TrackerGeometry> theTracker(trackerBuilder.build(gD, ptitp, ptp, tTopo));
96 
97  // Create the alignable hierarchy
98  auto theAlignableTracker = std::make_unique<AlignableTracker>(&(*theTracker), tTopo);
99 
100  // Create misalignment scenario, apply to geometry
101  TrackerScenarioBuilder scenarioBuilder(&(*theAlignableTracker));
102  scenarioBuilder.applyScenario(theScenario);
103  Alignments alignments = *(theAlignableTracker->alignments());
104  AlignmentErrorsExtended alignmentErrors = *(theAlignableTracker->alignmentErrors());
105 
106  // Store result to EventSetup
107  GeometryAligner aligner;
108  aligner.applyAlignments<TrackerGeometry>(&(*theTracker),
109  &alignments,
110  &alignmentErrors,
111  AlignTransform()); // dummy global position
112 
113  // Write alignments to DB: have to sort beforhand!
114  if (theSaveToDB) {
115  // Call service
117  if (!poolDbService.isAvailable()) // Die if not available
118  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
119  if (theSaveFakeScenario) { // make empty!
120  alignments.clear();
121  alignmentErrors.clear();
122  }
123  poolDbService->writeOneIOV<Alignments>(alignments, poolDbService->currentTime(), theAlignRecordName);
124  poolDbService->writeOneIOV<AlignmentErrorsExtended>(
125  alignmentErrors, poolDbService->currentTime(), theErrorRecordName);
126  }
127 
128  edm::LogInfo("MisalignedTracker") << "Producer done";
129  return theTracker;
130 }
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 PTrackerAdditionalParametersPerDet *ptitp, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
void applyAlignments(const C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
const std::string theAlignRecordName
misalignment scenario
edm::ESGetToken< PTrackerParameters, PTrackerParametersRcd > ptpToken_
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
Log< level::Info, false > LogInfo
edm::ESGetToken< GeometricDet, IdealGeometryRecord > geomDetToken_
const edm::ParameterSet theScenario
if theSaveToDB is true, save a fake scenario (empty alignments), irrespective of the misalignment sce...
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
bool isAvailable() const
Definition: Service.h:40
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Builds a scenario from configuration and applies it to the alignable tracker.
edm::ESGetToken< PTrackerAdditionalParametersPerDet, PTrackerAdditionalParametersPerDetRcd > ptitpToken_

Member Data Documentation

◆ geomDetToken_

edm::ESGetToken<GeometricDet, IdealGeometryRecord> MisalignedTrackerESProducer::geomDetToken_
private

Definition at line 49 of file MisalignedTrackerESProducer.cc.

Referenced by MisalignedTrackerESProducer(), and produce().

◆ ptitpToken_

Definition at line 51 of file MisalignedTrackerESProducer.cc.

Referenced by MisalignedTrackerESProducer(), and produce().

◆ ptpToken_

edm::ESGetToken<PTrackerParameters, PTrackerParametersRcd> MisalignedTrackerESProducer::ptpToken_
private

Definition at line 50 of file MisalignedTrackerESProducer.cc.

Referenced by MisalignedTrackerESProducer(), and produce().

◆ theAlignRecordName

const std::string MisalignedTrackerESProducer::theAlignRecordName
private

misalignment scenario

Definition at line 58 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

◆ theErrorRecordName

const std::string MisalignedTrackerESProducer::theErrorRecordName
private

Definition at line 58 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

◆ theSaveFakeScenario

const bool MisalignedTrackerESProducer::theSaveFakeScenario
private

whether or not writing to DB

Definition at line 56 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

◆ theSaveToDB

const bool MisalignedTrackerESProducer::theSaveToDB
private

Definition at line 54 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 57 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

◆ topoToken_

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> MisalignedTrackerESProducer::topoToken_
private

Definition at line 52 of file MisalignedTrackerESProducer.cc.

Referenced by MisalignedTrackerESProducer(), and produce().