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 ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- 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

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

- 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
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
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 >
ESConsumesCollector 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 eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 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

Definition at line 41 of file MisalignedMuonESProducer.cc.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 78 of file MisalignedMuonESProducer.cc.

References edm::ESProducer::setWhatProduced().

78  :
79  theSaveToDB(p.getUntrackedParameter<bool>("saveToDbase")),
81  theDTAlignRecordName( "DTAlignmentRcd" ),
82  theDTErrorRecordName( "DTAlignmentErrorExtendedRcd" ),
83  theCSCAlignRecordName( "CSCAlignmentRcd" ),
84  theCSCErrorRecordName( "CSCAlignmentErrorExtendedRcd" )
85 {
86 
87  setWhatProduced(this);
88 
89 }
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:116
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 93 of file MisalignedMuonESProducer.cc.

93 {}

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

99 {
100 
101  edm::LogInfo("MisalignedMuon") << "Producer called";
102 
103 
104  // Create the Muon geometry from ideal geometry
106  iRecord.getRecord<IdealGeometryRecord>().get( cpv );
107 
109  iRecord.getRecord<MuonNumberingRecord>().get(mdc);
110 
111  DTGeometryBuilderFromDDD DTGeometryBuilder;
113 
114  auto theDTGeometry = std::make_unique<DTGeometry>();
115  DTGeometryBuilder.build(*theDTGeometry, &(*cpv), *mdc);
116  auto theCSCGeometry = std::make_unique<CSCGeometry>();
117  CSCGeometryBuilder.build(*theCSCGeometry, &(*cpv), *mdc);
118 
119  // Create the alignable hierarchy
120  AlignableMuon* theAlignableMuon = new AlignableMuon( &(*theDTGeometry) , &(*theCSCGeometry) );
121 
122  // Create misalignment scenario
123  MuonScenarioBuilder scenarioBuilder( theAlignableMuon );
124  scenarioBuilder.applyScenario( theScenario );
125 
126  // Get alignments and errors
127  dt_Alignments = theAlignableMuon->dtAlignments() ;
129  csc_Alignments = theAlignableMuon->cscAlignments();
131 
132 
133  // Misalign the EventSetup geometry
134  GeometryAligner aligner;
135 
136  aligner.applyAlignments<DTGeometry>( &(*theDTGeometry),
137  dt_Alignments,
139  AlignTransform() );
140  aligner.applyAlignments<CSCGeometry>( &(*theCSCGeometry ),
143  AlignTransform() );
144 
145  // Write alignments to DB
146  if (theSaveToDB) this->saveToDB();
147 
148  edm::LogInfo("MisalignedMuon") << "Producer done";
149 
150  return edm::es::products( std::move(theDTGeometry), std::move(theCSCGeometry) );
151 }
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:129
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:37
def move(src, dest)
Definition: eostools.py:511
void MisalignedMuonESProducer::saveToDB ( void  )

Save alignemnts and error to database.

Definition at line 155 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().

156 {
157 
158  // Call service
160  if( !poolDbService.isAvailable() ) // Die if not available
161  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
162 
163  // Store DT alignments and errors
164  poolDbService->writeOne<Alignments>( &(*dt_Alignments), poolDbService->beginOfTime(), theDTAlignRecordName);
165  poolDbService->writeOne<AlignmentErrorsExtended>( &(*dt_AlignmentErrorsExtended), poolDbService->beginOfTime(), theDTErrorRecordName);
166 
167  // Store CSC alignments and errors
168  poolDbService->writeOne<Alignments>( &(*csc_Alignments), poolDbService->beginOfTime(), theCSCAlignRecordName);
169  poolDbService->writeOne<AlignmentErrorsExtended>( &(*csc_AlignmentErrorsExtended), poolDbService->beginOfTime(), theCSCErrorRecordName);
170 
171 }
std::string theDTAlignRecordName
misalignment scenario
bool isAvailable() const
Definition: Service.h:46
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 68 of file MisalignedMuonESProducer.cc.

Referenced by produce().

Alignments* MisalignedMuonESProducer::csc_Alignments
private

Definition at line 67 of file MisalignedMuonESProducer.cc.

Referenced by produce().

AlignmentErrorsExtended* MisalignedMuonESProducer::dt_AlignmentErrorsExtended
private

Definition at line 66 of file MisalignedMuonESProducer.cc.

Referenced by produce().

Alignments* MisalignedMuonESProducer::dt_Alignments
private

Definition at line 65 of file MisalignedMuonESProducer.cc.

Referenced by produce().

std::string MisalignedMuonESProducer::theCSCAlignRecordName
private

Definition at line 63 of file MisalignedMuonESProducer.cc.

Referenced by saveToDB().

std::string MisalignedMuonESProducer::theCSCErrorRecordName
private

Definition at line 63 of file MisalignedMuonESProducer.cc.

Referenced by saveToDB().

std::string MisalignedMuonESProducer::theDTAlignRecordName
private

misalignment scenario

Definition at line 62 of file MisalignedMuonESProducer.cc.

Referenced by saveToDB().

std::string MisalignedMuonESProducer::theDTErrorRecordName
private

Definition at line 62 of file MisalignedMuonESProducer.cc.

Referenced by saveToDB().

const bool MisalignedMuonESProducer::theSaveToDB
private

Definition at line 59 of file MisalignedMuonESProducer.cc.

Referenced by produce().

const edm::ParameterSet MisalignedMuonESProducer::theScenario
private

whether or not writing to DB

Definition at line 60 of file MisalignedMuonESProducer.cc.

Referenced by produce().