CMS 3D CMS Logo

MisalignedTrackerESProducer Class Reference

An ESProducer that fills the TrackerDigiGeometryRcd with a misaligned tracker. More...

#include <Alignment/TrackerAlignment/plugins/MisalignedTrackerESProducer.h>

Inheritance diagram for MisalignedTrackerESProducer:

edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Member Functions

 MisalignedTrackerESProducer (const edm::ParameterSet &p)
 Constructor.
boost::shared_ptr
< TrackerGeometry
produce (const TrackerDigiGeometryRecord &)
 Produce the misaligned tracker geometry and store it.
virtual ~MisalignedTrackerESProducer ()
 Destructor.

Private Attributes

std::string theAlignRecordName
std::string theErrorRecordName
edm::ParameterSet theParameterSet
boost::shared_ptr
< TrackerGeometry
theTracker


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 18 of file MisalignedTrackerESProducer.h.


Constructor & Destructor Documentation

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

Constructor.

An ESProducer that fills the TrackerDigiGeometryRcd with a misaligned tracker.

This should replace the standard TrackerDigiGeometryESModule when producing Misalignment scenarios.

Definition at line 34 of file MisalignedTrackerESProducer.cc.

References edm::ESProducer::setWhatProduced().

00034                                                                                  :
00035   theParameterSet( p ),
00036   theAlignRecordName( "TrackerAlignmentRcd" ),
00037   theErrorRecordName( "TrackerAlignmentErrorRcd" )
00038 {
00039   
00040   setWhatProduced(this);
00041 
00042 }

MisalignedTrackerESProducer::~MisalignedTrackerESProducer (  )  [virtual]

Destructor.

Definition at line 46 of file MisalignedTrackerESProducer.cc.

00046 {}


Member Function Documentation

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

Produce the misaligned tracker geometry and store it.

Definition at line 51 of file MisalignedTrackerESProducer.cc.

References GeometryAligner::applyAlignments(), TrackerScenarioBuilder::applyScenario(), TrackerGeomBuilderFromGeometricDet::build(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), edm::ParameterSet::getUntrackedParameter(), edm::Service< T >::isAvailable(), theAlignRecordName, theErrorRecordName, theParameterSet, and theTracker.

00052 { 
00053 
00054   edm::LogInfo("MisalignedTracker") << "Producer called";
00055 
00056   // Create the tracker geometry from ideal geometry
00057   edm::ESHandle<GeometricDet> gD;
00058   iRecord.getRecord<IdealGeometryRecord>().get( gD );
00059   TrackerGeomBuilderFromGeometricDet trackerBuilder;
00060   theTracker  = boost::shared_ptr<TrackerGeometry>( trackerBuilder.build(&(*gD)) );
00061   
00062   // Create the alignable hierarchy
00063   std::auto_ptr<AlignableTracker> theAlignableTracker(new AlignableTracker( &(*theTracker) ) );
00064 
00065   // Create misalignment scenario, apply to geometry
00066   TrackerScenarioBuilder scenarioBuilder( &(*theAlignableTracker) );
00067   scenarioBuilder.applyScenario( theParameterSet );
00068   Alignments* alignments =  theAlignableTracker->alignments();
00069   AlignmentErrors* alignmentErrors = theAlignableTracker->alignmentErrors();
00070   
00071   // Store result to EventSetup
00072   GeometryAligner aligner;
00073   aligner.applyAlignments<TrackerGeometry>( &(*theTracker), alignments, alignmentErrors, 
00074                                             AlignTransform()); // dummy global position
00075 
00076   // Write alignments to DB: have to sort beforhand!
00077   if (theParameterSet.getUntrackedParameter<bool>("saveToDbase")) {
00078 
00079       // Call service
00080       edm::Service<cond::service::PoolDBOutputService> poolDbService;
00081       if( !poolDbService.isAvailable() ) // Die if not available
00082         throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
00083           
00084   // Store
00085 //       if ( poolDbService->isNewTagRequest(theAlignRecordName) )
00086 //         poolDbService->createNewIOV<Alignments>( alignments, poolDbService->endOfTime(), 
00087 //                                                  theAlignRecordName );
00088 //       else
00089 //         poolDbService->appendSinceTime<Alignments>( alignments, poolDbService->currentTime(), 
00090 //                                                   theAlignRecordName );
00091       poolDbService->writeOne<Alignments>(alignments, poolDbService->currentTime(),
00092                                           theAlignRecordName);
00093 //       if ( poolDbService->isNewTagRequest(theErrorRecordName) )
00094 //         poolDbService->createNewIOV<AlignmentErrors>( alignmentErrors,
00095 //                                                       poolDbService->endOfTime(), 
00096 //                                                       theErrorRecordName );
00097 //       else
00098 //         poolDbService->appendSinceTime<AlignmentErrors>( alignmentErrors,
00099 //                                                          poolDbService->currentTime(), 
00100 //                                                          theErrorRecordName );
00101       poolDbService->writeOne<AlignmentErrors>(alignmentErrors, poolDbService->currentTime(),
00102                                                theErrorRecordName);
00103     }
00104   
00105 
00106   edm::LogInfo("MisalignedTracker") << "Producer done";
00107   return theTracker;
00108   
00109 }


Member Data Documentation

std::string MisalignedTrackerESProducer::theAlignRecordName [private]

Definition at line 35 of file MisalignedTrackerESProducer.h.

Referenced by produce().

std::string MisalignedTrackerESProducer::theErrorRecordName [private]

Definition at line 35 of file MisalignedTrackerESProducer.h.

Referenced by produce().

edm::ParameterSet MisalignedTrackerESProducer::theParameterSet [private]

Definition at line 33 of file MisalignedTrackerESProducer.h.

Referenced by produce().

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

Definition at line 37 of file MisalignedTrackerESProducer.h.

Referenced by produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:28:17 2009 for CMSSW by  doxygen 1.5.4