CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
< boost::shared_ptr
< DTGeometry >
, boost::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 ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- 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 ()
 

Private Attributes

AlignmentErrorscsc_AlignmentErrors
 
Alignmentscsc_Alignments
 
AlignmentErrorsdt_AlignmentErrors
 
Alignmentsdt_Alignments
 
std::string theCSCAlignRecordName
 
std::string theCSCErrorRecordName
 
boost::shared_ptr< CSCGeometrytheCSCGeometry
 
std::string theDTAlignRecordName
 misalignment scenario More...
 
std::string theDTErrorRecordName
 
boost::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, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 
- 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::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_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 42 of file MisalignedMuonESProducer.cc.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 82 of file MisalignedMuonESProducer.cc.

References edm::ESProducer::setWhatProduced().

82  :
83  theSaveToDB(p.getUntrackedParameter<bool>("saveToDbase")),
85  theDTAlignRecordName( "DTAlignmentRcd" ),
86  theDTErrorRecordName( "DTAlignmentErrorRcd" ),
87  theCSCAlignRecordName( "CSCAlignmentRcd" ),
88  theCSCErrorRecordName( "CSCAlignmentErrorRcd" )
89 {
90 
91  setWhatProduced(this);
92 
93 }
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 97 of file MisalignedMuonESProducer.cc.

97 {}

Member Function Documentation

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

Produce the misaligned Muon geometry and store it.

Definition at line 102 of file MisalignedMuonESProducer.cc.

References align::AlignableMuon, GeometryAligner::applyAlignments(), MuonScenarioBuilder::applyScenario(), CSCGeometryBuilderFromDDD::build(), DTGeometryBuilderFromDDD::build(), csc_AlignmentErrors, csc_Alignments, AlignableMuon::cscAlignmentErrors(), AlignableMuon::cscAlignments(), dt_AlignmentErrors, dt_Alignments, AlignableMuon::dtAlignmentErrors(), 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().

103 {
104 
105  edm::LogInfo("MisalignedMuon") << "Producer called";
106 
107 
108  // Create the Muon geometry from ideal geometry
110  iRecord.getRecord<IdealGeometryRecord>().get( cpv );
111 
113  iRecord.getRecord<MuonNumberingRecord>().get(mdc);
114 
115  DTGeometryBuilderFromDDD DTGeometryBuilder;
117 
118  theDTGeometry = boost::shared_ptr<DTGeometry>(new DTGeometry );
119  DTGeometryBuilder.build(theDTGeometry, &(*cpv), *mdc );
120  theCSCGeometry = boost::shared_ptr<CSCGeometry>( new CSCGeometry );
121  CSCGeometryBuilder.build( theCSCGeometry, &(*cpv), *mdc );
122 
123 
124  // Create the alignable hierarchy
125  AlignableMuon* theAlignableMuon = new AlignableMuon( &(*theDTGeometry) , &(*theCSCGeometry) );
126 
127  // Create misalignment scenario
128  MuonScenarioBuilder scenarioBuilder( theAlignableMuon );
129  scenarioBuilder.applyScenario( theScenario );
130 
131  // Get alignments and errors
132  dt_Alignments = theAlignableMuon->dtAlignments() ;
133  dt_AlignmentErrors = theAlignableMuon->dtAlignmentErrors();
134  csc_Alignments = theAlignableMuon->cscAlignments();
135  csc_AlignmentErrors = theAlignableMuon->cscAlignmentErrors();
136 
137 
138  // Misalign the EventSetup geometry
139  GeometryAligner aligner;
140 
141  aligner.applyAlignments<DTGeometry>( &(*theDTGeometry),
142  dt_Alignments,
144  AlignTransform() );
145  aligner.applyAlignments<CSCGeometry>( &(*theCSCGeometry ),
148  AlignTransform() );
149 
150  // Write alignments to DB
151  if (theSaveToDB) this->saveToDB();
152 
153  edm::LogInfo("MisalignedMuon") << "Producer done";
154 
155  return edm::es::products( theDTGeometry, theCSCGeometry );
156 
157 }
AlignmentErrors * dtAlignmentErrors()
Builds a scenario from configuration and applies it to the alignable Muon.
boost::shared_ptr< DTGeometry > theDTGeometry
void saveToDB()
Save alignemnts and error to database.
Class to update a given geometry with a set of alignments.
void build(boost::shared_ptr< CSCGeometry > geom, const DDCompactView *fv, const MuonDDDConstants &muonConstants)
Build the geometry.
Alignments * dtAlignments()
ESProducts< T, S > products(const T &i1, const S &i2)
Definition: ESProducts.h:189
AlignmentErrors * cscAlignmentErrors()
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrors *alignmentErrors, const AlignTransform &globalCoordinates)
void build(boost::shared_ptr< DTGeometry > theGeometry, const DDCompactView *cview, const MuonDDDConstants &muonConstants)
Alignments * cscAlignments()
const edm::ParameterSet theScenario
whether or not writing to DB
boost::shared_ptr< CSCGeometry > theCSCGeometry
Constructor of the full muon geometry.
Definition: AlignableMuon.h:36
void MisalignedMuonESProducer::saveToDB ( void  )

Save alignemnts and error to database.

Definition at line 161 of file MisalignedMuonESProducer.cc.

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

Referenced by produce().

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

AlignmentErrors* MisalignedMuonESProducer::csc_AlignmentErrors
private

Definition at line 72 of file MisalignedMuonESProducer.cc.

Referenced by produce().

Alignments* MisalignedMuonESProducer::csc_Alignments
private

Definition at line 71 of file MisalignedMuonESProducer.cc.

Referenced by produce().

AlignmentErrors* MisalignedMuonESProducer::dt_AlignmentErrors
private

Definition at line 70 of file MisalignedMuonESProducer.cc.

Referenced by produce().

Alignments* MisalignedMuonESProducer::dt_Alignments
private

Definition at line 69 of file MisalignedMuonESProducer.cc.

Referenced by produce().

std::string MisalignedMuonESProducer::theCSCAlignRecordName
private

Definition at line 64 of file MisalignedMuonESProducer.cc.

Referenced by saveToDB().

std::string MisalignedMuonESProducer::theCSCErrorRecordName
private

Definition at line 64 of file MisalignedMuonESProducer.cc.

Referenced by saveToDB().

boost::shared_ptr<CSCGeometry> MisalignedMuonESProducer::theCSCGeometry
private

Definition at line 67 of file MisalignedMuonESProducer.cc.

Referenced by produce().

std::string MisalignedMuonESProducer::theDTAlignRecordName
private

misalignment scenario

Definition at line 63 of file MisalignedMuonESProducer.cc.

Referenced by saveToDB().

std::string MisalignedMuonESProducer::theDTErrorRecordName
private

Definition at line 63 of file MisalignedMuonESProducer.cc.

Referenced by saveToDB().

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

Definition at line 66 of file MisalignedMuonESProducer.cc.

Referenced by produce().

const bool MisalignedMuonESProducer::theSaveToDB
private

Definition at line 60 of file MisalignedMuonESProducer.cc.

Referenced by produce().

const edm::ParameterSet MisalignedMuonESProducer::theScenario
private

whether or not writing to DB

Definition at line 61 of file MisalignedMuonESProducer.cc.

Referenced by produce().