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 theSaveFakeScenario
 whether or not writing to DB More...
 
const bool theSaveToDB
 
const edm::ParameterSet theScenario
 if theSaveToDB is true, save a fake scenario (empty alignments), irrespective of the misalignment scenario below More...
 
boost::shared_ptr
< TrackerGeometry
theTracker
 

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

An ESProducer that fills the TrackerDigiGeometryRcd with a misaligned tracker

This should replace the standard TrackerDigiGeometryESModule when producing Misalignment scenarios.

Definition at line 38 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")),
69  theSaveFakeScenario(p.getUntrackedParameter<bool>("saveFakeScenario")),
71  theAlignRecordName("TrackerAlignmentRcd"),
72  theErrorRecordName("TrackerAlignmentErrorExtendedRcd")
73 {
74  setWhatProduced(this);
75 
76 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const bool theSaveFakeScenario
whether or not writing to DB
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
const std::string theAlignRecordName
misalignment scenario
const edm::ParameterSet theScenario
if theSaveToDB is true, save a fake scenario (empty alignments), irrespective of the misalignment sce...
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(), edm::ESHandle< class >::product(), theAlignRecordName, theErrorRecordName, theSaveFakeScenario, theSaveToDB, theScenario, theTracker, and cond::service::PoolDBOutputService::writeOne().

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

86 {
87  //Retrieve tracker topology from geometry
89  iRecord.getRecord<TrackerTopologyRcd>().get(tTopoHandle);
90  const TrackerTopology* const tTopo = tTopoHandle.product();
91 
92  edm::LogInfo("MisalignedTracker") << "Producer called";
93 
94  // Create the tracker geometry from ideal geometry
96  iRecord.getRecord<IdealGeometryRecord>().get( gD );
98  iRecord.getRecord<PTrackerParametersRcd>().get( ptp );
100  theTracker = boost::shared_ptr<TrackerGeometry>( trackerBuilder.build(&(*gD), *ptp, tTopo));
101 
102  // Create the alignable hierarchy
103  std::auto_ptr<AlignableTracker> theAlignableTracker(new AlignableTracker( &(*theTracker), tTopo ) );
104 
105  // Create misalignment scenario, apply to geometry
106  TrackerScenarioBuilder scenarioBuilder( &(*theAlignableTracker) );
107  scenarioBuilder.applyScenario( theScenario );
108  Alignments* alignments = theAlignableTracker->alignments();
109  AlignmentErrorsExtended* alignmentErrors = theAlignableTracker->alignmentErrors();
110 
111  // Store result to EventSetup
112  GeometryAligner aligner;
113  aligner.applyAlignments<TrackerGeometry>( &(*theTracker), alignments, alignmentErrors,
114  AlignTransform()); // dummy global position
115 
116  // Write alignments to DB: have to sort beforhand!
117  if (theSaveToDB) {
118 
119  // Call service
121  if( !poolDbService.isAvailable() ) // Die if not available
122  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
123  if (theSaveFakeScenario) { // make empty!
124  alignments->clear();
125  alignmentErrors->clear();
126  }
127  poolDbService->writeOne<Alignments>(alignments, poolDbService->currentTime(),
129  poolDbService->writeOne<AlignmentErrorsExtended>(alignmentErrors, poolDbService->currentTime(),
131  } else {
132  // poolDbService::writeOne takes over ownership
133  // we have to delete in the case that containers are not written
134  delete alignments;
135  delete alignmentErrors;
136  }
137 
138 
139  edm::LogInfo("MisalignedTracker") << "Producer done";
140  return theTracker;
141 
142 }
const bool theSaveFakeScenario
whether or not writing to DB
Class to update a given geometry with a set of alignments.
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
const std::string theAlignRecordName
misalignment scenario
bool isAvailable() const
Definition: Service.h:46
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
T const * product() const
Definition: ESHandle.h:86
boost::shared_ptr< TrackerGeometry > theTracker
const edm::ParameterSet theScenario
if theSaveToDB is true, save a fake scenario (empty alignments), irrespective of the misalignment sce...
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 55 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

const std::string MisalignedTrackerESProducer::theErrorRecordName
private

Definition at line 55 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

const bool MisalignedTrackerESProducer::theSaveFakeScenario
private

whether or not writing to DB

Definition at line 53 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

const bool MisalignedTrackerESProducer::theSaveToDB
private

Definition at line 52 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

const edm::ParameterSet MisalignedTrackerESProducer::theScenario
private

if theSaveToDB is true, save a fake scenario (empty alignments), irrespective of the misalignment scenario below

Definition at line 54 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

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

Definition at line 57 of file MisalignedTrackerESProducer.cc.

Referenced by produce().