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

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

Definition at line 39 of file MisalignedMuonESProducer.cc.

Constructor & Destructor Documentation

◆ MisalignedMuonESProducer()

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

Constructor.

Definition at line 71 of file MisalignedMuonESProducer.cc.

72  : theSaveToDB(p.getUntrackedParameter<bool>("saveToDbase")),
73  theScenario(p.getParameter<edm::ParameterSet>("scenario")),
74  theDTAlignRecordName("DTAlignmentRcd"),
75  theDTErrorRecordName("DTAlignmentErrorExtendedRcd"),
76  theCSCAlignRecordName("CSCAlignmentRcd"),
77  theCSCErrorRecordName("CSCAlignmentErrorExtendedRcd") {
78  setWhatProduced(this);
79 }

References edm::ESProducer::setWhatProduced().

◆ ~MisalignedMuonESProducer()

MisalignedMuonESProducer::~MisalignedMuonESProducer ( )
override

Destructor.

Definition at line 82 of file MisalignedMuonESProducer.cc.

82 {}

Member Function Documentation

◆ produce()

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.

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<IdealGeometryRecord>().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 }

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

◆ saveToDB()

void MisalignedMuonESProducer::saveToDB ( void  )

Save alignemnts and error to database.

Definition at line 134 of file MisalignedMuonESProducer.cc.

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 }

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

Referenced by produce().

Member Data Documentation

◆ csc_AlignmentErrorsExtended

AlignmentErrorsExtended* MisalignedMuonESProducer::csc_AlignmentErrorsExtended
private

Definition at line 63 of file MisalignedMuonESProducer.cc.

Referenced by produce().

◆ csc_Alignments

Alignments* MisalignedMuonESProducer::csc_Alignments
private

Definition at line 62 of file MisalignedMuonESProducer.cc.

Referenced by produce().

◆ dt_AlignmentErrorsExtended

AlignmentErrorsExtended* MisalignedMuonESProducer::dt_AlignmentErrorsExtended
private

Definition at line 61 of file MisalignedMuonESProducer.cc.

Referenced by produce().

◆ dt_Alignments

Alignments* MisalignedMuonESProducer::dt_Alignments
private

Definition at line 60 of file MisalignedMuonESProducer.cc.

Referenced by produce().

◆ theCSCAlignRecordName

std::string MisalignedMuonESProducer::theCSCAlignRecordName
private

Definition at line 58 of file MisalignedMuonESProducer.cc.

Referenced by saveToDB().

◆ theCSCErrorRecordName

std::string MisalignedMuonESProducer::theCSCErrorRecordName
private

Definition at line 58 of file MisalignedMuonESProducer.cc.

Referenced by saveToDB().

◆ theDTAlignRecordName

std::string MisalignedMuonESProducer::theDTAlignRecordName
private

misalignment scenario

Definition at line 57 of file MisalignedMuonESProducer.cc.

Referenced by saveToDB().

◆ theDTErrorRecordName

std::string MisalignedMuonESProducer::theDTErrorRecordName
private

Definition at line 57 of file MisalignedMuonESProducer.cc.

Referenced by saveToDB().

◆ theSaveToDB

const bool MisalignedMuonESProducer::theSaveToDB
private

Definition at line 54 of file MisalignedMuonESProducer.cc.

Referenced by produce().

◆ theScenario

const edm::ParameterSet MisalignedMuonESProducer::theScenario
private

whether or not writing to DB

Definition at line 55 of file MisalignedMuonESProducer.cc.

Referenced by produce().

