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
MisalignedTrackerESProducer Class Reference
Inheritance diagram for MisalignedTrackerESProducer:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 MisalignedTrackerESProducer (const edm::ParameterSet &p)
 Constructor. More...
 
boost::shared_ptr
< TrackerGeometry
produce (const TrackerDigiGeometryRecord &iRecord)
 Produce the misaligned tracker geometry and store it. More...
 
virtual ~MisalignedTrackerESProducer ()
 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

const std::string theAlignRecordName
 misalignment scenario More...
 
const std::string theErrorRecordName
 
const bool theSaveToDB
 
const edm::ParameterSet theScenario
 whether or not writing to DB More...
 
boost::shared_ptr
< TrackerGeometry
theTracker
 

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

An ESProducer that fills the TrackerDigiGeometryRcd with a misaligned tracker

This should replace the standard TrackerDigiGeometryESModule when producing Misalignment scenarios.

Definition at line 37 of file MisalignedTrackerESProducer.cc.

Constructor & Destructor Documentation

MisalignedTrackerESProducer::MisalignedTrackerESProducer ( const edm::ParameterSet p)

Constructor.

Definition at line 67 of file MisalignedTrackerESProducer.cc.

References edm::ESProducer::setWhatProduced().

67  :
68  theSaveToDB(p.getUntrackedParameter<bool>("saveToDbase")),
70  theAlignRecordName("TrackerAlignmentRcd"),
71  theErrorRecordName("TrackerAlignmentErrorRcd")
72 {
73 
74  setWhatProduced(this);
75 
76 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
const std::string theAlignRecordName
misalignment scenario
const edm::ParameterSet theScenario
whether or not writing to DB
MisalignedTrackerESProducer::~MisalignedTrackerESProducer ( )
virtual

Destructor.

Definition at line 80 of file MisalignedTrackerESProducer.cc.

80 {}

Member Function Documentation

boost::shared_ptr< TrackerGeometry > MisalignedTrackerESProducer::produce ( const TrackerDigiGeometryRecord iRecord)

Produce the misaligned tracker geometry and store it.

Definition at line 85 of file MisalignedTrackerESProducer.cc.

References GeometryAligner::applyAlignments(), TrackerScenarioBuilder::applyScenario(), TrackerGeomBuilderFromGeometricDet::build(), cond::service::PoolDBOutputService::currentTime(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), edm::Service< T >::isAvailable(), theAlignRecordName, theErrorRecordName, theSaveToDB, theScenario, theTracker, and cond::service::PoolDBOutputService::writeOne().

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

86 {
87 
88  edm::LogInfo("MisalignedTracker") << "Producer called";
89 
90  // Create the tracker geometry from ideal geometry
92  iRecord.getRecord<IdealGeometryRecord>().get( gD );
94  theTracker = boost::shared_ptr<TrackerGeometry>( trackerBuilder.build(&(*gD)) );
95 
96  // Create the alignable hierarchy
97  std::auto_ptr<AlignableTracker> theAlignableTracker(new AlignableTracker( &(*theTracker) ) );
98 
99  // Create misalignment scenario, apply to geometry
100  TrackerScenarioBuilder scenarioBuilder( &(*theAlignableTracker) );
101  scenarioBuilder.applyScenario( theScenario );
102  Alignments* alignments = theAlignableTracker->alignments();
103  AlignmentErrors* alignmentErrors = theAlignableTracker->alignmentErrors();
104 
105  // Store result to EventSetup
106  GeometryAligner aligner;
107  aligner.applyAlignments<TrackerGeometry>( &(*theTracker), alignments, alignmentErrors,
108  AlignTransform()); // dummy global position
109 
110  // Write alignments to DB: have to sort beforhand!
111  if (theSaveToDB) {
112 
113  // Call service
115  if( !poolDbService.isAvailable() ) // Die if not available
116  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
117 
118  poolDbService->writeOne<Alignments>(alignments, poolDbService->currentTime(),
120  poolDbService->writeOne<AlignmentErrors>(alignmentErrors, poolDbService->currentTime(),
122  }
123 
124 
125  edm::LogInfo("MisalignedTracker") << "Producer done";
126  return theTracker;
127 
128 }
Class to update a given geometry with a set of alignments.
const std::string theAlignRecordName
misalignment scenario
bool isAvailable() const
Definition: Service.h:47
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrors *alignmentErrors, const AlignTransform &globalCoordinates)
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
TrackerGeometry * build(const GeometricDet *gd)
boost::shared_ptr< TrackerGeometry > theTracker
const edm::ParameterSet theScenario
whether or not writing to DB
Builds a scenario from configuration and applies it to the alignable tracker.

Member Data Documentation

const std::string MisalignedTrackerESProducer::theAlignRecordName
private

misalignment scenario

Definition at line 54 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

const std::string MisalignedTrackerESProducer::theErrorRecordName
private

Definition at line 54 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

const bool MisalignedTrackerESProducer::theSaveToDB
private

Definition at line 51 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

const edm::ParameterSet MisalignedTrackerESProducer::theScenario
private

whether or not writing to DB

Definition at line 52 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

boost::shared_ptr<TrackerGeometry> MisalignedTrackerESProducer::theTracker
private

Definition at line 56 of file MisalignedTrackerESProducer.cc.

Referenced by produce().