CMS 3D CMS Logo

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

Public Member Functions

 MisalignedMuonESProducer (const edm::ParameterSet &p)
 Constructor. More...
 
edm::ESProducts< std::unique_ptr< DTGeometry >, std::unique_ptr< CSCGeometry > > produce (const MuonGeometryRecord &)
 Produce the misaligned Muon geometry and store it. More...
 
void saveToDB ()
 Save alignemnts and error to database. More...
 
 ~MisalignedMuonESProducer () 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 ()(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

AlignmentErrorsExtendedcsc_AlignmentErrorsExtended
 
Alignmentscsc_Alignments
 
AlignmentErrorsExtendeddt_AlignmentErrorsExtended
 
Alignmentsdt_Alignments
 
std::string theCSCAlignRecordName
 
std::string theCSCErrorRecordName
 
std::string theDTAlignRecordName
 misalignment scenario More...
 
std::string theDTErrorRecordName
 
const bool theSaveToDB
 
const edm::ParameterSet theScenario
 whether or not writing to DB 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 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 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

Definition at line 39 of file MisalignedMuonESProducer.cc.

Constructor & Destructor Documentation

MisalignedMuonESProducer::MisalignedMuonESProducer ( const edm::ParameterSet p)

Constructor.

Definition at line 71 of file MisalignedMuonESProducer.cc.

References edm::ESProducer::setWhatProduced().

72  : theSaveToDB(p.getUntrackedParameter<bool>("saveToDbase")),
74  theDTAlignRecordName("DTAlignmentRcd"),
75  theDTErrorRecordName("DTAlignmentErrorExtendedRcd"),
76  theCSCAlignRecordName("CSCAlignmentRcd"),
77  theCSCErrorRecordName("CSCAlignmentErrorExtendedRcd") {
78  setWhatProduced(this);
79 }
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
T getUntrackedParameter(std::string const &, T const &) const
std::string theDTAlignRecordName
misalignment scenario
const edm::ParameterSet theScenario
whether or not writing to DB
MisalignedMuonESProducer::~MisalignedMuonESProducer ( )
override

Destructor.

Definition at line 82 of file MisalignedMuonESProducer.cc.

82 {}

Member Function Documentation

edm::ESProducts< std::unique_ptr< DTGeometry >, std::unique_ptr< CSCGeometry > > MisalignedMuonESProducer::produce ( const MuonGeometryRecord iRecord)

Produce the misaligned Muon geometry and store it.

Definition at line 85 of file MisalignedMuonESProducer.cc.

References align::AlignableMuon, GeometryAligner::applyAlignments(), MuonScenarioBuilder::applyScenario(), CSCGeometryBuilderFromDDD::build(), DTGeometryBuilderFromDDD::build(), csc_AlignmentErrorsExtended, csc_Alignments, AlignableMuon::cscAlignmentErrorsExtended(), AlignableMuon::cscAlignments(), dt_AlignmentErrorsExtended, dt_Alignments, AlignableMuon::dtAlignmentErrorsExtended(), AlignableMuon::dtAlignments(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), eostools::move(), edm::es::products(), saveToDB(), theSaveToDB, and theScenario.

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

86  {
87  edm::LogInfo("MisalignedMuon") << "Producer called";
88 
89  // Create the Muon geometry from ideal geometry
91  iRecord.getRecord<IdealGeometryRecord>().get(cpv);
92 
94  iRecord.getRecord<MuonNumberingRecord>().get(mdc);
95 
98 
99  auto theDTGeometry = std::make_unique<DTGeometry>();
100  DTGeometryBuilder.build(*theDTGeometry, &(*cpv), *mdc);
101  auto theCSCGeometry = std::make_unique<CSCGeometry>();
102  CSCGeometryBuilder.build(*theCSCGeometry, &(*cpv), *mdc);
103 
104  // Create the alignable hierarchy
105  AlignableMuon* theAlignableMuon = new AlignableMuon(&(*theDTGeometry), &(*theCSCGeometry));
106 
107  // Create misalignment scenario
108  MuonScenarioBuilder scenarioBuilder(theAlignableMuon);
109  scenarioBuilder.applyScenario(theScenario);
110 
111  // Get alignments and errors
112  dt_Alignments = theAlignableMuon->dtAlignments();
114  csc_Alignments = theAlignableMuon->cscAlignments();
116 
117  // Misalign the EventSetup geometry
118  GeometryAligner aligner;
119 
121  aligner.applyAlignments<CSCGeometry>(
123 
124  // Write alignments to DB
125  if (theSaveToDB)
126  this->saveToDB();
127 
128  edm::LogInfo("MisalignedMuon") << "Producer done";
129 
130  return edm::es::products(std::move(theDTGeometry), std::move(theCSCGeometry));
131 }
Builds a scenario from configuration and applies it to the alignable Muon.
void saveToDB()
Save alignemnts and error to database.
Class to update a given geometry with a set of alignments.
AlignmentErrorsExtended * dt_AlignmentErrorsExtended
ESProducts< std::remove_reference_t< TArgs >... > products(TArgs &&...args)
Definition: ESProducts.h:128
Alignments * dtAlignments()
Get DT alignments sorted by DetId.
void build(CSCGeometry &geom, const DDCompactView *fv, const MuonDDDConstants &muonConstants)
Build the geometry.
AlignmentErrorsExtended * csc_AlignmentErrorsExtended
void build(DTGeometry &theGeometry, const DDCompactView *cview, const MuonDDDConstants &muonConstants)
AlignmentErrorsExtended * cscAlignmentErrorsExtended()
Get CSC alignment errors sorted by DetId.
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
Alignments * cscAlignments()
Get CSC alignments sorted by DetId.
AlignmentErrorsExtended * dtAlignmentErrorsExtended()
Get DT alignment errors sorted by DetId.
const edm::ParameterSet theScenario
whether or not writing to DB
Constructor of the full muon geometry.
Definition: AlignableMuon.h:33
def move(src, dest)
Definition: eostools.py:511
void MisalignedMuonESProducer::saveToDB ( void  )

Save alignemnts and error to database.

Definition at line 134 of file MisalignedMuonESProducer.cc.

References cond::service::PoolDBOutputService::beginOfTime(), DEFINE_FWK_EVENTSETUP_MODULE, edm::Service< T >::isAvailable(), theCSCAlignRecordName, theCSCErrorRecordName, theDTAlignRecordName, theDTErrorRecordName, and cond::service::PoolDBOutputService::writeOne().

Referenced by produce().

134  {
135  // Call service
137  if (!poolDbService.isAvailable()) // Die if not available
138  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
139 
140  // Store DT alignments and errors
141  poolDbService->writeOne<Alignments>(&(*dt_Alignments), poolDbService->beginOfTime(), theDTAlignRecordName);
142  poolDbService->writeOne<AlignmentErrorsExtended>(
143  &(*dt_AlignmentErrorsExtended), poolDbService->beginOfTime(), theDTErrorRecordName);
144 
145  // Store CSC alignments and errors
146  poolDbService->writeOne<Alignments>(&(*csc_Alignments), poolDbService->beginOfTime(), theCSCAlignRecordName);
147  poolDbService->writeOne<AlignmentErrorsExtended>(
148  &(*csc_AlignmentErrorsExtended), poolDbService->beginOfTime(), theCSCErrorRecordName);
149 }
std::string theDTAlignRecordName
misalignment scenario
bool isAvailable() const
Definition: Service.h:40
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)

Member Data Documentation

AlignmentErrorsExtended* MisalignedMuonESProducer::csc_AlignmentErrorsExtended
private

Definition at line 63 of file MisalignedMuonESProducer.cc.

Referenced by produce().

Alignments* MisalignedMuonESProducer::csc_Alignments
private

Definition at line 62 of file MisalignedMuonESProducer.cc.

Referenced by produce().

AlignmentErrorsExtended* MisalignedMuonESProducer::dt_AlignmentErrorsExtended
private

Definition at line 61 of file MisalignedMuonESProducer.cc.

Referenced by produce().

Alignments* MisalignedMuonESProducer::dt_Alignments
private

Definition at line 60 of file MisalignedMuonESProducer.cc.

Referenced by produce().

std::string MisalignedMuonESProducer::theCSCAlignRecordName
private

Definition at line 58 of file MisalignedMuonESProducer.cc.

Referenced by saveToDB().

std::string MisalignedMuonESProducer::theCSCErrorRecordName
private

Definition at line 58 of file MisalignedMuonESProducer.cc.

Referenced by saveToDB().

std::string MisalignedMuonESProducer::theDTAlignRecordName
private

misalignment scenario

Definition at line 57 of file MisalignedMuonESProducer.cc.

Referenced by saveToDB().

std::string MisalignedMuonESProducer::theDTErrorRecordName
private

Definition at line 57 of file MisalignedMuonESProducer.cc.

Referenced by saveToDB().

const bool MisalignedMuonESProducer::theSaveToDB
private

Definition at line 54 of file MisalignedMuonESProducer.cc.

Referenced by produce().

const edm::ParameterSet MisalignedMuonESProducer::theScenario
private

whether or not writing to DB

Definition at line 55 of file MisalignedMuonESProducer.cc.

Referenced by produce().