edm::eventsetup::DependentRecordImplementation::getRecord
const DepRecordT getRecord() const
Definition: DependentRecordImplementation.h:51
DTGeometry
Definition: DTGeometry.h:28
AlignableMuon::dtAlignmentErrorsExtended
AlignmentErrorsExtended * dtAlignmentErrorsExtended()
Get DT alignment errors sorted by DetId.
Definition: AlignableMuon.cc:426
DTGeometryBuilder
MisalignedMuonESProducer::theDTErrorRecordName
std::string theDTErrorRecordName
Definition: MisalignedMuonESProducer.cc:57
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:187
DTGeometryBuilderFromDDD
Definition: DTGeometryBuilderFromDDD.h:31
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
MisalignedMuonESProducer::theScenario
const edm::ParameterSet theScenario
whether or not writing to DB
Definition: MisalignedMuonESProducer.cc:55
MisalignedMuonESProducer::dt_AlignmentErrorsExtended
AlignmentErrorsExtended * dt_AlignmentErrorsExtended
Definition: MisalignedMuonESProducer.cc:61
MisalignedMuonESProducer::theSaveToDB
const bool theSaveToDB
Definition: MisalignedMuonESProducer.cc:54
edm::LogInfo
Definition: MessageLogger.h:254
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
AlignableMuon::cscAlignments
Alignments * cscAlignments()
Get CSC alignments sorted by DetId.
Definition: AlignableMuon.cc:433
MisalignedMuonESProducer::csc_AlignmentErrorsExtended
AlignmentErrorsExtended * csc_AlignmentErrorsExtended
Definition: MisalignedMuonESProducer.cc:63
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
AlignableMuon::dtAlignments
Alignments * dtAlignments()
Get DT alignments sorted by DetId.
Definition: AlignableMuon.cc:419
MisalignedMuonESProducer::theCSCErrorRecordName
std::string theCSCErrorRecordName
Definition: MisalignedMuonESProducer.cc:58
edm::es::products
ESProducts< std::remove_reference_t< TArgs >... > products(TArgs &&... args)
Definition: ESProducts.h:128
CSCGeometry
Definition: CSCGeometry.h:24
align::AlignableMuon
Definition: StructureType.h:84
MisalignedMuonESProducer::theCSCAlignRecordName
std::string theCSCAlignRecordName
Definition: MisalignedMuonESProducer.cc:58
CSCGeometryBuilder
Definition: CSCGeometryBuilder.h:20
edm::ESHandle
Definition: DTSurvey.h:22
CSCGeometryBuilder::build
void build(CSCGeometry &theGeometry, const RecoIdealGeometry &rig, const CSCRecoDigiParameters &cscpars)
Build the geometry.
Definition: CSCGeometryBuilder.cc:17
AlignTransform
Definition: AlignTransform.h:15
edm::ParameterSet
Definition: ParameterSet.h:36
MisalignedMuonESProducer::dt_Alignments
Alignments * dt_Alignments
Definition: MisalignedMuonESProducer.cc:60
AlignableMuon
Constructor of the full muon geometry.
Definition: AlignableMuon.h:33
edm::Service< cond::service::PoolDBOutputService >
MisalignedMuonESProducer::saveToDB
void saveToDB()
Save alignemnts and error to database.
Definition: MisalignedMuonESProducer.cc:134
get
#define get
AlignmentErrorsExtended
Definition: AlignmentErrorsExtended.h:10
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
eostools.move
def move(src, dest)
Definition: eostools.py:511
MisalignedMuonESProducer::theDTAlignRecordName
std::string theDTAlignRecordName
misalignment scenario
Definition: MisalignedMuonESProducer.cc:57
CSCGeometryBuilderFromDDD
Definition: CSCGeometryBuilderFromDDD.h:30
cond::service::PoolDBOutputService::writeOne
Hash writeOne(const T *payload, Time_t time, const std::string &recordName)
Definition: PoolDBOutputService.h:57
cms::Exception
Definition: Exception.h:70
AlignableMuon::cscAlignmentErrorsExtended
AlignmentErrorsExtended * cscAlignmentErrorsExtended()
Get CSC alignment errors sorted by DetId.
Definition: AlignableMuon.cc:445
Alignments
Definition: Alignments.h:10
GeometryAligner::applyAlignments
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
Definition: GeometryAligner.h:52
MuonScenarioBuilder
Builds a scenario from configuration and applies it to the alignable Muon.
Definition: MuonScenarioBuilder.h:19
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27
MisalignedMuonESProducer::csc_Alignments
Alignments * csc_Alignments
Definition: MisalignedMuonESProducer.cc:62
GeometryAligner
Class to update a given geometry with a set of alignments.
Definition: GeometryAligner.h:33