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::shared_ptr< DTGeometry >, std::shared_ptr< CSCGeometry > > produce (const MuonGeometryRecord &)
 Produce the misaligned Muon geometry and store it. More...
 
void saveToDB ()
 Save alignemnts and error to database. More...
 
virtual ~MisalignedMuonESProducer ()
 Destructor. More...
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()(false)
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer () noexcept(false)
 
- 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::shared_ptr< CSCGeometrytheCSCGeometry
 
std::string theDTAlignRecordName
 misalignment scenario More...
 
std::string theDTErrorRecordName
 
std::shared_ptr< DTGeometrytheDTGeometry
 
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
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- 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())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 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 81 of file MisalignedMuonESProducer.cc.

References edm::ESProducer::setWhatProduced().

81  :
82  theSaveToDB(p.getUntrackedParameter<bool>("saveToDbase")),
84  theDTAlignRecordName( "DTAlignmentRcd" ),
85  theDTErrorRecordName( "DTAlignmentErrorExtendedRcd" ),
86  theCSCAlignRecordName( "CSCAlignmentRcd" ),
87  theCSCErrorRecordName( "CSCAlignmentErrorExtendedRcd" )
88 {
89 
90  setWhatProduced(this);
91 
92 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string theDTAlignRecordName
misalignment scenario
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
const edm::ParameterSet theScenario
whether or not writing to DB
MisalignedMuonESProducer::~MisalignedMuonESProducer ( )
virtual

Destructor.

Definition at line 96 of file MisalignedMuonESProducer.cc.

96 {}

Member Function Documentation

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

Produce the misaligned Muon geometry and store it.

Definition at line 101 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(), edm::es::products(), saveToDB(), theCSCGeometry, theDTGeometry, theSaveToDB, and theScenario.

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

102 {
103 
104  edm::LogInfo("MisalignedMuon") << "Producer called";
105 
106 
107  // Create the Muon geometry from ideal geometry
109  iRecord.getRecord<IdealGeometryRecord>().get( cpv );
110 
112  iRecord.getRecord<MuonNumberingRecord>().get(mdc);
113 
114  DTGeometryBuilderFromDDD DTGeometryBuilder;
116 
117  theDTGeometry = std::make_shared<DTGeometry>();
118  DTGeometryBuilder.build(theDTGeometry, &(*cpv), *mdc );
119  theCSCGeometry = std::make_shared<CSCGeometry>();
120  CSCGeometryBuilder.build( theCSCGeometry, &(*cpv), *mdc );
121 
122 
123  // Create the alignable hierarchy
124  AlignableMuon* theAlignableMuon = new AlignableMuon( &(*theDTGeometry) , &(*theCSCGeometry) );
125 
126  // Create misalignment scenario
127  MuonScenarioBuilder scenarioBuilder( theAlignableMuon );
128  scenarioBuilder.applyScenario( theScenario );
129 
130  // Get alignments and errors
131  dt_Alignments = theAlignableMuon->dtAlignments() ;
133  csc_Alignments = theAlignableMuon->cscAlignments();
135 
136 
137  // Misalign the EventSetup geometry
138  GeometryAligner aligner;
139 
140  aligner.applyAlignments<DTGeometry>( &(*theDTGeometry),
141  dt_Alignments,
143  AlignTransform() );
144  aligner.applyAlignments<CSCGeometry>( &(*theCSCGeometry ),
147  AlignTransform() );
148 
149  // Write alignments to DB
150  if (theSaveToDB) this->saveToDB();
151 
152  edm::LogInfo("MisalignedMuon") << "Producer done";
153 
154  return edm::es::products( theDTGeometry, theCSCGeometry );
155 
156 }
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.
std::shared_ptr< CSCGeometry > theCSCGeometry
AlignmentErrorsExtended * dt_AlignmentErrorsExtended
Alignments * dtAlignments()
Get DT alignments sorted by DetId.
AlignmentErrorsExtended * csc_AlignmentErrorsExtended
ESProducts< T, S > products(const T &i1, const S &i2)
Definition: ESProducts.h:191
std::shared_ptr< DTGeometry > theDTGeometry
AlignmentErrorsExtended * cscAlignmentErrorsExtended()
Get CSC alignment errors sorted by DetId.
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
void build(std::shared_ptr< CSCGeometry > geom, const DDCompactView *fv, const MuonDDDConstants &muonConstants)
Build the geometry.
Alignments * cscAlignments()
Get CSC alignments sorted by DetId.
AlignmentErrorsExtended * dtAlignmentErrorsExtended()
Get DT alignment errors sorted by DetId.
void build(std::shared_ptr< DTGeometry > theGeometry, const DDCompactView *cview, const MuonDDDConstants &muonConstants)
const edm::ParameterSet theScenario
whether or not writing to DB
Constructor of the full muon geometry.
Definition: AlignableMuon.h:37
void MisalignedMuonESProducer::saveToDB ( void  )

Save alignemnts and error to database.

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

161 {
162 
163  // Call service
165  if( !poolDbService.isAvailable() ) // Die if not available
166  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
167 
168  // Store DT alignments and errors
169  poolDbService->writeOne<Alignments>( &(*dt_Alignments), poolDbService->beginOfTime(), theDTAlignRecordName);
170  poolDbService->writeOne<AlignmentErrorsExtended>( &(*dt_AlignmentErrorsExtended), poolDbService->beginOfTime(), theDTErrorRecordName);
171 
172  // Store CSC alignments and errors
173  poolDbService->writeOne<Alignments>( &(*csc_Alignments), poolDbService->beginOfTime(), theCSCAlignRecordName);
174  poolDbService->writeOne<AlignmentErrorsExtended>( &(*csc_AlignmentErrorsExtended), poolDbService->beginOfTime(), theCSCErrorRecordName);
175 
176 }
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 71 of file MisalignedMuonESProducer.cc.

Referenced by produce().

Alignments* MisalignedMuonESProducer::csc_Alignments
private

Definition at line 70 of file MisalignedMuonESProducer.cc.

Referenced by produce().

AlignmentErrorsExtended* MisalignedMuonESProducer::dt_AlignmentErrorsExtended
private

Definition at line 69 of file MisalignedMuonESProducer.cc.

Referenced by produce().

Alignments* MisalignedMuonESProducer::dt_Alignments
private

Definition at line 68 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::shared_ptr<CSCGeometry> MisalignedMuonESProducer::theCSCGeometry
private

Definition at line 66 of file MisalignedMuonESProducer.cc.

Referenced by produce().

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

std::shared_ptr<DTGeometry> MisalignedMuonESProducer::theDTGeometry
private

Definition at line 65 of file MisalignedMuonESProducer.cc.

Referenced by produce().

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