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
 
const std::string theErrorRecordName
 
const edm::ParameterSet thePSet
 misalignment scenario More...
 
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, 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

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")),
69  theSaveFakeScenario(p.getUntrackedParameter<bool>("saveFakeScenario")),
71  thePSet(p),
72  theAlignRecordName("TrackerAlignmentRcd"),
73  theErrorRecordName("TrackerAlignmentErrorRcd")
74 {
75  setWhatProduced(this);
76 
77 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const bool theSaveFakeScenario
whether or not writing to DB
const edm::ParameterSet thePSet
misalignment scenario
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
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 81 of file MisalignedTrackerESProducer.cc.

81 {}

Member Function Documentation

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

Produce the misaligned tracker geometry and store it.

Definition at line 86 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, thePSet, theSaveFakeScenario, theSaveToDB, theScenario, theTracker, and cond::service::PoolDBOutputService::writeOne().

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

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

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 edm::ParameterSet MisalignedTrackerESProducer::thePSet
private

misalignment scenario

Definition at line 54 of file MisalignedTrackerESProducer.cc.

Referenced by produce().

const bool MisalignedTrackerESProducer::theSaveFakeScenario
private

whether or not writing to DB

Definition at line 52 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

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

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